Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6208
b: refs/heads/master
c: ce21795
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Aug 29, 2005
1 parent afe06d6 commit 7c42d95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 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: 56e97b71bf55edb69dc8e9715553972ce50b1564
refs/heads/master: ce21795275ab469b97384faa36462350af17eca0
21 changes: 7 additions & 14 deletions trunk/include/asm-ppc64/abs_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,17 @@ static inline unsigned long addr_to_chunk(unsigned long addr)
return addr >> MSCHUNKS_CHUNK_SHIFT;
}

static inline unsigned long chunk_offset(unsigned long addr)
static inline unsigned long phys_to_abs(unsigned long pa)
{
return addr & MSCHUNKS_OFFSET_MASK;
}
unsigned long chunk;

static inline unsigned long abs_chunk(unsigned long pchunk)
{
if (pchunk >= mschunks_map.num_chunks)
return pchunk;
chunk = addr_to_chunk(pa);

return mschunks_map.mapping[pchunk];
}
if (chunk < mschunks_map.num_chunks)
chunk = mschunks_map.mapping[chunk];

/* A macro so it can take pointers or unsigned long. */
#define phys_to_abs(pa) \
({ unsigned long _pa = (unsigned long)(pa); \
chunk_to_addr(abs_chunk(addr_to_chunk(_pa))) + chunk_offset(_pa); \
})
return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK);
}

static inline unsigned long
physRpn_to_absRpn(unsigned long rpn)
Expand Down

0 comments on commit 7c42d95

Please sign in to comment.