diff options
Diffstat (limited to 'arch/um/sys-i386/signal.c')
-rw-r--r-- | arch/um/sys-i386/signal.c | 86 |
1 files changed, 38 insertions, 48 deletions
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index a9fe8d6f72c3..c64d48734e3a 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -14,30 +14,30 @@ | |||
14 | #include "registers.h" | 14 | #include "registers.h" |
15 | #include "skas.h" | 15 | #include "skas.h" |
16 | 16 | ||
17 | void copy_sc(union uml_pt_regs *regs, void *from) | 17 | void copy_sc(struct uml_pt_regs *regs, void *from) |
18 | { | 18 | { |
19 | struct sigcontext *sc = from; | 19 | struct sigcontext *sc = from; |
20 | 20 | ||
21 | REGS_GS(regs->skas.regs) = sc->gs; | 21 | REGS_GS(regs->regs) = sc->gs; |
22 | REGS_FS(regs->skas.regs) = sc->fs; | 22 | REGS_FS(regs->regs) = sc->fs; |
23 | REGS_ES(regs->skas.regs) = sc->es; | 23 | REGS_ES(regs->regs) = sc->es; |
24 | REGS_DS(regs->skas.regs) = sc->ds; | 24 | REGS_DS(regs->regs) = sc->ds; |
25 | REGS_EDI(regs->skas.regs) = sc->edi; | 25 | REGS_EDI(regs->regs) = sc->edi; |
26 | REGS_ESI(regs->skas.regs) = sc->esi; | 26 | REGS_ESI(regs->regs) = sc->esi; |
27 | REGS_EBP(regs->skas.regs) = sc->ebp; | 27 | REGS_EBP(regs->regs) = sc->ebp; |
28 | REGS_SP(regs->skas.regs) = sc->esp; | 28 | REGS_SP(regs->regs) = sc->esp; |
29 | REGS_EBX(regs->skas.regs) = sc->ebx; | 29 | REGS_EBX(regs->regs) = sc->ebx; |
30 | REGS_EDX(regs->skas.regs) = sc->edx; | 30 | REGS_EDX(regs->regs) = sc->edx; |
31 | REGS_ECX(regs->skas.regs) = sc->ecx; | 31 | REGS_ECX(regs->regs) = sc->ecx; |
32 | REGS_EAX(regs->skas.regs) = sc->eax; | 32 | REGS_EAX(regs->regs) = sc->eax; |
33 | REGS_IP(regs->skas.regs) = sc->eip; | 33 | REGS_IP(regs->regs) = sc->eip; |
34 | REGS_CS(regs->skas.regs) = sc->cs; | 34 | REGS_CS(regs->regs) = sc->cs; |
35 | REGS_EFLAGS(regs->skas.regs) = sc->eflags; | 35 | REGS_EFLAGS(regs->regs) = sc->eflags; |
36 | REGS_SS(regs->skas.regs) = sc->ss; | 36 | REGS_SS(regs->regs) = sc->ss; |
37 | } | 37 | } |
38 | 38 | ||
39 | static int copy_sc_from_user_skas(struct pt_regs *regs, | 39 | static int copy_sc_from_user(struct pt_regs *regs, |
40 | struct sigcontext __user *from) | 40 | struct sigcontext __user *from) |
41 | { | 41 | { |
42 | struct sigcontext sc; | 42 | struct sigcontext sc; |
43 | unsigned long fpregs[HOST_FP_SIZE]; | 43 | unsigned long fpregs[HOST_FP_SIZE]; |
@@ -60,31 +60,32 @@ static int copy_sc_from_user_skas(struct pt_regs *regs, | |||
60 | return 0; | 60 | return 0; |
61 | } | 61 | } |
62 | 62 | ||
63 | int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp, | 63 | static int copy_sc_to_user(struct sigcontext __user *to, |
64 | struct pt_regs *regs, unsigned long sp) | 64 | struct _fpstate __user *to_fp, struct pt_regs *regs, |
65 | unsigned long sp) | ||
65 | { | 66 | { |
66 | struct sigcontext sc; | 67 | struct sigcontext sc; |
67 | unsigned long fpregs[HOST_FP_SIZE]; | 68 | unsigned long fpregs[HOST_FP_SIZE]; |
68 | struct faultinfo * fi = ¤t->thread.arch.faultinfo; | 69 | struct faultinfo * fi = ¤t->thread.arch.faultinfo; |
69 | int err; | 70 | int err; |
70 | 71 | ||
71 | sc.gs = REGS_GS(regs->regs.skas.regs); | 72 | sc.gs = REGS_GS(regs->regs.regs); |
72 | sc.fs = REGS_FS(regs->regs.skas.regs); | 73 | sc.fs = REGS_FS(regs->regs.regs); |
73 | sc.es = REGS_ES(regs->regs.skas.regs); | 74 | sc.es = REGS_ES(regs->regs.regs); |
74 | sc.ds = REGS_DS(regs->regs.skas.regs); | 75 | sc.ds = REGS_DS(regs->regs.regs); |
75 | sc.edi = REGS_EDI(regs->regs.skas.regs); | 76 | sc.edi = REGS_EDI(regs->regs.regs); |
76 | sc.esi = REGS_ESI(regs->regs.skas.regs); | 77 | sc.esi = REGS_ESI(regs->regs.regs); |
77 | sc.ebp = REGS_EBP(regs->regs.skas.regs); | 78 | sc.ebp = REGS_EBP(regs->regs.regs); |
78 | sc.esp = sp; | 79 | sc.esp = sp; |
79 | sc.ebx = REGS_EBX(regs->regs.skas.regs); | 80 | sc.ebx = REGS_EBX(regs->regs.regs); |
80 | sc.edx = REGS_EDX(regs->regs.skas.regs); | 81 | sc.edx = REGS_EDX(regs->regs.regs); |
81 | sc.ecx = REGS_ECX(regs->regs.skas.regs); | 82 | sc.ecx = REGS_ECX(regs->regs.regs); |
82 | sc.eax = REGS_EAX(regs->regs.skas.regs); | 83 | sc.eax = REGS_EAX(regs->regs.regs); |
83 | sc.eip = REGS_IP(regs->regs.skas.regs); | 84 | sc.eip = REGS_IP(regs->regs.regs); |
84 | sc.cs = REGS_CS(regs->regs.skas.regs); | 85 | sc.cs = REGS_CS(regs->regs.regs); |
85 | sc.eflags = REGS_EFLAGS(regs->regs.skas.regs); | 86 | sc.eflags = REGS_EFLAGS(regs->regs.regs); |
86 | sc.esp_at_signal = regs->regs.skas.regs[UESP]; | 87 | sc.esp_at_signal = regs->regs.regs[UESP]; |
87 | sc.ss = regs->regs.skas.regs[SS]; | 88 | sc.ss = regs->regs.regs[SS]; |
88 | sc.cr2 = fi->cr2; | 89 | sc.cr2 = fi->cr2; |
89 | sc.err = fi->error_code; | 90 | sc.err = fi->error_code; |
90 | sc.trapno = fi->trap_no; | 91 | sc.trapno = fi->trap_no; |
@@ -105,17 +106,6 @@ int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *t | |||
105 | copy_to_user(to_fp, fpregs, sizeof(fpregs)); | 106 | copy_to_user(to_fp, fpregs, sizeof(fpregs)); |
106 | } | 107 | } |
107 | 108 | ||
108 | static int copy_sc_from_user(struct pt_regs *to, void __user *from) | ||
109 | { | ||
110 | return copy_sc_from_user_skas(to, from); | ||
111 | } | ||
112 | |||
113 | static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp, | ||
114 | struct pt_regs *from, unsigned long sp) | ||
115 | { | ||
116 | return copy_sc_to_user_skas(to, fp, from, sp); | ||
117 | } | ||
118 | |||
119 | static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp, | 109 | static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp, |
120 | sigset_t *set, unsigned long sp) | 110 | sigset_t *set, unsigned long sp) |
121 | { | 111 | { |