aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-07-11 11:57:20 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-07-11 11:59:39 -0400
commit6a00cded91532f3d58e07729ba56269339281d8e (patch)
tree511becb90348f84b23c7669ba820e2fe852bb572
parentf7a55fa6ecef8be6d15bd79a803e44a3187ce9d6 (diff)
[ARM] pgtable: rearrange file PTE bit allocation
For future compatibility, we need to ensure that swap and file Linux PTEs conform with the hardware PTEs "fault" encoding. Swap PTEs already fit in with this, but file PTEs do not. Shift them by one bit to ensure that they conform, using bit 2 to distinguish between swap and file PTEs. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/include/asm/pgtable.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index d575666d5c46..9655bce3d345 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -162,8 +162,8 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
162 * entries are stored 1024 bytes below. 162 * entries are stored 1024 bytes below.
163 */ 163 */
164#define L_PTE_PRESENT (1 << 0) 164#define L_PTE_PRESENT (1 << 0)
165#define L_PTE_FILE (1 << 1) /* only when !PRESENT */
166#define L_PTE_YOUNG (1 << 1) 165#define L_PTE_YOUNG (1 << 1)
166#define L_PTE_FILE (1 << 2) /* only when !PRESENT */
167#define L_PTE_DIRTY (1 << 6) 167#define L_PTE_DIRTY (1 << 6)
168#define L_PTE_WRITE (1 << 7) 168#define L_PTE_WRITE (1 << 7)
169#define L_PTE_USER (1 << 8) 169#define L_PTE_USER (1 << 8)
@@ -379,13 +379,13 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
379 * 379 *
380 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 380 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
381 * 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 381 * 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
382 * <--------------- offset --------------------> <--- type --> 0 0 382 * <--------------- offset --------------------> <- type --> 0 0 0
383 * 383 *
384 * This gives us up to 127 swap files and 32GB per swap file. Note that 384 * This gives us up to 63 swap files and 32GB per swap file. Note that
385 * the offset field is always non-zero. 385 * the offset field is always non-zero.
386 */ 386 */
387#define __SWP_TYPE_SHIFT 2 387#define __SWP_TYPE_SHIFT 3
388#define __SWP_TYPE_BITS 7 388#define __SWP_TYPE_BITS 6
389#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) 389#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
390#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) 390#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
391 391
@@ -409,13 +409,13 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
409 * 409 *
410 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 410 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
411 * 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 411 * 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
412 * <------------------------ offset -------------------------> 1 0 412 * <----------------------- offset ------------------------> 1 0 0
413 */ 413 */
414#define pte_file(pte) (pte_val(pte) & L_PTE_FILE) 414#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
415#define pte_to_pgoff(x) (pte_val(x) >> 2) 415#define pte_to_pgoff(x) (pte_val(x) >> 3)
416#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE) 416#define pgoff_to_pte(x) __pte(((x) << 3) | L_PTE_FILE)
417 417
418#define PTE_FILE_MAX_BITS 30 418#define PTE_FILE_MAX_BITS 29
419 419
420/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 420/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
421/* FIXME: this is not correct */ 421/* FIXME: this is not correct */