aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/asm/vectors.s
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-06-06 02:18:51 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:17:14 +0200
commit1a0d4d56032b0326e415b8d450c601afa63ecd32 (patch)
treec5d97b9b70f0a244e59bc05edee111e3d41d3cd2 /src/arch/x86_64/asm/vectors.s
parentd495a1745c83a8186bf1c6c531177887dd245436 (diff)
chore: format asm code
mostly fixing identation and tabstop: 0. line width is 80 chars 1. tab is 8 chars wide (tabstop = 8) 2. leading indentation and only leading indentations are __hard_tabs__ 3. non-leading tabs are expanded into spaces 4. instrs are always indented 1 level, and only 1 level 5. the first operand (if any) starts at the next tabstop after the instruction, but the tab inbetween is expanded to spaces (3) Signed-off-by: Tianhao Wang <shrik3@mailbox.org>
Diffstat (limited to 'src/arch/x86_64/asm/vectors.s')
-rw-r--r--src/arch/x86_64/asm/vectors.s68
1 files changed, 34 insertions, 34 deletions
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