dont require many old syscalls
PATCH 1/1 dont require many old syscalls
the linux/syscall.c file assumes the target arch has a lot of historical syscall baggage ... this is not true for newer ports, so ive added more #ifdef's where needed in my case
-mike
syscall.c +62 -2
@@ -2043,6 +2047,7 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_fork: ret =get_errno (do_fork (cpu_env,SIGCHLD ,0 ));break ; +#ifdef TARGET_NR_waitpidcase TARGET_NR_waitpid: {int status;
@@ -2051,6 +2056,7 @@ long do_syscall(void *cpu_env, int num, tput32(arg2, status); }break ; +#endif case TARGET_NR_creat: p =lock_user_string (arg1); ret =get_errno (creat (p, arg2));
@@ -2179,11 +2185,13 @@ long do_syscall(void *cpu_env, int num,unlock_user (p3, arg3,0 );break ; } +#ifdef TARGET_NR_umountcase TARGET_NR_umount: p =lock_user_string (arg1); ret =get_errno (umount (p));unlock_user (p, arg1,0 );break ; +#endif case TARGET_NR_stime: {time_t host_time;
@@ -2203,6 +2211,7 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_pause: ret =get_errno (pause ());break ; +#ifdef TARGET_NR_utimecase TARGET_NR_utime: {struct utimbuf tbuf, *host_tbuf;
@@ -2221,6 +2230,7 @@ long do_syscall(void *cpu_env, int num, unlock_user(p, arg1, 0); }break ; +#endif case TARGET_NR_utimes: {struct timeval *tvp, tv[2 ];
@@ -2317,9 +2327,10 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_prof: goto unimplemented;#endif +#ifdef TARGET_NR_signalcase TARGET_NR_signal: goto unimplemented; - +#endif case TARGET_NR_acct: p =lock_user_string (arg1); ret =get_errno (acct (path (p)));
@@ -2377,6 +2388,7 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_setsid: ret =get_errno (setsid ());break ; +#ifdef TARGET_NR_sigactioncase TARGET_NR_sigaction: {#if !defined(TARGET_MIPS )
@@ -2431,6 +2443,7 @@ long do_syscall(void *cpu_env, int num, #endif }break ; +#endif case TARGET_NR_rt_sigaction: {struct target_sigaction *act;
@@ -2472,6 +2485,7 @@ long do_syscall(void *cpu_env, int num, ret = target_set; }break ; +#ifdef TARGET_NR_sigprocmaskcase TARGET_NR_sigprocmask: {int how = arg1;
@@ -2508,6 +2522,7 @@ long do_syscall(void *cpu_env, int num, } }break ; +#endif case TARGET_NR_rt_sigprocmask: {int how = arg1;
@@ -2544,6 +2559,7 @@ long do_syscall(void *cpu_env, int num, } }break ; +#ifdef TARGET_NR_sigpendingcase TARGET_NR_sigpending: {sigset_t set;
@@ -2555,6 +2571,7 @@ long do_syscall(void *cpu_env, int num, } }break ; +#endif case TARGET_NR_rt_sigpending: {sigset_t set;
@@ -2566,6 +2583,7 @@ long do_syscall(void *cpu_env, int num, } }break ; +#ifdef TARGET_NR_sigsuspendcase TARGET_NR_sigsuspend: {sigset_t set;
@@ -2575,6 +2593,7 @@ long do_syscall(void *cpu_env, int num, ret = get_errno(sigsuspend(&set)); }break ; +#endif case TARGET_NR_rt_sigsuspend: {sigset_t set;
@@ -2616,10 +2635,12 @@ long do_syscall(void *cpu_env, int num, ret =get_errno (sys_rt_sigqueueinfo (arg1, arg2, &uinfo)); }break ; +#ifdef TARGET_NR_sigreturncase TARGET_NR_sigreturn:/* NOTE: ret is eax, so not transcoding must be done */ ret =do_sigreturn (cpu_env);break ; +#endif case TARGET_NR_rt_sigreturn:/* NOTE: ret is eax, so not transcoding must be done */ ret =do_rt_sigreturn (cpu_env);
@@ -2725,17 +2746,24 @@ long do_syscall(void *cpu_env, int num,unlock_user (p, arg1,0 ); }break ; +#ifdef TARGET_NR_uselibcase TARGET_NR_uselib: goto unimplemented; +#endif +#ifdef TARGET_NR_swaponcase TARGET_NR_swapon: p =lock_user_string (arg1); ret =get_errno (swapon (p, arg2));unlock_user (p, arg1,0 );break ; +#endif case TARGET_NR_reboot: goto unimplemented; +#ifdef TARGET_NR_readdircase TARGET_NR_readdir: goto unimplemented; +#endif +#ifdef TARGET_NR_mmap case TARGET_NR_mmap: #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_M68K) {
@@ -2760,6 +2788,7 @@ long do_syscall(void *cpu_env, int num, arg6));#endif break ; +#endif #ifdef TARGET_NR_mmap2case TARGET_NR_mmap2:#if defined(TARGET_SPARC ) || defined(TARGET_MIPS )
@@ -2779,25 +2808,37 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_mprotect: ret =get_errno (target_mprotect (arg1, arg2, arg3));break ; +#ifdef TARGET_NR_mremapcase TARGET_NR_mremap: ret =get_errno (target_mremap (arg1, arg2, arg3, arg4, arg5));break ; +#endif /* ??? msync/mlock/munlock are broken for softmmu. */ +#ifdef TARGET_NR_msynccase TARGET_NR_msync: ret =get_errno (msync (g2h (arg1), arg2, arg3));break ; +#endif +#ifdef TARGET_NR_mlockcase TARGET_NR_mlock: ret =get_errno (mlock (g2h (arg1), arg2));break ; +#endif +#ifdef TARGET_NR_munlockcase TARGET_NR_munlock: ret =get_errno (munlock (g2h (arg1), arg2));break ; +#endif +#ifdef TARGET_NR_mlockallcase TARGET_NR_mlockall: ret =get_errno (mlockall (arg1));break ; +#endif +#ifdef TARGET_NR_munlockallcase TARGET_NR_munlockall: ret =get_errno (munlockall ());break ; +#endif case TARGET_NR_truncate: p =lock_user_string (arg1); ret =get_errno (truncate (p, arg2));
@@ -2875,10 +2916,11 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_ioperm: goto unimplemented;#endif +#ifdef TARGET_NR_socketcallcase TARGET_NR_socketcall: ret =do_socketcall (arg1, arg2);break ; - +#endif #ifdef TARGET_NR_acceptcase TARGET_NR_accept: ret =do_accept (arg1, arg2, arg3);
@@ -3087,11 +3129,13 @@ long do_syscall(void *cpu_env, int num, } }break ; +#ifdef TARGET_NR_swapoffcase TARGET_NR_swapoff: p =lock_user_string (arg1); ret =get_errno (swapoff (p));unlock_user (p, arg1,0 );break ; +#endif case TARGET_NR_sysinfo: {struct target_sysinfo *target_value;
@@ -3119,9 +3163,11 @@ long do_syscall(void *cpu_env, int num, } }break ; +#ifdef TARGET_NR_ipccase TARGET_NR_ipc: ret =do_ipc (arg1, arg2, arg3, arg4, arg5, arg6);break ; +#endif case TARGET_NR_fsync: ret =get_errno (fsync (arg1));break ;
@@ -3170,10 +3216,14 @@ long do_syscall(void *cpu_env, int num,#endif case TARGET_NR_adjtimex: goto unimplemented; +#ifdef TARGET_NR_create_modulecase TARGET_NR_create_module: +#endif case TARGET_NR_init_module:case TARGET_NR_delete_module: +#ifdef TARGET_NR_get_kernel_symscase TARGET_NR_get_kernel_syms: +#endif goto unimplemented;case TARGET_NR_quotactl: goto unimplemented;
@@ -3185,13 +3235,17 @@ long do_syscall(void *cpu_env, int num,break ;case TARGET_NR_bdflush: goto unimplemented; +#ifdef TARGET_NR_sysfscase TARGET_NR_sysfs: goto unimplemented; +#endif case TARGET_NR_personality: ret =get_errno (personality (arg1));break ; +#ifdef TARGET_NR_afs_syscallcase TARGET_NR_afs_syscall: goto unimplemented; +#endif case TARGET_NR__llseek: {#if defined (__x86_64__)
@@ -3305,9 +3359,12 @@ long do_syscall(void *cpu_env, int num, }break ;#endif /* TARGET_NR_getdents64 */ +#ifdef TARGET_NR__newselectcase TARGET_NR__newselect: ret =do_select (arg1, arg2, arg3, arg4, arg5);break ; +#endif +#ifdef TARGET_NR_pollcase TARGET_NR_poll: {struct target_pollfd *target_pfd;
@@ -3333,6 +3390,7 @@ long do_syscall(void *cpu_env, int num, unlock_user(target_pfd, arg1, ret); }break ; +#endif case TARGET_NR_flock:/* NOTE: the flock constant seems to be the same for every Linux platform */
@@ -3434,10 +3492,14 @@ long do_syscall(void *cpu_env, int num, } }break ; +#ifdef TARGET_NR_query_modulecase TARGET_NR_query_module: goto unimplemented; +#endif +#ifdef TARGET_NR_nfsservctlcase TARGET_NR_nfsservctl: goto unimplemented; +#endif case TARGET_NR_prctl:switch (arg1) {
@@ -3970,8 +4032,10 @@ long do_syscall(void *cpu_env, int num,case TARGET_NR_gettid: ret =get_errno (gettid ());break ; +#ifdef TARGET_NR_readaheadcase TARGET_NR_readahead: goto unimplemented; +#endif #ifdef TARGET_NR_setxattrcase TARGET_NR_setxattr:case TARGET_NR_lsetxattr: