Minor - reorganize romlayout.S to better group entry points.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 13 Apr 2009 23:26:43 +0000 (19:26 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 13 Apr 2009 23:26:43 +0000 (19:26 -0400)
src/romlayout.S

index 6d7fdd9faeacd73873f5f0be0900f2c73dd782fc..7ca0c432ec904652abc0a4f14ad50571002b528f 100644 (file)
         .endm
 
 
-/****************************************************************
- * POST handler
- ****************************************************************/
-
-        DECLFUNC entry_post
-entry_post:
-        // Enable cache
-        movl %cr0, %eax
-        andl $~(CR0_CD|CR0_NW), %eax
-        movl %eax, %cr0
-
-        // Disable interrupts
-        cli
-        cld
-
-        // Check for restart indicator.
-        movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
-        outb %al, $PORT_CMOS_INDEX
-        inb $PORT_CMOS_DATA, %al
-        cmpb $0x0, %al
-        jnz 1f
-
-        // Normal entry point
-        ENTRY_INTO32 _code32__start
-
-        // Entry point when a post call looks like a resume.
-1:
-        // Save old shutdown status.
-        movl %eax, %ebx
-
-        // Clear shutdown status register.
-        movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
-        outb %al, $PORT_CMOS_INDEX
-        xorl %eax, %eax
-        outb %al, $PORT_CMOS_DATA
-
-        // Use a stack in EBDA
-        movw $SEG_BDA, %ax
-        movw %ax, %ds
-        movw BDA_ebda_seg, %ax
-        // XXX - should verify ebda_seg looks sane.
-        movw %ax, %ds
-        movw %ax, %ss
-        movl $EBDA_OFFSET_TOP_STACK, %esp
-
-        // Call handler.
-        movl %ebx, %eax
-        jmp handle_resume
-
-
 /****************************************************************
  * Call trampolines
  ****************************************************************/
@@ -343,7 +293,77 @@ __call16:
 
         retl
 
-// PnP trampolines
+// IRQ trampolines
+        .macro IRQ_TRAMPOLINE num
+        DECLFUNC irq_trampoline_0x\num
+        irq_trampoline_0x\num :
+        int $0x\num
+        lretw
+        .endm
+
+        IRQ_TRAMPOLINE 10
+        IRQ_TRAMPOLINE 13
+        IRQ_TRAMPOLINE 15
+        IRQ_TRAMPOLINE 16
+        IRQ_TRAMPOLINE 18
+        IRQ_TRAMPOLINE 19
+
+
+/****************************************************************
+ * POST entry point
+ ****************************************************************/
+
+        DECLFUNC entry_post
+entry_post:
+        // Enable cache
+        movl %cr0, %eax
+        andl $~(CR0_CD|CR0_NW), %eax
+        movl %eax, %cr0
+
+        // Disable interrupts
+        cli
+        cld
+
+        // Check for restart indicator.
+        movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
+        outb %al, $PORT_CMOS_INDEX
+        inb $PORT_CMOS_DATA, %al
+        cmpb $0x0, %al
+        jnz 1f
+
+        // Normal entry point
+        ENTRY_INTO32 _code32__start
+
+        // Entry point when a post call looks like a resume.
+1:
+        // Save old shutdown status.
+        movl %eax, %ebx
+
+        // Clear shutdown status register.
+        movl $CMOS_RESET_CODE|NMI_DISABLE_BIT, %eax
+        outb %al, $PORT_CMOS_INDEX
+        xorl %eax, %eax
+        outb %al, $PORT_CMOS_DATA
+
+        // Use a stack in EBDA
+        movw $SEG_BDA, %ax
+        movw %ax, %ds
+        movw BDA_ebda_seg, %ax
+        // XXX - should verify ebda_seg looks sane.
+        movw %ax, %ds
+        movw %ax, %ss
+        movl $EBDA_OFFSET_TOP_STACK, %esp
+
+        // Call handler.
+        movl %ebx, %eax
+        jmp handle_resume
+
+
+/****************************************************************
+ * Misc. entry points.
+ ****************************************************************/
+
+// PnP entry points
         DECLFUNC entry_pnp_real
         .global entry_pnp_prot
 entry_pnp_prot:
@@ -373,7 +393,7 @@ entry_pnp_real:
         popl %esp
         lretw
 
-// APM trampolines
+// APM entry points
         DECLFUNC apm16protected_entry
 apm16protected_entry:
         pushfw          // save flags
@@ -416,21 +436,6 @@ post32:
 
         .code16gcc
 
-// IRQ trampolines
-        .macro IRQ_TRAMPOLINE num
-        DECLFUNC irq_trampoline_0x\num
-        irq_trampoline_0x\num :
-        int $0x\num
-        lretw
-        .endm
-
-        IRQ_TRAMPOLINE 10
-        IRQ_TRAMPOLINE 13
-        IRQ_TRAMPOLINE 15
-        IRQ_TRAMPOLINE 16
-        IRQ_TRAMPOLINE 18
-        IRQ_TRAMPOLINE 19
-
 
 /****************************************************************
  * Interrupt entry points