diff options
| author | Christoph Lameter <clameter@sgi.com> | 2006-06-23 05:03:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:42:53 -0400 |
| commit | 1b2db9fb7adc4d67d9ce7d16ce79c41ee84730fe (patch) | |
| tree | d3fc0962ada099d741717d36a3f658c15b20c65a /kernel | |
| parent | b63d64a324056cf3c2f7a1a1fe8134100edbb058 (diff) | |
[PATCH] sys_move_pages: 32bit support (i386, x86_64)
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.
[akpm@osdl.org: compile fix]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/compat.c | 23 | ||||
| -rw-r--r-- | kernel/sys_ni.c | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index c1601a84f8d8..ccea93e28954 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/unistd.h> | 21 | #include <linux/unistd.h> |
| 22 | #include <linux/security.h> | 22 | #include <linux/security.h> |
| 23 | #include <linux/timex.h> | 23 | #include <linux/timex.h> |
| 24 | #include <linux/migrate.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
| 26 | 27 | ||
| @@ -934,3 +935,25 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp) | |||
| 934 | 935 | ||
| 935 | return ret; | 936 | return ret; |
| 936 | } | 937 | } |
| 938 | |||
| 939 | #ifdef CONFIG_NUMA | ||
| 940 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages, | ||
| 941 | void __user *pages32, | ||
| 942 | const int __user *nodes, | ||
| 943 | int __user *status, | ||
| 944 | int flags) | ||
| 945 | { | ||
| 946 | const void __user * __user *pages; | ||
| 947 | int i; | ||
| 948 | |||
| 949 | pages = compat_alloc_user_space(nr_pages * sizeof(void *)); | ||
| 950 | for (i = 0; i < nr_pages; i++) { | ||
| 951 | compat_uptr_t p; | ||
| 952 | |||
| 953 | if (get_user(p, (compat_uptr_t *)(pages32 + i)) || | ||
| 954 | put_user(compat_ptr(p), pages + i)) | ||
| 955 | return -EFAULT; | ||
| 956 | } | ||
| 957 | return sys_move_pages(pid, nr_pages, pages, nodes, status, flags); | ||
| 958 | } | ||
| 959 | #endif | ||
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 597229749dec..6991bece67e8 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
| @@ -133,3 +133,4 @@ cond_syscall(sys_mincore); | |||
| 133 | cond_syscall(sys_madvise); | 133 | cond_syscall(sys_madvise); |
| 134 | cond_syscall(sys_mremap); | 134 | cond_syscall(sys_mremap); |
| 135 | cond_syscall(sys_remap_file_pages); | 135 | cond_syscall(sys_remap_file_pages); |
| 136 | cond_syscall(compat_sys_move_pages); | ||
