~adam-hraska+lp/helenos/cht-bench

« back to all changes in this revision

Viewing changes to kernel/arch/arm32/include/mm/page.h

  • Committer: Adam Hraska
  • Date: 2012-08-08 17:19:28 UTC
  • mfrom: (1574.1.16 rcu-clone)
  • Revision ID: adam.hraska+hos@gmail.com-20120808171928-7gf0fh7pcxxcoaoo
Merged in mainline changes from rcu-clone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <arch/mm/frame.h>
40
40
#include <mm/mm.h>
41
41
#include <arch/exception.h>
 
42
#include <arch/barrier.h>
42
43
#include <trace.h>
43
44
 
44
45
#define PAGE_WIDTH      FRAME_WIDTH
109
110
#define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \
110
111
        set_pt_level1_flags((pte_t *) (ptl3), (size_t) (i), (x))
111
112
 
 
113
/* Set PTE present bit accessors for each level. */
 
114
#define SET_PTL1_PRESENT_ARCH(ptl0, i) \
 
115
        set_pt_level0_present((pte_t *) (ptl0), (size_t) (i))
 
116
#define SET_PTL2_PRESENT_ARCH(ptl1, i)
 
117
#define SET_PTL3_PRESENT_ARCH(ptl2, i)
 
118
#define SET_FRAME_PRESENT_ARCH(ptl3, i) \
 
119
        set_pt_level1_present((pte_t *) (ptl3), (size_t) (i))
 
120
 
112
121
/* Macros for querying the last-level PTE entries. */
113
122
#define PTE_VALID_ARCH(pte) \
114
123
        (*((uint32_t *) (pte)) != 0)
266
275
        }
267
276
}
268
277
 
 
278
NO_TRACE static inline void set_pt_level0_present(pte_t *pt, size_t i)
 
279
{
 
280
        pte_level0_t *p = &pt[i].l0;
 
281
 
 
282
        p->should_be_zero = 0;
 
283
        write_barrier();
 
284
        p->descriptor_type = PTE_DESCRIPTOR_COARSE_TABLE;
 
285
}
269
286
 
270
287
/** Sets flags of level 1 page table entry.
271
288
 *
282
299
{
283
300
        pte_level1_t *p = &pt[i].l1;
284
301
        
285
 
        if (flags & PAGE_NOT_PRESENT) {
 
302
        if (flags & PAGE_NOT_PRESENT)
286
303
                p->descriptor_type = PTE_DESCRIPTOR_NOT_PRESENT;
287
 
                p->access_permission_3 = 1;
288
 
        } else {
 
304
        else
289
305
                p->descriptor_type = PTE_DESCRIPTOR_SMALL_PAGE;
290
 
                p->access_permission_3 = p->access_permission_0;
291
 
        }
292
306
        
293
307
        p->cacheable = p->bufferable = (flags & PAGE_CACHEABLE) != 0;
294
308
        
311
325
        }
312
326
}
313
327
 
 
328
NO_TRACE static inline void set_pt_level1_present(pte_t *pt, size_t i)
 
329
{
 
330
        pte_level1_t *p = &pt[i].l1;
314
331
 
 
332
        p->descriptor_type = PTE_DESCRIPTOR_SMALL_PAGE;
 
333
}
 
334
        
315
335
extern void page_arch_init(void);
316
336
 
317
 
 
318
337
#endif /* __ASM__ */
319
338
 
320
339
#endif