patch-1.3.29 linux/include/asm-alpha/pgtable.h
Next file: linux/include/asm-i386/page.h
Previous file: linux/include/asm-alpha/page.h
Back to the patch index
Back to the overall index
- Lines: 79
- Date:
Tue Sep 19 13:37:35 1995
- Orig file:
v1.3.28/linux/include/asm-alpha/pgtable.h
- Orig date:
Sat Sep 9 15:26:53 1995
diff -u --recursive --new-file v1.3.28/linux/include/asm-alpha/pgtable.h linux/include/asm-alpha/pgtable.h
@@ -171,35 +171,30 @@
extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_VALID; }
-extern inline int pte_inuse(pte_t *ptep) { return mem_map[MAP_NR(ptep)] != 1; }
+extern inline int pte_inuse(pte_t *ptep) { return mem_map[MAP_NR(ptep)].reserved || mem_map[MAP_NR(ptep)].count != 1; }
extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; }
extern inline void pte_reuse(pte_t * ptep)
{
- if (!(mem_map[MAP_NR(ptep)] & MAP_PAGE_RESERVED))
- mem_map[MAP_NR(ptep)]++;
+ if (!mem_map[MAP_NR(ptep)].reserved)
+ mem_map[MAP_NR(ptep)].count++;
}
extern inline int pmd_none(pmd_t pmd) { return !pmd_val(pmd); }
extern inline int pmd_bad(pmd_t pmd) { return (pmd_val(pmd) & ~_PFN_MASK) != _PAGE_TABLE || pmd_page(pmd) > high_memory; }
extern inline int pmd_present(pmd_t pmd) { return pmd_val(pmd) & _PAGE_VALID; }
-extern inline int pmd_inuse(pmd_t *pmdp) { return mem_map[MAP_NR(pmdp)] != 1; }
+extern inline int pmd_inuse(pmd_t *pmdp) { return mem_map[MAP_NR(pmdp)].reserved || mem_map[MAP_NR(pmdp)].count != 1; }
extern inline void pmd_clear(pmd_t * pmdp) { pmd_val(*pmdp) = 0; }
extern inline void pmd_reuse(pmd_t * pmdp)
{
- if (!(mem_map[MAP_NR(pmdp)] & MAP_PAGE_RESERVED))
- mem_map[MAP_NR(pmdp)]++;
+ if (!mem_map[MAP_NR(pmdp)].reserved)
+ mem_map[MAP_NR(pmdp)].count++;
}
extern inline int pgd_none(pgd_t pgd) { return !pgd_val(pgd); }
extern inline int pgd_bad(pgd_t pgd) { return (pgd_val(pgd) & ~_PFN_MASK) != _PAGE_TABLE || pgd_page(pgd) > high_memory; }
extern inline int pgd_present(pgd_t pgd) { return pgd_val(pgd) & _PAGE_VALID; }
-extern inline int pgd_inuse(pgd_t *pgdp) { return mem_map[MAP_NR(pgdp)] != 1; }
+extern inline int pgd_inuse(pgd_t *pgdp) { return mem_map[MAP_NR(pgdp)].reserved; }
extern inline void pgd_clear(pgd_t * pgdp) { pgd_val(*pgdp) = 0; }
-extern inline void pgd_reuse(pgd_t * pgdp)
-{
- if (!(mem_map[MAP_NR(pgdp)] & MAP_PAGE_RESERVED))
- mem_map[MAP_NR(pgdp)]++;
-}
/*
* The following only work if pte_present() is true.
@@ -273,7 +268,7 @@
*/
extern inline void pte_free_kernel(pte_t * pte)
{
- mem_map[MAP_NR(pte)] = 1;
+ mem_map[MAP_NR(pte)].reserved = 0;
free_page((unsigned long) pte);
}
@@ -285,7 +280,7 @@
if (pmd_none(*pmd)) {
if (page) {
pmd_set(pmd, page);
- mem_map[MAP_NR(page)] = MAP_PAGE_RESERVED;
+ mem_map[MAP_NR(page)].reserved = 1;
return page + address;
}
pmd_set(pmd, (pte_t *) BAD_PAGETABLE);
@@ -303,7 +298,7 @@
extern inline void pmd_free_kernel(pmd_t * pmd)
{
- mem_map[MAP_NR(pmd)] = 1;
+ mem_map[MAP_NR(pmd)].reserved = 0;
free_page((unsigned long) pmd);
}
@@ -315,7 +310,7 @@
if (pgd_none(*pgd)) {
if (page) {
pgd_set(pgd, page);
- mem_map[MAP_NR(page)] = MAP_PAGE_RESERVED;
+ mem_map[MAP_NR(page)].reserved = 1;
return page + address;
}
pgd_set(pgd, BAD_PAGETABLE);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this