mirror of
https://github.com/apache/nuttx.git
synced 2026-10-10 07:40:27 +00:00
arch/x64: interrupt add CFI info
interrupt add CFI info Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
This commit is contained in:
parent
49ffd94d84
commit
41da7121bd
1 changed files with 35 additions and 0 deletions
|
|
@ -51,6 +51,33 @@
|
|||
* Macros
|
||||
****************************************************************************/
|
||||
|
||||
#define CFI_UNWIND_REGS(reg, offst) \
|
||||
.cfi_def_cfa %##reg, (offst); \
|
||||
.cfi_rel_offset %rip, (REG_RIP * 8); \
|
||||
.cfi_rel_offset %rsp, (REG_RSP * 8); \
|
||||
.cfi_rel_offset %rbp, (REG_RBP * 8); \
|
||||
.cfi_rel_offset %rsi, (REG_RSI * 8); \
|
||||
.cfi_rel_offset %rdi, (REG_RDI * 8); \
|
||||
.cfi_rel_offset %rdx, (REG_RDX * 8); \
|
||||
.cfi_rel_offset %rcx, (REG_RCX * 8); \
|
||||
.cfi_rel_offset %r8, (REG_R8 * 8); \
|
||||
.cfi_rel_offset %r9, (REG_R9 * 8); \
|
||||
.cfi_rel_offset %r15, (REG_R15 * 8); \
|
||||
.cfi_rel_offset %r14, (REG_R14 * 8); \
|
||||
.cfi_rel_offset %r13, (REG_R13 * 8); \
|
||||
.cfi_rel_offset %r12, (REG_R12 * 8); \
|
||||
.cfi_rel_offset %r11, (REG_R11 * 8); \
|
||||
.cfi_rel_offset %r10, (REG_R10 * 8); \
|
||||
.cfi_rel_offset %rbx, (REG_RBX * 8); \
|
||||
.cfi_rel_offset %rax, (REG_RAX * 8); \
|
||||
.cfi_rel_offset %rflags, (REG_RFLAGS * 8); \
|
||||
.cfi_rel_offset %cs, (REG_CS * 8); \
|
||||
.cfi_rel_offset %ss, (REG_SS * 8); \
|
||||
.cfi_rel_offset %ds, (REG_DS * 8); \
|
||||
.cfi_rel_offset %es, (REG_ES * 8); \
|
||||
.cfi_rel_offset %fs, (REG_FS * 8); \
|
||||
.cfi_rel_offset %gs, (REG_GS * 8);
|
||||
|
||||
/* This macro creates a stub for an ISR which does NOT pass it's own
|
||||
* error code (adds a dummy errcode byte).
|
||||
*/
|
||||
|
|
@ -701,6 +728,8 @@ vector_isr\intno:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
.cfi_sections .debug_frame
|
||||
|
||||
.type irq_common, @function
|
||||
irq_common:
|
||||
/* Already swap to the interrupt stack
|
||||
|
|
@ -711,6 +740,8 @@ irq_common:
|
|||
* corrupts only RAX, RDI and RDX registers.
|
||||
*/
|
||||
|
||||
.cfi_startproc
|
||||
|
||||
pushq %rax
|
||||
pushq %rdx
|
||||
call irq_xcp_regs
|
||||
|
|
@ -785,12 +816,16 @@ irq_common:
|
|||
* that we don't lose the correct stack alignment for vector operations
|
||||
*/
|
||||
|
||||
CFI_UNWIND_REGS(rdi, 0)
|
||||
|
||||
pushq %rdi
|
||||
pushq $0
|
||||
call irq_handler
|
||||
add $8, %rsp
|
||||
popq %rdi
|
||||
|
||||
.cfi_endproc
|
||||
|
||||
/* The common return point for irq_handler */
|
||||
|
||||
.Lreturn:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue