Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1#ifndef __MMU_H
2#define __MMU_H
3
4/*
5 * Privileged Space Mapping Buffer (PMB) definitions
6 */
7#define PMB_PASCR 0xff000070
8#define PMB_IRMCR 0xff000078
9
10#define PMB_ADDR 0xf6100000
11#define PMB_DATA 0xf7100000
12#define PMB_ENTRY_MAX 16
13#define PMB_E_MASK 0x0000000f
14#define PMB_E_SHIFT 8
15
16#define PMB_SZ_16M 0x00000000
17#define PMB_SZ_64M 0x00000010
18#define PMB_SZ_128M 0x00000080
19#define PMB_SZ_512M 0x00000090
20#define PMB_SZ_MASK PMB_SZ_512M
21#define PMB_C 0x00000008
22#define PMB_WT 0x00000001
23#define PMB_UB 0x00000200
24#define PMB_V 0x00000100
25
26#define PMB_NO_ENTRY (-1)
27
28#ifndef __ASSEMBLY__
29
30/* Default "unsigned long" context */
31typedef unsigned long mm_context_id_t[NR_CPUS];
32
33typedef struct {
34#ifdef CONFIG_MMU
35 mm_context_id_t id;
36 void *vdso;
37#else
38 unsigned long end_brk;
39#endif
40#ifdef CONFIG_BINFMT_ELF_FDPIC
41 unsigned long exec_fdpic_loadmap;
42 unsigned long interp_fdpic_loadmap;
43#endif
44} mm_context_t;
45
46struct pmb_entry;
47
48struct pmb_entry {
49 unsigned long vpn;
50 unsigned long ppn;
51 unsigned long flags;
52
53 /*
54 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
55 * PMB_NO_ENTRY to search for a free one
56 */
57 int entry;
58
59 struct pmb_entry *next;
60 /* Adjacent entry link for contiguous multi-entry mappings */
61 struct pmb_entry *link;
62};
63
64/* arch/sh/mm/pmb.c */
65int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
66 unsigned long flags, int *entry);
67int set_pmb_entry(struct pmb_entry *pmbe);
68void clear_pmb_entry(struct pmb_entry *pmbe);
69struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
70 unsigned long flags);
71void pmb_free(struct pmb_entry *pmbe);
72long pmb_remap(unsigned long virt, unsigned long phys,
73 unsigned long size, unsigned long flags);
74void pmb_unmap(unsigned long addr);
75#endif /* __ASSEMBLY__ */
76
77#endif /* __MMU_H */
78