cif.S 989 B

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