mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-25 03:30:27 +07:00
m32r: Fix set_memory() for DISCONTIGMEM
In case CONFIG_DISCONTIGMEM is set, the memory size of system was always determined by CONFIG_MEMORY_SIZE and was not changeable. This patch fixes set_memory() of arch/m32r/mm/discontig.c so that we can specify memory size by the "mem=<size>" kernel parameter. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
This commit is contained in:
parent
bac33bd571
commit
6b6fabce5a
@ -32,6 +32,9 @@ typedef struct {
|
|||||||
} mem_prof_t;
|
} mem_prof_t;
|
||||||
static mem_prof_t mem_prof[MAX_NUMNODES];
|
static mem_prof_t mem_prof[MAX_NUMNODES];
|
||||||
|
|
||||||
|
extern unsigned long memory_start;
|
||||||
|
extern unsigned long memory_end;
|
||||||
|
|
||||||
static void __init mem_prof_init(void)
|
static void __init mem_prof_init(void)
|
||||||
{
|
{
|
||||||
unsigned long start_pfn, holes, free_pfn;
|
unsigned long start_pfn, holes, free_pfn;
|
||||||
@ -42,7 +45,7 @@ static void __init mem_prof_init(void)
|
|||||||
/* Node#0 SDRAM */
|
/* Node#0 SDRAM */
|
||||||
mp = &mem_prof[0];
|
mp = &mem_prof[0];
|
||||||
mp->start_pfn = PFN_UP(CONFIG_MEMORY_START);
|
mp->start_pfn = PFN_UP(CONFIG_MEMORY_START);
|
||||||
mp->pages = PFN_DOWN(CONFIG_MEMORY_SIZE);
|
mp->pages = PFN_DOWN(memory_end - memory_start);
|
||||||
mp->holes = 0;
|
mp->holes = 0;
|
||||||
mp->free_pfn = PFN_UP(__pa(_end));
|
mp->free_pfn = PFN_UP(__pa(_end));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user