aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/pgtable.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-11-26 22:06:26 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-05 20:45:39 -0500
commit510c72ad2dd4e05e6908755f51ac89482c6eb987 (patch)
treefa2e9e9a674e38dd523d937329627560f0bd6b64 /include/asm-sh/pgtable.h
parent1dc41e58a553e612e3d0349bb60eef08f9462bde (diff)
sh: Fixup various PAGE_SIZE == 4096 assumptions.
There were a number of places that made evil PAGE_SIZE == 4k assumptions that ended up breaking when trying to play with 8k and 64k page sizes, this fixes those up. The most significant change is the way we load THREAD_SIZE, previously this was done via: mov #(THREAD_SIZE >> 8), reg shll8 reg to avoid a memory access and allow the immediate load. With a 64k PAGE_SIZE, we're out of range for the immediate load size without resorting to special instructions available in later ISAs (movi20s and so on). The "workaround" for this is to bump up the shift to 10 and insert a shll2, which gives a bit more flexibility while still being much cheaper than a memory access. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/pgtable.h')
-rw-r--r--include/asm-sh/pgtable.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index fa625245051d..f87504abb43f 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -47,8 +47,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
47#define PGDIR_MASK (~(PGDIR_SIZE-1)) 47#define PGDIR_MASK (~(PGDIR_SIZE-1))
48 48
49/* Entries per level */ 49/* Entries per level */
50#define PTRS_PER_PTE (1 << PTE_BITS) 50#define PTRS_PER_PTE (PAGE_SIZE / 4)
51#define PTRS_PER_PGD (1 << PGDIR_BITS) 51#define PTRS_PER_PGD (PAGE_SIZE / 4)
52 52
53#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 53#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
54#define FIRST_USER_ADDRESS 0 54#define FIRST_USER_ADDRESS 0
@@ -57,7 +57,7 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
57 57
58/* 58/*
59 * First 1MB map is used by fixed purpose. 59 * First 1MB map is used by fixed purpose.
60 * Currently only 4-enty (16kB) is used (see arch/sh/mm/cache.c) 60 * Currently only 4-entry (16kB) is used (see arch/sh/mm/cache.c)
61 */ 61 */
62#define VMALLOC_START (P3SEG+0x00100000) 62#define VMALLOC_START (P3SEG+0x00100000)
63#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) 63#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)