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