Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120931
b: refs/heads/master
c: 4a61204
h: refs/heads/master
i:
  120929: a3db77f
  120927: 220cf25
v: v3
  • Loading branch information
Hiroshi Shimamoto authored and Ingo Molnar committed Nov 12, 2008
1 parent c321ef8 commit e44972d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 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: 15002fa9bf3a79ac9dcafba7ff308586936088b2
refs/heads/master: 4a61204856e8b28e9f5489a7875cb3a60afd1e43
30 changes: 24 additions & 6 deletions trunk/arch/x86/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@
# define FIX_EFLAGS __FIX_EFLAGS
#endif

static const struct {
u16 poplmovl;
u32 val;
u16 int80;
} __attribute__((packed)) retcode = {
0xb858, /* popl %eax; movl $..., %eax */
__NR_sigreturn,
0x80cd, /* int $0x80 */
};

static const struct {
u8 movl;
u32 val;
u16 int80;
u8 pad;
} __attribute__((packed)) rt_retcode = {
0xb8, /* movl $..., %eax */
__NR_rt_sigreturn,
0x80cd, /* int $0x80 */
0
};

/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
Expand Down Expand Up @@ -427,9 +449,7 @@ __setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
* reasons and because gdb uses it as a signature to notice
* signal handler stack frames.
*/
err |= __put_user(0xb858, (short __user *)(frame->retcode+0));
err |= __put_user(__NR_sigreturn, (int __user *)(frame->retcode+2));
err |= __put_user(0x80cd, (short __user *)(frame->retcode+6));
err |= __put_user(*((u64 *)&retcode), (u64 *)frame->retcode);

if (err)
return -EFAULT;
Expand Down Expand Up @@ -498,9 +518,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* reasons and because gdb uses it as a signature to notice
* signal handler stack frames.
*/
err |= __put_user(0xb8, (char __user *)(frame->retcode+0));
err |= __put_user(__NR_rt_sigreturn, (int __user *)(frame->retcode+1));
err |= __put_user(0x80cd, (short __user *)(frame->retcode+5));
err |= __put_user(*((u64 *)&rt_retcode), (u64 *)frame->retcode);

if (err)
return -EFAULT;
Expand Down

0 comments on commit e44972d

Please sign in to comment.