diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-07-05 06:52:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-07-05 10:31:35 -0400 |
commit | 65b1bfc13e8f50034187e339aa12b81cd6785bd5 (patch) | |
tree | 6611d43eb749e2dbdd1074f57b0fa296530c5b39 /arch/arm | |
parent | fb93a1c75eb646fde35985e9af23da936775ae52 (diff) |
[ARM] pgtable: file pte layout documentation
Document the layout of our file PTE entries.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/pgtable.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index c1d97938f3e2..c433c6c73112 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
@@ -285,15 +285,6 @@ extern struct page *empty_zero_page; | |||
285 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) | 285 | #define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) |
286 | #define pte_special(pte) (0) | 286 | #define pte_special(pte) (0) |
287 | 287 | ||
288 | /* | ||
289 | * The following only works if pte_present() is not true. | ||
290 | */ | ||
291 | #define pte_file(pte) (pte_val(pte) & L_PTE_FILE) | ||
292 | #define pte_to_pgoff(x) (pte_val(x) >> 2) | ||
293 | #define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE) | ||
294 | |||
295 | #define PTE_FILE_MAX_BITS 30 | ||
296 | |||
297 | #define PTE_BIT_FUNC(fn,op) \ | 288 | #define PTE_BIT_FUNC(fn,op) \ |
298 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } | 289 | static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } |
299 | 290 | ||
@@ -414,6 +405,20 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
414 | */ | 405 | */ |
415 | #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS) | 406 | #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS) |
416 | 407 | ||
408 | /* | ||
409 | * Encode and decode a file entry. File entries are stored in the Linux | ||
410 | * page tables as follows: | ||
411 | * | ||
412 | * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 | ||
413 | * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 | ||
414 | * <------------------------ offset -------------------------> 1 0 | ||
415 | */ | ||
416 | #define pte_file(pte) (pte_val(pte) & L_PTE_FILE) | ||
417 | #define pte_to_pgoff(x) (pte_val(x) >> 2) | ||
418 | #define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE) | ||
419 | |||
420 | #define PTE_FILE_MAX_BITS 30 | ||
421 | |||
417 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ | 422 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ |
418 | /* FIXME: this is not correct */ | 423 | /* FIXME: this is not correct */ |
419 | #define kern_addr_valid(addr) (1) | 424 | #define kern_addr_valid(addr) (1) |