summaryrefslogtreecommitdiff
path: root/drivers/misc/sgi-xp/xp_uv.c
diff options
context:
space:
mode:
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 @@
*
*/
+#include <linux/device.h>
+#include <asm/uv/uv_hub.h>
+#include "../sgi-gru/grukservices.h"
#include "xp.h"
+/*
+ * Convert a virtual memory address to a physical memory address.
+ */
+static unsigned long
+xp_pa_uv(void *addr)
+{
+ return uv_gpa(addr);
+}
+
static enum xp_retval
-xp_remote_memcpy_uv(void *vdst, const void *psrc, size_t len)
+xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa,
+ size_t len)
{
- /* !!! this function needs fleshing out */
- return xpUnsupported;
+ int ret;
+
+ ret = gru_copy_gpa(dst_gpa, src_gpa, len);
+ if (ret == 0)
+ return xpSuccess;
+
+ dev_err(xp, "gru_copy_gpa() failed, dst_gpa=0x%016lx src_gpa=0x%016lx "
+ "len=%ld\n", dst_gpa, src_gpa, len);
+ return xpGruCopyError;
}
enum xp_retval
@@ -29,6 +49,7 @@ xp_init_uv(void)
xp_max_npartitions = XP_MAX_NPARTITIONS_UV;
+ xp_pa = xp_pa_uv;
xp_remote_memcpy = xp_remote_memcpy_uv;
return xpSuccess;