diff options
Diffstat (limited to 'include/asm-powerpc/ppc_asm.h')
-rw-r--r-- | include/asm-powerpc/ppc_asm.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index 4efa71878fa9..6cd52c130332 100644 --- a/include/asm-powerpc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
@@ -103,12 +103,13 @@ | |||
103 | oris rn,rn,name##@h; \ | 103 | oris rn,rn,name##@h; \ |
104 | ori rn,rn,name##@l | 104 | ori rn,rn,name##@l |
105 | 105 | ||
106 | #define LOADBASE(rn,name) \ | 106 | #define LOADBASE(rn,name) \ |
107 | lis rn,name@highest; \ | 107 | .section .toc,"aw"; \ |
108 | ori rn,rn,name@higher; \ | 108 | 1: .tc name[TC],name; \ |
109 | rldicr rn,rn,32,31; \ | 109 | .previous; \ |
110 | oris rn,rn,name@ha | 110 | ld rn,1b@toc(r2) |
111 | 111 | ||
112 | #define OFF(name) 0 | ||
112 | 113 | ||
113 | #define SET_REG_TO_CONST(reg, value) \ | 114 | #define SET_REG_TO_CONST(reg, value) \ |
114 | lis reg,(((value)>>48)&0xFFFF); \ | 115 | lis reg,(((value)>>48)&0xFFFF); \ |
@@ -123,6 +124,23 @@ | |||
123 | rldicr reg,reg,32,31; \ | 124 | rldicr reg,reg,32,31; \ |
124 | oris reg,reg,(label)@h; \ | 125 | oris reg,reg,(label)@h; \ |
125 | ori reg,reg,(label)@l; | 126 | ori reg,reg,(label)@l; |
127 | |||
128 | /* operations for longs and pointers */ | ||
129 | #define LDL ld | ||
130 | #define STL std | ||
131 | #define CMPI cmpdi | ||
132 | |||
133 | #else /* 32-bit */ | ||
134 | #define LOADBASE(rn,name) \ | ||
135 | lis rn,name@ha | ||
136 | |||
137 | #define OFF(name) name@l | ||
138 | |||
139 | /* operations for longs and pointers */ | ||
140 | #define LDL lwz | ||
141 | #define STL stw | ||
142 | #define CMPI cmpwi | ||
143 | |||
126 | #endif | 144 | #endif |
127 | 145 | ||
128 | /* various errata or part fixups */ | 146 | /* various errata or part fixups */ |