diff options
Diffstat (limited to 'include/asm-ppc64/abs_addr.h')
-rw-r--r-- | include/asm-ppc64/abs_addr.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/asm-ppc64/abs_addr.h b/include/asm-ppc64/abs_addr.h index 93dc63ed4f2f..2276567f133a 100644 --- a/include/asm-ppc64/abs_addr.h +++ b/include/asm-ppc64/abs_addr.h | |||
@@ -17,34 +17,37 @@ | |||
17 | #include <asm/prom.h> | 17 | #include <asm/prom.h> |
18 | #include <asm/lmb.h> | 18 | #include <asm/lmb.h> |
19 | 19 | ||
20 | typedef u32 msChunks_entry; | ||
21 | struct msChunks { | 20 | struct msChunks { |
22 | unsigned long num_chunks; | 21 | unsigned long num_chunks; |
23 | unsigned long chunk_size; | 22 | unsigned long chunk_size; |
24 | unsigned long chunk_shift; | 23 | unsigned long chunk_shift; |
25 | unsigned long chunk_mask; | 24 | unsigned long chunk_mask; |
26 | msChunks_entry *abs; | 25 | u32 *abs; |
27 | }; | 26 | }; |
28 | 27 | ||
29 | extern struct msChunks msChunks; | 28 | extern struct msChunks msChunks; |
30 | 29 | ||
31 | extern unsigned long msChunks_alloc(unsigned long, unsigned long, unsigned long); | ||
32 | 30 | ||
33 | #ifdef CONFIG_MSCHUNKS | 31 | #ifdef CONFIG_MSCHUNKS |
34 | 32 | ||
33 | /* Chunks are 256 KB */ | ||
34 | #define MSCHUNKS_CHUNK_SHIFT (18) | ||
35 | #define MSCHUNKS_CHUNK_SIZE (1UL << MSCHUNKS_CHUNK_SHIFT) | ||
36 | #define MSCHUNKS_OFFSET_MASK (MSCHUNKS_CHUNK_SIZE - 1) | ||
37 | |||
35 | static inline unsigned long chunk_to_addr(unsigned long chunk) | 38 | static inline unsigned long chunk_to_addr(unsigned long chunk) |
36 | { | 39 | { |
37 | return chunk << msChunks.chunk_shift; | 40 | return chunk << MSCHUNKS_CHUNK_SHIFT; |
38 | } | 41 | } |
39 | 42 | ||
40 | static inline unsigned long addr_to_chunk(unsigned long addr) | 43 | static inline unsigned long addr_to_chunk(unsigned long addr) |
41 | { | 44 | { |
42 | return addr >> msChunks.chunk_shift; | 45 | return addr >> MSCHUNKS_CHUNK_SHIFT; |
43 | } | 46 | } |
44 | 47 | ||
45 | static inline unsigned long chunk_offset(unsigned long addr) | 48 | static inline unsigned long chunk_offset(unsigned long addr) |
46 | { | 49 | { |
47 | return addr & msChunks.chunk_mask; | 50 | return addr & MSCHUNKS_OFFSET_MASK; |
48 | } | 51 | } |
49 | 52 | ||
50 | static inline unsigned long abs_chunk(unsigned long pchunk) | 53 | static inline unsigned long abs_chunk(unsigned long pchunk) |