Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101701
b: refs/heads/master
c: 316a405
h: refs/heads/master
i:
  101699: 2d5c1a4
v: v3
  • Loading branch information
Becky Bruce authored and Paul Mackerras committed Jun 30, 2008
1 parent b849d9f commit 6807a45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 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: 7c5c4325d2d911fe54db3bc14149bfa558ae0acb
refs/heads/master: 316a405841cc03723d401b098d188aa4e3daa69b
19 changes: 8 additions & 11 deletions trunk/arch/powerpc/mm/ppc_mmu_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ struct hash_pte *Hash, *Hash_end;
unsigned long Hash_size, Hash_mask;
unsigned long _SDR1;

union ubat { /* BAT register values to be loaded */
struct ppc_bat bat;
u32 word[2];
} BATS[8][2]; /* 8 pairs of IBAT, DBAT */
struct ppc_bat BATS[8][2]; /* 8 pairs of IBAT, DBAT */

struct batrange { /* stores address ranges mapped by BATs */
unsigned long start;
Expand Down Expand Up @@ -124,7 +121,7 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
{
unsigned int bl;
int wimgxpp;
union ubat *bat = BATS[index];
struct ppc_bat *bat = BATS[index];

if (((flags & _PAGE_NO_CACHE) == 0) &&
cpu_has_feature(CPU_FTR_NEED_COHERENT))
Expand All @@ -137,15 +134,15 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
wimgxpp = flags & (_PAGE_WRITETHRU | _PAGE_NO_CACHE
| _PAGE_COHERENT | _PAGE_GUARDED);
wimgxpp |= (flags & _PAGE_RW)? BPP_RW: BPP_RX;
bat[1].word[0] = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
bat[1].word[1] = BAT_PHYS_ADDR(phys) | wimgxpp;
bat[1].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */
bat[1].batl = BAT_PHYS_ADDR(phys) | wimgxpp;
#ifndef CONFIG_KGDB /* want user access for breakpoints */
if (flags & _PAGE_USER)
#endif
bat[1].bat.batu.vp = 1;
bat[1].batu |= 1; /* Vp = 1 */
if (flags & _PAGE_GUARDED) {
/* G bit must be zero in IBATs */
bat[0].word[0] = bat[0].word[1] = 0;
bat[0].batu = bat[0].batl = 0;
} else {
/* make IBAT same as DBAT */
bat[0] = bat[1];
Expand All @@ -158,8 +155,8 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys,
| _PAGE_COHERENT);
wimgxpp |= (flags & _PAGE_RW)?
((flags & _PAGE_USER)? PP_RWRW: PP_RWXX): PP_RXRX;
bat->word[0] = virt | wimgxpp | 4; /* Ks=0, Ku=1 */
bat->word[1] = phys | bl | 0x40; /* V=1 */
bat->batu = virt | wimgxpp | 4; /* Ks=0, Ku=1 */
bat->batl = phys | bl | 0x40; /* V=1 */
}

bat_addrs[index].start = virt;
Expand Down
19 changes: 2 additions & 17 deletions trunk/include/asm-powerpc/mmu-hash32.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,8 @@
#endif

struct ppc_bat {
struct {
unsigned long bepi:15; /* Effective page index (virtual address) */
unsigned long :4; /* Unused */
unsigned long bl:11; /* Block size mask */
unsigned long vs:1; /* Supervisor valid */
unsigned long vp:1; /* User valid */
} batu; /* Upper register */
struct {
unsigned long brpn:15; /* Real page index (physical address) */
unsigned long :10; /* Unused */
unsigned long w:1; /* Write-thru cache */
unsigned long i:1; /* Cache inhibit */
unsigned long m:1; /* Memory coherence */
unsigned long g:1; /* Guarded (MBZ in IBAT) */
unsigned long :1; /* Unused */
unsigned long pp:2; /* Page access protections */
} batl; /* Lower register */
u32 batu;
u32 batl;
};
#endif /* !__ASSEMBLY__ */

Expand Down

0 comments on commit 6807a45

Please sign in to comment.