diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-02-10 21:38:10 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-02-10 21:38:10 +0000 |
commit | 4f1dc929c47e0d019726681daa8d78d616868b0e (patch) | |
tree | 491aefdafea5a99c69af4d436e03004336af6d11 /include/asm-mips64 | |
parent | ab4ce301407e42412088ad0044c7fdc4be706f9c (diff) |
Clean up the discontig case page -> physaddr and physaddr -> page macros.
Probably needs to be debugged once we achieve single user.
Diffstat (limited to 'include/asm-mips64')
-rw-r--r-- | include/asm-mips64/pgtable.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h index 8dc8af0f9..02b08b4c3 100644 --- a/include/asm-mips64/pgtable.h +++ b/include/asm-mips64/pgtable.h @@ -289,7 +289,9 @@ extern inline void pgd_clear(pgd_t *pgdp) #ifndef CONFIG_DISCONTIGMEM #define pte_pagenr(x) ((unsigned long)((pte_val(x) >> PAGE_SHIFT))) #else -#define pte_pagenr(x) (PLAT_NODE_DATA_STARTNR(PHYSADDR_TO_NID((pte_val(x) & PAGE_MASK))) + PLAT_NODE_DATA_LOCALNR((pte_val(x) & PAGE_MASK), PHYSADDR_TO_NID((pte_val(x) >> PAGE_SHIFT)))) +#define pte_pagenr(x) \ + (PLAT_NODE_DATA_STARTNR(PHYSADDR_TO_NID(pte_val(x))) + \ + PLAT_NODE_DATA_LOCALNR(pte_val(x), PHYSADDR_TO_NID(pte_val(x)))) #endif #define pte_page(x) (mem_map+pte_pagenr(x)) @@ -378,18 +380,18 @@ extern inline pte_t pte_mkyoung(pte_t pte) * and a page entry and page directory to the page they refer to. */ #ifndef CONFIG_DISCONTIGMEM -#define PAGE_TO_PFN(page) (page - mem_map) +#define PAGE_TO_PA(page) ((page - mem_map) << PAGE_SHIFT) #else -#define PAGE_TO_PFN(page) (((page)-(page)->zone->zone_pgdat->node_mem_map) \ - + ((PAGE_TO_PLAT_NODE(page))->physstart >> \ - PAGE_SHIFT)) +#define PAGE_TO_PA(page) \ + ((((page)-(page)->zone->zone_pgdat->node_mem_map) << PAGE_SHIFT) \ + + ((PAGE_TO_PLAT_NODE(page))->physstart)) #endif #define mk_pte(page, pgprot) \ ({ \ pte_t __pte; \ \ - pte_val(__pte) = ((unsigned long)(PAGE_TO_PFN(page)) << PAGE_SHIFT) | \ - pgprot_val(pgprot); \ + pte_val(__pte) = ((unsigned long)(PAGE_TO_PA(page))) | \ + pgprot_val(pgprot); \ \ __pte; \ }) |