tlb.h 1.9 KB

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