Skip to content

Commit

Permalink
asm: macro for generic interrupt handler
Browse files Browse the repository at this point in the history
Added generic asm macro for interrupt handlers

Signed-off-by: Daniele Ahmed <ahmeddan amazon com ; >
  • Loading branch information
82marbag authored and wipawel committed Oct 23, 2020
1 parent 893b9e9 commit a36cbaa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/x86/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ ENTRY(entry_\sym)
END_FUNC(entry_\sym)
.endm

.macro interrupt_handler sym func
ENTRY(asm_interrupt_handler_\sym)
cld
SAVE_REGS
call \func
RESTORE_REGS
#if defined(__x86_64__)
iretq
#else
iret
#endif
END_FUNC(asm_interrupt_handler_\sym)
.endm

exception_handler DE X86_EX_DE 0
exception_handler DB X86_EX_DB 0
exception_handler NMI X86_EX_NMI 0
Expand Down

0 comments on commit a36cbaa

Please sign in to comment.