Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91556
b: refs/heads/master
c: d7917ba
h: refs/heads/master
v: v3
  • Loading branch information
Kumar Gala authored and Paul Mackerras committed Apr 16, 2008
1 parent 9b98552 commit 9910e33
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 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: 99c62dd773797b68f3b1ca6bb3274725d1852fa2
refs/heads/master: d7917ba7051e3fd12ebe2d5a09b29fb3a2b38190
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/44x_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ unsigned long __init mmu_mapin_ram(void)

/* Pin in enough TLBs to cover any lowmem not covered by the
* initial 256M mapping established in head_44x.S */
for (addr = PPC_PIN_SIZE; addr < total_lowmem;
for (addr = PPC_PIN_SIZE; addr < lowmem_end_addr;
addr += PPC_PIN_SIZE)
ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);

Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void __init MMU_init(void)
}

total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr;
lowmem_end_addr = memstart_addr + total_lowmem;

#ifdef CONFIG_FSL_BOOKE
/* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
Expand All @@ -156,9 +157,10 @@ void __init MMU_init(void)

if (total_lowmem > __max_low_memory) {
total_lowmem = __max_low_memory;
lowmem_end_addr = memstart_addr + total_lowmem;
#ifndef CONFIG_HIGHMEM
total_memory = total_lowmem;
lmb_enforce_memory_limit(total_lowmem);
lmb_enforce_memory_limit(lowmem_end_addr);
lmb_analyze();
#endif /* CONFIG_HIGHMEM */
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
/* max amount of RAM to use */
unsigned long __max_memory;

phys_addr_t memstart_addr;

void free_initmem(void)
{
unsigned long addr;
Expand Down
16 changes: 9 additions & 7 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ void __init do_init_bootmem(void)
unsigned long total_pages;
int boot_mapsize;

max_pfn = total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT;
max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT;
#ifdef CONFIG_HIGHMEM
total_pages = total_lowmem >> PAGE_SHIFT;
max_low_pfn = lowmem_end_addr >> PAGE_SHIFT;
#endif

/*
Expand All @@ -244,18 +246,18 @@ void __init do_init_bootmem(void)
* present.
*/
#ifdef CONFIG_HIGHMEM
free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
free_bootmem_with_active_regions(0, lowmem_end_addr >> PAGE_SHIFT);

/* reserve the sections we're already using */
for (i = 0; i < lmb.reserved.cnt; i++) {
unsigned long addr = lmb.reserved.region[i].base +
lmb_size_bytes(&lmb.reserved, i) - 1;
if (addr < total_lowmem)
if (addr < lowmem_end_addr)
reserve_bootmem(lmb.reserved.region[i].base,
lmb_size_bytes(&lmb.reserved, i),
BOOTMEM_DEFAULT);
else if (lmb.reserved.region[i].base < total_lowmem) {
unsigned long adjusted_size = total_lowmem -
else if (lmb.reserved.region[i].base < lowmem_end_addr) {
unsigned long adjusted_size = lowmem_end_addr -
lmb.reserved.region[i].base;
reserve_bootmem(lmb.reserved.region[i].base,
adjusted_size, BOOTMEM_DEFAULT);
Expand Down Expand Up @@ -325,7 +327,7 @@ void __init paging_init(void)
(top_of_ram - total_ram) >> 20);
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
#ifdef CONFIG_HIGHMEM
max_zone_pfns[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT;
#else
max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
Expand Down Expand Up @@ -380,7 +382,7 @@ void __init mem_init(void)
{
unsigned long pfn, highmem_mapnr;

highmem_mapnr = total_lowmem >> PAGE_SHIFT;
highmem_mapnr = lowmem_end_addr >> PAGE_SHIFT;
for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
struct page *page = pfn_to_page(pfn);
if (lmb_is_reserved(pfn << PAGE_SHIFT))
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/mm/mmu_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extern unsigned long __initial_memory_limit;
extern unsigned long total_memory;
extern unsigned long total_lowmem;
extern phys_addr_t memstart_addr;
extern phys_addr_t lowmem_end_addr;

/* ...and now those things that may be slightly different between processor
* architectures. -- Dan
Expand Down

0 comments on commit 9910e33

Please sign in to comment.