mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
[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>
This commit is contained in:
parent
b63d64a324
commit
1b2db9fb7a
6 changed files with 33 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <linux/unistd.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/timex.h>
|
||||
#include <linux/migrate.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
@ -934,3 +935,25 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
|
||||
void __user *pages32,
|
||||
const int __user *nodes,
|
||||
int __user *status,
|
||||
int flags)
|
||||
{
|
||||
const void __user * __user *pages;
|
||||
int i;
|
||||
|
||||
pages = compat_alloc_user_space(nr_pages * sizeof(void *));
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
compat_uptr_t p;
|
||||
|
||||
if (get_user(p, (compat_uptr_t *)(pages32 + i)) ||
|
||||
put_user(compat_ptr(p), pages + i))
|
||||
return -EFAULT;
|
||||
}
|
||||
return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue