diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-02-22 13:40:13 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-02-22 13:40:13 +0000 |
commit | edf779ffccc836661a7b654d320571a6c220caea (patch) | |
tree | a2da1f139f832957716890525c94f105dc46713c /linux-user/signal.c | |
parent | 121061dcdfdf5ef1d78cd2ae84b39b779a568e28 (diff) |
use kernel like macros for user access (will be useful someday to have a better error checking
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@634 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r-- | linux-user/signal.c | 72 |
1 files changed, 2 insertions, 70 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index 666d6e14fb..41affb56e7 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -450,69 +450,6 @@ int do_sigaction(int sig, const struct target_sigaction *act, return 0; } -#define __put_user(x,ptr)\ -({\ - int size = sizeof(*ptr);\ - switch(size) {\ - case 1:\ - stb(ptr, (typeof(*ptr))(x));\ - break;\ - case 2:\ - stw(ptr, (typeof(*ptr))(x));\ - break;\ - case 4:\ - stl(ptr, (typeof(*ptr))(x));\ - break;\ - case 8:\ - stq(ptr, (typeof(*ptr))(x));\ - break;\ - default:\ - abort();\ - }\ - 0;\ -}) - -#define __get_user(x, ptr) \ -({\ - int size = sizeof(*ptr);\ - switch(size) {\ - case 1:\ - x = (typeof(*ptr))ldub(ptr);\ - break;\ - case 2:\ - x = (typeof(*ptr))lduw(ptr);\ - break;\ - case 4:\ - x = (typeof(*ptr))ldl(ptr);\ - break;\ - case 8:\ - x = (typeof(*ptr))ldq(ptr);\ - break;\ - default:\ - abort();\ - }\ - 0;\ -}) - - -#define __copy_to_user(dst, src, size)\ -({\ - memcpy(dst, src, size);\ - 0;\ -}) - -#define __copy_from_user(dst, src, size)\ -({\ - memcpy(dst, src, size);\ - 0;\ -}) - -#define __clear_user(dst, size)\ -({\ - memset(dst, 0, size);\ - 0;\ -}) - #ifndef offsetof #define offsetof(type, field) ((size_t) &((type *)0)->field) #endif @@ -707,10 +644,8 @@ static void setup_frame(int sig, struct emulated_sigaction *ka, frame = get_sigframe(ka, env, sizeof(*frame)); -#if 0 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; -#endif err |= __put_user((/*current->exec_domain && current->exec_domain->signal_invmap && sig < 32 @@ -773,10 +708,8 @@ static void setup_rt_frame(int sig, struct emulated_sigaction *ka, frame = get_sigframe(ka, env, sizeof(*frame)); -#if 0 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) goto give_sigsegv; -#endif err |= __put_user((/*current->exec_domain && current->exec_domain->signal_invmap @@ -1172,10 +1105,9 @@ static void setup_rt_frame(int usig, struct emulated_sigaction *ka, struct rt_sigframe *frame = get_sigframe(ka, env, sizeof(*frame)); int err = 0; -#if 0 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) - return 1; -#endif + return /* 1 */; + __put_user_error(&frame->info, (target_ulong *)&frame->pinfo, err); __put_user_error(&frame->uc, (target_ulong *)&frame->puc, err); err |= copy_siginfo_to_user(&frame->info, info); |