1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#include "qemu/osdep.h"
20#include "qemu.h"
21#include "signal-common.h"
22#include "linux-user/trace.h"
23
24
25struct target_reg_window {
26 abi_ulong locals[8];
27 abi_ulong ins[8];
28};
29
30
31struct target_stackf {
32
33
34
35
36
37 struct target_reg_window win;
38
39
40
41
42
43 abi_ulong xargs[8];
44};
45
46struct target_siginfo_fpu {
47#ifdef TARGET_SPARC64
48 uint64_t si_double_regs[32];
49 uint64_t si_fsr;
50 uint64_t si_gsr;
51 uint64_t si_fprs;
52#else
53
54 uint64_t si_double_regs[16];
55 uint32_t si_fsr;
56 uint32_t si_fpqdepth;
57 struct {
58 uint32_t insn_addr;
59 uint32_t insn;
60 } si_fpqueue [16];
61#endif
62};
63
64#ifdef TARGET_ARCH_HAS_SETUP_FRAME
65struct target_signal_frame {
66 struct target_stackf ss;
67 struct target_pt_regs regs;
68 uint32_t si_mask;
69 abi_ulong fpu_save;
70 uint32_t insns[2] QEMU_ALIGNED(8);
71 abi_ulong extramask[TARGET_NSIG_WORDS - 1];
72 abi_ulong extra_size;
73 abi_ulong rwin_save;
74};
75#endif
76
77struct target_rt_signal_frame {
78 struct target_stackf ss;
79 target_siginfo_t info;
80 struct target_pt_regs regs;
81#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
82 abi_ulong fpu_save;
83 target_stack_t stack;
84 target_sigset_t mask;
85#else
86 target_sigset_t mask;
87 abi_ulong fpu_save;
88 uint32_t insns[2];
89 target_stack_t stack;
90 abi_ulong extra_size;
91#endif
92 abi_ulong rwin_save;
93};
94
95static abi_ulong get_sigframe(struct target_sigaction *sa,
96 CPUSPARCState *env,
97 size_t framesize)
98{
99 abi_ulong sp = get_sp_from_cpustate(env);
100
101
102
103
104
105 if (on_sig_stack(sp) && !likely(on_sig_stack(sp - framesize))) {
106 return -1;
107 }
108
109
110 sp = target_sigsp(sp, sa) - framesize;
111
112
113
114
115
116
117
118
119 sp &= ~15UL;
120
121 return sp;
122}
123
124static void save_pt_regs(struct target_pt_regs *regs, CPUSPARCState *env)
125{
126 int i;
127
128#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
129 __put_user(sparc64_tstate(env), ®s->tstate);
130
131 __put_user(0, ®s->magic);
132#else
133 __put_user(cpu_get_psr(env), ®s->psr);
134#endif
135
136 __put_user(env->pc, ®s->pc);
137 __put_user(env->npc, ®s->npc);
138 __put_user(env->y, ®s->y);
139
140 for (i = 0; i < 8; i++) {
141 __put_user(env->gregs[i], ®s->u_regs[i]);
142 }
143 for (i = 0; i < 8; i++) {
144 __put_user(env->regwptr[WREG_O0 + i], ®s->u_regs[i + 8]);
145 }
146}
147
148static void restore_pt_regs(struct target_pt_regs *regs, CPUSPARCState *env)
149{
150 int i;
151
152#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
153
154 uint64_t tstate;
155 __get_user(tstate, ®s->tstate);
156 cpu_put_ccr(env, tstate >> 32);
157 env->asi = extract64(tstate, 24, 8);
158#else
159
160
161
162
163
164 uint32_t psr;
165 __get_user(psr, ®s->psr);
166 env->psr = (psr & PSR_ICC) | (env->psr & ~PSR_ICC);
167#endif
168
169
170
171 __get_user(env->y, ®s->y);
172
173 for (i = 0; i < 8; i++) {
174 __get_user(env->gregs[i], ®s->u_regs[i]);
175 }
176 for (i = 0; i < 8; i++) {
177 __get_user(env->regwptr[WREG_O0 + i], ®s->u_regs[i + 8]);
178 }
179}
180
181static void save_reg_win(struct target_reg_window *win, CPUSPARCState *env)
182{
183 int i;
184
185 for (i = 0; i < 8; i++) {
186 __put_user(env->regwptr[i + WREG_L0], &win->locals[i]);
187 }
188 for (i = 0; i < 8; i++) {
189 __put_user(env->regwptr[i + WREG_I0], &win->ins[i]);
190 }
191}
192
193static void save_fpu(struct target_siginfo_fpu *fpu, CPUSPARCState *env)
194{
195 int i;
196
197#ifdef TARGET_SPARC64
198 for (i = 0; i < 32; ++i) {
199 __put_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
200 }
201 __put_user(env->fsr, &fpu->si_fsr);
202 __put_user(env->gsr, &fpu->si_gsr);
203 __put_user(env->fprs, &fpu->si_fprs);
204#else
205 for (i = 0; i < 16; ++i) {
206 __put_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
207 }
208 __put_user(env->fsr, &fpu->si_fsr);
209 __put_user(0, &fpu->si_fpqdepth);
210#endif
211}
212
213static void restore_fpu(struct target_siginfo_fpu *fpu, CPUSPARCState *env)
214{
215 int i;
216
217#ifdef TARGET_SPARC64
218 uint64_t fprs;
219 __get_user(fprs, &fpu->si_fprs);
220
221
222 if (fprs & FPRS_DL) {
223 for (i = 0; i < 16; ++i) {
224 __get_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
225 }
226 }
227 if (fprs & FPRS_DU) {
228 for (i = 16; i < 32; ++i) {
229 __get_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
230 }
231 }
232 __get_user(env->fsr, &fpu->si_fsr);
233 __get_user(env->gsr, &fpu->si_gsr);
234 env->fprs |= fprs;
235#else
236 for (i = 0; i < 16; ++i) {
237 __get_user(env->fpr[i].ll, &fpu->si_double_regs[i]);
238 }
239 __get_user(env->fsr, &fpu->si_fsr);
240#endif
241}
242
243#ifdef TARGET_ARCH_HAS_SETUP_FRAME
244void setup_frame(int sig, struct target_sigaction *ka,
245 target_sigset_t *set, CPUSPARCState *env)
246{
247 abi_ulong sf_addr;
248 struct target_signal_frame *sf;
249 size_t sf_size = sizeof(*sf) + sizeof(struct target_siginfo_fpu);
250 int i;
251
252 sf_addr = get_sigframe(ka, env, sf_size);
253 trace_user_setup_frame(env, sf_addr);
254
255 sf = lock_user(VERIFY_WRITE, sf_addr, sf_size, 0);
256 if (!sf) {
257 force_sigsegv(sig);
258 return;
259 }
260
261
262 save_pt_regs(&sf->regs, env);
263 __put_user(0, &sf->extra_size);
264
265 save_fpu((struct target_siginfo_fpu *)(sf + 1), env);
266 __put_user(sf_addr + sizeof(*sf), &sf->fpu_save);
267
268 __put_user(0, &sf->rwin_save);
269
270 __put_user(set->sig[0], &sf->si_mask);
271 for (i = 0; i < TARGET_NSIG_WORDS - 1; i++) {
272 __put_user(set->sig[i + 1], &sf->extramask[i]);
273 }
274
275 save_reg_win(&sf->ss.win, env);
276
277
278 env->regwptr[WREG_SP] = sf_addr;
279 env->regwptr[WREG_O0] = sig;
280 env->regwptr[WREG_O1] = sf_addr +
281 offsetof(struct target_signal_frame, regs);
282 env->regwptr[WREG_O2] = sf_addr +
283 offsetof(struct target_signal_frame, regs);
284
285
286 env->pc = ka->_sa_handler;
287 env->npc = env->pc + 4;
288
289
290 if (ka->ka_restorer) {
291 env->regwptr[WREG_O7] = ka->ka_restorer;
292 } else {
293 env->regwptr[WREG_O7] = sf_addr +
294 offsetof(struct target_signal_frame, insns) - 2 * 4;
295
296
297 __put_user(0x821020d8u, &sf->insns[0]);
298
299 __put_user(0x91d02010u, &sf->insns[1]);
300 }
301 unlock_user(sf, sf_addr, sf_size);
302}
303#endif
304
305void setup_rt_frame(int sig, struct target_sigaction *ka,
306 target_siginfo_t *info,
307 target_sigset_t *set, CPUSPARCState *env)
308{
309 abi_ulong sf_addr;
310 struct target_rt_signal_frame *sf;
311 size_t sf_size = sizeof(*sf) + sizeof(struct target_siginfo_fpu);
312
313 sf_addr = get_sigframe(ka, env, sf_size);
314 trace_user_setup_rt_frame(env, sf_addr);
315
316 sf = lock_user(VERIFY_WRITE, sf_addr, sf_size, 0);
317 if (!sf) {
318 force_sigsegv(sig);
319 return;
320 }
321
322
323 save_reg_win(&sf->ss.win, env);
324 save_pt_regs(&sf->regs, env);
325
326 save_fpu((struct target_siginfo_fpu *)(sf + 1), env);
327 __put_user(sf_addr + sizeof(*sf), &sf->fpu_save);
328
329 __put_user(0, &sf->rwin_save);
330
331 tswap_siginfo(&sf->info, info);
332 tswap_sigset(&sf->mask, set);
333 target_save_altstack(&sf->stack, env);
334
335#ifdef TARGET_ABI32
336 __put_user(0, &sf->extra_size);
337#endif
338
339
340 env->regwptr[WREG_SP] = sf_addr - TARGET_STACK_BIAS;
341 env->regwptr[WREG_O0] = sig;
342 env->regwptr[WREG_O1] =
343 sf_addr + offsetof(struct target_rt_signal_frame, info);
344#ifdef TARGET_ABI32
345 env->regwptr[WREG_O2] =
346 sf_addr + offsetof(struct target_rt_signal_frame, regs);
347#else
348 env->regwptr[WREG_O2] = env->regwptr[WREG_O1];
349#endif
350
351
352 env->pc = ka->_sa_handler;
353 env->npc = env->pc + 4;
354
355
356#ifdef TARGET_ABI32
357 if (ka->ka_restorer) {
358 env->regwptr[WREG_O7] = ka->ka_restorer;
359 } else {
360 env->regwptr[WREG_O7] =
361 sf_addr + offsetof(struct target_rt_signal_frame, insns) - 2 * 4;
362
363
364 __put_user(0x82102065u, &sf->insns[0]);
365
366 __put_user(0x91d02010u, &sf->insns[1]);
367 }
368#else
369 env->regwptr[WREG_O7] = ka->ka_restorer;
370#endif
371
372 unlock_user(sf, sf_addr, sf_size);
373}
374
375long do_sigreturn(CPUSPARCState *env)
376{
377#ifdef TARGET_ARCH_HAS_SETUP_FRAME
378 abi_ulong sf_addr;
379 struct target_signal_frame *sf = NULL;
380 abi_ulong pc, npc, ptr;
381 target_sigset_t set;
382 sigset_t host_set;
383 int i;
384
385 sf_addr = env->regwptr[WREG_SP];
386 trace_user_do_sigreturn(env, sf_addr);
387
388
389 if ((sf_addr & 15) || !lock_user_struct(VERIFY_READ, sf, sf_addr, 1)) {
390 goto segv_and_exit;
391 }
392
393
394 __get_user(ptr, &sf->regs.u_regs[14]);
395 if (ptr & 7) {
396 goto segv_and_exit;
397 }
398
399
400 __get_user(pc, &sf->regs.pc);
401 __get_user(npc, &sf->regs.npc);
402 if ((pc | npc) & 3) {
403 goto segv_and_exit;
404 }
405
406
407 restore_pt_regs(&sf->regs, env);
408 env->pc = pc;
409 env->npc = npc;
410
411 __get_user(ptr, &sf->fpu_save);
412 if (ptr) {
413 struct target_siginfo_fpu *fpu;
414 if ((ptr & 3) || !lock_user_struct(VERIFY_READ, fpu, ptr, 1)) {
415 goto segv_and_exit;
416 }
417 restore_fpu(fpu, env);
418 unlock_user_struct(fpu, ptr, 0);
419 }
420
421 __get_user(ptr, &sf->rwin_save);
422 if (ptr) {
423 goto segv_and_exit;
424 }
425
426 __get_user(set.sig[0], &sf->si_mask);
427 for (i = 1; i < TARGET_NSIG_WORDS; i++) {
428 __get_user(set.sig[i], &sf->extramask[i - 1]);
429 }
430
431 target_to_host_sigset_internal(&host_set, &set);
432 set_sigmask(&host_set);
433
434 unlock_user_struct(sf, sf_addr, 0);
435 return -TARGET_QEMU_ESIGRETURN;
436
437 segv_and_exit:
438 unlock_user_struct(sf, sf_addr, 0);
439 force_sig(TARGET_SIGSEGV);
440 return -TARGET_QEMU_ESIGRETURN;
441#else
442 return -TARGET_ENOSYS;
443#endif
444}
445
446long do_rt_sigreturn(CPUSPARCState *env)
447{
448 abi_ulong sf_addr, tpc, tnpc, ptr;
449 struct target_rt_signal_frame *sf = NULL;
450 sigset_t set;
451
452 sf_addr = get_sp_from_cpustate(env);
453 trace_user_do_rt_sigreturn(env, sf_addr);
454
455
456 if ((sf_addr & 15) || !lock_user_struct(VERIFY_READ, sf, sf_addr, 1)) {
457 goto segv_and_exit;
458 }
459
460
461 __get_user(ptr, &sf->regs.u_regs[8 + WREG_SP]);
462 if ((ptr + TARGET_STACK_BIAS) & 7) {
463 goto segv_and_exit;
464 }
465
466
467 __get_user(tpc, &sf->regs.pc);
468 __get_user(tnpc, &sf->regs.npc);
469 if ((tpc | tnpc) & 3) {
470 goto segv_and_exit;
471 }
472
473
474 restore_pt_regs(&sf->regs, env);
475
476 __get_user(ptr, &sf->fpu_save);
477 if (ptr) {
478 struct target_siginfo_fpu *fpu;
479 if ((ptr & 7) || !lock_user_struct(VERIFY_READ, fpu, ptr, 1)) {
480 goto segv_and_exit;
481 }
482 restore_fpu(fpu, env);
483 unlock_user_struct(fpu, ptr, 0);
484 }
485
486 __get_user(ptr, &sf->rwin_save);
487 if (ptr) {
488 goto segv_and_exit;
489 }
490
491 target_restore_altstack(&sf->stack, env);
492 target_to_host_sigset(&set, &sf->mask);
493 set_sigmask(&set);
494
495 env->pc = tpc;
496 env->npc = tnpc;
497
498 unlock_user_struct(sf, sf_addr, 0);
499 return -TARGET_QEMU_ESIGRETURN;
500
501 segv_and_exit:
502 unlock_user_struct(sf, sf_addr, 0);
503 force_sig(TARGET_SIGSEGV);
504 return -TARGET_QEMU_ESIGRETURN;
505}
506
507#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
508#define SPARC_MC_TSTATE 0
509#define SPARC_MC_PC 1
510#define SPARC_MC_NPC 2
511#define SPARC_MC_Y 3
512#define SPARC_MC_G1 4
513#define SPARC_MC_G2 5
514#define SPARC_MC_G3 6
515#define SPARC_MC_G4 7
516#define SPARC_MC_G5 8
517#define SPARC_MC_G6 9
518#define SPARC_MC_G7 10
519#define SPARC_MC_O0 11
520#define SPARC_MC_O1 12
521#define SPARC_MC_O2 13
522#define SPARC_MC_O3 14
523#define SPARC_MC_O4 15
524#define SPARC_MC_O5 16
525#define SPARC_MC_O6 17
526#define SPARC_MC_O7 18
527#define SPARC_MC_NGREG 19
528
529typedef abi_ulong target_mc_greg_t;
530typedef target_mc_greg_t target_mc_gregset_t[SPARC_MC_NGREG];
531
532struct target_mc_fq {
533 abi_ulong mcfq_addr;
534 uint32_t mcfq_insn;
535};
536
537
538
539
540
541
542struct target_mc_fpu {
543 union {
544 uint32_t sregs[32];
545 uint64_t dregs[32];
546
547 } mcfpu_fregs;
548 abi_ulong mcfpu_fsr;
549 abi_ulong mcfpu_fprs;
550 abi_ulong mcfpu_gsr;
551 abi_ulong mcfpu_fq;
552 unsigned char mcfpu_qcnt;
553 unsigned char mcfpu_qentsz;
554 unsigned char mcfpu_enab;
555} __attribute__((aligned(16)));
556typedef struct target_mc_fpu target_mc_fpu_t;
557
558typedef struct {
559 target_mc_gregset_t mc_gregs;
560 target_mc_greg_t mc_fp;
561 target_mc_greg_t mc_i7;
562 target_mc_fpu_t mc_fpregs;
563} target_mcontext_t;
564
565struct target_ucontext {
566 abi_ulong tuc_link;
567 abi_ulong tuc_flags;
568 target_sigset_t tuc_sigmask;
569 target_mcontext_t tuc_mcontext;
570};
571
572
573void sparc64_set_context(CPUSPARCState *env)
574{
575 abi_ulong ucp_addr;
576 struct target_ucontext *ucp;
577 target_mc_gregset_t *grp;
578 target_mc_fpu_t *fpup;
579 abi_ulong pc, npc, tstate;
580 unsigned int i;
581 unsigned char fenab;
582
583 ucp_addr = env->regwptr[WREG_O0];
584 if (!lock_user_struct(VERIFY_READ, ucp, ucp_addr, 1)) {
585 goto do_sigsegv;
586 }
587 grp = &ucp->tuc_mcontext.mc_gregs;
588 __get_user(pc, &((*grp)[SPARC_MC_PC]));
589 __get_user(npc, &((*grp)[SPARC_MC_NPC]));
590 if ((pc | npc) & 3) {
591 goto do_sigsegv;
592 }
593 if (env->regwptr[WREG_O1]) {
594 target_sigset_t target_set;
595 sigset_t set;
596
597 if (TARGET_NSIG_WORDS == 1) {
598 __get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]);
599 } else {
600 abi_ulong *src, *dst;
601 src = ucp->tuc_sigmask.sig;
602 dst = target_set.sig;
603 for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
604 __get_user(*dst, src);
605 }
606 }
607 target_to_host_sigset_internal(&set, &target_set);
608 set_sigmask(&set);
609 }
610 env->pc = pc;
611 env->npc = npc;
612 __get_user(env->y, &((*grp)[SPARC_MC_Y]));
613 __get_user(tstate, &((*grp)[SPARC_MC_TSTATE]));
614
615 env->asi = (tstate >> 24) & 0xff;
616 cpu_put_ccr(env, (tstate >> 32) & 0xff);
617 __get_user(env->gregs[1], (&(*grp)[SPARC_MC_G1]));
618 __get_user(env->gregs[2], (&(*grp)[SPARC_MC_G2]));
619 __get_user(env->gregs[3], (&(*grp)[SPARC_MC_G3]));
620 __get_user(env->gregs[4], (&(*grp)[SPARC_MC_G4]));
621 __get_user(env->gregs[5], (&(*grp)[SPARC_MC_G5]));
622 __get_user(env->gregs[6], (&(*grp)[SPARC_MC_G6]));
623
624
625
626
627
628
629
630
631
632
633 __get_user(env->regwptr[WREG_O0], (&(*grp)[SPARC_MC_O0]));
634 __get_user(env->regwptr[WREG_O1], (&(*grp)[SPARC_MC_O1]));
635 __get_user(env->regwptr[WREG_O2], (&(*grp)[SPARC_MC_O2]));
636 __get_user(env->regwptr[WREG_O3], (&(*grp)[SPARC_MC_O3]));
637 __get_user(env->regwptr[WREG_O4], (&(*grp)[SPARC_MC_O4]));
638 __get_user(env->regwptr[WREG_O5], (&(*grp)[SPARC_MC_O5]));
639 __get_user(env->regwptr[WREG_O6], (&(*grp)[SPARC_MC_O6]));
640 __get_user(env->regwptr[WREG_O7], (&(*grp)[SPARC_MC_O7]));
641
642 __get_user(env->regwptr[WREG_FP], &(ucp->tuc_mcontext.mc_fp));
643 __get_user(env->regwptr[WREG_I7], &(ucp->tuc_mcontext.mc_i7));
644
645 fpup = &ucp->tuc_mcontext.mc_fpregs;
646
647 __get_user(fenab, &(fpup->mcfpu_enab));
648 if (fenab) {
649 abi_ulong fprs;
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667 __get_user(fprs, &(fpup->mcfpu_fprs));
668 if (fprs & FPRS_DL) {
669 for (i = 0; i < 16; i++) {
670 __get_user(env->fpr[i].ll, &(fpup->mcfpu_fregs.dregs[i]));
671 }
672 }
673 if (fprs & FPRS_DU) {
674 for (i = 16; i < 32; i++) {
675 __get_user(env->fpr[i].ll, &(fpup->mcfpu_fregs.dregs[i]));
676 }
677 }
678 __get_user(env->fsr, &(fpup->mcfpu_fsr));
679 __get_user(env->gsr, &(fpup->mcfpu_gsr));
680 }
681 unlock_user_struct(ucp, ucp_addr, 0);
682 return;
683do_sigsegv:
684 unlock_user_struct(ucp, ucp_addr, 0);
685 force_sig(TARGET_SIGSEGV);
686}
687
688void sparc64_get_context(CPUSPARCState *env)
689{
690 abi_ulong ucp_addr;
691 struct target_ucontext *ucp;
692 target_mc_gregset_t *grp;
693 target_mcontext_t *mcp;
694 int err;
695 unsigned int i;
696 target_sigset_t target_set;
697 sigset_t set;
698
699 ucp_addr = env->regwptr[WREG_O0];
700 if (!lock_user_struct(VERIFY_WRITE, ucp, ucp_addr, 0)) {
701 goto do_sigsegv;
702 }
703
704 memset(ucp, 0, sizeof(*ucp));
705
706 mcp = &ucp->tuc_mcontext;
707 grp = &mcp->mc_gregs;
708
709
710 env->pc = env->npc;
711 env->npc += 4;
712
713
714
715
716
717
718 err = do_sigprocmask(0, NULL, &set);
719 assert(err == 0);
720 host_to_target_sigset_internal(&target_set, &set);
721 if (TARGET_NSIG_WORDS == 1) {
722 __put_user(target_set.sig[0],
723 (abi_ulong *)&ucp->tuc_sigmask);
724 } else {
725 abi_ulong *src, *dst;
726 src = target_set.sig;
727 dst = ucp->tuc_sigmask.sig;
728 for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
729 __put_user(*src, dst);
730 }
731 }
732
733 __put_user(sparc64_tstate(env), &((*grp)[SPARC_MC_TSTATE]));
734 __put_user(env->pc, &((*grp)[SPARC_MC_PC]));
735 __put_user(env->npc, &((*grp)[SPARC_MC_NPC]));
736 __put_user(env->y, &((*grp)[SPARC_MC_Y]));
737 __put_user(env->gregs[1], &((*grp)[SPARC_MC_G1]));
738 __put_user(env->gregs[2], &((*grp)[SPARC_MC_G2]));
739 __put_user(env->gregs[3], &((*grp)[SPARC_MC_G3]));
740 __put_user(env->gregs[4], &((*grp)[SPARC_MC_G4]));
741 __put_user(env->gregs[5], &((*grp)[SPARC_MC_G5]));
742 __put_user(env->gregs[6], &((*grp)[SPARC_MC_G6]));
743 __put_user(env->gregs[7], &((*grp)[SPARC_MC_G7]));
744
745
746
747
748
749
750
751
752
753 __put_user(env->regwptr[WREG_O0], &((*grp)[SPARC_MC_O0]));
754 __put_user(env->regwptr[WREG_O1], &((*grp)[SPARC_MC_O1]));
755 __put_user(env->regwptr[WREG_O2], &((*grp)[SPARC_MC_O2]));
756 __put_user(env->regwptr[WREG_O3], &((*grp)[SPARC_MC_O3]));
757 __put_user(env->regwptr[WREG_O4], &((*grp)[SPARC_MC_O4]));
758 __put_user(env->regwptr[WREG_O5], &((*grp)[SPARC_MC_O5]));
759 __put_user(env->regwptr[WREG_O6], &((*grp)[SPARC_MC_O6]));
760 __put_user(env->regwptr[WREG_O7], &((*grp)[SPARC_MC_O7]));
761
762 __put_user(env->regwptr[WREG_FP], &(mcp->mc_fp));
763 __put_user(env->regwptr[WREG_I7], &(mcp->mc_i7));
764
765
766
767
768
769
770
771 unlock_user_struct(ucp, ucp_addr, 1);
772 return;
773do_sigsegv:
774 unlock_user_struct(ucp, ucp_addr, 1);
775 force_sig(TARGET_SIGSEGV);
776}
777#endif
778