blob: 5f27ad779c0c578097218e44b005eaed770acf7d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* cif.S: PROM entry/exit assembler trampolines.
2 *
David S. Miller45fec052006-02-05 22:27:28 -08003 * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
4 * Copyright (C) 2005, 2006 David S. Miller <davem@davemloft.net>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
7#include <asm/pstate.h>
David S. Miller45fec052006-02-05 22:27:28 -08008#include <asm/cpudata.h>
9#include <asm/thread_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11 .text
12 .globl prom_cif_interface
13prom_cif_interface:
14 sethi %hi(p1275buf), %o0
15 or %o0, %lo(p1275buf), %o0
16 ldx [%o0 + 0x010], %o1 ! prom_cif_stack
David S. Miller45fec052006-02-05 22:27:28 -080017 save %o1, -192, %sp
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 ldx [%i0 + 0x008], %l2 ! prom_cif_handler
David S. Miller45fec052006-02-05 22:27:28 -080019 mov %g4, %l0
20 mov %g5, %l1
21 mov %g6, %l3
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 call %l2
23 add %i0, 0x018, %o0 ! prom_args
David S. Miller45fec052006-02-05 22:27:28 -080024 mov %l0, %g4
25 mov %l1, %g5
26 mov %l3, %g6
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 ret
28 restore
29
30 .globl prom_cif_callback
31prom_cif_callback:
32 sethi %hi(p1275buf), %o1
33 or %o1, %lo(p1275buf), %o1
David S. Miller45fec052006-02-05 22:27:28 -080034 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 call prom_world
David S. Miller45fec052006-02-05 22:27:28 -080039 mov 0, %o0
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 ldx [%i1 + 0x000], %l2
41 call %l2
42 mov %i0, %o0
43 mov %o0, %l1
44 call prom_world
David S. Miller45fec052006-02-05 22:27:28 -080045 mov 1, %o0
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 ret
47 restore %l1, 0, %o0
48