arm: add ARM-specific memory low-power support

Add ARM-specific memory low-power support and allow
the memory add code to call into platform-specific
code as the memory remove and low-power code does.

Change-Id: Ifb00366d8513092c8f14720980b4232fc8d758c0
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
(cherry picked from commit ae314e9efd9f24f6347342a765f923d560080059)
This commit is contained in:
Larry Bassel
2010-01-22 10:47:13 -08:00
committed by Stephen Boyd
parent 131ab41aec
commit 0088b5dca9

View File

@@ -833,6 +833,46 @@ void free_initmem(void)
}
}
#ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size)
{
struct pglist_data *pgdata = NODE_DATA(nid);
struct zone *zone = pgdata->node_zones + ZONE_MOVABLE;
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
int ret;
ret = __add_pages(nid, zone, start_pfn, nr_pages);
if (ret)
return ret;
return platform_physical_active_pages(start_pfn, nr_pages);
}
int arch_physical_active_memory(u64 start, u64 size)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
return platform_physical_active_pages(start_pfn, nr_pages);
}
int arch_physical_remove_memory(u64 start, u64 size)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
return platform_physical_remove_pages(start_pfn, nr_pages);
}
int arch_physical_low_power_memory(u64 start, u64 size)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
return platform_physical_low_power_pages(start_pfn, nr_pages);
}
#endif
#ifdef CONFIG_BLK_DEV_INITRD
static int keep_initrd;