aboutsummaryrefslogtreecommitdiff
path: root/lib/libhvcall
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-08-30 15:54:54 +0530
committerAlexey Kardashevskiy <aik@ozlabs.ru>2013-10-09 14:07:02 +1100
commit8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34 (patch)
tree1d4642ebe223baddb86d0785efaec91d86b28a97 /lib/libhvcall
parent887e3b2089c3898a9df280feed72a13bcd6b3eaf (diff)
downloadSLOF-8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34.zip
SLOF-8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34.tar.gz
SLOF-8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34.tar.bz2
Add ibm,client-architecture-support method
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'lib/libhvcall')
-rw-r--r--lib/libhvcall/hvcall.S9
-rw-r--r--lib/libhvcall/hvcall.code7
-rw-r--r--lib/libhvcall/hvcall.in1
-rw-r--r--lib/libhvcall/libhvcall.h7
4 files changed, 23 insertions, 1 deletions
diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S
index 326e2ed..2444953 100644
--- a/lib/libhvcall/hvcall.S
+++ b/lib/libhvcall/hvcall.S
@@ -110,6 +110,15 @@ ENTRY(hv_logical_memop)
HVCALL
blr
+ENTRY(hv_cas)
+ mr r6,r5
+ mr r5,r4
+ mr r4,r3
+ lis r3,KVMPPC_H_CAS@h
+ ori r3,r3,KVMPPC_H_CAS@l
+ HVCALL
+ blr
+
.section ".bss"
inbuf: .space 16
inlen: .space 4
diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
index de51943..9bd47c6 100644
--- a/lib/libhvcall/hvcall.code
+++ b/lib/libhvcall/hvcall.code
@@ -103,3 +103,10 @@ PRIM(hv_X2d_logical_X2d_memop)
unsigned long dst = TOS.u;
TOS.u = hv_logical_memop(dst, src, esize, count, op);
MIRP
+
+PRIM(hv_X2d_cas)
+ unsigned long size = TOS.u; POP;
+ unsigned long buf = TOS.u; POP;
+ unsigned long vec = TOS.u;
+ TOS.u = hv_cas(vec, buf, size);
+MIRP
diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in
index 151654e..9c8d6aa 100644
--- a/lib/libhvcall/hvcall.in
+++ b/lib/libhvcall/hvcall.in
@@ -28,3 +28,4 @@ cod(RX@)
cod(RX!)
cod(hv-logical-memop)
+cod(hv-cas)
diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
index 6e418ba..de54313 100644
--- a/lib/libhvcall/libhvcall.h
+++ b/lib/libhvcall/libhvcall.h
@@ -21,7 +21,9 @@
#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
+/* Client Architecture support */
+#define KVMPPC_H_CAS (KVMPPC_HCALL_BASE + 0x2)
+#define KVMPPC_HCALL_MAX KVMPPC_H_CAS
#ifndef __ASSEMBLY__
@@ -92,6 +94,9 @@ extern unsigned long hv_logical_memop(unsigned long dst, unsigned long src,
unsigned long esize, unsigned long count,
unsigned long op);
+extern unsigned long hv_cas(unsigned long vec, unsigned long buf,
+ unsigned long size);
+
#endif /* __ASSEMBLY__ */
#endif /* __LIBHVCALL_H__ */