diff options
| author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2003-03-24 06:21:58 -0800 |
|---|---|---|
| committer | Richard Henderson <rth@are.twiddle.net> | 2003-03-24 06:21:58 -0800 |
| commit | 95a41bc4c831fb58af624bde9b96303bd14f2392 (patch) | |
| tree | 9b68dac3ab45230fdab280e031196496de18dc89 /include | |
| parent | f2b5f0fd6017564b07a9550087ad1b2e6c1b39c1 (diff) | |
[PATCH] alpha: file offset in pte
It's possible to squeeze more bits out of lower half of pte,
but 32 seem to be a plenty...
Ivan.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-alpha/pgtable.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h index 49c68637ae70..84286e14c4d4 100644 --- a/include/asm-alpha/pgtable.h +++ b/include/asm-alpha/pgtable.h @@ -68,6 +68,7 @@ /* .. and these are ours ... */ #define _PAGE_DIRTY 0x20000 #define _PAGE_ACCESSED 0x40000 +#define _PAGE_FILE 0x80000 /* pagecache or swap? */ /* * NOTE! The "accessed" bit isn't necessarily exact: it can be kept exactly @@ -254,6 +255,7 @@ extern inline int pte_write(pte_t pte) { return !(pte_val(pte) & _PAGE_FOW); } extern inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_FOE); } extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } +extern inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOW; return pte; } extern inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) |= _PAGE_FOR; return pte; } @@ -311,11 +313,16 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) { pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; } -#define __swp_type(x) (((x).val >> 32) & 0xff) -#define __swp_offset(x) ((x).val >> 40) -#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type),(offset))) }) -#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) -#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) +#define __swp_type(x) (((x).val >> 32) & 0xff) +#define __swp_offset(x) ((x).val >> 40) +#define __swp_entry(type, off) ((swp_entry_t) { pte_val(mk_swap_pte((type), (off))) }) +#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) +#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) + +#define pte_to_pgoff(pte) (pte_val(pte) >> 32) +#define pgoff_to_pte(off) ((pte_t) { ((off) << 32) | _PAGE_FILE }) + +#define PTE_FILE_MAX_BITS 32 #ifndef CONFIG_DISCONTIGMEM #define kern_addr_valid(addr) (1) |
