Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __MMU_H |
| 2 | #define __MMU_H |
| 3 | |
| 4 | #if !defined(CONFIG_MMU) |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | typedef struct { |
Yoshinori Sato | e96636c | 2006-09-27 17:21:02 +0900 | [diff] [blame] | 7 | struct vm_list_struct *vmlist; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | unsigned long end_brk; |
| 9 | } mm_context_t; |
| 10 | |
| 11 | #else |
| 12 | |
| 13 | /* Default "unsigned long" context */ |
Paul Mundt | 19f9a34 | 2006-09-27 18:33:49 +0900 | [diff] [blame] | 14 | typedef unsigned long mm_context_id_t; |
| 15 | |
| 16 | typedef struct { |
| 17 | mm_context_id_t id; |
| 18 | void *vdso; |
| 19 | } mm_context_t; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
| 21 | #endif /* CONFIG_MMU */ |
Paul Mundt | 0c7b1df | 2006-09-27 15:08:07 +0900 | [diff] [blame] | 22 | |
| 23 | /* |
| 24 | * Privileged Space Mapping Buffer (PMB) definitions |
| 25 | */ |
| 26 | #define PMB_PASCR 0xff000070 |
| 27 | #define PMB_IRMCR 0xff000078 |
| 28 | |
| 29 | #define PMB_ADDR 0xf6100000 |
| 30 | #define PMB_DATA 0xf7100000 |
| 31 | #define PMB_ENTRY_MAX 16 |
| 32 | #define PMB_E_MASK 0x0000000f |
| 33 | #define PMB_E_SHIFT 8 |
| 34 | |
| 35 | #define PMB_SZ_16M 0x00000000 |
| 36 | #define PMB_SZ_64M 0x00000010 |
| 37 | #define PMB_SZ_128M 0x00000080 |
| 38 | #define PMB_SZ_512M 0x00000090 |
| 39 | #define PMB_SZ_MASK PMB_SZ_512M |
| 40 | #define PMB_C 0x00000008 |
| 41 | #define PMB_WT 0x00000001 |
| 42 | #define PMB_UB 0x00000200 |
| 43 | #define PMB_V 0x00000100 |
| 44 | |
| 45 | #define PMB_NO_ENTRY (-1) |
| 46 | |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame] | 47 | struct pmb_entry; |
| 48 | |
Paul Mundt | 0c7b1df | 2006-09-27 15:08:07 +0900 | [diff] [blame] | 49 | struct pmb_entry { |
| 50 | unsigned long vpn; |
| 51 | unsigned long ppn; |
| 52 | unsigned long flags; |
| 53 | |
| 54 | /* |
| 55 | * 0 .. NR_PMB_ENTRIES for specific entry selection, or |
| 56 | * PMB_NO_ENTRY to search for a free one |
| 57 | */ |
| 58 | int entry; |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame] | 59 | |
| 60 | struct pmb_entry *next; |
| 61 | /* Adjacent entry link for contiguous multi-entry mappings */ |
| 62 | struct pmb_entry *link; |
Paul Mundt | 0c7b1df | 2006-09-27 15:08:07 +0900 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | /* arch/sh/mm/pmb.c */ |
| 66 | int __set_pmb_entry(unsigned long vpn, unsigned long ppn, |
| 67 | unsigned long flags, int *entry); |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame] | 68 | int set_pmb_entry(struct pmb_entry *pmbe); |
Paul Mundt | 0c7b1df | 2006-09-27 15:08:07 +0900 | [diff] [blame] | 69 | void clear_pmb_entry(struct pmb_entry *pmbe); |
| 70 | struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, |
| 71 | unsigned long flags); |
| 72 | void pmb_free(struct pmb_entry *pmbe); |
Paul Mundt | d7cdc9e | 2006-09-27 15:16:42 +0900 | [diff] [blame] | 73 | long pmb_remap(unsigned long virt, unsigned long phys, |
| 74 | unsigned long size, unsigned long flags); |
| 75 | void pmb_unmap(unsigned long addr); |
Paul Mundt | 0c7b1df | 2006-09-27 15:08:07 +0900 | [diff] [blame] | 76 | |
| 77 | #endif /* __MMU_H */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |