Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22904
b: refs/heads/master
c: d7a5b2f
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Feb 7, 2006
1 parent 1ab30c0 commit 7a61054
Show file tree
Hide file tree
Showing 9 changed files with 19 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: 2fb07d776b3c4473275eb225b6bf2a83755c9bfe
refs/heads/master: d7a5b2ffa1352f0310630934a56aecbdfb617b72
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,6 @@ void __init unflatten_device_tree(void)

/* Allocate memory for the expanded device tree */
mem = lmb_alloc(size + 4, __alignof__(struct device_node));
if (!mem) {
DBG("Couldn't allocate memory with lmb_alloc()!\n");
panic("Couldn't allocate memory with lmb_alloc()!\n");
}
mem = (unsigned long) __va(mem);

((u32 *)mem)[size / 4] = 0xdeadbeef;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/mm/hash_utils_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ void __init htab_initialize(void)
* the absolute address space.
*/
table = lmb_alloc(htab_size_bytes, htab_size_bytes);
BUG_ON(table == 0);

DBG("Hash table allocated at %lx, size: %lx\n", table,
htab_size_bytes);
Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/powerpc/mm/lmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,20 @@ unsigned long __init lmb_alloc(unsigned long size, unsigned long align)

unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
unsigned long max_addr)
{
unsigned long alloc;

alloc = __lmb_alloc_base(size, align, max_addr);

if (alloc < 0)
panic("ERROR: Failed to allocate 0x%lx bytes below 0x%lx.\n",
size, max_addr);

return alloc;
}

unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align,
unsigned long max_addr)
{
long i, j;
unsigned long base = 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ void __init do_init_bootmem(void)
bootmap_pages = bootmem_bootmap_pages(total_pages);

start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE);
BUG_ON(!start);

boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,11 @@ static void __init *careful_allocation(int nid, unsigned long size,
unsigned long end_pfn)
{
int new_nid;
unsigned long ret = lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT);
unsigned long ret = __lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT);

/* retry over all memory */
if (!ret)
ret = lmb_alloc_base(size, align, lmb_end_of_DRAM());
ret = __lmb_alloc_base(size, align, lmb_end_of_DRAM());

if (!ret)
panic("numa.c: cannot allocate %lu bytes on node %d",
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/mm/stab.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ void stabs_alloc(void)

newstab = lmb_alloc_base(HW_PAGE_SIZE, HW_PAGE_SIZE,
1<<SID_SHIFT);
if (! newstab)
panic("Unable to allocate segment table for CPU %d.\n",
cpu);

newstab = (unsigned long)__va(newstab);

memset((void *)newstab, 0, HW_PAGE_SIZE);
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/powerpc/sysdev/dart_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ static int dart_init(struct device_node *dart_node)
* prefetching into invalid pages and corrupting data
*/
tmp = lmb_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
if (!tmp)
panic("DART: Cannot allocate spare page!");
dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) &
DARTMAP_RPNMASK);

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-powerpc/lmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ extern long __init lmb_reserve(unsigned long, unsigned long);
extern unsigned long __init lmb_alloc(unsigned long, unsigned long);
extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long,
unsigned long);
extern unsigned long __init __lmb_alloc_base(unsigned long, unsigned long,
unsigned long);
extern unsigned long __init lmb_phys_mem_size(void);
extern unsigned long __init lmb_end_of_DRAM(void);
extern unsigned long __init lmb_abs_to_phys(unsigned long);
Expand Down

0 comments on commit 7a61054

Please sign in to comment.