aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/asm
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-04-18 03:03:27 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:16:34 +0200
commit35d1a6ef41fa716503925226837cf0f0b8894a90 (patch)
treea07d9d3073e802af03922c9d4732ad2f988cf6cb /src/arch/x86_64/asm
parent4c7dec80c02db70d9592bbe91f00145c0eb7a40e (diff)
linker: "optimize" section arrangements
1. throw vectors in a custom ".reserved" section 2. throw idt in a NOLOAD ".reserved_0" section: save some binary size (like .bss) since we don't care for its initial value. 3. squash all ".data.*" sections from rust into ".data"
Diffstat (limited to 'src/arch/x86_64/asm')
-rw-r--r--src/arch/x86_64/asm/vectors.s5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/x86_64/asm/vectors.s b/src/arch/x86_64/asm/vectors.s
index ba5fb87..2798032 100644
--- a/src/arch/x86_64/asm/vectors.s
+++ b/src/arch/x86_64/asm/vectors.s
@@ -5,7 +5,7 @@
[GLOBAL vectors_start]
[EXTERN interrupt_gate]
-[SECTION .data.idt]
+[SECTION .reserved_0.idt]
;
; Interrupt descriptor table with 256 entries
; TODO: use a interrupt stack instead of the current stack.
@@ -14,6 +14,7 @@ idt:
; reserve space for 256x idt entries (16 bytes each)
resb 16 * 256
+[SECTION .reserved]
idt_descr:
dw 256*8 - 1 ; 256 entries
dq idt
@@ -22,6 +23,7 @@ idt_descr:
; bytes. DO NOT modify the wrapper, instead change the wrapper_body if needed.
; if the vector has to be modified into more than 16 bytes,
; arch::x86_64:: interrupt::_idt_init() must be modified accordingly
+[SECTION .reserved.vectors]
%macro wrapper 1
align 16
wrapper_%1:
@@ -34,7 +36,6 @@ wrapper_%1:
; automatic generation of 256 interrupt-handling routines, based on above macro
-[SECTION .data.vectors]
vectors_start:
%assign i 0
%rep 256