Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0500871f authored by David Howells's avatar David Howells
Browse files

Construct init thread stack in the linker script rather than by union



Construct the init thread stack in the linker script rather than doing it
by means of a union so that ia64's init_task.c can be got rid of.

The following symbols are then made available from INIT_TASK_DATA() linker
script macro:

	init_thread_union
	init_stack

INIT_TASK_DATA() also expands the region to THREAD_SIZE to accommodate the
size of the init stack.  init_thread_union is given its own section so that
it can be placed into the stack space in the right order.  I'm assuming
that the ia64 ordering is correct and that the task_struct is first and the
thread_info second.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-by: default avatarTony Luck <tony.luck@intel.com>
Tested-by: Will Deacon <will.deacon@arm.com> (arm64)
Tested-by: default avatarPalmer Dabbelt <palmer@sifive.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 13810193
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -234,8 +234,8 @@ config ARCH_HAS_FORTIFY_SOURCE
config ARCH_HAS_SET_MEMORY
	bool

# Select if arch init_task initializer is different to init/init_task.c
config ARCH_INIT_TASK
# Select if arch init_task must go in the __init_task_data section
config ARCH_TASK_STRUCT_ON_STACK
       bool

# Select if arch has its private alloc_task_struct() function
+0 −3
Original line number Diff line number Diff line
@@ -39,9 +39,6 @@ struct thread_info {
	.preempt_count	= INIT_PREEMPT_COUNT,	\
}

#define init_thread_info	(init_thread_union.thread_info)
#define init_stack		(init_thread_union.stack)

/* How to get the thread information struct from C.  */
register struct thread_info *__current_thread_info __asm__("$8");
#define current_thread_info()  __current_thread_info
+0 −3
Original line number Diff line number Diff line
@@ -62,9 +62,6 @@ struct thread_info {
	.addr_limit = KERNEL_DS,		\
}

#define init_thread_info    (init_thread_union.thread_info)
#define init_stack          (init_thread_union.stack)

static inline __attribute_const__ struct thread_info *current_thread_info(void)
{
	register unsigned long sp asm("sp");
+0 −3
Original line number Diff line number Diff line
@@ -75,9 +75,6 @@ struct thread_info {
	.addr_limit	= KERNEL_DS,					\
}

#define init_thread_info	(init_thread_union.thread_info)
#define init_stack		(init_thread_union.stack)

/*
 * how to get the current stack pointer in C
 */
+0 −2
Original line number Diff line number Diff line
@@ -51,8 +51,6 @@ struct thread_info {
	.addr_limit	= KERNEL_DS,					\
}

#define init_stack		(init_thread_union.stack)

#define thread_saved_pc(tsk)	\
	((unsigned long)(tsk->thread.cpu_context.pc))
#define thread_saved_sp(tsk)	\
Loading