diff options
Diffstat (limited to 'arch/um/kernel/tt/tlb.c')
-rw-r--r-- | arch/um/kernel/tt/tlb.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/um/kernel/tt/tlb.c b/arch/um/kernel/tt/tlb.c index 16fc6a28882d..f1d85dbb45b9 100644 --- a/arch/um/kernel/tt/tlb.c +++ b/arch/um/kernel/tt/tlb.c | |||
@@ -17,26 +17,31 @@ | |||
17 | #include "os.h" | 17 | #include "os.h" |
18 | #include "tlb.h" | 18 | #include "tlb.h" |
19 | 19 | ||
20 | static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | 20 | static int do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, |
21 | int finished, void *flush) | 21 | int finished, void **flush) |
22 | { | 22 | { |
23 | struct host_vm_op *op; | 23 | struct host_vm_op *op; |
24 | int i; | 24 | int i, ret=0; |
25 | 25 | ||
26 | for(i = 0; i <= last; i++){ | 26 | for(i = 0; i <= last && !ret; i++){ |
27 | op = &ops[i]; | 27 | op = &ops[i]; |
28 | switch(op->type){ | 28 | switch(op->type){ |
29 | case MMAP: | 29 | case MMAP: |
30 | os_map_memory((void *) op->u.mmap.addr, op->u.mmap.fd, | 30 | ret = os_map_memory((void *) op->u.mmap.addr, |
31 | op->u.mmap.offset, op->u.mmap.len, | 31 | op->u.mmap.fd, op->u.mmap.offset, |
32 | op->u.mmap.r, op->u.mmap.w, | 32 | op->u.mmap.len, op->u.mmap.r, |
33 | op->u.mmap.x); | 33 | op->u.mmap.w, op->u.mmap.x); |
34 | break; | 34 | break; |
35 | case MUNMAP: | 35 | case MUNMAP: |
36 | os_unmap_memory((void *) op->u.munmap.addr, | 36 | ret = os_unmap_memory((void *) op->u.munmap.addr, |
37 | op->u.munmap.len); | 37 | op->u.munmap.len); |
38 | break; | 38 | break; |
39 | case MPROTECT: | 39 | case MPROTECT: |
40 | ret = protect_memory(op->u.mprotect.addr, | ||
41 | op->u.munmap.len, | ||
42 | op->u.mprotect.r, | ||
43 | op->u.mprotect.w, | ||
44 | op->u.mprotect.x, 1); | ||
40 | protect_memory(op->u.mprotect.addr, op->u.munmap.len, | 45 | protect_memory(op->u.mprotect.addr, op->u.munmap.len, |
41 | op->u.mprotect.r, op->u.mprotect.w, | 46 | op->u.mprotect.r, op->u.mprotect.w, |
42 | op->u.mprotect.x, 1); | 47 | op->u.mprotect.x, 1); |
@@ -47,7 +52,7 @@ static void *do_ops(union mm_context *mmu, struct host_vm_op *ops, int last, | |||
47 | } | 52 | } |
48 | } | 53 | } |
49 | 54 | ||
50 | return NULL; | 55 | return ret; |
51 | } | 56 | } |
52 | 57 | ||
53 | static void fix_range(struct mm_struct *mm, unsigned long start_addr, | 58 | static void fix_range(struct mm_struct *mm, unsigned long start_addr, |