Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67414
b: refs/heads/master
c: 5669c3c
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Oct 3, 2007
1 parent 838006c commit 0d268ba
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 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: 88de3cab98ff6c794b840969427e61605d0cc1ea
refs/heads/master: 5669c3cf19fbadaa9120b59914beec8431277efe
10 changes: 2 additions & 8 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static int default_irq_host_match(struct irq_host *h, struct device_node *np)
return h->of_node != NULL && h->of_node == np;
}

__init_refok struct irq_host *irq_alloc_host(struct device_node *of_node,
struct irq_host *irq_alloc_host(struct device_node *of_node,
unsigned int revmap_type,
unsigned int revmap_arg,
struct irq_host_ops *ops,
Expand All @@ -439,13 +439,7 @@ __init_refok struct irq_host *irq_alloc_host(struct device_node *of_node,
/* Allocate structure and revmap table if using linear mapping */
if (revmap_type == IRQ_HOST_MAP_LINEAR)
size += revmap_arg * sizeof(unsigned int);
if (mem_init_done)
host = kzalloc(size, GFP_KERNEL);
else {
host = alloc_bootmem(size);
if (host)
memset(host, 0, size);
}
host = zalloc_maybe_bootmem(size, GFP_KERNEL);
if (host == NULL)
return NULL;

Expand Down
15 changes: 15 additions & 0 deletions trunk/arch/powerpc/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/bootmem.h>
#include <linux/string.h>

#include <asm/system.h>

Expand All @@ -12,3 +13,17 @@ void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
else
return alloc_bootmem(size);
}

void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
{
void *p;

if (mem_init_done)
p = kzalloc(size, mask);
else {
p = alloc_bootmem(size);
if (p)
memset(p, 0, size);
}
return p;
}
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ extern unsigned long memory_limit;
extern unsigned long klimit;

extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);

extern int powersave_nap; /* set if nap mode can be used in idle loop */

Expand Down

0 comments on commit 0d268ba

Please sign in to comment.