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