1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _PPC64_PPC_ASM_H
3 #define _PPC64_PPC_ASM_H
6 * Definitions used by various bits of low-level assembly code on PowerPC.
8 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
11 /* Condition Register Bit Fields */
23 /* General Purpose Registers (GPRs) */
60 #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */
61 #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
63 #define MSR_LE 0x0000000000000001
65 #define FIXUP_ENDIAN \
66 tdi 0,0,0x48; /* Reverse endian of b . + 8 */ \
67 b $+44; /* Skip trampoline if endian is good */ \
68 .long 0xa600607d; /* mfmsr r11 */ \
69 .long 0x01006b69; /* xori r11,r11,1 */ \
70 .long 0x00004039; /* li r10,0 */ \
71 .long 0x6401417d; /* mtmsrd r10,1 */ \
72 .long 0x05009f42; /* bcl 20,31,$+4 */ \
73 .long 0xa602487d; /* mflr r10 */ \
74 .long 0x14004a39; /* addi r10,r10,20 */ \
75 .long 0xa6035a7d; /* mtsrr0 r10 */ \
76 .long 0xa6037b7d; /* mtsrr1 r11 */ \
77 .long 0x2400004c /* rfid */
80 #define MFTBL(dest) mftb dest
81 #define MFTBU(dest) mftbu dest
83 #define MFTBL(dest) mfspr dest, SPRN_TBRL
84 #define MFTBU(dest) mfspr dest, SPRN_TBRU
87 #endif /* _PPC64_PPC_ASM_H */