Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228941
b: refs/heads/master
c: 625dbc3
h: refs/heads/master
i:
  228939: 212fa77
v: v3
  • Loading branch information
Frederic Weisbecker committed Jan 7, 2011
1 parent 9bd815d commit 8517511
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39a6eebda253aa34d659ca9436e3c32ef60473f1
refs/heads/master: 625dbc3b8acbefefefe27e1d7bbc6e53eb4f3f2d
36 changes: 23 additions & 13 deletions trunk/arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,21 @@ ENDPROC(native_usergs_sysret64)
ENTRY(save_args)
XCPT_FRAME
cld
movq_cfi rdi, RDI+16-ARGOFFSET
movq_cfi rsi, RSI+16-ARGOFFSET
movq_cfi rdx, RDX+16-ARGOFFSET
movq_cfi rcx, RCX+16-ARGOFFSET
movq_cfi rax, RAX+16-ARGOFFSET
movq_cfi r8, R8+16-ARGOFFSET
movq_cfi r9, R9+16-ARGOFFSET
movq_cfi r10, R10+16-ARGOFFSET
movq_cfi r11, R11+16-ARGOFFSET

leaq -ARGOFFSET+16(%rsp),%rdi /* arg1 for handler */
/*
* start from rbp in pt_regs and jump over
* return address.
*/
movq_cfi rdi, RDI+8-RBP
movq_cfi rsi, RSI+8-RBP
movq_cfi rdx, RDX+8-RBP
movq_cfi rcx, RCX+8-RBP
movq_cfi rax, RAX+8-RBP
movq_cfi r8, R8+8-RBP
movq_cfi r9, R9+8-RBP
movq_cfi r10, R10+8-RBP
movq_cfi r11, R11+8-RBP

leaq -RBP+8(%rsp),%rdi /* arg1 for handler */
movq_cfi rbp, 8 /* push %rbp */
leaq 8(%rsp), %rbp /* mov %rsp, %ebp */
testl $3, CS(%rdi)
Expand Down Expand Up @@ -782,8 +786,9 @@ END(interrupt)

/* 0(%rsp): ~(interrupt number) */
.macro interrupt func
subq $ORIG_RAX-ARGOFFSET+8, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-ARGOFFSET+8
/* reserve pt_regs for scratch regs and rbp */
subq $ORIG_RAX-RBP, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
call save_args
PARTIAL_FRAME 0
call \func
Expand All @@ -808,9 +813,14 @@ ret_from_intr:
TRACE_IRQS_OFF
decl PER_CPU_VAR(irq_count)
leaveq

CFI_RESTORE rbp
CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -8

/* we did not save rbx, restore only from ARGOFFSET */
addq $8, %rsp
CFI_ADJUST_CFA_OFFSET -8
exit_intr:
GET_THREAD_INFO(%rcx)
testl $3,CS-ARGOFFSET(%rsp)
Expand Down

0 comments on commit 8517511

Please sign in to comment.