core: move the generated IDT stubs to a separate .gentext16 section
authorH. Peter Anvin <hpa@zytor.com>
Thu, 3 Sep 2009 05:48:57 +0000 (22:48 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 3 Sep 2009 05:52:29 +0000 (22:52 -0700)
Move the generated IDT stubs to a separate section, .gentext16, so
that they aren't immediately adjacent to a piece of highly mutable
data.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/layout.inc
core/pm.inc
core/syslinux.ld

index 3df0772..c67105a 100644 (file)
@@ -38,6 +38,7 @@ LATEBSS_START equ 0B800h
                section .earlybss       nobits
                section .config         write progbits align=4
                section .replacestub    exec write progbits align=16
+               section .gentextnr      exec write nobits align=16
 
                ; Use .bss16 for things that doesn't have to be in low memory;
                ; .earlybss should be used for things that absolutely have
index 873da08..9584cda 100644 (file)
@@ -440,10 +440,11 @@ pm_init:
                section .earlybss
                alignb 8
 IDT:           resq 256
-IRQStubs:      resb 4*256+3*8
-
 RealModeSSSP   resd 1                  ; Real-mode SS:SP
 
+               section .gentextnr      ; Autogenerated 32-bit code
+IRQStubs:      resb 4*256+3*8
+
                section .text16
 
 %include "callback.inc"                        ; Real-mode callbacks
index 50e7305..c2e49a2 100644 (file)
@@ -60,7 +60,9 @@ SECTIONS
        __config_len = __config_end - __config_start;
        __config_dwords = (__config_len + 3) >> 2;
 
-       . = ALIGN(16);
+       /* Generated and/or copied code */
+
+       . = ALIGN(128);         /* Minimum separation from mutable data */
        .replacestub : AT (__replacestub_lma) {
                __replacestub_start = .;
                *(.replacestub)
@@ -69,6 +71,16 @@ SECTIONS
        __replacestub_len = __replacestub_end - __replacestub_start;
        __replacestub_dwords = (__replacestub_len + 3) >> 2;
 
+       . = ALIGN(16);
+       __gentextnr_lma = .;
+       .gentextnr : AT(__gentextnr_lma) {
+               __gentextnr_start = .;
+               *(.gentextnr)
+               __gentextnr_end = .;
+       }
+       __gentextnr_len = __gentextnr_end - __gentextnr_start;
+       __gentextnr_dwords = (__gentextnr_len + 3) >> 2;
+
        /* 16-bit stack */
 
        STACK16_BASE = 0x7c00 - STACK16_LEN;