Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Quadword loads and stores
0004  * for use in instruction emulation.
0005  *
0006  * Copyright 2017 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>
0007  */
0008 
0009 #include <asm/processor.h>
0010 #include <asm/ppc_asm.h>
0011 #include <asm/ppc-opcode.h>
0012 #include <asm/reg.h>
0013 #include <asm/asm-offsets.h>
0014 #include <linux/errno.h>
0015 
0016 /* do_lq(unsigned long ea, unsigned long *regs) */
0017 _GLOBAL(do_lq)
0018 1:  lq  r6, 0(r3)
0019     std r6, 0(r4)
0020     std r7, 8(r4)
0021     li  r3, 0
0022     blr
0023 2:  li  r3, -EFAULT
0024     blr
0025     EX_TABLE(1b, 2b)
0026 
0027 /* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */
0028 _GLOBAL(do_stq)
0029 1:  stq r4, 0(r3)
0030     li  r3, 0
0031     blr
0032 2:  li  r3, -EFAULT
0033     blr
0034     EX_TABLE(1b, 2b)
0035 
0036 /* do_lqarx(unsigned long ea, unsigned long *regs) */
0037 _GLOBAL(do_lqarx)
0038 1:  PPC_LQARX(6, 0, 3, 0)
0039     std r6, 0(r4)
0040     std r7, 8(r4)
0041     li  r3, 0
0042     blr
0043 2:  li  r3, -EFAULT
0044     blr
0045     EX_TABLE(1b, 2b)
0046 
0047 /* do_stqcx(unsigned long ea, unsigned long val0, unsigned long val1,
0048         unsigned int *crp) */
0049 
0050 _GLOBAL(do_stqcx)
0051 1:  PPC_STQCX(4, 0, 3)
0052     mfcr    r5
0053     stw r5, 0(r6)
0054     li  r3, 0
0055     blr
0056 2:  li  r3, -EFAULT
0057     blr
0058     EX_TABLE(1b, 2b)