diff options
Diffstat (limited to 'include/asm-powerpc/prom.h')
-rw-r--r-- | include/asm-powerpc/prom.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index c15e66a2e681..524629769336 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -197,7 +197,7 @@ extern int release_OF_resource(struct device_node* node, int index); | |||
197 | */ | 197 | */ |
198 | 198 | ||
199 | 199 | ||
200 | /* Helper to read a big number */ | 200 | /* Helper to read a big number; size is in cells (not bytes) */ |
201 | static inline u64 of_read_number(const u32 *cell, int size) | 201 | static inline u64 of_read_number(const u32 *cell, int size) |
202 | { | 202 | { |
203 | u64 r = 0; | 203 | u64 r = 0; |
@@ -206,6 +206,16 @@ static inline u64 of_read_number(const u32 *cell, int size) | |||
206 | return r; | 206 | return r; |
207 | } | 207 | } |
208 | 208 | ||
209 | /* Like of_read_number, but we want an unsigned long result */ | ||
210 | #ifdef CONFIG_PPC32 | ||
211 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
212 | { | ||
213 | return cell[size-1]; | ||
214 | } | ||
215 | #else | ||
216 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
217 | #endif | ||
218 | |||
209 | /* Translate an OF address block into a CPU physical address | 219 | /* Translate an OF address block into a CPU physical address |
210 | */ | 220 | */ |
211 | #define OF_BAD_ADDR ((u64)-1) | 221 | #define OF_BAD_ADDR ((u64)-1) |