From 8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34 Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Fri, 30 Aug 2013 15:54:54 +0530 Subject: Add ibm,client-architecture-support method Signed-off-by: Nikunj A Dadhania --- lib/libhvcall/hvcall.S | 9 +++++++++ lib/libhvcall/hvcall.code | 7 +++++++ lib/libhvcall/hvcall.in | 1 + lib/libhvcall/libhvcall.h | 7 ++++++- 4 files changed, 23 insertions(+), 1 deletion(-) (limited to 'lib/libhvcall') 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__ */ -- cgit v1.1