aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobin Holt <holt@sgi.com>2009-12-15 19:47:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 10:20:13 -0500
commit682128939f546e3a9cdd9fef392b932dd9c41a65 (patch)
treeec641fbca980cbba69b655f7575523a8cdc93b30 /drivers
parent729d69e6995fc4dea8ff70df256a7d4034a3d21d (diff)
x86: uv: xpc needs to provide an abstraction for uv_gpa
Provide an SGI SN2/UV agnositic method for converting a global physical address into a socket physical address. Signed-off-by: Robin Holt <holt@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/sgi-xp/xp.h1
-rw-r--r--drivers/misc/sgi-xp/xp_main.c3
-rw-r--r--drivers/misc/sgi-xp/xp_sn2.c10
-rw-r--r--drivers/misc/sgi-xp/xp_uv.c10
4 files changed, 24 insertions, 0 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h
index 2275126cb334..851b2f25ce0e 100644
--- a/drivers/misc/sgi-xp/xp.h
+++ b/drivers/misc/sgi-xp/xp.h
@@ -339,6 +339,7 @@ extern short xp_partition_id;
339extern u8 xp_region_size; 339extern u8 xp_region_size;
340 340
341extern unsigned long (*xp_pa) (void *); 341extern unsigned long (*xp_pa) (void *);
342extern unsigned long (*xp_socket_pa) (unsigned long);
342extern enum xp_retval (*xp_remote_memcpy) (unsigned long, const unsigned long, 343extern enum xp_retval (*xp_remote_memcpy) (unsigned long, const unsigned long,
343 size_t); 344 size_t);
344extern int (*xp_cpu_to_nasid) (int); 345extern int (*xp_cpu_to_nasid) (int);
diff --git a/drivers/misc/sgi-xp/xp_main.c b/drivers/misc/sgi-xp/xp_main.c
index 7896849b16dc..01be66d02ca8 100644
--- a/drivers/misc/sgi-xp/xp_main.c
+++ b/drivers/misc/sgi-xp/xp_main.c
@@ -44,6 +44,9 @@ EXPORT_SYMBOL_GPL(xp_region_size);
44unsigned long (*xp_pa) (void *addr); 44unsigned long (*xp_pa) (void *addr);
45EXPORT_SYMBOL_GPL(xp_pa); 45EXPORT_SYMBOL_GPL(xp_pa);
46 46
47unsigned long (*xp_socket_pa) (unsigned long gpa);
48EXPORT_SYMBOL_GPL(xp_socket_pa);
49
47enum xp_retval (*xp_remote_memcpy) (unsigned long dst_gpa, 50enum xp_retval (*xp_remote_memcpy) (unsigned long dst_gpa,
48 const unsigned long src_gpa, size_t len); 51 const unsigned long src_gpa, size_t len);
49EXPORT_SYMBOL_GPL(xp_remote_memcpy); 52EXPORT_SYMBOL_GPL(xp_remote_memcpy);
diff --git a/drivers/misc/sgi-xp/xp_sn2.c b/drivers/misc/sgi-xp/xp_sn2.c
index fb3ec9d735a9..d8e463f87241 100644
--- a/drivers/misc/sgi-xp/xp_sn2.c
+++ b/drivers/misc/sgi-xp/xp_sn2.c
@@ -84,6 +84,15 @@ xp_pa_sn2(void *addr)
84} 84}
85 85
86/* 86/*
87 * Convert a global physical to a socket physical address.
88 */
89static unsigned long
90xp_socket_pa_sn2(unsigned long gpa)
91{
92 return gpa;
93}
94
95/*
87 * Wrapper for bte_copy(). 96 * Wrapper for bte_copy().
88 * 97 *
89 * dst_pa - physical address of the destination of the transfer. 98 * dst_pa - physical address of the destination of the transfer.
@@ -162,6 +171,7 @@ xp_init_sn2(void)
162 xp_region_size = sn_region_size; 171 xp_region_size = sn_region_size;
163 172
164 xp_pa = xp_pa_sn2; 173 xp_pa = xp_pa_sn2;
174 xp_socket_pa = xp_socket_pa_sn2;
165 xp_remote_memcpy = xp_remote_memcpy_sn2; 175 xp_remote_memcpy = xp_remote_memcpy_sn2;
166 xp_cpu_to_nasid = xp_cpu_to_nasid_sn2; 176 xp_cpu_to_nasid = xp_cpu_to_nasid_sn2;
167 xp_expand_memprotect = xp_expand_memprotect_sn2; 177 xp_expand_memprotect = xp_expand_memprotect_sn2;
diff --git a/drivers/misc/sgi-xp/xp_uv.c b/drivers/misc/sgi-xp/xp_uv.c
index d238576b26fa..1e61f8a61a30 100644
--- a/drivers/misc/sgi-xp/xp_uv.c
+++ b/drivers/misc/sgi-xp/xp_uv.c
@@ -32,6 +32,15 @@ xp_pa_uv(void *addr)
32 return uv_gpa(addr); 32 return uv_gpa(addr);
33} 33}
34 34
35/*
36 * Convert a global physical to socket physical address.
37 */
38static unsigned long
39xp_socket_pa_uv(unsigned long gpa)
40{
41 return uv_gpa_to_soc_phys_ram(gpa);
42}
43
35static enum xp_retval 44static enum xp_retval
36xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa, 45xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa,
37 size_t len) 46 size_t len)
@@ -123,6 +132,7 @@ xp_init_uv(void)
123 xp_region_size = sn_region_size; 132 xp_region_size = sn_region_size;
124 133
125 xp_pa = xp_pa_uv; 134 xp_pa = xp_pa_uv;
135 xp_socket_pa = xp_socket_pa_uv;
126 xp_remote_memcpy = xp_remote_memcpy_uv; 136 xp_remote_memcpy = xp_remote_memcpy_uv;
127 xp_cpu_to_nasid = xp_cpu_to_nasid_uv; 137 xp_cpu_to_nasid = xp_cpu_to_nasid_uv;
128 xp_expand_memprotect = xp_expand_memprotect_uv; 138 xp_expand_memprotect = xp_expand_memprotect_uv;