]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ppc64: Remove PTRRELOC() from msChunks code
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 3 Aug 2005 10:21:23 +0000 (20:21 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 29 Aug 2005 00:53:35 +0000 (10:53 +1000)
The msChunks code was written to work on pSeries, but now it's only used on
iSeries. This means there's no need to do PTRRELOC anymore, so remove it all.

A few places were getting "extern reloc_offset()" from abs_addr.h, move it
into system.h instead.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc64/kernel/LparData.c
include/asm-ppc64/abs_addr.h
include/asm-ppc64/system.h

index 3b9a2600fec2432ade6839d75265fff4d1f0208c..0ed77b2f7d5ff3ae414b4465da62845bf0945fc7 100644 (file)
@@ -229,24 +229,16 @@ struct ItVpdAreas itVpdAreas = {
 struct msChunks msChunks;
 EXPORT_SYMBOL(msChunks);
 
-/* Depending on whether this is called from iSeries or pSeries setup
- * code, the location of the msChunks struct may or may not have
- * to be reloc'd, so we force the caller to do that for us by passing
- * in a pointer to the structure.
- */
 unsigned long
 msChunks_alloc(unsigned long mem, unsigned long num_chunks, unsigned long chunk_size)
 {
-       unsigned long offset = reloc_offset();
-       struct msChunks *_msChunks = PTRRELOC(&msChunks);
-
        _msChunks->num_chunks  = num_chunks;
        _msChunks->chunk_size  = chunk_size;
        _msChunks->chunk_shift = __ilog2(chunk_size);
        _msChunks->chunk_mask  = (1UL<<_msChunks->chunk_shift)-1;
 
        mem = _ALIGN(mem, sizeof(msChunks_entry));
-       _msChunks->abs = (msChunks_entry *)(mem + offset);
+       _msChunks->abs = (msChunks_entry *)mem;
        mem += num_chunks * sizeof(msChunks_entry);
 
        return mem;
index 6d4e8e787058e8253a66ee5265270abcd5b92740..93dc63ed4f2f1048dfbdd4f5165d060dcec3f1b3 100644 (file)
@@ -29,46 +29,30 @@ struct msChunks {
 extern struct msChunks msChunks;
 
 extern unsigned long msChunks_alloc(unsigned long, unsigned long, unsigned long);
-extern unsigned long reloc_offset(void);
 
 #ifdef CONFIG_MSCHUNKS
 
-static inline unsigned long
-chunk_to_addr(unsigned long chunk)
+static inline unsigned long chunk_to_addr(unsigned long chunk)
 {
-       unsigned long offset = reloc_offset();
-       struct msChunks *_msChunks = PTRRELOC(&msChunks);
-
-       return chunk << _msChunks->chunk_shift;
+       return chunk << msChunks.chunk_shift;
 }
 
-static inline unsigned long
-addr_to_chunk(unsigned long addr)
+static inline unsigned long addr_to_chunk(unsigned long addr)
 {
-       unsigned long offset = reloc_offset();
-       struct msChunks *_msChunks = PTRRELOC(&msChunks);
-
-       return addr >> _msChunks->chunk_shift;
+       return addr >> msChunks.chunk_shift;
 }
 
-static inline unsigned long
-chunk_offset(unsigned long addr)
+static inline unsigned long chunk_offset(unsigned long addr)
 {
-       unsigned long offset = reloc_offset();
-       struct msChunks *_msChunks = PTRRELOC(&msChunks);
-
-       return addr & _msChunks->chunk_mask;
+       return addr & msChunks.chunk_mask;
 }
 
-static inline unsigned long
-abs_chunk(unsigned long pchunk)
+static inline unsigned long abs_chunk(unsigned long pchunk)
 {
-       unsigned long offset = reloc_offset();
-       struct msChunks *_msChunks = PTRRELOC(&msChunks);
-       if ( pchunk >= _msChunks->num_chunks ) {
+       if (pchunk >= msChunks.num_chunks)
                return pchunk;
-       }
-       return PTRRELOC(_msChunks->abs)[pchunk];
+
+       return msChunks.abs[pchunk];
 }
 
 /* A macro so it can take pointers or unsigned long. */
index 98d120ca8a91dc0be5043d2eedc7f8be082bd826..4104a5dedbaa4d8eecab0a3f912b66c4a5446004 100644 (file)
@@ -302,5 +302,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 
 #define arch_align_stack(x) (x)
 
+extern unsigned long reloc_offset(void);
+
 #endif /* __KERNEL__ */
 #endif