diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-08-03 06:21:23 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:35 -0400 |
commit | 34c8f6961fc601294a38c5bd5ca12131b2e52674 (patch) | |
tree | 98035e5581a0addfca935fa2d8afddfc7c56c631 /include/asm-ppc64/abs_addr.h | |
parent | 38e85dc18036804ada8698951cfad4e6114fec1b (diff) |
[PATCH] ppc64: msChunks cleanups
Chunks are 256KB, so use constants for the size/shift/mask, rather than
getting them from the msChunks struct. The iSeries debugger (??) might still
need access to the values in the msChunks struct, so we keep them around
for now, but set them from the constant values.
Replace msChunks_entry typedef with regular u32.
Simplify msChunks_alloc() to manipulate klimit directly, rather than via
a parameter.
Move msChunks_alloc() and msChunks into iSeries_setup.c, as that's where
they're used.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
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) |