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