Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6205
b: refs/heads/master
c: 38e85dc
h: refs/heads/master
i:
  6203: 52c3f19
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Aug 29, 2005
1 parent 2bacc39 commit 893fa3d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aed31351941aa990fb0865c186565a589c56d3fe
refs/heads/master: 38e85dc18036804ada8698951cfad4e6114fec1b
10 changes: 1 addition & 9 deletions trunk/arch/ppc64/kernel/LparData.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 10 additions & 26 deletions trunk/include/asm-ppc64/abs_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-ppc64/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 893fa3d

Please sign in to comment.