2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1991, 1992 Linus Torvalds
7 * Copyright (C) 1994 - 2000, 2006 Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
10 #include <linux/cache.h>
11 #include <linux/compat.h>
12 #include <linux/sched.h>
14 #include <linux/smp.h>
15 #include <linux/smp_lock.h>
16 #include <linux/kernel.h>
17 #include <linux/signal.h>
18 #include <linux/syscalls.h>
19 #include <linux/errno.h>
20 #include <linux/wait.h>
21 #include <linux/ptrace.h>
22 #include <linux/compat.h>
23 #include <linux/suspend.h>
24 #include <linux/compiler.h>
25 #include <linux/uaccess.h>
29 #include <asm/compat-signal.h>
30 #include <linux/bitops.h>
31 #include <asm/cacheflush.h>
33 #include <asm/ucontext.h>
34 #include <asm/system.h>
38 #include "signal-common.h"
40 #define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
42 typedef struct compat_siginfo {
48 int _pad[SI_PAD_SIZE32];
52 compat_pid_t _pid; /* sender's pid */
53 compat_uid_t _uid; /* sender's uid */
58 compat_pid_t _pid; /* which child */
59 compat_uid_t _uid; /* sender's uid */
60 int _status; /* exit code */
61 compat_clock_t _utime;
62 compat_clock_t _stime;
67 compat_pid_t _pid; /* which child */
68 compat_clock_t _utime;
69 int _status; /* exit code */
70 compat_clock_t _stime;
73 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
75 s32 _addr; /* faulting insn/memory ref. */
78 /* SIGPOLL, SIGXFSZ (To do ...) */
80 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
86 timer_t _tid; /* timer id */
87 int _overrun; /* overrun count */
88 compat_sigval_t _sigval;/* same as below */
89 int _sys_private; /* not to be passed to user */
92 /* POSIX.1b signals */
94 compat_pid_t _pid; /* sender's pid */
95 compat_uid_t _uid; /* sender's uid */
96 compat_sigval_t _sigval;
103 * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
105 #define __NR_O32_sigreturn 4119
106 #define __NR_O32_rt_sigreturn 4193
107 #define __NR_O32_restart_syscall 4253
109 /* 32-bit compatibility types */
111 typedef unsigned int __sighandler32_t;
112 typedef void (*vfptr_t)(void);
115 unsigned int sa_flags;
116 __sighandler32_t sa_handler;
117 compat_sigset_t sa_mask;
120 /* IRIX compatible stack_t */
121 typedef struct sigaltstack32 {
123 compat_size_t ss_size;
131 struct sigcontext32 uc_mcontext;
132 compat_sigset_t uc_sigmask; /* mask last for extensibility */
136 * Horribly complicated - with the bloody RM9000 workarounds enabled
137 * the signal trampolines is moving to the end of the structure so we can
138 * increase the alignment without breaking software compatibility.
140 #if ICACHE_REFILLS_WORKAROUND_WAR == 0
143 u32 sf_ass[4]; /* argument save space for o32 */
144 u32 sf_code[2]; /* signal trampoline */
145 struct sigcontext32 sf_sc;
146 compat_sigset_t sf_mask;
149 struct rt_sigframe32 {
150 u32 rs_ass[4]; /* argument save space for o32 */
151 u32 rs_code[2]; /* signal trampoline */
152 compat_siginfo_t rs_info;
153 struct ucontext32 rs_uc;
156 #else /* ICACHE_REFILLS_WORKAROUND_WAR */
159 u32 sf_ass[4]; /* argument save space for o32 */
161 struct sigcontext32 sf_sc; /* hw context */
162 compat_sigset_t sf_mask;
163 u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */
166 struct rt_sigframe32 {
167 u32 rs_ass[4]; /* argument save space for o32 */
169 compat_siginfo_t rs_info;
170 struct ucontext32 rs_uc;
171 u32 rs_code[8] __attribute__((aligned(32))); /* signal trampoline */
174 #endif /* !ICACHE_REFILLS_WORKAROUND_WAR */
177 * sigcontext handlers
179 static int protected_save_fp_context32(struct sigcontext32 __user *sc)
185 err = save_fp_context32(sc); /* this might fail */
189 /* touch the sigcontext and try again */
190 err = __put_user(0, &sc->sc_fpregs[0]) |
191 __put_user(0, &sc->sc_fpregs[31]) |
192 __put_user(0, &sc->sc_fpc_csr);
194 break; /* really bad sigcontext */
199 static int protected_restore_fp_context32(struct sigcontext32 __user *sc)
205 err = restore_fp_context32(sc); /* this might fail */
209 /* touch the sigcontext and try again */
210 err = __get_user(tmp, &sc->sc_fpregs[0]) |
211 __get_user(tmp, &sc->sc_fpregs[31]) |
212 __get_user(tmp, &sc->sc_fpc_csr);
214 break; /* really bad sigcontext */
219 static int setup_sigcontext32(struct pt_regs *regs,
220 struct sigcontext32 __user *sc)
226 err |= __put_user(regs->cp0_epc, &sc->sc_pc);
228 err |= __put_user(0, &sc->sc_regs[0]);
229 for (i = 1; i < 32; i++)
230 err |= __put_user(regs->regs[i], &sc->sc_regs[i]);
232 err |= __put_user(regs->hi, &sc->sc_mdhi);
233 err |= __put_user(regs->lo, &sc->sc_mdlo);
235 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
236 err |= __put_user(mfhi1(), &sc->sc_hi1);
237 err |= __put_user(mflo1(), &sc->sc_lo1);
238 err |= __put_user(mfhi2(), &sc->sc_hi2);
239 err |= __put_user(mflo2(), &sc->sc_lo2);
240 err |= __put_user(mfhi3(), &sc->sc_hi3);
241 err |= __put_user(mflo3(), &sc->sc_lo3);
244 used_math = !!used_math();
245 err |= __put_user(used_math, &sc->sc_used_math);
249 * Save FPU state to signal context. Signal handler
250 * will "inherit" current FPU state.
252 err |= protected_save_fp_context32(sc);
258 check_and_restore_fp_context32(struct sigcontext32 __user *sc)
262 err = sig = fpcsr_pending(&sc->sc_fpc_csr);
265 err |= protected_restore_fp_context32(sc);
269 static int restore_sigcontext32(struct pt_regs *regs,
270 struct sigcontext32 __user *sc)
277 /* Always make any pending restarted system calls return -EINTR */
278 current_thread_info()->restart_block.fn = do_no_restart_syscall;
280 err |= __get_user(regs->cp0_epc, &sc->sc_pc);
281 err |= __get_user(regs->hi, &sc->sc_mdhi);
282 err |= __get_user(regs->lo, &sc->sc_mdlo);
284 err |= __get_user(treg, &sc->sc_hi1); mthi1(treg);
285 err |= __get_user(treg, &sc->sc_lo1); mtlo1(treg);
286 err |= __get_user(treg, &sc->sc_hi2); mthi2(treg);
287 err |= __get_user(treg, &sc->sc_lo2); mtlo2(treg);
288 err |= __get_user(treg, &sc->sc_hi3); mthi3(treg);
289 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg);
290 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK);
293 for (i = 1; i < 32; i++)
294 err |= __get_user(regs->regs[i], &sc->sc_regs[i]);
296 err |= __get_user(used_math, &sc->sc_used_math);
297 conditional_used_math(used_math);
300 /* restore fpu context if we have used it before */
302 err = check_and_restore_fp_context32(sc);
304 /* signal handler may have used FPU. Give it up. */
314 extern void __put_sigset_unknown_nsig(void);
315 extern void __get_sigset_unknown_nsig(void);
317 static inline int put_sigset(const sigset_t *kbuf, compat_sigset_t __user *ubuf)
321 if (!access_ok(VERIFY_WRITE, ubuf, sizeof(*ubuf)))
324 switch (_NSIG_WORDS) {
326 __put_sigset_unknown_nsig();
328 err |= __put_user (kbuf->sig[1] >> 32, &ubuf->sig[3]);
329 err |= __put_user (kbuf->sig[1] & 0xffffffff, &ubuf->sig[2]);
331 err |= __put_user (kbuf->sig[0] >> 32, &ubuf->sig[1]);
332 err |= __put_user (kbuf->sig[0] & 0xffffffff, &ubuf->sig[0]);
338 static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t __user *ubuf)
341 unsigned long sig[4];
343 if (!access_ok(VERIFY_READ, ubuf, sizeof(*ubuf)))
346 switch (_NSIG_WORDS) {
348 __get_sigset_unknown_nsig();
350 err |= __get_user (sig[3], &ubuf->sig[3]);
351 err |= __get_user (sig[2], &ubuf->sig[2]);
352 kbuf->sig[1] = sig[2] | (sig[3] << 32);
354 err |= __get_user (sig[1], &ubuf->sig[1]);
355 err |= __get_user (sig[0], &ubuf->sig[0]);
356 kbuf->sig[0] = sig[0] | (sig[1] << 32);
363 * Atomically swap in the new signal mask, and wait for a signal.
366 asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
368 compat_sigset_t __user *uset;
371 uset = (compat_sigset_t __user *) regs.regs[4];
372 if (get_sigset(&newset, uset))
374 sigdelsetmask(&newset, ~_BLOCKABLE);
376 spin_lock_irq(¤t->sighand->siglock);
377 current->saved_sigmask = current->blocked;
378 current->blocked = newset;
380 spin_unlock_irq(¤t->sighand->siglock);
382 current->state = TASK_INTERRUPTIBLE;
384 set_thread_flag(TIF_RESTORE_SIGMASK);
385 return -ERESTARTNOHAND;
388 asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
390 compat_sigset_t __user *uset;
394 /* XXX Don't preclude handling different sized sigset_t's. */
395 sigsetsize = regs.regs[5];
396 if (sigsetsize != sizeof(compat_sigset_t))
399 uset = (compat_sigset_t __user *) regs.regs[4];
400 if (get_sigset(&newset, uset))
402 sigdelsetmask(&newset, ~_BLOCKABLE);
404 spin_lock_irq(¤t->sighand->siglock);
405 current->saved_sigmask = current->blocked;
406 current->blocked = newset;
408 spin_unlock_irq(¤t->sighand->siglock);
410 current->state = TASK_INTERRUPTIBLE;
412 set_thread_flag(TIF_RESTORE_SIGMASK);
413 return -ERESTARTNOHAND;
416 asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act,
417 struct sigaction32 __user *oact)
419 struct k_sigaction new_ka, old_ka;
427 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
429 err |= __get_user(handler, &act->sa_handler);
430 new_ka.sa.sa_handler = (void __user *)(s64)handler;
431 err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
432 err |= __get_user(mask, &act->sa_mask.sig[0]);
436 siginitset(&new_ka.sa.sa_mask, mask);
439 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
442 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
444 err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
445 err |= __put_user((u32)(u64)old_ka.sa.sa_handler,
447 err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig);
448 err |= __put_user(0, &oact->sa_mask.sig[1]);
449 err |= __put_user(0, &oact->sa_mask.sig[2]);
450 err |= __put_user(0, &oact->sa_mask.sig[3]);
458 asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
460 const stack32_t __user *uss = (const stack32_t __user *) regs.regs[4];
461 stack32_t __user *uoss = (stack32_t __user *) regs.regs[5];
462 unsigned long usp = regs.regs[29];
465 mm_segment_t old_fs = get_fs();
469 if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
471 err |= __get_user(sp, &uss->ss_sp);
472 kss.ss_sp = (void __user *) (long) sp;
473 err |= __get_user(kss.ss_size, &uss->ss_size);
474 err |= __get_user(kss.ss_flags, &uss->ss_flags);
480 ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL,
481 uoss ? (stack_t __user *)&koss : NULL, usp);
485 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
487 sp = (int) (unsigned long) koss.ss_sp;
488 err |= __put_user(sp, &uoss->ss_sp);
489 err |= __put_user(koss.ss_size, &uoss->ss_size);
490 err |= __put_user(koss.ss_flags, &uoss->ss_flags);
497 int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
501 if (!access_ok (VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
504 /* If you change siginfo_t structure, please be sure
505 this code is fixed accordingly.
506 It should never copy any pad contained in the structure
507 to avoid security leaks, but must copy the generic
508 3 ints plus the relevant union member.
509 This routine must convert siginfo from 64bit to 32bit as well
511 err = __put_user(from->si_signo, &to->si_signo);
512 err |= __put_user(from->si_errno, &to->si_errno);
513 err |= __put_user((short)from->si_code, &to->si_code);
514 if (from->si_code < 0)
515 err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
517 switch (from->si_code >> 16) {
518 case __SI_TIMER >> 16:
519 err |= __put_user(from->si_tid, &to->si_tid);
520 err |= __put_user(from->si_overrun, &to->si_overrun);
521 err |= __put_user(from->si_int, &to->si_int);
523 case __SI_CHLD >> 16:
524 err |= __put_user(from->si_utime, &to->si_utime);
525 err |= __put_user(from->si_stime, &to->si_stime);
526 err |= __put_user(from->si_status, &to->si_status);
528 err |= __put_user(from->si_pid, &to->si_pid);
529 err |= __put_user(from->si_uid, &to->si_uid);
531 case __SI_FAULT >> 16:
532 err |= __put_user((unsigned long)from->si_addr, &to->si_addr);
534 case __SI_POLL >> 16:
535 err |= __put_user(from->si_band, &to->si_band);
536 err |= __put_user(from->si_fd, &to->si_fd);
538 case __SI_RT >> 16: /* This is not generated by the kernel as of now. */
539 case __SI_MESGQ >> 16:
540 err |= __put_user(from->si_pid, &to->si_pid);
541 err |= __put_user(from->si_uid, &to->si_uid);
542 err |= __put_user(from->si_int, &to->si_int);
549 asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
551 struct sigframe32 __user *frame;
555 frame = (struct sigframe32 __user *) regs.regs[29];
556 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
558 if (__copy_conv_sigset_from_user(&blocked, &frame->sf_mask))
561 sigdelsetmask(&blocked, ~_BLOCKABLE);
562 spin_lock_irq(¤t->sighand->siglock);
563 current->blocked = blocked;
565 spin_unlock_irq(¤t->sighand->siglock);
567 sig = restore_sigcontext32(®s, &frame->sf_sc);
571 force_sig(sig, current);
574 * Don't let your children do this ...
576 __asm__ __volatile__(
584 force_sig(SIGSEGV, current);
587 asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
589 struct rt_sigframe32 __user *frame;
596 frame = (struct rt_sigframe32 __user *) regs.regs[29];
597 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
599 if (__copy_conv_sigset_from_user(&set, &frame->rs_uc.uc_sigmask))
602 sigdelsetmask(&set, ~_BLOCKABLE);
603 spin_lock_irq(¤t->sighand->siglock);
604 current->blocked = set;
606 spin_unlock_irq(¤t->sighand->siglock);
608 sig = restore_sigcontext32(®s, &frame->rs_uc.uc_mcontext);
612 force_sig(sig, current);
614 /* The ucontext contains a stack32_t, so we must convert! */
615 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
617 st.ss_sp = (void __user *)(long) sp;
618 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
620 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
623 /* It is more difficult to avoid calling this function than to
624 call it and ignore errors. */
627 do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
631 * Don't let your children do this ...
633 __asm__ __volatile__(
641 force_sig(SIGSEGV, current);
644 static int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
645 int signr, sigset_t *set)
647 struct sigframe32 __user *frame;
650 frame = get_sigframe(ka, regs, sizeof(*frame));
651 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
654 err |= install_sigtramp(frame->sf_code, __NR_O32_sigreturn);
656 err |= setup_sigcontext32(regs, &frame->sf_sc);
657 err |= __copy_conv_sigset_to_user(&frame->sf_mask, set);
663 * Arguments to signal handler:
666 * a1 = 0 (should be cause)
667 * a2 = pointer to struct sigcontext
669 * $25 and c0_epc point to the signal handler, $29 points to the
672 regs->regs[ 4] = signr;
674 regs->regs[ 6] = (unsigned long) &frame->sf_sc;
675 regs->regs[29] = (unsigned long) frame;
676 regs->regs[31] = (unsigned long) frame->sf_code;
677 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
679 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
680 current->comm, current->pid,
681 frame, regs->cp0_epc, regs->regs[31]);
686 force_sigsegv(signr, current);
690 static int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
691 int signr, sigset_t *set, siginfo_t *info)
693 struct rt_sigframe32 __user *frame;
697 frame = get_sigframe(ka, regs, sizeof(*frame));
698 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
701 err |= install_sigtramp(frame->rs_code, __NR_O32_rt_sigreturn);
703 /* Convert (siginfo_t -> compat_siginfo_t) and copy to user. */
704 err |= copy_siginfo_to_user32(&frame->rs_info, info);
706 /* Create the ucontext. */
707 err |= __put_user(0, &frame->rs_uc.uc_flags);
708 err |= __put_user(0, &frame->rs_uc.uc_link);
709 sp = (int) (long) current->sas_ss_sp;
710 err |= __put_user(sp,
711 &frame->rs_uc.uc_stack.ss_sp);
712 err |= __put_user(sas_ss_flags(regs->regs[29]),
713 &frame->rs_uc.uc_stack.ss_flags);
714 err |= __put_user(current->sas_ss_size,
715 &frame->rs_uc.uc_stack.ss_size);
716 err |= setup_sigcontext32(regs, &frame->rs_uc.uc_mcontext);
717 err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
723 * Arguments to signal handler:
726 * a1 = 0 (should be cause)
727 * a2 = pointer to ucontext
729 * $25 and c0_epc point to the signal handler, $29 points to
730 * the struct rt_sigframe32.
732 regs->regs[ 4] = signr;
733 regs->regs[ 5] = (unsigned long) &frame->rs_info;
734 regs->regs[ 6] = (unsigned long) &frame->rs_uc;
735 regs->regs[29] = (unsigned long) frame;
736 regs->regs[31] = (unsigned long) frame->rs_code;
737 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler;
739 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
740 current->comm, current->pid,
741 frame, regs->cp0_epc, regs->regs[31]);
746 force_sigsegv(signr, current);
751 * o32 compatibility on 64-bit kernels, without DSP ASE
753 struct mips_abi mips_abi_32 = {
754 .setup_frame = setup_frame_32,
755 .setup_rt_frame = setup_rt_frame_32,
756 .restart = __NR_O32_restart_syscall
759 asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
760 struct sigaction32 __user *oact,
761 unsigned int sigsetsize)
763 struct k_sigaction new_sa, old_sa;
766 /* XXX: Don't preclude handling different sized sigset_t's. */
767 if (sigsetsize != sizeof(sigset_t))
774 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
776 err |= __get_user(handler, &act->sa_handler);
777 new_sa.sa.sa_handler = (void __user *)(s64)handler;
778 err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags);
779 err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask);
784 ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL);
789 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
792 err |= __put_user((u32)(u64)old_sa.sa.sa_handler,
794 err |= __put_user(old_sa.sa.sa_flags, &oact->sa_flags);
795 err |= put_sigset(&old_sa.sa.sa_mask, &oact->sa_mask);
803 asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
804 compat_sigset_t __user *oset, unsigned int sigsetsize)
806 sigset_t old_set, new_set;
808 mm_segment_t old_fs = get_fs();
810 if (set && get_sigset(&new_set, set))
814 ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL,
815 oset ? (sigset_t __user *)&old_set : NULL,
819 if (!ret && oset && put_sigset(&old_set, oset))
825 asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset,
826 unsigned int sigsetsize)
830 mm_segment_t old_fs = get_fs();
833 ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize);
836 if (!ret && put_sigset(&set, uset))
842 asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
846 mm_segment_t old_fs = get_fs();
848 if (copy_from_user (&info, uinfo, 3*sizeof(int)) ||
849 copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE))
852 ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
858 sys32_waitid(int which, compat_pid_t pid,
859 compat_siginfo_t __user *uinfo, int options,
860 struct compat_rusage __user *uru)
865 mm_segment_t old_fs = get_fs();
869 ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
870 uru ? (struct rusage __user *) &ru : NULL);
873 if (ret < 0 || info.si_signo == 0)
876 if (uru && (ret = put_compat_rusage(&ru, uru)))
879 BUG_ON(info.si_code & __SI_MASK);
880 info.si_code |= __SI_CHLD;
881 return copy_siginfo_to_user32(uinfo, &info);