From bc32df00894f0e1dbf583cc3dab210d2969b078a Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 15 Mar 2010 00:35:03 -0400 Subject: memory hotplug: allow setting of phys_device /sys/devices/system/memory/memoryX/phys_device is supposed to contain the number of the physical device that the corresponding piece of memory belongs to. In case a physical device should be replaced or taken offline for whatever reason it is necessary to set all corresponding memory pieces offline. The current implementation always sets phys_device to '0' and there is no way or hook to change that. Seems like there was a plan to implement that but it wasn't finished for whatever reason. So add a weak function which architectures can override to actually set the phys_device from within add_memory_block(). Signed-off-by: Heiko Carstens Cc: Dave Hansen Cc: Gerald Schaefer Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/memory.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/memory.h b/include/linux/memory.h index 1adfe779eb99..85582e1bcee9 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -36,6 +36,8 @@ struct memory_block { struct sys_device sysdev; }; +int arch_get_memory_phys_device(unsigned long start_pfn); + /* These states are exposed to userspace as text strings in sysfs */ #define MEM_ONLINE (1<<0) /* exposed to userspace */ #define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ -- cgit v1.2.3