Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31575
b: refs/heads/master
c: 47e5243
h: refs/heads/master
i:
  31573: 212f7f8
  31571: ef93a31
  31567: c8a01fd
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Jul 1, 2006
1 parent 1562d11 commit f84cf4f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ec4d41f88872e6a5980558e362c0174dce54e40
refs/heads/master: 47e5243afe0bd2a1aca1e1f05dfbcc214267fbc9
15 changes: 9 additions & 6 deletions trunk/arch/um/kernel/skas/uaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#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"
Expand Down Expand Up @@ -38,7 +39,7 @@ static unsigned long maybe_map(unsigned long virt, int is_write)
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;
Expand All @@ -49,9 +50,11 @@ static int do_op(unsigned long addr, int len, int is_write,
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);
kunmap(page);

kunmap_atomic(page, KM_UML_USERCOPY);

return(n);
}
Expand All @@ -77,7 +80,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
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;
Expand All @@ -91,7 +94,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
}

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;
Expand All @@ -105,7 +108,7 @@ static void do_buffer_op(void *jmpbuf, void *arg_ptr)
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;
Expand Down
20 changes: 19 additions & 1 deletion trunk/include/asm-um/kmap_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
#ifndef __UM_KMAP_TYPES_H
#define __UM_KMAP_TYPES_H

#include "asm/arch/kmap_types.h"
/* No more #include "asm/arch/kmap_types.h" ! */

enum km_type {
KM_BOUNCE_READ,
KM_SKB_SUNRPC_DATA,
KM_SKB_DATA_SOFTIRQ,
KM_USER0,
KM_USER1,
KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */
KM_BIO_SRC_IRQ,
KM_BIO_DST_IRQ,
KM_PTE0,
KM_PTE1,
KM_IRQ0,
KM_IRQ1,
KM_SOFTIRQ0,
KM_SOFTIRQ1,
KM_TYPE_NR
};

#endif

0 comments on commit f84cf4f

Please sign in to comment.