diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-10-15 12:58:00 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-10-15 12:58:00 -0400 |
commit | b6caf2ad7ce30648b89c1cf40d8f7cf6f4b58033 (patch) | |
tree | 014b9f2c763711a52c21540ea49845d0ab497e01 /arch/powerpc | |
parent | 50436312f47f1fd2bf82c983638fe27ca7e03238 (diff) |
of: merge of_read_number() an of_read_ulong()
Merge common code between Microblaze and PowerPC
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/prom.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 2cfd43288a3e..d8c0525c3139 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -89,26 +89,6 @@ extern int release_OF_resource(struct device_node* node, int index); | |||
89 | * OF address retreival & translation | 89 | * OF address retreival & translation |
90 | */ | 90 | */ |
91 | 91 | ||
92 | |||
93 | /* Helper to read a big number; size is in cells (not bytes) */ | ||
94 | static inline u64 of_read_number(const u32 *cell, int size) | ||
95 | { | ||
96 | u64 r = 0; | ||
97 | while (size--) | ||
98 | r = (r << 32) | *(cell++); | ||
99 | return r; | ||
100 | } | ||
101 | |||
102 | /* Like of_read_number, but we want an unsigned long result */ | ||
103 | #ifdef CONFIG_PPC32 | ||
104 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
105 | { | ||
106 | return cell[size-1]; | ||
107 | } | ||
108 | #else | ||
109 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
110 | #endif | ||
111 | |||
112 | /* Translate an OF address block into a CPU physical address | 92 | /* Translate an OF address block into a CPU physical address |
113 | */ | 93 | */ |
114 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | 94 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); |