aboutsummaryrefslogtreecommitdiffstats
path: root/src/romlayout.S
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-05-16 23:31:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-05-16 23:31:27 -0400
commit9f193b9883da62105238c9b5e199e28508748f09 (patch)
tree9dfc0345e1d4a3a63ef4db5d68162ee17842fdd3 /src/romlayout.S
parentf61afb897f40a6bdd8e15585e478881127ef87bf (diff)
downloadseabios-9f193b9883da62105238c9b5e199e28508748f09.tar.gz
Define unified entry points for irq handlers.
The irq entry points now push the handler address and jump to a function that does parameter setup. This reduces the code size because the entry setup isn't repeated for every handler.
Diffstat (limited to 'src/romlayout.S')
-rw-r--r--src/romlayout.S48
1 files changed, 40 insertions, 8 deletions
diff --git a/src/romlayout.S b/src/romlayout.S
index 736dc9b3..f354c74a 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -347,9 +347,45 @@ post32:
* Interrupt entry points
****************************************************************/
+ // Define an entry point for an interrupt (no args passed).
+ .macro IRQ_ENTRY num
+ .global entry_\num
+ entry_\num :
+ pushl $ handle_\num
+ jmp irqentry
+ .endm
+
+ // Define an entry point for an interrupt (can read/modify args).
+ .macro IRQ_ENTRY_ARG num
+ .global entry_\num
+ entry_\num :
+ pushl $ handle_\num
+ jmp irqentryarg
+ .endm
+
+ // Macros that put each handler into its own section
+ .macro DECL_IRQ_ENTRY num
+ DECLFUNC entry_\num
+ IRQ_ENTRY \num
+ .endm
+ .macro DECL_IRQ_ENTRY_ARG num
+ DECLFUNC entry_\num
+ IRQ_ENTRY_ARG \num
+ .endm
+
+ // Main entry point for interrupts without args
+ DECLFUNC irqentry
+irqentry:
+ ENTRY_ST
+ iretw
+
+ // Main entry point for interrupts with args
+ DECLFUNC irqentry
+irqentryarg:
+ ENTRY_ARG_ST
+ iretw
+
DECL_IRQ_ENTRY_ARG 13
- DECL_IRQ_ENTRY_ARG 12
- DECL_IRQ_ENTRY_ARG 11
DECL_IRQ_ENTRY 76
DECL_IRQ_ENTRY 70
DECL_IRQ_ENTRY 74
@@ -430,14 +466,10 @@ entry_10_0x0f:
// 0xf0a4 - VideoParams in misc.c
ORG 0xf841
- .global entry_12_official
-entry_12_official:
- jmp entry_12
+ IRQ_ENTRY_ARG 12
ORG 0xf84d
- .global entry_11_official
-entry_11_official:
- jmp entry_11
+ IRQ_ENTRY_ARG 11
ORG 0xf859
IRQ_ENTRY_ARG 15