summaryrefslogtreecommitdiff
path: root/src/arch/amd64/idt.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/amd64/idt.S')
-rw-r--r--src/arch/amd64/idt.S162
1 files changed, 81 insertions, 81 deletions
diff --git a/src/arch/amd64/idt.S b/src/arch/amd64/idt.S
index 8cb537e..33d488a 100644
--- a/src/arch/amd64/idt.S
+++ b/src/arch/amd64/idt.S
@@ -7,39 +7,39 @@ extern idt_pic_mouse
extern idt_pic_eoi
%macro PUSHALL 0
- push rax
- push rbx
- push rcx
- push rdx
- push rbp
- push rdi
- push rsi
- push r8
- push r9
- push r10
- push r11
- push r12
- push r13
- push r14
- push r15
+ push rax
+ push rbx
+ push rcx
+ push rdx
+ push rbp
+ push rdi
+ push rsi
+ push r8
+ push r9
+ push r10
+ push r11
+ push r12
+ push r13
+ push r14
+ push r15
%endmacro
%macro POPALL 0
- pop r15
- pop r14
- pop r13
- pop r12
- pop r11
- pop r10
- pop r9
- pop r8
- pop rsi
- pop rdi
- pop rbp
- pop rdx
- pop rcx
- pop rbx
- pop rax
+ pop r15
+ pop r14
+ pop r13
+ pop r12
+ pop r11
+ pop r10
+ pop r9
+ pop r8
+ pop rsi
+ pop rdi
+ pop rbp
+ pop rdx
+ pop rcx
+ pop rbx
+ pop rax
%endmacro
; call the exception handler with the interrupt number
@@ -47,15 +47,15 @@ extern idt_pic_eoi
%macro ISRException 1
align 8
isr_stub_%+%1:
- PUSHALL
- cld
- mov rdi, %1 ; exception number
- mov rsi, 0 ; placeholder error code
- mov rdx, [rsp + 15 * 8] ; instruction pointer
- mov rcx, rbp ; base pointer for stack trace
- call idt_exception_handler
- POPALL
- iretq
+ PUSHALL
+ cld
+ mov rdi, %1 ; exception number
+ mov rsi, 0 ; placeholder error code
+ mov rdx, [rsp + 15 * 8] ; instruction pointer
+ mov rcx, rbp ; base pointer for stack trace
+ call idt_exception_handler
+ POPALL
+ iretq
%endmacro
; call the exception handler with the interrupt number
@@ -64,59 +64,59 @@ isr_stub_%+%1:
%macro ISRExceptionCode 1
align 8
isr_stub_%+%1:
- PUSHALL
- cld
- mov rdi, %1 ; exception number
- mov rsi, [rsp + 15 * 8] ; error code
- mov rdx, [rsp + 16 * 8] ; instruction pointer
- mov rcx, rbp ; base pointer for stack trace
- call idt_exception_handler
- POPALL
- sub rsp, 8 ; discard error code
- iretq
+ PUSHALL
+ cld
+ mov rdi, %1 ; exception number
+ mov rsi, [rsp + 15 * 8] ; error code
+ mov rdx, [rsp + 16 * 8] ; instruction pointer
+ mov rcx, rbp ; base pointer for stack trace
+ call idt_exception_handler
+ POPALL
+ sub rsp, 8 ; discard error code
+ iretq
%endmacro
%macro PICGeneric 1
isr_stub_%+%1:
- PUSHALL
- cld
- mov rdi, %1
- call idt_pic_eoi
- POPALL
- iretq
+ PUSHALL
+ cld
+ mov rdi, %1
+ call idt_pic_eoi
+ POPALL
+ iretq
%endmacro
%macro PICTimer 1
isr_stub_%+%1:
- PUSHALL
- cld
- call idt_pic_timer
- mov rdi, %1
- call idt_pic_eoi
- POPALL
- iretq
+ PUSHALL
+ cld
+ call idt_pic_timer
+ mov rdi, %1
+ call idt_pic_eoi
+ POPALL
+ iretq
%endmacro
%macro PICKeyboard 1
isr_stub_%+%1:
- PUSHALL
- cld
- call idt_pic_keyboard
- mov rdi, %1
- call idt_pic_eoi
- POPALL
- iretq
+ PUSHALL
+ cld
+ call idt_pic_keyboard
+ mov rdi, %1
+ call idt_pic_eoi
+ POPALL
+ iretq
%endmacro
%macro PICMouse 1
isr_stub_%+%1:
- PUSHALL
- cld
- call idt_pic_mouse
- mov rdi, %1
- call idt_pic_eoi
- POPALL
- iretq
+ PUSHALL
+ cld
+ call idt_pic_mouse
+ mov rdi, %1
+ call idt_pic_eoi
+ POPALL
+ iretq
%endmacro
; do nothing
@@ -124,7 +124,7 @@ isr_stub_%+%1:
%macro ISRIgnore 1
align 8
isr_stub_%+%1:
- iretq
+ iretq
%endmacro
; isr stubs
@@ -164,7 +164,7 @@ ISRExceptionCode 29
ISRExceptionCode 30
ISRException 31
-PICTimer 32 ; 0
+PICTimer 32 ; 0
PICKeyboard 33 ; 1
PICGeneric 34 ; 2
PICGeneric 35 ; 3
@@ -184,8 +184,8 @@ PICGeneric 47 ; 15
; ignore other interrupts
%assign i 48
%rep 256 - i
- ISRIgnore i
- %assign i i+1
+ ISRIgnore i
+ %assign i i+1
%endrep
; isr stub table
@@ -196,6 +196,6 @@ align 16
isr_stub_table:
%assign i 0
%rep 256
- dq isr_stub_%+i
+ dq isr_stub_%+i
%assign i i+1
%endrep