X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fx86_64%2Fmm%2Fsrat.c;h=8491300ef909ac4dc79af12453950185b9c910f2;hb=4942e998b40b8f6080930ec16442444e9930aee5;hp=19396a261e8d0be749e2e5410d28eab3f983de90;hpb=71efa8fdc55e70ec6687c897a30759f0a2c2ad7e;p=pandora-kernel.git diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 19396a261e8d..8491300ef909 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c @@ -27,7 +27,7 @@ static struct acpi_table_slit *acpi_slit; static nodemask_t nodes_parsed __initdata; static struct bootnode nodes[MAX_NUMNODES] __initdata; -static struct bootnode nodes_add[MAX_NUMNODES] __initdata; +static struct bootnode nodes_add[MAX_NUMNODES]; static int found_add_area __initdata; int hotadd_percent __initdata = 0; @@ -466,3 +466,14 @@ int __node_distance(int a, int b) } EXPORT_SYMBOL(__node_distance); + +int memory_add_physaddr_to_nid(u64 start) +{ + int i, ret = 0; + + for_each_node(i) + if (nodes_add[i].start <= start && nodes_add[i].end > start) + ret = i; + + return ret; +}