aboutsummaryrefslogtreecommitdiff
path: root/lib/libhvcall
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libhvcall')
-rw-r--r--lib/libhvcall/hvcall.S11
-rw-r--r--lib/libhvcall/hvcall.code8
-rw-r--r--lib/libhvcall/hvcall.in2
-rw-r--r--lib/libhvcall/libhvcall.h10
4 files changed, 31 insertions, 0 deletions
diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S
index e28dbeb..326e2ed 100644
--- a/lib/libhvcall/hvcall.S
+++ b/lib/libhvcall/hvcall.S
@@ -99,6 +99,17 @@ ENTRY(hv_logical_ci_store)
HVCALL
blr
+ENTRY(hv_logical_memop)
+ mr r8,r7
+ mr r7,r6
+ mr r6,r5
+ mr r5,r4
+ mr r4,r3
+ lis r3,KVMPPC_H_LOGICAL_MEMOP@h
+ ori r3,r3,KVMPPC_H_LOGICAL_MEMOP@l
+ HVCALL
+ blr
+
.section ".bss"
inbuf: .space 16
inlen: .space 4
diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
index ebaaac8..de51943 100644
--- a/lib/libhvcall/hvcall.code
+++ b/lib/libhvcall/hvcall.code
@@ -95,3 +95,11 @@ PRIM(RX_X21)
hv_logical_ci_store(8, qaddr, val);
MIRP
+PRIM(hv_X2d_logical_X2d_memop)
+ unsigned long op = TOS.u; POP;
+ unsigned long count = TOS.u; POP;
+ unsigned long esize = TOS.u; POP;
+ unsigned long src = TOS.u; POP;
+ unsigned long dst = TOS.u;
+ TOS.u = hv_logical_memop(dst, src, esize, count, op);
+MIRP
diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in
index abbb2c8..151654e 100644
--- a/lib/libhvcall/hvcall.in
+++ b/lib/libhvcall/hvcall.in
@@ -26,3 +26,5 @@ cod(RL@)
cod(RL!)
cod(RX@)
cod(RX!)
+
+cod(hv-logical-memop)
diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
index 4b7f069..302e2a3 100644
--- a/lib/libhvcall/libhvcall.h
+++ b/lib/libhvcall/libhvcall.h
@@ -17,6 +17,12 @@
#define H_ADD_LOGICAL_LAN_BUFFER 0x11C
#define H_SEND_LOGICAL_LAN 0x120
+/* KVM specific ones */
+#define KVMPPC_HCALL_BASE 0xf000
+#define KVMPPC_H_RTAS (KVMPPC_HCALL_BASE + 0x0)
+#define KVMPPC_H_LOGICAL_MEMOP (KVMPPC_HCALL_BASE + 0x1)
+#define KVMPPC_HCALL_MAX KVMPPC_H_LOGICAL_MEMOP
+
#ifndef __ASSEMBLY__
extern long hv_generic(unsigned long opcode, ...);
@@ -68,6 +74,10 @@ extern unsigned long hv_logical_ci_load(unsigned long size, unsigned long addr);
extern unsigned long hv_logical_ci_store(unsigned long size, unsigned long addr,
unsigned long value);
+extern unsigned long hv_logical_memop(unsigned long dst, unsigned long src,
+ unsigned long esize, unsigned long count,
+ unsigned long op);
+
#endif /* __ASSEMBLY__ */
#endif /* __LIBHVCALL_H__ */