1// SPDX-License-Identifier: GPL-2.0 2/* 3 * This is where we statically allocate and initialize the initial 4 * task. 5 * 6 * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co 7 * David Mosberger-Tang <davidm@hpl.hp.com> 8 */ 9 10#include <linux/init.h> 11#include <linux/mm.h> 12#include <linux/fs.h> 13#include <linux/module.h> 14#include <linux/sched.h> 15#include <linux/init_task.h> 16#include <linux/mqueue.h> 17 18#include <linux/uaccess.h> 19#include <asm/pgtable.h> 20 21static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 22static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 23/* 24 * Initial task structure. 25 * 26 * We need to make sure that this is properly aligned due to the way process stacks are 27 * handled. This is done by having a special ".data..init_task" section... 28 */ 29#define init_thread_info init_task_mem.s.thread_info 30#define init_stack init_task_mem.stack 31 32union { 33 struct { 34 struct task_struct task; 35 struct thread_info thread_info; 36 } s; 37 unsigned long stack[KERNEL_STACK_SIZE/sizeof (unsigned long)]; 38} init_task_mem asm ("init_task") __init_task_data = 39 {{ 40 .task = INIT_TASK(init_task_mem.s.task), 41 .thread_info = INIT_THREAD_INFO(init_task_mem.s.task) 42}}; 43 44EXPORT_SYMBOL(init_task); 45