1 #ifndef _PPC64_PPC_ASM_H
2 #define _PPC64_PPC_ASM_H
5 * Definitions used by various bits of low-level assembly code on PowerPC.
7 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
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.
15 /* Condition Register Bit Fields */
27 /* General Purpose Registers (GPRs) */
64 #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */
65 #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
67 #define MSR_LE 0x0000000000000001
69 #define FIXUP_ENDIAN \
70 tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
71 b $+44; /* Skip trampoline if endian is good */ \
72 .long 0xa600607d; /* mfmsr r11 */ \
73 .long 0x01006b69; /* xori r11,r11,1 */ \
74 .long 0x00004039; /* li r10,0 */ \
75 .long 0x6401417d; /* mtmsrd r10,1 */ \
76 .long 0x05009f42; /* bcl 20,31,$+4 */ \
77 .long 0xa602487d; /* mflr r10 */ \
78 .long 0x14004a39; /* addi r10,r10,20 */ \
79 .long 0xa6035a7d; /* mtsrr0 r10 */ \
80 .long 0xa6037b7d; /* mtsrr1 r11 */ \
81 .long 0x2400004c /* rfid */
84 #define MFTBL(dest) mftb dest
85 #define MFTBU(dest) mftbu dest
87 #define MFTBL(dest) mfspr dest, SPRN_TBRL
88 #define MFTBU(dest) mfspr dest, SPRN_TBRU
91 #endif /* _PPC64_PPC_ASM_H */