]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/um/kernel/exec.c
sched/headers: Prepare for new header dependencies before moving code to <linux/sched...
[mirror_ubuntu-bionic-kernel.git] / arch / um / kernel / exec.c
CommitLineData
1d3468a6 1/*
ba180fd4 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
1da177e4
LT
3 * Licensed under the GPL
4 */
5
73395a00
AV
6#include <linux/stddef.h>
7#include <linux/module.h>
8#include <linux/fs.h>
9#include <linux/ptrace.h>
10#include <linux/sched.h>
29930025 11#include <linux/sched/task.h>
68db0cf1 12#include <linux/sched/task_stack.h>
73395a00
AV
13#include <linux/slab.h>
14#include <asm/current.h>
15#include <asm/processor.h>
7c0f6ba6 16#include <linux/uaccess.h>
37185b33
AV
17#include <as-layout.h>
18#include <mem_user.h>
19#include <skas.h>
20#include <os.h>
1da177e4
LT
21
22void flush_thread(void)
23{
77bf4400 24 void *data = NULL;
77bf4400
JD
25 int ret;
26
aa6758d4 27 arch_flush_thread(&current->thread.arch);
77bf4400 28
3963333f
JD
29 ret = unmap(&current->mm->context.id, 0, STUB_START, 0, &data);
30 ret = ret || unmap(&current->mm->context.id, STUB_END,
536788fe 31 host_task_size - STUB_END, 1, &data);
ba180fd4
JD
32 if (ret) {
33 printk(KERN_ERR "flush_thread - clearing address space failed, "
77bf4400
JD
34 "err = %d\n", ret);
35 force_sig(SIGKILL, current);
36 }
9436d5c3
AV
37 get_safe_registers(current_pt_regs()->regs.gp,
38 current_pt_regs()->regs.fp);
77bf4400 39
6c738ffa 40 __switch_mm(&current->mm->context.id);
1da177e4
LT
41}
42
43void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
44{
77bf4400
JD
45 PT_REGS_IP(regs) = eip;
46 PT_REGS_SP(regs) = esp;
42459792 47 current->ptrace &= ~PT_DTRACE;
1d3468a6 48#ifdef SUBARCH_EXECVE1
42459792 49 SUBARCH_EXECVE1(regs->regs);
1d3468a6 50#endif
1da177e4 51}
42459792 52EXPORT_SYMBOL(start_thread);