From: Paul M. <le...@us...> - 2003-03-31 16:37:04
|
Update of /cvsroot/linuxsh/linux/include/asm-sh In directory sc8-pr-cvs1:/tmp/cvs-serv17928/include/asm-sh Modified Files: Tag: linux-2_5-restructure-saturn pgtable.h mmu_context.h Log Message: Cleanups, API changes, and support for nonlinear file mapping entries.. Index: pgtable.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgtable.h,v retrieving revision 1.3.2.1.2.3 retrieving revision 1.3.2.1.2.4 diff -u -d -r1.3.2.1.2.3 -r1.3.2.1.2.4 --- pgtable.h 31 Mar 2003 05:30:53 -0000 1.3.2.1.2.3 +++ pgtable.h 31 Mar 2003 16:35:46 -0000 1.3.2.1.2.4 @@ -1,7 +1,10 @@ #ifndef __ASM_SH_PGTABLE_H #define __ASM_SH_PGTABLE_H -/* Copyright (C) 1999 Niibe Yutaka */ +/* + * Copyright (C) 1999 Niibe Yutaka + * Copyright (C) 2002, 2003 Paul Mundt + */ #include <asm/pgtable-2level.h> @@ -60,6 +63,7 @@ /* 0x080 SZ1-bit : Size of page (on SH-4) */ #define _PAGE_PRESENT 0x100 /* V-bit : page is valid */ #define _PAGE_PROTNONE 0x200 /* software: if not present */ +#define _PAGE_FILE 0x400 /* only when !present */ #define _PAGE_ACCESSED 0x400 /* software: page referenced */ #define _PAGE_U0_SHARED 0x800 /* software: page is shared in user space */ @@ -160,6 +164,7 @@ static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; } static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } +static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_RW; } static inline int pte_not_present(pte_t pte){ return !(pte_val(pte) & _PAGE_PRESENT); } @@ -237,6 +242,13 @@ #define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) + +/* + * Encode and decode a nonlinear file mapping entry + */ +#define PTE_FILE_MAX_BITS 29 +#define pte_to_pgoff(pte) (pte_val(pte)) +#define pgoff_to_pte(off) ((pte_t) { (off) | _PAGE_FILE }) /* * Routines for update of PTE Index: mmu_context.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/mmu_context.h,v retrieving revision 1.3.2.2.2.6 retrieving revision 1.3.2.2.2.7 diff -u -d -r1.3.2.2.2.6 -r1.3.2.2.2.7 --- mmu_context.h 31 Mar 2003 04:03:08 -0000 1.3.2.2.2.6 +++ mmu_context.h 31 Mar 2003 16:35:48 -0000 1.3.2.2.2.7 @@ -8,6 +8,7 @@ #include <asm/cpu/mmu_context.h> #include <asm/tlbflush.h> +#include <asm/pgalloc.h> #include <asm/uaccess.h> #include <asm/io.h> |