Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96284
b: refs/heads/master
c: 0146ba7
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 8, 2008
1 parent c37ee23 commit b5c436f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 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: 3d83984e99d80672b1d2e3c7dfdd393631883428
refs/heads/master: 0146ba78b9339c27ed12545f9bdc208604354bb3
38 changes: 37 additions & 1 deletion trunk/arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ EXPORT_SYMBOL(memory_start);
unsigned long memory_end = 0;
EXPORT_SYMBOL(memory_end);

static struct resource mem_resources[MAX_NUMNODES];

int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;

static int __init early_parse_mem(char *p)
Expand Down Expand Up @@ -175,6 +177,40 @@ static inline void __init reserve_crashkernel(void)
{}
#endif

void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
unsigned long end_pfn)
{
struct resource *res = &mem_resources[nid];

WARN_ON(res->name); /* max one active range per node for now */

res->name = "System RAM";
res->start = start_pfn << PAGE_SHIFT;
res->end = (end_pfn << PAGE_SHIFT) - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
if (request_resource(&iomem_resource, res)) {
pr_err("unable to request memory_resource 0x%lx 0x%lx\n",
start_pfn, end_pfn);
return;
}

/*
* We don't know which RAM region contains kernel data,
* so we try it repeatedly and let the resource manager
* test it.
*/
request_resource(res, &code_resource);
request_resource(res, &data_resource);
request_resource(res, &bss_resource);

#ifdef CONFIG_KEXEC
if (crashk_res.start != crashk_res.end)
request_resource(res, &crashk_res);
#endif

add_active_range(nid, start_pfn, end_pfn);
}

void __init setup_bootmem_allocator(unsigned long free_pfn)
{
unsigned long bootmap_size;
Expand All @@ -187,7 +223,7 @@ void __init setup_bootmem_allocator(unsigned long free_pfn)
bootmap_size = init_bootmem_node(NODE_DATA(0), free_pfn,
min_low_pfn, max_low_pfn);

add_active_range(0, min_low_pfn, max_low_pfn);
__add_active_range(0, min_low_pfn, max_low_pfn);
register_bootmem_low_pages();

node_set_online(0);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
free_pfn = start_pfn = start >> PAGE_SHIFT;
end_pfn = end >> PAGE_SHIFT;

add_active_range(nid, start_pfn, end_pfn);
__add_active_range(nid, start_pfn, end_pfn);

/* Node-local pgdat */
NODE_DATA(nid) = pfn_to_kaddr(free_pfn);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-sh/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ void __init plat_mem_setup(void);

/* arch/sh/kernel/setup.c */
void __init setup_bootmem_allocator(unsigned long start_pfn);
void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
unsigned long end_pfn);

#endif /* __KERNEL__ */
#endif /* __ASM_SH_MMZONE_H */

0 comments on commit b5c436f

Please sign in to comment.