diff options
author | Robin Holt <holt@sgi.com> | 2009-12-15 19:47:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:20:13 -0500 |
commit | 682128939f546e3a9cdd9fef392b932dd9c41a65 (patch) | |
tree | ec641fbca980cbba69b655f7575523a8cdc93b30 /drivers/misc | |
parent | 729d69e6995fc4dea8ff70df256a7d4034a3d21d (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/misc')
-rw-r--r-- | drivers/misc/sgi-xp/xp.h | 1 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xp_main.c | 3 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xp_sn2.c | 10 | ||||
-rw-r--r-- | drivers/misc/sgi-xp/xp_uv.c | 10 |
4 files changed, 24 insertions, 0 deletions
diff --git a/drivers/misc/sgi-xp/xp.h b/drivers/misc/sgi-xp/xp.h index 2275126cb33..851b2f25ce0 100644 --- a/drivers/misc/sgi-xp/xp.h +++ b/drivers/misc/sgi-xp/xp.h | |||
@@ -339,6 +339,7 @@ extern short xp_partition_id; | |||
339 | extern u8 xp_region_size; | 339 | extern u8 xp_region_size; |
340 | 340 | ||
341 | extern unsigned long (*xp_pa) (void *); | 341 | extern unsigned long (*xp_pa) (void *); |
342 | extern unsigned long (*xp_socket_pa) (unsigned long); | ||
342 | extern enum xp_retval (*xp_remote_memcpy) (unsigned long, const unsigned long, | 343 | extern enum xp_retval (*xp_remote_memcpy) (unsigned long, const unsigned long, |
343 | size_t); | 344 | size_t); |
344 | extern int (*xp_cpu_to_nasid) (int); | 345 | extern 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 7896849b16d..01be66d02ca 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); | |||
44 | unsigned long (*xp_pa) (void *addr); | 44 | unsigned long (*xp_pa) (void *addr); |
45 | EXPORT_SYMBOL_GPL(xp_pa); | 45 | EXPORT_SYMBOL_GPL(xp_pa); |
46 | 46 | ||
47 | unsigned long (*xp_socket_pa) (unsigned long gpa); | ||
48 | EXPORT_SYMBOL_GPL(xp_socket_pa); | ||
49 | |||
47 | enum xp_retval (*xp_remote_memcpy) (unsigned long dst_gpa, | 50 | enum 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); |
49 | EXPORT_SYMBOL_GPL(xp_remote_memcpy); | 52 | EXPORT_SYMBOL_GPL(xp_remote_memcpy); |
diff --git a/drivers/misc/sgi-xp/xp_sn2.c b/drivers/misc/sgi-xp/xp_sn2.c index fb3ec9d735a..d8e463f8724 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 | */ | ||
89 | static unsigned long | ||
90 | xp_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 d238576b26f..1e61f8a61a3 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 | */ | ||
38 | static unsigned long | ||
39 | xp_socket_pa_uv(unsigned long gpa) | ||
40 | { | ||
41 | return uv_gpa_to_soc_phys_ram(gpa); | ||
42 | } | ||
43 | |||
35 | static enum xp_retval | 44 | static enum xp_retval |
36 | xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa, | 45 | xp_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; |