diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libhvcall/hvcall.S | 18 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.code | 40 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.in | 11 | ||||
-rw-r--r-- | lib/libhvcall/libhvcall.h | 6 | ||||
-rw-r--r-- | lib/libnativeio/nativeio.code | 25 | ||||
-rw-r--r-- | lib/libnativeio/nativeio.in | 22 |
6 files changed, 120 insertions, 2 deletions
diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S index 5cc0bd7..b36f9cb 100644 --- a/lib/libhvcall/hvcall.S +++ b/lib/libhvcall/hvcall.S @@ -78,6 +78,24 @@ ENTRY(hv_send_logical_lan) HVCALL blr +ENTRY(hv_logical_ci_load) + mr r5,r4 + mr r4,r3 + li r3,H_LOGICAL_CI_LOAD + HVCALL + cmpdi cr0,r3,0 + mr r3,r4 + beqlr + li r3,-1 + blr + +ENTRY(hv_logical_ci_store) + mr r6,r5 + mr r5,r4 + mr r4,r3 + li r3,H_LOGICAL_CI_STORE + blr + .section ".bss" inbuf: .space 16 inlen: .space 4 diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code index 4e47c06..6d4a141 100644 --- a/lib/libhvcall/hvcall.code +++ b/lib/libhvcall/hvcall.code @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2004, 2008 IBM Corporation + * Copyright (c) 2004, 2011 IBM Corporation * All rights reserved. * This program and the accompanying materials * are made available under the terms of the BSD License @@ -49,3 +49,41 @@ PRIM(hv_X2d_send_X2d_crq) unsigned int unit = TOS.u; TOS.n = hv_send_crq(unit, msgaddr); MIRP + + +PRIM(RB_X40) + unsigned long qaddr = TOS.u; + TOS.u = hv_logical_ci_load(1, qaddr); +MIRP +PRIM(RB_X21) + unsigned long qaddr = TOS.u; POP; + unsigned char val = TOS.u; POP; + hv_logical_ci_store(1, qaddr, val); +MIRP +PRIM(RW_X40) + unsigned long qaddr = TOS.u; + TOS.u = hv_logical_ci_load(2, qaddr); +MIRP +PRIM(RW_X21) + unsigned long qaddr = TOS.u; POP; + unsigned short val = TOS.u; POP; + hv_logical_ci_store(2, qaddr, val); +MIRP +PRIM(RL_X40) + unsigned long qaddr = TOS.u; + TOS.u = hv_logical_ci_load(4, qaddr); +MIRP +PRIM(RL_X21) + unsigned long qaddr = TOS.u; POP; + unsigned int val = TOS.u; POP; + hv_logical_ci_store(4, qaddr, val); +MIRP +PRIM(RX_X40) + unsigned long qaddr = TOS.u; + TOS.u = hv_logical_ci_load(8, qaddr); +MIRP +PRIM(RX_X21) + unsigned long qaddr = TOS.u; POP; + unsigned long val = TOS.u; POP; + hv_logical_ci_store(8, qaddr, val); +MIRP diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in index 827aed4..13fa790 100644 --- a/lib/libhvcall/hvcall.in +++ b/lib/libhvcall/hvcall.in @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2004, 2008 IBM Corporation + * Copyright (c) 2004, 2011 IBM Corporation * All rights reserved. * This program and the accompanying materials * are made available under the terms of the BSD License @@ -16,3 +16,12 @@ cod(hv-haschar) cod(hv-reg-crq) cod(hv-free-crq) cod(hv-send-crq) + +cod(RB@) +cod(RB!) +cod(RW@) +cod(RW!) +cod(RL@) +cod(RL!) +cod(RX@) +cod(RX!) diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h index db1d890..ad7088d 100644 --- a/lib/libhvcall/libhvcall.h +++ b/lib/libhvcall/libhvcall.h @@ -3,6 +3,8 @@ #define H_SUCCESS 0 +#define H_LOGICAL_CI_LOAD 0x3c +#define H_LOGICAL_CI_STORE 0x40 #define H_GET_TERM_CHAR 0x54 #define H_PUT_TERM_CHAR 0x58 #define H_REG_CRQ 0xFC @@ -60,6 +62,10 @@ static inline long h_add_logical_lan_buffer(unsigned long unit_address, return hv_generic(H_ADD_LOGICAL_LAN_BUFFER, unit_address, buffer); } +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); + #endif /* __ASSEMBLY__ */ #endif /* __LIBHVCALL_H__ */ diff --git a/lib/libnativeio/nativeio.code b/lib/libnativeio/nativeio.code new file mode 100644 index 0000000..4887b11 --- /dev/null +++ b/lib/libnativeio/nativeio.code @@ -0,0 +1,25 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +/* There are 970 implementations. If we are ever to run native IOs + * on Power7 in hypervisor mode, these will have to change to use + * the new CI-load/store instructions + */ +PRIM(RB_X40) GET_CHAR1; SET_CI; GET_CHAR2; CLR_CI; GET_CHAR3; MIRP +PRIM(RB_X21) PUT_CHAR1; SET_CI; PUT_CHAR2; CLR_CI; MIRP +PRIM(RW_X40) GET_WORD1; SET_CI; GET_WORD2; CLR_CI; GET_WORD3; MIRP +PRIM(RW_X21) PUT_WORD1; SET_CI; PUT_WORD2; CLR_CI; MIRP +PRIM(RL_X40) GET_LONG1; SET_CI; GET_LONG2; CLR_CI; GET_LONG3; MIRP +PRIM(RL_X21) PUT_LONG1; SET_CI; PUT_LONG2; CLR_CI; MIRP +PRIM(RX_X40) GET_XONG1; SET_CI; GET_XONG2; CLR_CI; GET_XONG3; MIRP +PRIM(RX_X21) PUT_XONG1; SET_CI; PUT_XONG2; CLR_CI; MIRP + diff --git a/lib/libnativeio/nativeio.in b/lib/libnativeio/nativeio.in new file mode 100644 index 0000000..f5fb9d9 --- /dev/null +++ b/lib/libnativeio/nativeio.in @@ -0,0 +1,22 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +// I/O accesses. +cod(RB@) +cod(RB!) +cod(RW@) +cod(RW!) +cod(RL@) +cod(RL!) +cod(RX@) +cod(RX!) + |