mmu.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef __MMU_H
  2. #define __MMU_H
  3. /*
  4. * Privileged Space Mapping Buffer (PMB) definitions
  5. */
  6. #define PMB_PASCR 0xff000070
  7. #define PMB_IRMCR 0xff000078
  8. #define PASCR_SE 0x80000000
  9. #define PMB_ADDR 0xf6100000
  10. #define PMB_DATA 0xf7100000
  11. #define NR_PMB_ENTRIES 16
  12. #define PMB_E_MASK 0x0000000f
  13. #define PMB_E_SHIFT 8
  14. #define PMB_PFN_MASK 0xff000000
  15. #define PMB_SZ_16M 0x00000000
  16. #define PMB_SZ_64M 0x00000010
  17. #define PMB_SZ_128M 0x00000080
  18. #define PMB_SZ_512M 0x00000090
  19. #define PMB_SZ_MASK PMB_SZ_512M
  20. #define PMB_C 0x00000008
  21. #define PMB_WT 0x00000001
  22. #define PMB_UB 0x00000200
  23. #define PMB_CACHE_MASK (PMB_C | PMB_WT | PMB_UB)
  24. #define PMB_V 0x00000100
  25. #define PMB_NO_ENTRY (-1)
  26. #ifndef __ASSEMBLY__
  27. #include <linux/errno.h>
  28. #include <linux/threads.h>
  29. #include <asm/page.h>
  30. /* Default "unsigned long" context */
  31. typedef unsigned long mm_context_id_t[NR_CPUS];
  32. typedef struct {
  33. #ifdef CONFIG_MMU
  34. mm_context_id_t id;
  35. void *vdso;
  36. #else
  37. unsigned long end_brk;
  38. #endif
  39. #ifdef CONFIG_BINFMT_ELF_FDPIC
  40. unsigned long exec_fdpic_loadmap;
  41. unsigned long interp_fdpic_loadmap;
  42. #endif
  43. } mm_context_t;
  44. #ifdef CONFIG_PMB
  45. /* arch/sh/mm/pmb.c */
  46. long pmb_remap(unsigned long virt, unsigned long phys,
  47. unsigned long size, pgprot_t prot);
  48. void pmb_unmap(unsigned long addr);
  49. int pmb_init(void);
  50. bool __in_29bit_mode(void);
  51. #else
  52. static inline long pmb_remap(unsigned long virt, unsigned long phys,
  53. unsigned long size, pgprot_t prot)
  54. {
  55. return -EINVAL;
  56. }
  57. static inline void pmb_unmap(unsigned long addr)
  58. {
  59. }
  60. static inline int pmb_init(void)
  61. {
  62. return -ENODEV;
  63. }
  64. #ifdef CONFIG_29BIT
  65. #define __in_29bit_mode() (1)
  66. #else
  67. #define __in_29bit_mode() (0)
  68. #endif
  69. #endif /* CONFIG_PMB */
  70. #endif /* __ASSEMBLY__ */
  71. #endif /* __MMU_H */