blob: fa90db964b28733ccd9c97ac688fa170aa7d4022 [file] [log] [blame]
Jeff Dikec14b8492007-05-10 22:22:34 -07001/*
2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,intel.linux}.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Licensed under the GPL
4 */
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include "linux/mm.h"
Alexey Dobriyan4e950f62007-07-30 02:36:13 +04007#include "linux/fs.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include "linux/module.h"
9#include "linux/sched.h"
10#include "linux/init_task.h"
11#include "linux/mqueue.h"
12#include "asm/uaccess.h"
13#include "asm/pgtable.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include "mem_user.h"
Jeff Dike0f80bc82005-09-16 19:27:50 -070015#include "os.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17static struct fs_struct init_fs = INIT_FS;
18struct mm_struct init_mm = INIT_MM(init_mm);
19static struct files_struct init_files = INIT_FILES;
20static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
21static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
22EXPORT_SYMBOL(init_mm);
23
24/*
25 * Initial task structure.
26 *
27 * All other task structs will be allocated on slabs in fork.c
28 */
29
30struct task_struct init_task = INIT_TASK(init_task);
31
32EXPORT_SYMBOL(init_task);
33
34/*
35 * Initial thread structure.
36 *
Jeff Dikec14b8492007-05-10 22:22:34 -070037 * We need to make sure that this is aligned due to the
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 * way process stacks are handled. This is done by having a special
39 * "init_task" linker map entry..
40 */
41
Jeff Dikec14b8492007-05-10 22:22:34 -070042union thread_union init_thread_union
43 __attribute__((__section__(".data.init_task"))) =
44 { INIT_THREAD_INFO(init_task) };
45
46union thread_union cpu0_irqstack
47 __attribute__((__section__(".data.init_irqstack"))) =
48 { INIT_THREAD_INFO(init_task) };
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Jeff Dike5c8aace2007-10-16 01:26:46 -070050#ifdef CONFIG_MODE_TT
Linus Torvalds1da177e2005-04-16 15:20:36 -070051void unprotect_stack(unsigned long stack)
52{
Jeff Dikee1a79c42007-05-10 22:22:31 -070053 os_protect_memory((void *) stack, THREAD_SIZE, 1, 1, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070054}
Jeff Dike5c8aace2007-10-16 01:26:46 -070055#endif