15 #include <linux/types.h>
16 #include <linux/kernel.h>
17 #include <linux/module.h>
19 #include <linux/errno.h>
20 #include <linux/string.h>
26 #include <asm/pgtable.h>
28 #include <asm/tlbflush.h>
29 #include <asm/sn/arch.h>
41 #define MAX_CONVERTED_CHUNKS_PER_NODE 2
46 static void uncached_ipi_visibility(
void *
data)
58 static void uncached_ipi_mc_drain(
void *data)
63 status = ia64_pal_mc_drain();
78 static int uncached_add_chunk(
struct uncached_pool *uc_pool,
int nid)
82 unsigned long c_addr, uc_addr;
100 page = alloc_pages_exact_node(nid,
119 SetPageUncached(&page[i]);
144 status = ia64_pal_mc_drain();
167 ClearPageUncached(&page[i]);
187 unsigned long uc_addr;
194 if (starting_nid < 0)
209 }
while (uncached_add_chunk(uc_pool, nid) == 0);
211 }
while ((nid = (nid + 1) %
MAX_NUMNODES) != starting_nid);
228 int nid =
paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);
234 if ((uc_addr & (0XFUL << 60)) != __IA64_UNCACHED_OFFSET)
235 panic(
"uncached_free_page invalid address %lx\n", uc_addr);
252 static int __init uncached_build_memmap(
u64 uc_start,
u64 uc_end,
void *
arg)
254 int nid =
paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);
256 size_t size = uc_end - uc_start;
261 memset((
char *)uc_start, 0, size);
262 (
void) gen_pool_add(pool, uc_start, size, nid);