Sony PlayStation2 Study
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
589 B

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * SBIOS interface for MIPS r5900
  3. *
  4. * Copyright (c) 2014 Juergen Urban
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. .text
  9. .global sbios_call
  10. /*
  11. * extern int sbios_call(int func, void *arg, void *sbiosfunc);
  12. * a0 = func
  13. * a1 = arg
  14. * a2 = sbiosfunc
  15. *
  16. * Calls sbiosfunc with 16 Byte aligned stack and a0 + a1 as
  17. * parameter.
  18. * Returns v0 return value of SBIOS call.
  19. */
  20. sbios_call:
  21. move $t0, $sp
  22. addiu $sp,$sp,-32
  23. # Align stack to 16 Bytes:
  24. li $t1,-16
  25. and $sp,$sp,$t1
  26. sw $ra,28($sp)
  27. sw $t0,24($sp)
  28. move $t9, $a2
  29. jalr $t9
  30. lw $ra,28($sp)
  31. lw $sp,24($sp)
  32. jr $ra