mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
parent
311b2c0720
commit
5666809889
2 changed files with 62 additions and 62 deletions
|
@ -94,69 +94,69 @@ static EntropySource s_entropy_source_interrupts { EntropySource::Static::Interr
|
|||
" jmp common_trap_exit \n");
|
||||
|
||||
#elif ARCH(X86_64)
|
||||
#define EH_ENTRY(ec, title) \
|
||||
extern "C" void title##_asm_entry(); \
|
||||
extern "C" void title##_handler(TrapFrame*); \
|
||||
asm( \
|
||||
".globl " #title "_asm_entry\n" \
|
||||
"" #title "_asm_entry: \n" \
|
||||
" pushq %r15\n" \
|
||||
" pushq %r14\n" \
|
||||
" pushq %r13\n" \
|
||||
" pushq %r12\n" \
|
||||
" pushq %r11\n" \
|
||||
" pushq %r10\n" \
|
||||
" pushq %r9\n" \
|
||||
" pushq %r8\n" \
|
||||
" pushq %rax\n" \
|
||||
" pushq %rcx\n" \
|
||||
" pushq %rdx\n" \
|
||||
" pushq %rbx\n" \
|
||||
" pushq %rsp\n" \
|
||||
" pushq %rbp\n" \
|
||||
" pushq %rsi\n" \
|
||||
" pushq %rdi\n" \
|
||||
" pushq %rsp \n" /* set TrapFrame::regs */ \
|
||||
" subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" \
|
||||
" subq $0x8, %rsp\n" /* align stack */ \
|
||||
" lea 0x8(%rsp), %rdi \n" \
|
||||
" cld\n" \
|
||||
" call enter_trap_no_irq \n" \
|
||||
" lea 0x8(%rsp), %rdi \n" \
|
||||
" call " #title "_handler\n" \
|
||||
" addq $0x8, %rsp\n" /* undo alignment */\
|
||||
#define EH_ENTRY(ec, title) \
|
||||
extern "C" void title##_asm_entry(); \
|
||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||
asm( \
|
||||
".globl " #title "_asm_entry\n" \
|
||||
"" #title "_asm_entry: \n" \
|
||||
" pushq %r15\n" \
|
||||
" pushq %r14\n" \
|
||||
" pushq %r13\n" \
|
||||
" pushq %r12\n" \
|
||||
" pushq %r11\n" \
|
||||
" pushq %r10\n" \
|
||||
" pushq %r9\n" \
|
||||
" pushq %r8\n" \
|
||||
" pushq %rax\n" \
|
||||
" pushq %rcx\n" \
|
||||
" pushq %rdx\n" \
|
||||
" pushq %rbx\n" \
|
||||
" pushq %rsp\n" \
|
||||
" pushq %rbp\n" \
|
||||
" pushq %rsi\n" \
|
||||
" pushq %rdi\n" \
|
||||
" pushq %rsp \n" /* set TrapFrame::regs */ \
|
||||
" subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" \
|
||||
" subq $0x8, %rsp\n" /* align stack */ \
|
||||
" lea 0x8(%rsp), %rdi \n" \
|
||||
" cld\n" \
|
||||
" call enter_trap_no_irq \n" \
|
||||
" lea 0x8(%rsp), %rdi \n" \
|
||||
" call " #title "_handler\n" \
|
||||
" addq $0x8, %rsp\n" /* undo alignment */ \
|
||||
" jmp common_trap_exit \n");
|
||||
|
||||
#define EH_ENTRY_NO_CODE(ec, title) \
|
||||
extern "C" void title##_handler(TrapFrame*); \
|
||||
extern "C" void title##_asm_entry(); \
|
||||
asm( \
|
||||
".globl " #title "_asm_entry\n" \
|
||||
"" #title "_asm_entry: \n" \
|
||||
" pushq $0x0\n" \
|
||||
" pushq %r15\n" \
|
||||
" pushq %r14\n" \
|
||||
" pushq %r13\n" \
|
||||
" pushq %r12\n" \
|
||||
" pushq %r11\n" \
|
||||
" pushq %r10\n" \
|
||||
" pushq %r9\n" \
|
||||
" pushq %r8\n" \
|
||||
" pushq %rax\n" \
|
||||
" pushq %rcx\n" \
|
||||
" pushq %rdx\n" \
|
||||
" pushq %rbx\n" \
|
||||
" pushq %rsp\n" \
|
||||
" pushq %rbp\n" \
|
||||
" pushq %rsi\n" \
|
||||
" pushq %rdi\n" \
|
||||
" pushq %rsp \n" /* set TrapFrame::regs */ \
|
||||
" subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" \
|
||||
" movq %rsp, %rdi \n" \
|
||||
" cld\n" \
|
||||
" call enter_trap_no_irq \n" \
|
||||
" movq %rsp, %rdi \n" \
|
||||
" call " #title "_handler\n" \
|
||||
#define EH_ENTRY_NO_CODE(ec, title) \
|
||||
extern "C" void title##_handler(TrapFrame*) __attribute__((used)); \
|
||||
extern "C" void title##_asm_entry(); \
|
||||
asm( \
|
||||
".globl " #title "_asm_entry\n" \
|
||||
"" #title "_asm_entry: \n" \
|
||||
" pushq $0x0\n" \
|
||||
" pushq %r15\n" \
|
||||
" pushq %r14\n" \
|
||||
" pushq %r13\n" \
|
||||
" pushq %r12\n" \
|
||||
" pushq %r11\n" \
|
||||
" pushq %r10\n" \
|
||||
" pushq %r9\n" \
|
||||
" pushq %r8\n" \
|
||||
" pushq %rax\n" \
|
||||
" pushq %rcx\n" \
|
||||
" pushq %rdx\n" \
|
||||
" pushq %rbx\n" \
|
||||
" pushq %rsp\n" \
|
||||
" pushq %rbp\n" \
|
||||
" pushq %rsi\n" \
|
||||
" pushq %rdi\n" \
|
||||
" pushq %rsp \n" /* set TrapFrame::regs */ \
|
||||
" subq $" __STRINGIFY(TRAP_FRAME_SIZE - 8) ", %rsp \n" \
|
||||
" movq %rsp, %rdi \n" \
|
||||
" cld\n" \
|
||||
" call enter_trap_no_irq \n" \
|
||||
" movq %rsp, %rdi \n" \
|
||||
" call " #title "_handler\n" \
|
||||
" jmp common_trap_exit \n");
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue