ppc_asm.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _PPC64_PPC_ASM_H
  2. #define _PPC64_PPC_ASM_H
  3. /*
  4. *
  5. * Definitions used by various bits of low-level assembly code on PowerPC.
  6. *
  7. * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. /* Condition Register Bit Fields */
  15. #define cr0 0
  16. #define cr1 1
  17. #define cr2 2
  18. #define cr3 3
  19. #define cr4 4
  20. #define cr5 5
  21. #define cr6 6
  22. #define cr7 7
  23. /* General Purpose Registers (GPRs) */
  24. #define r0 0
  25. #define r1 1
  26. #define r2 2
  27. #define r3 3
  28. #define r4 4
  29. #define r5 5
  30. #define r6 6
  31. #define r7 7
  32. #define r8 8
  33. #define r9 9
  34. #define r10 10
  35. #define r11 11
  36. #define r12 12
  37. #define r13 13
  38. #define r14 14
  39. #define r15 15
  40. #define r16 16
  41. #define r17 17
  42. #define r18 18
  43. #define r19 19
  44. #define r20 20
  45. #define r21 21
  46. #define r22 22
  47. #define r23 23
  48. #define r24 24
  49. #define r25 25
  50. #define r26 26
  51. #define r27 27
  52. #define r28 28
  53. #define r29 29
  54. #define r30 30
  55. #define r31 31
  56. #define SPRN_TBRL 268
  57. #define SPRN_TBRU 269
  58. #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */
  59. #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
  60. #define MSR_LE 0x0000000000000001
  61. #define FIXUP_ENDIAN \
  62. tdi 0, 0, 0x48; /* Reverse endian of b . + 8 */ \
  63. b $+36; /* Skip trampoline if endian is good */ \
  64. .long 0x05009f42; /* bcl 20,31,$+4 */ \
  65. .long 0xa602487d; /* mflr r10 */ \
  66. .long 0x1c004a39; /* addi r10,r10,28 */ \
  67. .long 0xa600607d; /* mfmsr r11 */ \
  68. .long 0x01006b69; /* xori r11,r11,1 */ \
  69. .long 0xa6035a7d; /* mtsrr0 r10 */ \
  70. .long 0xa6037b7d; /* mtsrr1 r11 */ \
  71. .long 0x2400004c /* rfid */
  72. #endif /* _PPC64_PPC_ASM_H */