Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef __TLB_H__ |
| 7 | #define __TLB_H__ |
| 8 | |
| 9 | #include "um_mmu.h" |
| 10 | |
| 11 | struct host_vm_op { |
| 12 | enum { MMAP, MUNMAP, MPROTECT } type; |
| 13 | union { |
| 14 | struct { |
| 15 | unsigned long addr; |
| 16 | unsigned long len; |
| 17 | unsigned int r:1; |
| 18 | unsigned int w:1; |
| 19 | unsigned int x:1; |
| 20 | int fd; |
| 21 | __u64 offset; |
| 22 | } mmap; |
| 23 | struct { |
| 24 | unsigned long addr; |
| 25 | unsigned long len; |
| 26 | } munmap; |
| 27 | struct { |
| 28 | unsigned long addr; |
| 29 | unsigned long len; |
| 30 | unsigned int r:1; |
| 31 | unsigned int w:1; |
| 32 | unsigned int x:1; |
| 33 | } mprotect; |
| 34 | } u; |
| 35 | }; |
| 36 | |
| 37 | extern void mprotect_kernel_vm(int w); |
| 38 | extern void force_flush_all(void); |
| 39 | extern void fix_range_common(struct mm_struct *mm, unsigned long start_addr, |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame^] | 40 | unsigned long end_addr, int force, |
| 41 | void (*do_ops)(union mm_context *, |
| 42 | struct host_vm_op *, int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | extern int flush_tlb_kernel_range_common(unsigned long start, |
| 44 | unsigned long end); |
| 45 | |
| 46 | extern int add_mmap(unsigned long virt, unsigned long phys, unsigned long len, |
| 47 | int r, int w, int x, struct host_vm_op *ops, int index, |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame^] | 48 | int last_filled, union mm_context *mmu, |
| 49 | void (*do_ops)(union mm_context *, struct host_vm_op *, |
| 50 | int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | extern int add_munmap(unsigned long addr, unsigned long len, |
| 52 | struct host_vm_op *ops, int index, int last_filled, |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame^] | 53 | union mm_context *mmu, |
| 54 | void (*do_ops)(union mm_context *, struct host_vm_op *, |
| 55 | int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | extern int add_mprotect(unsigned long addr, unsigned long len, int r, int w, |
| 57 | int x, struct host_vm_op *ops, int index, |
Jeff Dike | d67b569 | 2005-07-07 17:56:49 -0700 | [diff] [blame^] | 58 | int last_filled, union mm_context *mmu, |
| 59 | void (*do_ops)(union mm_context *, struct host_vm_op *, |
| 60 | int)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | #endif |