aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xp_uv.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-07-30 01:34:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:50 -0400
commita812dcc3a298eef650c381e094e2cf41a4ecc9ad (patch)
treecb6a24a623891054789f5340742c3c8ff1fb8cde /drivers/misc/sgi-xp/xp_uv.c
parent261f3b4979db88d29fc86aad9f76fbc0c2c6d21a (diff)
sgi-xp: add usage of GRU driver by xpc_remote_memcpy()
Add UV support to xpc_remote_memcpy(), which involves interfacing to the GRU driver. Signed-off-by: Dean Nelson <dcn@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xp_uv.c')
-rw-r--r--drivers/misc/sgi-xp/xp_uv.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/misc/sgi-xp/xp_uv.c b/drivers/misc/sgi-xp/xp_uv.c
index 382b1b6bcc0b..44f2c2b58c2f 100644
--- a/drivers/misc/sgi-xp/xp_uv.c
+++ b/drivers/misc/sgi-xp/xp_uv.c
@@ -13,13 +13,33 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/device.h>
17#include <asm/uv/uv_hub.h>
18#include "../sgi-gru/grukservices.h"
16#include "xp.h" 19#include "xp.h"
17 20
21/*
22 * Convert a virtual memory address to a physical memory address.
23 */
24static unsigned long
25xp_pa_uv(void *addr)
26{
27 return uv_gpa(addr);
28}
29
18static enum xp_retval 30static enum xp_retval
19xp_remote_memcpy_uv(void *vdst, const void *psrc, size_t len) 31xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa,
32 size_t len)
20{ 33{
21 /* !!! this function needs fleshing out */ 34 int ret;
22 return xpUnsupported; 35
36 ret = gru_copy_gpa(dst_gpa, src_gpa, len);
37 if (ret == 0)
38 return xpSuccess;
39
40 dev_err(xp, "gru_copy_gpa() failed, dst_gpa=0x%016lx src_gpa=0x%016lx "
41 "len=%ld\n", dst_gpa, src_gpa, len);
42 return xpGruCopyError;
23} 43}
24 44
25enum xp_retval 45enum xp_retval
@@ -29,6 +49,7 @@ xp_init_uv(void)
29 49
30 xp_max_npartitions = XP_MAX_NPARTITIONS_UV; 50 xp_max_npartitions = XP_MAX_NPARTITIONS_UV;
31 51
52 xp_pa = xp_pa_uv;
32 xp_remote_memcpy = xp_remote_memcpy_uv; 53 xp_remote_memcpy = xp_remote_memcpy_uv;
33 54
34 return xpSuccess; 55 return xpSuccess;