aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/signal_64.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-30 07:30:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:56 -0500
commit742fa54a62be6a263df14a553bf832724471dfbe (patch)
tree991589593b078eb2ede035f511e4b85b11b95a9c /arch/x86/kernel/signal_64.c
parent153d5f2e5787c74e9cbb6b6687c9b04be1b59893 (diff)
x86: use generic register names in struct sigcontext
Switch struct sigcontext (defined in <asm/sigcontext*.h>) to using register names withut e- or r-prefixes for both 32- and 64-bit x86. This is intended as a preliminary step in unifying this code between architectures. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/signal_64.c')
-rw-r--r--arch/x86/kernel/signal_64.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 4b228fd83b31..1c9bca56fb55 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -62,11 +62,10 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned
62 /* Always make any pending restarted system calls return -EINTR */ 62 /* Always make any pending restarted system calls return -EINTR */
63 current_thread_info()->restart_block.fn = do_no_restart_syscall; 63 current_thread_info()->restart_block.fn = do_no_restart_syscall;
64 64
65#define COPYR(x) err |= __get_user(regs->x, &sc->r ## x)
66#define COPY(x) err |= __get_user(regs->x, &sc->x) 65#define COPY(x) err |= __get_user(regs->x, &sc->x)
67 66
68 COPYR(di); COPYR(si); COPYR(bp); COPYR(sp); COPYR(bx); 67 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
69 COPYR(dx); COPYR(cx); COPYR(ip); 68 COPY(dx); COPY(cx); COPY(ip);
70 COPY(r8); 69 COPY(r8);
71 COPY(r9); 70 COPY(r9);
72 COPY(r10); 71 COPY(r10);
@@ -87,7 +86,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned
87 86
88 { 87 {
89 unsigned int tmpflags; 88 unsigned int tmpflags;
90 err |= __get_user(tmpflags, &sc->eflags); 89 err |= __get_user(tmpflags, &sc->flags);
91 regs->flags = (regs->flags & ~0x40DD5) | (tmpflags & 0x40DD5); 90 regs->flags = (regs->flags & ~0x40DD5) | (tmpflags & 0x40DD5);
92 regs->orig_ax = -1; /* disable syscall checks */ 91 regs->orig_ax = -1; /* disable syscall checks */
93 } 92 }
@@ -109,7 +108,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned
109 } 108 }
110 } 109 }
111 110
112 err |= __get_user(*prax, &sc->rax); 111 err |= __get_user(*prax, &sc->ax);
113 return err; 112 return err;
114 113
115badframe: 114badframe:
@@ -166,14 +165,14 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo
166 err |= __put_user(0, &sc->gs); 165 err |= __put_user(0, &sc->gs);
167 err |= __put_user(0, &sc->fs); 166 err |= __put_user(0, &sc->fs);
168 167
169 err |= __put_user(regs->di, &sc->rdi); 168 err |= __put_user(regs->di, &sc->di);
170 err |= __put_user(regs->si, &sc->rsi); 169 err |= __put_user(regs->si, &sc->si);
171 err |= __put_user(regs->bp, &sc->rbp); 170 err |= __put_user(regs->bp, &sc->bp);
172 err |= __put_user(regs->sp, &sc->rsp); 171 err |= __put_user(regs->sp, &sc->sp);
173 err |= __put_user(regs->bx, &sc->rbx); 172 err |= __put_user(regs->bx, &sc->bx);
174 err |= __put_user(regs->dx, &sc->rdx); 173 err |= __put_user(regs->dx, &sc->dx);
175 err |= __put_user(regs->cx, &sc->rcx); 174 err |= __put_user(regs->cx, &sc->cx);
176 err |= __put_user(regs->ax, &sc->rax); 175 err |= __put_user(regs->ax, &sc->ax);
177 err |= __put_user(regs->r8, &sc->r8); 176 err |= __put_user(regs->r8, &sc->r8);
178 err |= __put_user(regs->r9, &sc->r9); 177 err |= __put_user(regs->r9, &sc->r9);
179 err |= __put_user(regs->r10, &sc->r10); 178 err |= __put_user(regs->r10, &sc->r10);
@@ -184,8 +183,8 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo
184 err |= __put_user(regs->r15, &sc->r15); 183 err |= __put_user(regs->r15, &sc->r15);
185 err |= __put_user(me->thread.trap_no, &sc->trapno); 184 err |= __put_user(me->thread.trap_no, &sc->trapno);
186 err |= __put_user(me->thread.error_code, &sc->err); 185 err |= __put_user(me->thread.error_code, &sc->err);
187 err |= __put_user(regs->ip, &sc->rip); 186 err |= __put_user(regs->ip, &sc->ip);
188 err |= __put_user(regs->flags, &sc->eflags); 187 err |= __put_user(regs->flags, &sc->flags);
189 err |= __put_user(mask, &sc->oldmask); 188 err |= __put_user(mask, &sc->oldmask);
190 err |= __put_user(me->thread.cr2, &sc->cr2); 189 err |= __put_user(me->thread.cr2, &sc->cr2);
191 190