cif.S 947 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. save %sp, -192, %sp
  13. sethi %hi(p1275buf), %o1
  14. or %o1, %lo(p1275buf), %o1
  15. ldx [%o1 + 0x0008], %l2 ! prom_cif_handler
  16. mov %g4, %l0
  17. mov %g5, %l1
  18. mov %g6, %l3
  19. call %l2
  20. mov %i0, %o0 ! prom_args
  21. mov %l0, %g4
  22. mov %l1, %g5
  23. mov %l3, %g6
  24. ret
  25. restore
  26. .globl prom_cif_callback
  27. prom_cif_callback:
  28. sethi %hi(p1275buf), %o1
  29. or %o1, %lo(p1275buf), %o1
  30. save %sp, -192, %sp
  31. TRAP_LOAD_THREAD_REG(%g6, %g1)
  32. LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %o0)
  33. ldx [%g6 + TI_TASK], %g4
  34. call prom_world
  35. mov 0, %o0
  36. ldx [%i1 + 0x000], %l2
  37. call %l2
  38. mov %i0, %o0
  39. mov %o0, %l1
  40. call prom_world
  41. mov 1, %o0
  42. ret
  43. restore %l1, 0, %o0