diff options
Diffstat (limited to 'src/arch/x86_64')
| -rw-r--r-- | src/arch/x86_64/asm/misc.s | 8 | ||||
| -rw-r--r-- | src/arch/x86_64/asm/vectors.s | 68 |
2 files changed, 36 insertions, 40 deletions
diff --git a/src/arch/x86_64/asm/misc.s b/src/arch/x86_64/asm/misc.s index fc5aa90..532aacd 100644 --- a/src/arch/x86_64/asm/misc.s +++ b/src/arch/x86_64/asm/misc.s @@ -1,11 +1,7 @@ ; place for misc code, before they find better places to live.. - [GLOBAL _delay] - [SECTION .text] - _delay: - jmp .dummy + jmp .dummy .dummy: - ret - + ret diff --git a/src/arch/x86_64/asm/vectors.s b/src/arch/x86_64/asm/vectors.s index cc7a7b7..8b4992e 100644 --- a/src/arch/x86_64/asm/vectors.s +++ b/src/arch/x86_64/asm/vectors.s @@ -11,29 +11,29 @@ ; TODO: use a interrupt stack instead of the current stack. idt: ; reserve space for 256x idt entries (16 bytes each) -resb 16 * 256 + resb 16 * 256 [SECTION .data.idt_descr] idt_descr: - dw 256*8 - 1 ; 256 entries - dq idt + dw 256*8 - 1 ; 256 entries + dq idt [SECTION .text.vectors] %macro trap_without_err 1 align 16 vector_%1: - push 0 - push rax - mov al, %1 - jmp vector_body + push 0 + push rax + mov al, %1 + jmp vector_body %endmacro %macro trap_with_err 1 align 16 vector_e_%1: - push rax - mov al, %1 - jmp vector_body + push rax + mov al, %1 + jmp vector_body %endmacro vectors_start: @@ -84,38 +84,38 @@ vector_body: ; GCC expects the direction flag to be 0 cld ; save volatile registers - push rcx - push rdx - push rdi - push rsi - push r8 - push r9 - push r10 - push r11 + push rcx + push rdx + push rdi + push rsi + push r8 + push r9 + push r10 + push r11 ; the generated wrapper only gives us 8 bits, mask the rest - and rax, 0xff + and rax, 0xff ; the first parameter is the interrupt (exception) number - mov rdi, rax - ; the second parameter is a pointer to the trap frame - mov rsi, rsp + mov rdi, rax + ; the second parameter is a pointer to the trap frame + mov rsi, rsp ; For a long jump, we need to put the (large) address in an register ; here reusing one of the caller clobbered regs (pushed above) - mov r11, trap_gate - call r11 + mov r11, trap_gate + call r11 ; restore volatile registers - pop r11 - pop r10 - pop r9 - pop r8 - pop rsi - pop rdi - pop rdx - pop rcx + pop r11 + pop r10 + pop r9 + pop r8 + pop rsi + pop rdi + pop rdx + pop rcx - pop rax + pop rax ; "pop" the error code - add rsp, 8 + add rsp, 8 ; done iretq |
