tlb.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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, int data,
  37. void (*do_ops)(int, struct host_vm_op *, int));
  38. extern int flush_tlb_kernel_range_common(unsigned long start,
  39. unsigned long end);
  40. extern int add_mmap(unsigned long virt, unsigned long phys, unsigned long len,
  41. int r, int w, int x, struct host_vm_op *ops, int index,
  42. int last_filled, int data,
  43. void (*do_ops)(int, struct host_vm_op *, int));
  44. extern int add_munmap(unsigned long addr, unsigned long len,
  45. struct host_vm_op *ops, int index, int last_filled,
  46. int data, void (*do_ops)(int, struct host_vm_op *, int));
  47. extern int add_mprotect(unsigned long addr, unsigned long len, int r, int w,
  48. int x, struct host_vm_op *ops, int index,
  49. int last_filled, int data,
  50. void (*do_ops)(int, struct host_vm_op *, int));
  51. #endif
  52. /*
  53. * Overrides for Emacs so that we follow Linus's tabbing style.
  54. * Emacs will notice this stuff at the end of the file and automatically
  55. * adjust the settings for this buffer only. This must remain at the end
  56. * of the file.
  57. * ---------------------------------------------------------------------------
  58. * Local variables:
  59. * c-file-style: "linux"
  60. * End:
  61. */