Linux Audio

Check our new training course

Loading...
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0
 2/*
 3 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 
 4 */
 5
 6#include <linux/init.h>
 7#include <linux/sched/mm.h>
 8#include <linux/sched/task_stack.h>
 9#include <linux/sched/task.h>
10
11#include <asm/tlbflush.h>
12
13#include <as-layout.h>
14#include <kern.h>
15#include <os.h>
16#include <skas.h>
17#include <kern_util.h>
18
19extern void start_kernel(void);
20
21static int __init start_kernel_proc(void *unused)
22{
23	block_signals_trace();
 
 
 
 
 
 
24
25	start_kernel();
26	return 0;
27}
28
29extern int userspace_pid[];
30
31static char cpu0_irqstack[THREAD_SIZE] __aligned(THREAD_SIZE);
32
33int __init start_uml(void)
34{
35	stack_protections((unsigned long) &cpu0_irqstack);
36	set_sigstack(cpu0_irqstack, THREAD_SIZE);
37
38	init_new_thread_signals();
39
40	init_task.thread.request.thread.proc = start_kernel_proc;
41	init_task.thread.request.thread.arg = NULL;
42	return start_idle_thread(task_stack_page(&init_task),
43				 &init_task.thread.switch_buf);
44}
45
46unsigned long current_stub_stack(void)
47{
48	if (current->mm == NULL)
49		return 0;
50
51	return current->mm->context.id.stack;
52}
53
54struct mm_id *current_mm_id(void)
55{
56	if (current->mm == NULL)
57		return NULL;
58
59	return &current->mm->context.id;
60}
61
62void current_mm_sync(void)
63{
64	if (current->mm == NULL)
65		return;
66
67	um_tlb_sync(current->mm);
68}
v4.10.11
 
 1/*
 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 3 * Licensed under the GPL
 4 */
 5
 6#include <linux/init.h>
 7#include <linux/sched.h>
 
 
 
 
 
 8#include <as-layout.h>
 9#include <kern.h>
10#include <os.h>
11#include <skas.h>
 
12
13extern void start_kernel(void);
14
15static int __init start_kernel_proc(void *unused)
16{
17	int pid;
18
19	block_signals();
20	pid = os_getpid();
21
22	cpu_tasks[0].pid = pid;
23	cpu_tasks[0].task = current;
24
25	start_kernel();
26	return 0;
27}
28
29extern int userspace_pid[];
30
31extern char cpu0_irqstack[];
32
33int __init start_uml(void)
34{
35	stack_protections((unsigned long) &cpu0_irqstack);
36	set_sigstack(cpu0_irqstack, THREAD_SIZE);
37
38	init_new_thread_signals();
39
40	init_task.thread.request.u.thread.proc = start_kernel_proc;
41	init_task.thread.request.u.thread.arg = NULL;
42	return start_idle_thread(task_stack_page(&init_task),
43				 &init_task.thread.switch_buf);
44}
45
46unsigned long current_stub_stack(void)
47{
48	if (current->mm == NULL)
49		return 0;
50
51	return current->mm->context.id.stack;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52}