From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550Ab2ECJDL (ORCPT ); Thu, 3 May 2012 05:03:11 -0400 Received: from www.linutronix.de ([62.245.132.108]:49999 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756465Ab2ECJDF (ORCPT ); Thu, 3 May 2012 05:03:05 -0400 Message-Id: <20120503085034.092585287@linutronix.de> User-Agent: quilt/0.48-1 Date: Thu, 03 May 2012 09:02:48 -0000 From: Thomas Gleixner To: LKML Cc: Benjamin Herrenschmidt , Chen Liqin , Chris Metcalf , Chris Zankel , David Howells , "David S. Miller" , Geert Uytterhoeven , Guan Xuetao , Haavard Skinnemoen , Hirokazu Takata , "James E.J. Bottomley" , Jesper Nilsson , Jonas Bonn , Mark Salter , Martin Schwidefsky , Heiko Carstens , Matt Turner , Michal Simek , Mike Frysinger , Paul Mundt , Ralf Baechle , Richard Kuo , Richard Weinberger , Russell King , x86@kernel.org, Yoshinori Sato Subject: [patch V2 04/31] init_task: Create generic init_task instance References: <20120503083859.991965503@linutronix.de> Content-Disposition: inline; filename=init-task-move-common-code-to-core.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All archs define init_task in the same way (except ia64, but there is no particular reason why ia64 cannot use the common version). Create a generic instance so all archs can be converted over. The config switch is temporary and will be removed when all archs are converted over. Signed-off-by: Thomas Gleixner Cc: Benjamin Herrenschmidt Cc: Chen Liqin Cc: Chris Metcalf Cc: Chris Zankel Cc: David Howells Cc: "David S. Miller" Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: Haavard Skinnemoen Cc: Hirokazu Takata Cc: "James E.J. Bottomley" Cc: Jesper Nilsson Cc: Jonas Bonn Cc: Mark Salter Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Matt Turner Cc: Michal Simek Cc: Mike Frysinger Cc: Paul Mundt Cc: Ralf Baechle Cc: Richard Kuo Cc: Richard Weinberger Cc: Russell King Cc: x86@kernel.org Cc: Yoshinori Sato --- arch/Kconfig | 3 +++ init/Makefile | 1 + init/init_task.c | 24 ++++++++++++++++++++++++ kernel/sched/Makefile | 2 -- 4 files changed, 28 insertions(+), 2 deletions(-) Index: tip/arch/Kconfig =================================================================== --- tip.orig/arch/Kconfig +++ tip/arch/Kconfig @@ -148,6 +148,9 @@ config USE_GENERIC_SMP_HELPERS config GENERIC_SMP_IDLE_THREAD bool +config HAVE_GENERIC_INIT_TASK + bool + config HAVE_REGS_AND_STACK_ACCESS_API bool help Index: tip/init/Makefile =================================================================== --- tip.orig/init/Makefile +++ tip/init/Makefile @@ -9,6 +9,7 @@ else obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o endif obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o +obj-$(CONFIG_HAVE_GENERIC_INIT_TASK) += init_task.o mounts-y := do_mounts.o mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o Index: tip/init/init_task.c =================================================================== --- /dev/null +++ tip/init/init_task.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static struct signal_struct init_signals = INIT_SIGNALS(init_signals); +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); + +/* Initial task structure */ +struct task_struct init_task = INIT_TASK(init_task); +EXPORT_SYMBOL(init_task); + +/* + * Initial thread structure. Alignment of this is handled by a special + * linker map entry. + */ +union thread_union init_thread_union __init_task_data = + { INIT_THREAD_INFO(init_task) }; Index: tip/kernel/sched/Makefile =================================================================== --- tip.orig/kernel/sched/Makefile +++ tip/kernel/sched/Makefile @@ -16,5 +16,3 @@ obj-$(CONFIG_SMP) += cpupri.o obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o obj-$(CONFIG_SCHEDSTATS) += stats.o obj-$(CONFIG_SCHED_DEBUG) += debug.o - -