1/* SPDX-License-Identifier: GPL-2.0 */
2/* cif.S: PROM entry/exit assembler trampolines.
3 *
4 * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 * Copyright (C) 2005, 2006 David S. Miller <davem@davemloft.net>
6 */
7
8#include <asm/pstate.h>
9#include <asm/cpudata.h>
10#include <asm/thread_info.h>
11
12	.text
13	.globl	prom_cif_direct
14prom_cif_direct:
15	save	%sp, -192, %sp
16	sethi	%hi(p1275buf), %o1
17	or	%o1, %lo(p1275buf), %o1
18	ldx	[%o1 + 0x0008], %l2	! prom_cif_handler
19	mov	%g4, %l0
20	mov	%g5, %l1
21	mov	%g6, %l3
22	call	%l2
23	 mov	%i0, %o0		! prom_args
24	mov	%l0, %g4
25	mov	%l1, %g5
26	mov	%l3, %g6
27	ret
28	 restore
29
30	.globl	prom_cif_callback
31prom_cif_callback:
32	sethi	%hi(p1275buf), %o1
33	or	%o1, %lo(p1275buf), %o1
34	save	%sp, -192, %sp
35	TRAP_LOAD_THREAD_REG(%g6, %g1)
36	LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %o0)
37	ldx	[%g6 + TI_TASK], %g4
38	call	prom_world
39	 mov	0, %o0
40	ldx	[%i1 + 0x000], %l2
41	call	%l2
42	 mov	%i0, %o0
43	mov	%o0, %l1
44	call	prom_world
45	 mov	1, %o0
46	ret
47	 restore %l1, 0, %o0
48
49