diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-08-30 15:54:54 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2013-10-09 14:07:02 +1100 |
commit | 8fa0ee8b2bf134a8506e6e7345b357e43c4d7e34 (patch) | |
tree | 1d4642ebe223baddb86d0785efaec91d86b28a97 | |
parent | 887e3b2089c3898a9df280feed72a13bcd6b3eaf (diff) | |
download | SLOF-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>
-rw-r--r-- | lib/libhvcall/hvcall.S | 9 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.code | 7 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.in | 1 | ||||
-rw-r--r-- | lib/libhvcall/libhvcall.h | 7 | ||||
-rw-r--r-- | slof/fs/archsupport.fs | 20 | ||||
-rw-r--r-- | slof/fs/root.fs | 1 |
6 files changed, 44 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__ */ diff --git a/slof/fs/archsupport.fs b/slof/fs/archsupport.fs new file mode 100644 index 0000000..4d18c74 --- /dev/null +++ b/slof/fs/archsupport.fs @@ -0,0 +1,20 @@ +4096 VALUE size +: ibm,client-architecture-support ( vec -- err? ) + \ Store require parameters in nvram + \ to come back to right boot device + + \ Allocate memory for H_CALL + size alloc-mem ( vec memaddr ) + swap over + \ FIXME: convert memaddr to phys + size ( memaddr vec memaddr size ) + \ make h_call to hypervisor + hv-cas 0= IF + ." hv-cas succeeded " cr + \ Make required changes + FALSE + ELSE + ." hv-cas failed " TRUE + THEN + >r size free-mem r> +; diff --git a/slof/fs/root.fs b/slof/fs/root.fs index 8154763..1ae28fa 100644 --- a/slof/fs/root.fs +++ b/slof/fs/root.fs @@ -77,6 +77,7 @@ finish-device : open true ; : close ; +#include <archsupport.fs> \ Finish root finish-device |