path: root/kernel/compat.c
AgeCommit message (Collapse)AuthorLines
2008-04-30signals: add set_restore_sigmaskRoland McGrath-2/+1
This adds the set_restore_sigmask() inline in <linux/thread_info.h> and replaces every set_thread_flag(TIF_RESTORE_SIGMASK) with a call to it. No change, but abstracts the details of the flag protocol from all the calls. Signed-off-by: Roland McGrath <> Cc: Oleg Nesterov <> Cc: Ingo Molnar <> Cc: Thomas Gleixner <> Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: "Luck, Tony" <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2008-04-19generic: reduce stack pressure in sched_affinityMike Travis-1/+1
* Modify sched_affinity functions to pass cpumask_t variables by reference instead of by value. * Use new set_cpus_allowed_ptr function. Depends on: [sched-devel]: sched: add new set_cpus_allowed_ptr function Cc: Paul Jackson <> Cc: Cliff Wickman <> Signed-off-by: Mike Travis <> Signed-off-by: Ingo Molnar <>
2008-04-17hrtimer: use nanosleep specific restart_block fieldsThomas Gleixner-8/+7
Convert all the nanosleep related users of restart_block to the new nanosleep specific restart_block fields. Signed-off-by: Thomas Gleixner <>
2008-02-10hrtimer: don't modify restart_block->fn in restart functionsOleg Nesterov-1/+0
hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is pointless and complicates its usage. Note that if sys_restart_syscall() doesn't actually happen, we have a bogus "pending" restart->fn anyway, this is harmless. Signed-off-by: Oleg Nesterov <> Cc: Alexey Dobriyan <> Cc: Pavel Emelyanov <> Cc: Peter Zijlstra <> Cc: Toyo Abe <> Cc: Andrew Morton <> Signed-off-by: Thomas Gleixner <>
2008-02-10hrtimer: fix *rmtp/restarts handling in compat_sys_nanosleep()Oleg Nesterov-4/+40
Spotted by Pavel Emelyanov and Alexey Dobriyan. compat_sys_nanosleep() implicitly uses hrtimer_nanosleep_restart(), this can't work. Make a suitable compat_nanosleep_restart() helper. Introduced by commit c70878b4e0b6cf8d2f1e46319e48e821ef4a8aba hrtimer: hook compat_sys_nanosleep up to high res timer code Also, set ->addr_limit = KERNEL_DS before doing hrtimer_nanosleep(), this func was changed by the previous patch and now takes the "__user *" parameter. Thanks to Ingo Molnar for fixing the bug in this patch. Signed-off-by: Oleg Nesterov <> Cc: Andrew Morton <> Cc: Alexey Dobriyan <> Cc: Pavel Emelyanov <> Cc: Peter Zijlstra <> Cc: Toyo Abe <> Signed-off-by: Thomas Gleixner <>
2007-10-18Merge ssh:// Torvalds-46/+11
* ssh:// hrtimer: hook compat_sys_nanosleep up to high res timer code hrtimer: Rework hrtimer_nanosleep to make sys_compat_nanosleep easier
2007-10-18whitespace fixes: compat syscallsDaniel Walker-30/+30
Signed-off-by: Daniel Walker <> Cc: Arnd Bergmann <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-10-18hrtimer: hook compat_sys_nanosleep up to high res timer codeAnton Blanchard-46/+11
Now we have high res timers on ppc64 I thought Id test them. It turns out compat_sys_nanosleep hasnt been converted to the hrtimer code and so is limited to HZ resolution. The follow patch converts compat_sys_nanosleep to use high res timers. Signed-off-by: Anton Blanchard <> Signed-off-by: Thomas Gleixner <>
2007-05-11signal/timer/event: timerfd compat codeDavide Libenzi-4/+4
This patch implements the necessary compat code for the timerfd system call. Signed-off-by: Davide Libenzi <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2007-02-11[PATCH] Common compat_sys_sysinfoKyle McMartin-0/+66
I noticed that almost all architectures implemented exactly the same sys32_sysinfo... except parisc, where a bug was to be found in handling of the uptime. So let's remove a whole whack of code for fun and profit. Cribbed compat_sys_sysinfo from x86_64's implementation, since I figured it would be the best tested. This patch incorporates Arnd's suggestion of not using set_fs/get_fs, but instead extracting out the common code from sys_sysinfo. Cc: Christoph Hellwig <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-11-03[PATCH] Create compat_sys_migrate_pagesStephen Rothwell-0/+33
This is needed on bigendian 64bit architectures. Signed-off-by: Stephen Rothwell <> Acked-by: Christoph Lameter <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-10-28[PATCH] Constify compat_get_bitmap argumentStephen Rothwell-1/+1
This means we can call it when the bitmap we want to fetch is declared const. Signed-off-by: Stephen Rothwell <> Cc: Christoph Lameter <> Cc: Paul Jackson <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-10-02[PATCH] BLOCK: Revert patch to hack around undeclared sigset_t in linux/compat.hDavid Howells-2/+0
Revert Andrew Morton's patch to temporarily hack around the lack of a declaration of sigset_t in linux/compat.h to make the block-disablement patches build on IA64. This got accidentally pushed to Linus and should be fixed in a different manner. Also make linux/compat.h #include asm/signal.h to gain a definition of sigset_t so that it can externally declare sigset_from_compat(). This has been compile-tested for i386, x86_64, ia64, mips, mips64, frv, ppc and ppc64 and run-tested on frv. Signed-off-by: David Howells <> Signed-off-by: Linus Torvalds <>
2006-09-30[PATCH] BLOCK: Move extern declarations out of fs/*.c into header files [try #6]David Howells-0/+2
Create a new header file, fs/internal.h, for common definitions local to the sources in the fs/ directory. Move extern definitions that should be in header files from fs/*.c to fs/internal.h or other main header files where they span directories. Signed-Off-By: David Howells <> Signed-off-by: Jens Axboe <>
2006-09-29[PATCH] posix-timers: Fix clock_nanosleep() doesn't return the remaining ↵Toyo Abe-0/+33
time in compatibility mode The clock_nanosleep() function does not return the time remaining when the sleep is interrupted by a signal. This patch creates a new call out, compat_clock_nanosleep_restart(), which handles returning the remaining time after a sleep is interrupted. This patch revives clock_nanosleep_restart(). It is now accessed via the new call out. The compat_clock_nanosleep_restart() is used for compatibility access. Since this is implemented in compatibility mode the normal path is virtually unaffected - no real performance impact. Signed-off-by: Toyo Abe <> Cc: Thomas Gleixner <> Cc: Ingo Molnar <> Cc: Roland McGrath <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-06-25[PATCH] N32 sigset and
I'm testing glibc on MIPS64, little-endian, N32, O32 and N64 multilibs. Among the NPTL test failures seen are some arising from sigsuspend problems for N32: it blocks the wrong signals, so SIGCANCEL (SIGRTMIN) is blocked despite glibc's carefully excluding it from sets of signals to block. Specifically, testing suggests it blocks signal N^32 instead of signal N, so (in the example tested) blocking SIGUSR1 (17) blocks signal 49 instead. glibc's sigset_t uses an array of unsigned long, as does the kernel. In both cases, signal N+1 is represented as (1UL << (N % (8 * sizeof (unsigned long)))) in word number (N / (8 * sizeof (unsigned long))). Thus the N32 glibc uses an array of 32-bit words and the N64 kernel uses an array of 64-bit words. For little-endian, the layout is the same, with signals 1-32 in the first 4 bytes, signals 33-64 in the second, etc.; for big-endian, userspace has that layout while in the kernel each 8 bytes have the two halves swapped from the userspace layout. The N32 sigsuspend syscall uses sigset_from_compat to convert the userspace sigset to kernel format. If __COMPAT_ENDIAN_SWAP__ is *not* set, this uses logic of the form set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32 ) to convert the userspace sigset to a kernel one. This looks correct to me for both big and little endian, given that in userspace compat->sig[1] will represent signals 33-64, and so will the high 32 bits of set->sig[0] in the kernel. If however __COMPAT_ENDIAN_SWAP__ *is* set, as it is for __MIPSEL__, it uses set->sig[0] = compat->sig[1] | (((long)compat->sig[0]) << 32 ); which seems incorrect for both big and little endian, and would explain the observed symptoms. This code is the only use of __COMPAT_ENDIAN_SWAP__, so if incorrect then that macro serves no purpose, in which case something like the following patch would seem appropriate to remove it. Signed-off-by: Joseph Myers <> Signed-off-by: Ralf Baechle <> Cc: Arnd Bergmann <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-06-23[PATCH] move_pages: fix 32 -> 64 bit compat functionChristoph Lameter-2/+2
The definition of the third parameter is a pointer to an array of virtual addresses which give us some trouble. The existing code calculated the wrong address in the array since I used void to avoid having to specify a type. I now use the correct type "compat_uptr_t __user *" in the definition of the function in kernel/compat.c. However, I used __u32 in syscalls.h. Would have to include compat.h there in order to provide the same definition which would generate an ugly include situation. On both ia64 and x86_64 compat_uptr_t is u32. So this works although parameter declarations differ. Signed-off-by: Christoph Lameter <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-06-23[PATCH] sys_move_pages: 32bit support (i386, x86_64)Christoph Lameter-0/+23
sys_move_pages() support for 32bit (i386 plus x86_64 compat layer) Add support for move_pages() on i386 and also add the compat functions necessary to run 32 bit binaries on x86_64. Add compat_sys_move_pages to the x86_64 32bit binary layer. Note that it is not up to date so I added the missing pieces. Not sure if this is done the right way. [ compile fix] Signed-off-by: Christoph Lameter <> Cc: Andi Kleen <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-03-27[PATCH] lightweight robust futexes: compatIngo Molnar-23/+0
32-bit syscall compatibility support. (This patch also moves all futex related compat functionality into kernel/futex_compat.c.) Signed-off-by: Ingo Molnar <> Signed-off-by: Thomas Gleixner <> Signed-off-by: Arjan van de Ven <> Acked-by: Ulrich Drepper <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-03-26[PATCH] consolidate sys32/compat_adjtimexStephen Rothwell-0/+59
Create compat_sys_adjtimex and use it an all appropriate places. Signed-off-by: Stephen Rothwell <> Cc: Arnd Bergmann <> Acked-by: Paul Mackerras <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-02-07[PATCH] remove bogus asm/bug.h includes.Al Viro-1/+0
A bunch of asm/bug.h includes are both not needed (since it will get pulled anyway) and bogus (since they are done too early). Removed. Signed-off-by: Al Viro <>
2006-01-18[PATCH] Generic sys_rt_sigsuspend()David Woodhouse-0/+28
The TIF_RESTORE_SIGMASK flag allows us to have a generic implementation of sys_rt_sigsuspend() instead of duplicating it for each architecture. This provides such an implementation and makes arch/powerpc use it. It also tidies up the ppc32 sys_sigsuspend() to use TIF_RESTORE_SIGMASK. Signed-off-by: David Woodhouse <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2006-01-10[PATCH] common compat_sys_timer_createChristoph Hellwig-2/+18
The comment in compat.c is wrong, every architecture provides a get_compat_sigevent() for the IPC compat code already. This basically moves the x86_64 version to common code and removes all the others. Signed-off-by: Christoph Hellwig <> Acked-by: Paul Mackerras <> Cc: Arnd Bergmann <> Cc: Benjamin Herrenschmidt <> Cc: Martin Schwidefsky <> Cc: "David S. Miller" <> Acked-by: Andi Kleen <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2005-09-10[PATCH] kernel: fix-up schedule_timeout() usageNishanth Aravamudan-6/+3
Use schedule_timeout_{,un}interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2005-04-16[PATCH] Fix get_compat_sigevent()David S. Miller-1/+1
I have no idea how a bug like this lasted so long. Anyways, obvious memset()'ing of incorrect pointer. Signed-off-by: David S. Miller <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds-0/+860
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!