Rev 831 | Rev 852 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 831 | Rev 849 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | typedef union page_mask page_mask_t; |
51 | typedef union page_mask page_mask_t; |
52 | typedef union index tlb_index_t; |
52 | typedef union index tlb_index_t; |
53 | 53 | ||
54 | union entry_lo { |
54 | union entry_lo { |
55 | struct { |
55 | struct { |
- | 56 | #ifdef BIG_ENDIAN |
|
- | 57 | unsigned : 2; /* zero */ |
|
- | 58 | unsigned pfn : 24; /* frame number */ |
|
- | 59 | unsigned c : 3; /* cache coherency attribute */ |
|
- | 60 | unsigned d : 1; /* dirty/write-protect bit */ |
|
- | 61 | unsigned v : 1; /* valid bit */ |
|
- | 62 | unsigned g : 1; /* global bit */ |
|
- | 63 | #else |
|
56 | unsigned g : 1; /* global bit */ |
64 | unsigned g : 1; /* global bit */ |
57 | unsigned v : 1; /* valid bit */ |
65 | unsigned v : 1; /* valid bit */ |
58 | unsigned d : 1; /* dirty/write-protect bit */ |
66 | unsigned d : 1; /* dirty/write-protect bit */ |
59 | unsigned c : 3; /* cache coherency attribute */ |
67 | unsigned c : 3; /* cache coherency attribute */ |
60 | unsigned pfn : 24; /* frame number */ |
68 | unsigned pfn : 24; /* frame number */ |
61 | unsigned : 2; /* zero */ |
69 | unsigned : 2; /* zero */ |
- | 70 | #endif |
|
62 | } __attribute__ ((packed)); |
71 | } __attribute__ ((packed)); |
63 | __u32 value; |
72 | __u32 value; |
64 | }; |
73 | }; |
65 | 74 | ||
66 | /** Page Table Entry. */ |
75 | /** Page Table Entry. */ |
67 | struct pte { |
76 | struct pte { |
- | 77 | #ifdef BIG_ENDIAN |
|
- | 78 | unsigned a : 1; /**< Accessed bit. */ |
|
- | 79 | unsigned w : 1; /**< Page writable bit. */ |
|
- | 80 | unsigned pfn : 24; /**< Physical frame number. */ |
|
- | 81 | unsigned soft_valid : 1; /**< Valid content even if not present. */ |
|
- | 82 | unsigned : 1; /**< Unused. */ |
|
- | 83 | unsigned cacheable : 1; /**< Cacheable bit. */ |
|
- | 84 | unsigned d : 1; /**< Dirty bit. */ |
|
- | 85 | unsigned p : 1; /**< Present bit. */ |
|
- | 86 | unsigned g : 1; /**< Global bit. */ |
|
- | 87 | #else |
|
68 | unsigned g : 1; /**< Global bit. */ |
88 | unsigned g : 1; /**< Global bit. */ |
69 | unsigned p : 1; /**< Present bit. */ |
89 | unsigned p : 1; /**< Present bit. */ |
70 | unsigned d : 1; /**< Dirty bit. */ |
90 | unsigned d : 1; /**< Dirty bit. */ |
71 | unsigned cacheable : 1; /**< Cacheable bit. */ |
91 | unsigned cacheable : 1; /**< Cacheable bit. */ |
72 | unsigned : 1; /**< Unused. */ |
92 | unsigned : 1; /**< Unused. */ |
73 | unsigned soft_valid : 1; /**< Valid content even if not present. */ |
93 | unsigned soft_valid : 1; /**< Valid content even if not present. */ |
74 | unsigned pfn : 24; /**< Physical frame number. */ |
94 | unsigned pfn : 24; /**< Physical frame number. */ |
75 | unsigned w : 1; /**< Page writable bit. */ |
95 | unsigned w : 1; /**< Page writable bit. */ |
76 | unsigned a : 1; /**< Accessed bit. */ |
96 | unsigned a : 1; /**< Accessed bit. */ |
- | 97 | #endif |
|
77 | }; |
98 | }; |
78 | 99 | ||
79 | union entry_hi { |
100 | union entry_hi { |
80 | struct { |
101 | struct { |
- | 102 | #ifdef BIG_ENDIAN |
|
- | 103 | unsigned vpn2 : 19; |
|
- | 104 | unsigned : 5; |
|
- | 105 | unsigned asid : 8; |
|
- | 106 | #else |
|
81 | unsigned asid : 8; |
107 | unsigned asid : 8; |
82 | unsigned : 5; |
108 | unsigned : 5; |
83 | unsigned vpn2 : 19; |
109 | unsigned vpn2 : 19; |
- | 110 | #endif |
|
84 | } __attribute__ ((packed)); |
111 | } __attribute__ ((packed)); |
85 | __u32 value; |
112 | __u32 value; |
86 | }; |
113 | }; |
87 | 114 | ||
88 | union page_mask { |
115 | union page_mask { |
89 | struct { |
116 | struct { |
- | 117 | #ifdef BIG_ENDIAN |
|
- | 118 | unsigned : 7; |
|
- | 119 | unsigned mask : 12; |
|
- | 120 | unsigned : 13; |
|
- | 121 | #else |
|
90 | unsigned : 13; |
122 | unsigned : 13; |
91 | unsigned mask : 12; |
123 | unsigned mask : 12; |
92 | unsigned : 7; |
124 | unsigned : 7; |
- | 125 | #endif |
|
93 | } __attribute__ ((packed)); |
126 | } __attribute__ ((packed)); |
94 | __u32 value; |
127 | __u32 value; |
95 | }; |
128 | }; |
96 | 129 | ||
97 | union index { |
130 | union index { |
98 | struct { |
131 | struct { |
- | 132 | #ifdef BIG_ENDIAN |
|
- | 133 | unsigned p : 1; |
|
- | 134 | unsigned : 27; |
|
- | 135 | unsigned index : 4; |
|
- | 136 | #else |
|
99 | unsigned index : 4; |
137 | unsigned index : 4; |
100 | unsigned : 27; |
138 | unsigned : 27; |
101 | unsigned p : 1; |
139 | unsigned p : 1; |
- | 140 | #endif |
|
102 | } __attribute__ ((packed)); |
141 | } __attribute__ ((packed)); |
103 | __u32 value; |
142 | __u32 value; |
104 | }; |
143 | }; |
105 | 144 | ||
106 | /** Probe TLB for Matching Entry |
145 | /** Probe TLB for Matching Entry |