blob: 19bd89db17e71749b1e7bb07355e2152e4c92408 [file] [log] [blame]
Paul Mundte44d6c42010-01-13 19:18:39 +09001#ifndef __ASM_SH_PGTABLE_2LEVEL_H
2#define __ASM_SH_PGTABLE_2LEVEL_H
Matt Flemingb73c8062009-11-25 22:00:08 +00003
4#include <asm-generic/pgtable-nopmd.h>
5
6/*
7 * traditional two-level paging structure
8 */
Paul Mundt782bb5a2010-01-13 19:11:14 +09009#define PAGETABLE_LEVELS 2
Matt Flemingb73c8062009-11-25 22:00:08 +000010
11/* PTE bits */
Paul Mundt782bb5a2010-01-13 19:11:14 +090012#define PTE_MAGNITUDE 2 /* 32-bit PTEs */
Matt Flemingb73c8062009-11-25 22:00:08 +000013
Paul Mundt782bb5a2010-01-13 19:11:14 +090014#define PTE_SHIFT PAGE_SHIFT
15#define PTE_BITS (PTE_SHIFT - PTE_MAGNITUDE)
Matt Flemingb73c8062009-11-25 22:00:08 +000016
17/* PGD bits */
Paul Mundt782bb5a2010-01-13 19:11:14 +090018#define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS)
Matt Flemingb73c8062009-11-25 22:00:08 +000019
Paul Mundt782bb5a2010-01-13 19:11:14 +090020#define PTRS_PER_PGD (PAGE_SIZE / (1 << PTE_MAGNITUDE))
Matt Flemingb73c8062009-11-25 22:00:08 +000021#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
22
Paul Mundte44d6c42010-01-13 19:18:39 +090023#endif /* __ASM_SH_PGTABLE_2LEVEL_H */