summaryrefslogtreecommitdiff
path: root/arch/um/kernel/skas/process.c
blob: f60541df209fe5ddb01f882a5c1fa64f1cd88b93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 */

#include <linux/init.h>
#include <linux/sched/mm.h>
#include <linux/sched/task_stack.h>
#include <linux/sched/task.h>
#include <linux/smp-internal.h>

#include <as-layout.h>
#include <kern.h>
#include <os.h>
#include <skas.h>
#include <kern_util.h>

extern void start_kernel(void);

static int __init start_kernel_proc(void *unused)
{
	block_signals_trace();

	start_kernel();
	return 0;
}

char cpu_irqstacks[NR_CPUS][THREAD_SIZE] __aligned(THREAD_SIZE);

void __init start_uml(void)
{
	stack_protections((unsigned long) &cpu_irqstacks[0]);
	set_sigstack(cpu_irqstacks[0], THREAD_SIZE);

	init_new_thread_signals();

	init_task.thread.request.thread.proc = start_kernel_proc;
	init_task.thread.request.thread.arg = NULL;
	start_idle_thread(task_stack_page(&init_task),
			  &init_task.thread.switch_buf);
}

static DEFINE_SPINLOCK(initial_jmpbuf_spinlock);

void initial_jmpbuf_lock(void)
{
	spin_lock_irq(&initial_jmpbuf_spinlock);
}

void initial_jmpbuf_unlock(void)
{
	spin_unlock_irq(&initial_jmpbuf_spinlock);
}