diff options
| author | Anton Blanchard <anton@samba.org> | 2003-07-20 05:52:43 +1000 |
|---|---|---|
| committer | Anton Blanchard <anton@samba.org> | 2003-07-20 05:52:43 +1000 |
| commit | 8673f4ab8402bd62dd61fe25bc65226d9b7ae962 (patch) | |
| tree | f64c4f29d14106390347055287a53e6ee562e2e2 | |
| parent | c224533239518361f5be43e00ed12e9c0ab0d2d6 (diff) | |
ppc64: Add posix timers, tgkill, utimes, statfs64.
| -rw-r--r-- | arch/ppc64/kernel/misc.S | 28 | ||||
| -rw-r--r-- | arch/ppc64/kernel/sys_ppc32.c | 41 | ||||
| -rw-r--r-- | include/asm-ppc64/unistd.h | 7 |
3 files changed, 75 insertions, 1 deletions
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 299cbfc6b227..61746717aaec 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S @@ -838,6 +838,20 @@ _GLOBAL(sys_call_table32) .llong .sys_epoll_ctl .llong .sys_epoll_wait .llong .sys_remap_file_pages + .llong .sys_ni_syscall /* 240 */ + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys_ni_syscall /* 245 */ + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys_ni_syscall + .llong .sys32_tgkill /* 250 */ + .llong .sys32_utimes + .llong .sys_statfs64 + .llong .sys_fstatfs64 .balign 8 _GLOBAL(sys_call_table) @@ -1081,3 +1095,17 @@ _GLOBAL(sys_call_table) .llong .sys_epoll_ctl .llong .sys_epoll_wait .llong .sys_remap_file_pages + .llong .sys_timer_create /* 240 */ + .llong .sys_timer_settime + .llong .sys_timer_gettime + .llong .sys_timer_getoverrun + .llong .sys_timer_delete + .llong .sys_clock_settime /* 245 */ + .llong .sys_clock_gettime + .llong .sys_clock_getres + .llong .sys_clock_nanosleep + .llong .sys_ni_syscall + .llong .sys_tgkill /* 250 */ + .llong .sys_utimes + .llong .sys_statfs64 + .llong .sys_fstatfs64 diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c index 4c4e1a91dc5d..7f107d1f5245 100644 --- a/arch/ppc64/kernel/sys_ppc32.c +++ b/arch/ppc64/kernel/sys_ppc32.c @@ -2797,6 +2797,47 @@ long sys32_io_submit(aio_context_t ctx_id, u32 number, u32 *iocbpp) return i ? i : ret; } +int get_compat_timeval(struct timeval *tv, struct compat_timeval *ctv) +{ + return (verify_area(VERIFY_READ, ctv, sizeof(*ctv)) || + __get_user(tv->tv_sec, &ctv->tv_sec) || + __get_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0; +} + +long sys32_utimes(char *filename, struct compat_timeval *tvs) +{ + char *kfilename; + struct timeval ktvs[2]; + mm_segment_t old_fs; + long ret; + + kfilename = getname(filename); + ret = PTR_ERR(kfilename); + if (!IS_ERR(kfilename)) { + if (tvs) { + if (get_compat_timeval(&ktvs[0], &tvs[0]) || + get_compat_timeval(&ktvs[1], &tvs[1])) + return -EFAULT; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = do_utimes(kfilename, (tvs ? &ktvs[0] : NULL)); + set_fs(old_fs); + + putname(kfilename); + } + return ret; +} + +extern long sys_tgkill(int tgid, int pid, int sig); + +long sys32_tgkill(u32 tgid, u32 pid, int sig) +{ + /* sign extend tgid, pid */ + return sys_tgkill((int)tgid, (int)pid, sig); +} + /* * long long munging: * The 32 bit ABI passes long longs in an odd even register pair. diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h index 102e846a80ab..76871826eca0 100644 --- a/include/asm-ppc64/unistd.h +++ b/include/asm-ppc64/unistd.h @@ -259,8 +259,13 @@ #define __NR_clock_gettime 246 #define __NR_clock_getres 247 #define __NR_clock_nanosleep 248 +#define __NR_swapcontext 249 +#define __NR_tgkill 250 +#define __NR_utimes 251 +#define __NR_statfs64 252 +#define __NR_fstatfs64 253 -#define __NR_syscalls 239 +#define __NR_syscalls 254 #ifdef __KERNEL__ #define NR_syscalls __NR_syscalls #endif |
