Skip to content

Commit f8f9f21

Browse files
FreeFlyingSheeptsbogend
authored andcommitted
MIPS: Fix build error for loongson64 and sgi-ip27
Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error when CONFIG_NUMA=y: mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init': (.init.text+0x1714): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data' Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error: mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init': page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data' Signed-off-by: Feiyang Chen <[email protected]> Reviewed-by: Huacai Chen <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 8931ddd commit f8f9f21

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

arch/mips/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ config MACH_LOONGSON64
513513
select USE_OF
514514
select BUILTIN_DTB
515515
select PCI_HOST_GENERIC
516+
select HAVE_ARCH_NODEDATA_EXTENSION if NUMA
516517
help
517518
This enables the support of Loongson-2/3 family of machines.
518519

@@ -709,6 +710,7 @@ config SGI_IP27
709710
select WAR_R10000_LLSC
710711
select MIPS_L1_CACHE_SHIFT_7
711712
select NUMA
713+
select HAVE_ARCH_NODEDATA_EXTENSION
712714
help
713715
This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
714716
workstations. To compile a Linux kernel that runs on these, say Y
@@ -2708,6 +2710,9 @@ config NUMA
27082710
config SYS_SUPPORTS_NUMA
27092711
bool
27102712

2713+
config HAVE_ARCH_NODEDATA_EXTENSION
2714+
bool
2715+
27112716
config RELOCATABLE
27122717
bool "Relocatable kernel"
27132718
depends on SYS_SUPPORTS_RELOCATABLE

arch/mips/loongson64/numa.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,13 @@ void __init prom_init_numa_memory(void)
197197
prom_meminit();
198198
}
199199
EXPORT_SYMBOL(prom_init_numa_memory);
200+
201+
pg_data_t * __init arch_alloc_nodedata(int nid)
202+
{
203+
return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
204+
}
205+
206+
void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
207+
{
208+
__node_data[nid] = pgdat;
209+
}

arch/mips/sgi-ip27/ip27-memory.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,13 @@ void __init mem_init(void)
422422
memblock_free_all();
423423
setup_zero_pages(); /* This comes from node 0 */
424424
}
425+
426+
pg_data_t * __init arch_alloc_nodedata(int nid)
427+
{
428+
return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
429+
}
430+
431+
void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
432+
{
433+
__node_data[nid] = (struct node_data *)pgdat;
434+
}

0 commit comments

Comments
 (0)