xref: /linux/arch/powerpc/lib/quad.S (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*2874c5fdSThomas Gleixner/* SPDX-License-Identifier: GPL-2.0-or-later */
2350779a2SPaul Mackerras/*
3350779a2SPaul Mackerras * Quadword loads and stores
4350779a2SPaul Mackerras * for use in instruction emulation.
5350779a2SPaul Mackerras *
6350779a2SPaul Mackerras * Copyright 2017 Paul Mackerras, IBM Corp. <paulus@au1.ibm.com>
7350779a2SPaul Mackerras */
8350779a2SPaul Mackerras
9350779a2SPaul Mackerras#include <asm/processor.h>
10350779a2SPaul Mackerras#include <asm/ppc_asm.h>
11350779a2SPaul Mackerras#include <asm/ppc-opcode.h>
12350779a2SPaul Mackerras#include <asm/reg.h>
13350779a2SPaul Mackerras#include <asm/asm-offsets.h>
14350779a2SPaul Mackerras#include <linux/errno.h>
15350779a2SPaul Mackerras
16350779a2SPaul Mackerras/* do_lq(unsigned long ea, unsigned long *regs) */
17350779a2SPaul Mackerras_GLOBAL(do_lq)
18350779a2SPaul Mackerras1:	lq	r6, 0(r3)
19350779a2SPaul Mackerras	std	r6, 0(r4)
20350779a2SPaul Mackerras	std	r7, 8(r4)
21350779a2SPaul Mackerras	li	r3, 0
22350779a2SPaul Mackerras	blr
23350779a2SPaul Mackerras2:	li	r3, -EFAULT
24350779a2SPaul Mackerras	blr
25350779a2SPaul Mackerras	EX_TABLE(1b, 2b)
26350779a2SPaul Mackerras
27350779a2SPaul Mackerras/* do_stq(unsigned long ea, unsigned long val0, unsigned long val1) */
28350779a2SPaul Mackerras_GLOBAL(do_stq)
29350779a2SPaul Mackerras1:	stq	r4, 0(r3)
30350779a2SPaul Mackerras	li	r3, 0
31350779a2SPaul Mackerras	blr
32350779a2SPaul Mackerras2:	li	r3, -EFAULT
33350779a2SPaul Mackerras	blr
34350779a2SPaul Mackerras	EX_TABLE(1b, 2b)
35350779a2SPaul Mackerras
36350779a2SPaul Mackerras/* do_lqarx(unsigned long ea, unsigned long *regs) */
37350779a2SPaul Mackerras_GLOBAL(do_lqarx)
38350779a2SPaul Mackerras1:	PPC_LQARX(6, 0, 3, 0)
39350779a2SPaul Mackerras	std	r6, 0(r4)
40350779a2SPaul Mackerras	std	r7, 8(r4)
41350779a2SPaul Mackerras	li	r3, 0
42350779a2SPaul Mackerras	blr
43350779a2SPaul Mackerras2:	li	r3, -EFAULT
44350779a2SPaul Mackerras	blr
45350779a2SPaul Mackerras	EX_TABLE(1b, 2b)
46350779a2SPaul Mackerras
47350779a2SPaul Mackerras/* do_stqcx(unsigned long ea, unsigned long val0, unsigned long val1,
48350779a2SPaul Mackerras	    unsigned int *crp) */
49350779a2SPaul Mackerras
50350779a2SPaul Mackerras_GLOBAL(do_stqcx)
51350779a2SPaul Mackerras1:	PPC_STQCX(4, 0, 3)
52350779a2SPaul Mackerras	mfcr	r5
53350779a2SPaul Mackerras	stw	r5, 0(r6)
54350779a2SPaul Mackerras	li	r3, 0
55350779a2SPaul Mackerras	blr
56350779a2SPaul Mackerras2:	li	r3, -EFAULT
57350779a2SPaul Mackerras	blr
58350779a2SPaul Mackerras	EX_TABLE(1b, 2b)
59