git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
um
/
kernel
/
skas
/
uaccess.c
diff --git
a/arch/um/kernel/skas/uaccess.c
b/arch/um/kernel/skas/uaccess.c
index
7519528
..
8912cec
100644
(file)
--- a/
arch/um/kernel/skas/uaccess.c
+++ b/
arch/um/kernel/skas/uaccess.c
@@
-8,12
+8,13
@@
#include "linux/kernel.h"
#include "linux/string.h"
#include "linux/fs.h"
#include "linux/kernel.h"
#include "linux/string.h"
#include "linux/fs.h"
+#include "linux/hardirq.h"
#include "linux/highmem.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include "asm/uaccess.h"
#include "kern_util.h"
#include "linux/highmem.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include "asm/uaccess.h"
#include "kern_util.h"
-#include "
user_util
.h"
+#include "
os
.h"
extern void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
pte_t *pte_out);
extern void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
pte_t *pte_out);
@@
-38,7
+39,7
@@
static unsigned long maybe_map(unsigned long virt, int is_write)
return((unsigned long) phys);
}
return((unsigned long) phys);
}
-static int do_op(unsigned long addr, int len, int is_write,
+static int do_op
_one_page
(unsigned long addr, int len, int is_write,
int (*op)(unsigned long addr, int len, void *arg), void *arg)
{
struct page *page;
int (*op)(unsigned long addr, int len, void *arg), void *arg)
{
struct page *page;
@@
-49,9
+50,11
@@
static int do_op(unsigned long addr, int len, int is_write,
return(-1);
page = phys_to_page(addr);
return(-1);
page = phys_to_page(addr);
- addr = (unsigned long) kmap(page) + (addr & ~PAGE_MASK);
+ addr = (unsigned long) kmap_atomic(page, KM_UML_USERCOPY) + (addr & ~PAGE_MASK);
+
n = (*op)(addr, len, arg);
n = (*op)(addr, len, arg);
- kunmap(page);
+
+ kunmap_atomic(page, KM_UML_USERCOPY);
return(n);
}
return(n);
}
@@
-77,7
+80,7
@@
static void do_buffer_op(void *jmpbuf, void *arg_ptr)
remain = len;
current->thread.fault_catcher = jmpbuf;
remain = len;
current->thread.fault_catcher = jmpbuf;
- n = do_op(addr, size, is_write, op, arg);
+ n = do_op
_one_page
(addr, size, is_write, op, arg);
if(n != 0){
*res = (n < 0 ? remain : 0);
goto out;
if(n != 0){
*res = (n < 0 ? remain : 0);
goto out;
@@
-91,7
+94,7
@@
static void do_buffer_op(void *jmpbuf, void *arg_ptr)
}
while(addr < ((addr + remain) & PAGE_MASK)){
}
while(addr < ((addr + remain) & PAGE_MASK)){
- n = do_op(addr, PAGE_SIZE, is_write, op, arg);
+ n = do_op
_one_page
(addr, PAGE_SIZE, is_write, op, arg);
if(n != 0){
*res = (n < 0 ? remain : 0);
goto out;
if(n != 0){
*res = (n < 0 ? remain : 0);
goto out;
@@
-105,7
+108,7
@@
static void do_buffer_op(void *jmpbuf, void *arg_ptr)
goto out;
}
goto out;
}
- n = do_op(addr, remain, is_write, op, arg);
+ n = do_op
_one_page
(addr, remain, is_write, op, arg);
if(n != 0)
*res = (n < 0 ? remain : 0);
else *res = 0;
if(n != 0)
*res = (n < 0 ? remain : 0);
else *res = 0;
@@
-143,7
+146,7
@@
int copy_from_user_skas(void *to, const void __user *from, int n)
return(0);
}
return(0);
}
- return(access_ok
_skas
(VERIFY_READ, from, n) ?
+ return(access_ok(VERIFY_READ, from, n) ?
buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
n);
}
buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
n);
}
@@
-164,7
+167,7
@@
int copy_to_user_skas(void __user *to, const void *from, int n)
return(0);
}
return(0);
}
- return(access_ok
_skas
(VERIFY_WRITE, to, n) ?
+ return(access_ok(VERIFY_WRITE, to, n) ?
buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
n);
}
buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
n);
}
@@
-193,7
+196,7
@@
int strncpy_from_user_skas(char *dst, const char __user *src, int count)
return(strnlen(dst, count));
}
return(strnlen(dst, count));
}
- if(!access_ok
_skas
(VERIFY_READ, src, 1))
+ if(!access_ok(VERIFY_READ, src, 1))
return(-EFAULT);
n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user,
return(-EFAULT);
n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user,
@@
-221,7
+224,7
@@
int clear_user_skas(void __user *mem, int len)
return(0);
}
return(0);
}
- return(access_ok
_skas
(VERIFY_WRITE, mem, len) ?
+ return(access_ok(VERIFY_WRITE, mem, len) ?
buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len);
}
buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len);
}