aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-alpha')
-rw-r--r--include/asm-alpha/mmzone.h19
-rw-r--r--include/asm-alpha/page.h4
-rw-r--r--include/asm-alpha/poll.h4
3 files changed, 5 insertions, 22 deletions
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index a011ef4cf3d3..192d80c875b0 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -59,9 +59,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
59#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) 59#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr))
60#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 60#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
61 61
62#define local_mapnr(kvaddr) \
63 ((__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)))
64
65/* 62/*
66 * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory 63 * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
67 * and returns the kaddr corresponding to first physical page in the 64 * and returns the kaddr corresponding to first physical page in the
@@ -86,8 +83,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
86 pte_t pte; \ 83 pte_t pte; \
87 unsigned long pfn; \ 84 unsigned long pfn; \
88 \ 85 \
89 pfn = ((unsigned long)((page)-page_zone(page)->zone_mem_map)) << 32; \ 86 pfn = page_to_pfn(page) << 32; \
90 pfn += page_zone(page)->zone_start_pfn << 32; \
91 pte_val(pte) = pfn | pgprot_val(pgprot); \ 87 pte_val(pte) = pfn | pgprot_val(pgprot); \
92 \ 88 \
93 pte; \ 89 pte; \
@@ -104,19 +100,8 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
104 __xx; \ 100 __xx; \
105}) 101})
106 102
107#define pfn_to_page(pfn) \
108({ \
109 unsigned long kaddr = (unsigned long)__va((pfn) << PAGE_SHIFT); \
110 (NODE_DATA(kvaddr_to_nid(kaddr))->node_mem_map + local_mapnr(kaddr)); \
111})
112
113#define page_to_pfn(page) \
114 ((page) - page_zone(page)->zone_mem_map + \
115 (page_zone(page)->zone_start_pfn))
116
117#define page_to_pa(page) \ 103#define page_to_pa(page) \
118 ((( (page) - page_zone(page)->zone_mem_map ) \ 104 (page_to_pfn(page) << PAGE_SHIFT)
119 + page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
120 105
121#define pfn_to_nid(pfn) pa_to_nid(((u64)(pfn) << PAGE_SHIFT)) 106#define pfn_to_nid(pfn) pa_to_nid(((u64)(pfn) << PAGE_SHIFT))
122#define pfn_valid(pfn) \ 107#define pfn_valid(pfn) \
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index fa0b41b164a7..61bcf70b5eac 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -85,8 +85,6 @@ typedef unsigned long pgprot_t;
85#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) 85#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
86#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) 86#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
87#ifndef CONFIG_DISCONTIGMEM 87#ifndef CONFIG_DISCONTIGMEM
88#define pfn_to_page(pfn) (mem_map + (pfn))
89#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
90#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 88#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
91 89
92#define pfn_valid(pfn) ((pfn) < max_mapnr) 90#define pfn_valid(pfn) ((pfn) < max_mapnr)
@@ -95,9 +93,9 @@ typedef unsigned long pgprot_t;
95 93
96#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 94#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
97 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 95 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
98
99#endif /* __KERNEL__ */ 96#endif /* __KERNEL__ */
100 97
98#include <asm-generic/memory_model.h>
101#include <asm-generic/page.h> 99#include <asm-generic/page.h>
102 100
103#endif /* _ALPHA_PAGE_H */ 101#endif /* _ALPHA_PAGE_H */
diff --git a/include/asm-alpha/poll.h b/include/asm-alpha/poll.h
index 95707182b3ed..76f89356b6a7 100644
--- a/include/asm-alpha/poll.h
+++ b/include/asm-alpha/poll.h
@@ -12,8 +12,8 @@
12#define POLLWRNORM (1 << 8) 12#define POLLWRNORM (1 << 8)
13#define POLLWRBAND (1 << 9) 13#define POLLWRBAND (1 << 9)
14#define POLLMSG (1 << 10) 14#define POLLMSG (1 << 10)
15#define POLLREMOVE (1 << 11) 15#define POLLREMOVE (1 << 12)
16#define POLLRDHUP (1 << 12) 16#define POLLRDHUP (1 << 13)
17 17
18 18
19struct pollfd { 19struct pollfd {