diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-30 13:30:56 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:30:56 +0100 |
commit | 742fa54a62be6a263df14a553bf832724471dfbe (patch) | |
tree | 991589593b078eb2ede035f511e4b85b11b95a9c /arch/x86/kernel | |
parent | 153d5f2e5787c74e9cbb6b6687c9b04be1b59893 (diff) | |
download | kernel_samsung_smdk4412-742fa54a62be6a263df14a553bf832724471dfbe.zip kernel_samsung_smdk4412-742fa54a62be6a263df14a553bf832724471dfbe.tar.gz kernel_samsung_smdk4412-742fa54a62be6a263df14a553bf832724471dfbe.tar.bz2 |
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')
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_64.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/signal_32.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/signal_64.c | 29 |
4 files changed, 46 insertions, 47 deletions
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index a3a8be7..4fc24a6 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c @@ -38,15 +38,15 @@ void foo(void); void foo(void) { - OFFSET(IA32_SIGCONTEXT_eax, sigcontext, eax); - OFFSET(IA32_SIGCONTEXT_ebx, sigcontext, ebx); - OFFSET(IA32_SIGCONTEXT_ecx, sigcontext, ecx); - OFFSET(IA32_SIGCONTEXT_edx, sigcontext, edx); - OFFSET(IA32_SIGCONTEXT_esi, sigcontext, esi); - OFFSET(IA32_SIGCONTEXT_edi, sigcontext, edi); - OFFSET(IA32_SIGCONTEXT_ebp, sigcontext, ebp); - OFFSET(IA32_SIGCONTEXT_esp, sigcontext, esp); - OFFSET(IA32_SIGCONTEXT_eip, sigcontext, eip); + OFFSET(IA32_SIGCONTEXT_ax, sigcontext, ax); + OFFSET(IA32_SIGCONTEXT_bx, sigcontext, bx); + OFFSET(IA32_SIGCONTEXT_cx, sigcontext, cx); + OFFSET(IA32_SIGCONTEXT_dx, sigcontext, dx); + OFFSET(IA32_SIGCONTEXT_si, sigcontext, si); + OFFSET(IA32_SIGCONTEXT_di, sigcontext, di); + OFFSET(IA32_SIGCONTEXT_bp, sigcontext, bp); + OFFSET(IA32_SIGCONTEXT_sp, sigcontext, sp); + OFFSET(IA32_SIGCONTEXT_ip, sigcontext, ip); BLANK(); OFFSET(CPUINFO_x86, cpuinfo_x86, x86); diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 2e918eb..a054287 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -63,15 +63,15 @@ int main(void) #undef ENTRY #ifdef CONFIG_IA32_EMULATION #define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry)) - ENTRY(eax); - ENTRY(ebx); - ENTRY(ecx); - ENTRY(edx); - ENTRY(esi); - ENTRY(edi); - ENTRY(ebp); - ENTRY(esp); - ENTRY(eip); + ENTRY(ax); + ENTRY(bx); + ENTRY(cx); + ENTRY(dx); + ENTRY(si); + ENTRY(di); + ENTRY(bp); + ENTRY(sp); + ENTRY(ip); BLANK(); #undef ENTRY DEFINE(IA32_RT_SIGFRAME_sigcontext, diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 40fd351..64cb3c0 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c @@ -105,7 +105,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax /* Always make any pending restarted system calls return -EINTR */ current_thread_info()->restart_block.fn = do_no_restart_syscall; -#define COPY(x) err |= __get_user(regs->x, &sc->e ## x) +#define COPY(x) err |= __get_user(regs->x, &sc->x) #define COPY_SEG(seg) \ { unsigned short tmp; \ @@ -144,7 +144,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax { unsigned int tmpflags; - err |= __get_user(tmpflags, &sc->eflags); + err |= __get_user(tmpflags, &sc->flags); regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); regs->orig_ax = -1; /* disable syscall checks */ } @@ -165,7 +165,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax } } - err |= __get_user(*peax, &sc->eax); + err |= __get_user(*peax, &sc->ax); return err; badframe: @@ -256,20 +256,20 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, err |= __put_user(regs->es, (unsigned int __user *)&sc->es); err |= __put_user(regs->ds, (unsigned int __user *)&sc->ds); - err |= __put_user(regs->di, &sc->edi); - err |= __put_user(regs->si, &sc->esi); - err |= __put_user(regs->bp, &sc->ebp); - err |= __put_user(regs->sp, &sc->esp); - err |= __put_user(regs->bx, &sc->ebx); - err |= __put_user(regs->dx, &sc->edx); - err |= __put_user(regs->cx, &sc->ecx); - err |= __put_user(regs->ax, &sc->eax); + err |= __put_user(regs->di, &sc->di); + err |= __put_user(regs->si, &sc->si); + err |= __put_user(regs->bp, &sc->bp); + err |= __put_user(regs->sp, &sc->sp); + err |= __put_user(regs->bx, &sc->bx); + err |= __put_user(regs->dx, &sc->dx); + err |= __put_user(regs->cx, &sc->cx); + err |= __put_user(regs->ax, &sc->ax); err |= __put_user(current->thread.trap_no, &sc->trapno); err |= __put_user(current->thread.error_code, &sc->err); - err |= __put_user(regs->ip, &sc->eip); + err |= __put_user(regs->ip, &sc->ip); err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs); - err |= __put_user(regs->flags, &sc->eflags); - err |= __put_user(regs->sp, &sc->esp_at_signal); + err |= __put_user(regs->flags, &sc->flags); + err |= __put_user(regs->sp, &sc->sp_at_signal); err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss); tmp = save_i387(fpstate); diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index 4b228fd..1c9bca5 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 /* Always make any pending restarted system calls return -EINTR */ current_thread_info()->restart_block.fn = do_no_restart_syscall; -#define COPYR(x) err |= __get_user(regs->x, &sc->r ## x) #define COPY(x) err |= __get_user(regs->x, &sc->x) - COPYR(di); COPYR(si); COPYR(bp); COPYR(sp); COPYR(bx); - COPYR(dx); COPYR(cx); COPYR(ip); + COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); + COPY(dx); COPY(cx); COPY(ip); COPY(r8); COPY(r9); COPY(r10); @@ -87,7 +86,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned { unsigned int tmpflags; - err |= __get_user(tmpflags, &sc->eflags); + err |= __get_user(tmpflags, &sc->flags); regs->flags = (regs->flags & ~0x40DD5) | (tmpflags & 0x40DD5); regs->orig_ax = -1; /* disable syscall checks */ } @@ -109,7 +108,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned } } - err |= __get_user(*prax, &sc->rax); + err |= __get_user(*prax, &sc->ax); return err; badframe: @@ -166,14 +165,14 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo err |= __put_user(0, &sc->gs); err |= __put_user(0, &sc->fs); - err |= __put_user(regs->di, &sc->rdi); - err |= __put_user(regs->si, &sc->rsi); - err |= __put_user(regs->bp, &sc->rbp); - err |= __put_user(regs->sp, &sc->rsp); - err |= __put_user(regs->bx, &sc->rbx); - err |= __put_user(regs->dx, &sc->rdx); - err |= __put_user(regs->cx, &sc->rcx); - err |= __put_user(regs->ax, &sc->rax); + err |= __put_user(regs->di, &sc->di); + err |= __put_user(regs->si, &sc->si); + err |= __put_user(regs->bp, &sc->bp); + err |= __put_user(regs->sp, &sc->sp); + err |= __put_user(regs->bx, &sc->bx); + err |= __put_user(regs->dx, &sc->dx); + err |= __put_user(regs->cx, &sc->cx); + err |= __put_user(regs->ax, &sc->ax); err |= __put_user(regs->r8, &sc->r8); err |= __put_user(regs->r9, &sc->r9); err |= __put_user(regs->r10, &sc->r10); @@ -184,8 +183,8 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo err |= __put_user(regs->r15, &sc->r15); err |= __put_user(me->thread.trap_no, &sc->trapno); err |= __put_user(me->thread.error_code, &sc->err); - err |= __put_user(regs->ip, &sc->rip); - err |= __put_user(regs->flags, &sc->eflags); + err |= __put_user(regs->ip, &sc->ip); + err |= __put_user(regs->flags, &sc->flags); err |= __put_user(mask, &sc->oldmask); err |= __put_user(me->thread.cr2, &sc->cr2); |