diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/um/kernel | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/init_task.c | 38 | ||||
-rw-r--r-- | arch/um/kernel/internal.h | 1 | ||||
-rw-r--r-- | arch/um/kernel/uaccess.c | 33 |
3 files changed, 72 insertions, 0 deletions
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c new file mode 100644 index 00000000000..ddc9698b66e --- /dev/null +++ b/arch/um/kernel/init_task.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,intel.linux}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include "linux/sched.h" | ||
7 | #include "linux/init_task.h" | ||
8 | #include "linux/fs.h" | ||
9 | #include "linux/module.h" | ||
10 | #include "linux/mqueue.h" | ||
11 | #include "asm/uaccess.h" | ||
12 | |||
13 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
14 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
15 | /* | ||
16 | * Initial task structure. | ||
17 | * | ||
18 | * All other task structs will be allocated on slabs in fork.c | ||
19 | */ | ||
20 | |||
21 | struct task_struct init_task = INIT_TASK(init_task); | ||
22 | |||
23 | EXPORT_SYMBOL(init_task); | ||
24 | |||
25 | /* | ||
26 | * Initial thread structure. | ||
27 | * | ||
28 | * We need to make sure that this is aligned due to the | ||
29 | * way process stacks are handled. This is done by having a special | ||
30 | * "init_task" linker map entry.. | ||
31 | */ | ||
32 | |||
33 | union thread_union init_thread_union __init_task_data = | ||
34 | { INIT_THREAD_INFO(init_task) }; | ||
35 | |||
36 | union thread_union cpu0_irqstack | ||
37 | __attribute__((__section__(".data..init_irqstack"))) = | ||
38 | { INIT_THREAD_INFO(init_task) }; | ||
diff --git a/arch/um/kernel/internal.h b/arch/um/kernel/internal.h new file mode 100644 index 00000000000..5bf97db24a0 --- /dev/null +++ b/arch/um/kernel/internal.h | |||
@@ -0,0 +1 @@ | |||
extern long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env); | |||
diff --git a/arch/um/kernel/uaccess.c b/arch/um/kernel/uaccess.c new file mode 100644 index 00000000000..dd33f040c52 --- /dev/null +++ b/arch/um/kernel/uaccess.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk) | ||
3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * These are here rather than tt/uaccess.c because skas mode needs them in | ||
9 | * order to do SIGBUS recovery when a tmpfs mount runs out of room. | ||
10 | */ | ||
11 | |||
12 | #include <linux/string.h> | ||
13 | #include "os.h" | ||
14 | |||
15 | static void __do_copy(void *to, const void *from, int n) | ||
16 | { | ||
17 | memcpy(to, from, n); | ||
18 | } | ||
19 | |||
20 | |||
21 | int __do_copy_to_user(void *to, const void *from, int n, | ||
22 | void **fault_addr, jmp_buf **fault_catcher) | ||
23 | { | ||
24 | unsigned long fault; | ||
25 | int faulted; | ||
26 | |||
27 | fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, | ||
28 | __do_copy, &faulted); | ||
29 | if (!faulted) | ||
30 | return 0; | ||
31 | else | ||
32 | return n - (fault - (unsigned long) to); | ||
33 | } | ||