LCOV - code coverage report
Current view: top level - arch/um/kernel/skas - process.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 13 17 76.5 %
Date: 2023-07-19 18:55:55 Functions: 2 3 66.7 %

          Line data    Source code
       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 <as-layout.h>
      12             : #include <kern.h>
      13             : #include <os.h>
      14             : #include <skas.h>
      15             : 
      16             : extern void start_kernel(void);
      17             : 
      18           1 : static int __init start_kernel_proc(void *unused)
      19             : {
      20             :         int pid;
      21             : 
      22           1 :         block_signals_trace();
      23           1 :         pid = os_getpid();
      24             : 
      25           1 :         cpu_tasks[0].pid = pid;
      26           1 :         cpu_tasks[0].task = current;
      27             : 
      28           1 :         start_kernel();
      29           0 :         return 0;
      30             : }
      31             : 
      32             : extern int userspace_pid[];
      33             : 
      34             : extern char cpu0_irqstack[];
      35             : 
      36           1 : int __init start_uml(void)
      37             : {
      38           1 :         stack_protections((unsigned long) &cpu0_irqstack);
      39           1 :         set_sigstack(cpu0_irqstack, THREAD_SIZE);
      40             : 
      41           1 :         init_new_thread_signals();
      42             : 
      43           1 :         init_task.thread.request.u.thread.proc = start_kernel_proc;
      44           1 :         init_task.thread.request.u.thread.arg = NULL;
      45           1 :         return start_idle_thread(task_stack_page(&init_task),
      46             :                                  &init_task.thread.switch_buf);
      47             : }
      48             : 
      49           0 : unsigned long current_stub_stack(void)
      50             : {
      51           0 :         if (current->mm == NULL)
      52             :                 return 0;
      53             : 
      54           0 :         return current->mm->context.id.stack;
      55             : }

Generated by: LCOV version 1.14