syscall.c (a20fd901afdb453b8afc578a7be14703c3a36300) syscall.c (19f59bcef91cd4abc04d10c9ecbf5183b71f1b06)
1/*
2 * Linux syscalls
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 21 unchanged lines hidden (view full) ---

30#include <sys/file.h>
31#include <sys/fsuid.h>
32#include <sys/personality.h>
33#include <sys/prctl.h>
34#include <sys/resource.h>
35#include <sys/swap.h>
36#include <linux/capability.h>
37#include <sched.h>
1/*
2 * Linux syscalls
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 21 unchanged lines hidden (view full) ---

30#include <sys/file.h>
31#include <sys/fsuid.h>
32#include <sys/personality.h>
33#include <sys/prctl.h>
34#include <sys/resource.h>
35#include <sys/swap.h>
36#include <linux/capability.h>
37#include <sched.h>
38#include <sys/timex.h>
38#ifdef __ia64__
39int __clone2(int (*fn)(void *), void *child_stack_base,
40 size_t stack_size, int flags, void *arg, ...);
41#endif
42#include <sys/socket.h>
43#include <sys/un.h>
44#include <sys/uio.h>
45#include <poll.h>

--- 6719 unchanged lines hidden (view full) ---

6765
6766 target_itspec->it_value.tv_sec = tswapal(host_its->it_value.tv_sec);
6767 target_itspec->it_value.tv_nsec = tswapal(host_its->it_value.tv_nsec);
6768
6769 unlock_user_struct(target_itspec, target_addr, 0);
6770 return 0;
6771}
6772
39#ifdef __ia64__
40int __clone2(int (*fn)(void *), void *child_stack_base,
41 size_t stack_size, int flags, void *arg, ...);
42#endif
43#include <sys/socket.h>
44#include <sys/un.h>
45#include <sys/uio.h>
46#include <poll.h>

--- 6719 unchanged lines hidden (view full) ---

6766
6767 target_itspec->it_value.tv_sec = tswapal(host_its->it_value.tv_sec);
6768 target_itspec->it_value.tv_nsec = tswapal(host_its->it_value.tv_nsec);
6769
6770 unlock_user_struct(target_itspec, target_addr, 0);
6771 return 0;
6772}
6773
6774static inline abi_long target_to_host_timex(struct timex *host_tx,
6775 abi_long target_addr)
6776{
6777 struct target_timex *target_tx;
6778
6779 if (!lock_user_struct(VERIFY_READ, target_tx, target_addr, 1)) {
6780 return -TARGET_EFAULT;
6781 }
6782
6783 __get_user(host_tx->modes, &target_tx->modes);
6784 __get_user(host_tx->offset, &target_tx->offset);
6785 __get_user(host_tx->freq, &target_tx->freq);
6786 __get_user(host_tx->maxerror, &target_tx->maxerror);
6787 __get_user(host_tx->esterror, &target_tx->esterror);
6788 __get_user(host_tx->status, &target_tx->status);
6789 __get_user(host_tx->constant, &target_tx->constant);
6790 __get_user(host_tx->precision, &target_tx->precision);
6791 __get_user(host_tx->tolerance, &target_tx->tolerance);
6792 __get_user(host_tx->time.tv_sec, &target_tx->time.tv_sec);
6793 __get_user(host_tx->time.tv_usec, &target_tx->time.tv_usec);
6794 __get_user(host_tx->tick, &target_tx->tick);
6795 __get_user(host_tx->ppsfreq, &target_tx->ppsfreq);
6796 __get_user(host_tx->jitter, &target_tx->jitter);
6797 __get_user(host_tx->shift, &target_tx->shift);
6798 __get_user(host_tx->stabil, &target_tx->stabil);
6799 __get_user(host_tx->jitcnt, &target_tx->jitcnt);
6800 __get_user(host_tx->calcnt, &target_tx->calcnt);
6801 __get_user(host_tx->errcnt, &target_tx->errcnt);
6802 __get_user(host_tx->stbcnt, &target_tx->stbcnt);
6803 __get_user(host_tx->tai, &target_tx->tai);
6804
6805 unlock_user_struct(target_tx, target_addr, 0);
6806 return 0;
6807}
6808
6809static inline abi_long host_to_target_timex(abi_long target_addr,
6810 struct timex *host_tx)
6811{
6812 struct target_timex *target_tx;
6813
6814 if (!lock_user_struct(VERIFY_WRITE, target_tx, target_addr, 0)) {
6815 return -TARGET_EFAULT;
6816 }
6817
6818 __put_user(host_tx->modes, &target_tx->modes);
6819 __put_user(host_tx->offset, &target_tx->offset);
6820 __put_user(host_tx->freq, &target_tx->freq);
6821 __put_user(host_tx->maxerror, &target_tx->maxerror);
6822 __put_user(host_tx->esterror, &target_tx->esterror);
6823 __put_user(host_tx->status, &target_tx->status);
6824 __put_user(host_tx->constant, &target_tx->constant);
6825 __put_user(host_tx->precision, &target_tx->precision);
6826 __put_user(host_tx->tolerance, &target_tx->tolerance);
6827 __put_user(host_tx->time.tv_sec, &target_tx->time.tv_sec);
6828 __put_user(host_tx->time.tv_usec, &target_tx->time.tv_usec);
6829 __put_user(host_tx->tick, &target_tx->tick);
6830 __put_user(host_tx->ppsfreq, &target_tx->ppsfreq);
6831 __put_user(host_tx->jitter, &target_tx->jitter);
6832 __put_user(host_tx->shift, &target_tx->shift);
6833 __put_user(host_tx->stabil, &target_tx->stabil);
6834 __put_user(host_tx->jitcnt, &target_tx->jitcnt);
6835 __put_user(host_tx->calcnt, &target_tx->calcnt);
6836 __put_user(host_tx->errcnt, &target_tx->errcnt);
6837 __put_user(host_tx->stbcnt, &target_tx->stbcnt);
6838 __put_user(host_tx->tai, &target_tx->tai);
6839
6840 unlock_user_struct(target_tx, target_addr, 1);
6841 return 0;
6842}
6843
6844
6773static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
6774 abi_ulong target_addr)
6775{
6776 struct target_sigevent *target_sevp;
6777
6778 if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {
6779 return -TARGET_EFAULT;
6780 }

--- 2757 unchanged lines hidden (view full) ---

9538 case TARGET_NR_vm86old:
9539 goto unimplemented;
9540 case TARGET_NR_vm86:
9541 ret = do_vm86(cpu_env, arg1, arg2);
9542 break;
9543#endif
9544#endif
9545 case TARGET_NR_adjtimex:
6845static inline abi_long target_to_host_sigevent(struct sigevent *host_sevp,
6846 abi_ulong target_addr)
6847{
6848 struct target_sigevent *target_sevp;
6849
6850 if (!lock_user_struct(VERIFY_READ, target_sevp, target_addr, 1)) {
6851 return -TARGET_EFAULT;
6852 }

--- 2757 unchanged lines hidden (view full) ---

9610 case TARGET_NR_vm86old:
9611 goto unimplemented;
9612 case TARGET_NR_vm86:
9613 ret = do_vm86(cpu_env, arg1, arg2);
9614 break;
9615#endif
9616#endif
9617 case TARGET_NR_adjtimex:
9546 goto unimplemented;
9618 {
9619 struct timex host_buf;
9620
9621 if (target_to_host_timex(&host_buf, arg1) != 0) {
9622 goto efault;
9623 }
9624 ret = get_errno(adjtimex(&host_buf));
9625 if (!is_error(ret)) {
9626 if (host_to_target_timex(arg1, &host_buf) != 0) {
9627 goto efault;
9628 }
9629 }
9630 }
9631 break;
9547#ifdef TARGET_NR_create_module
9548 case TARGET_NR_create_module:
9549#endif
9550 case TARGET_NR_init_module:
9551 case TARGET_NR_delete_module:
9552#ifdef TARGET_NR_get_kernel_syms
9553 case TARGET_NR_get_kernel_syms:
9554#endif

--- 2417 unchanged lines hidden ---
9632#ifdef TARGET_NR_create_module
9633 case TARGET_NR_create_module:
9634#endif
9635 case TARGET_NR_init_module:
9636 case TARGET_NR_delete_module:
9637#ifdef TARGET_NR_get_kernel_syms
9638 case TARGET_NR_get_kernel_syms:
9639#endif

--- 2417 unchanged lines hidden ---