xref: /DragonOS/kernel/src/process/process.h (revision ce5850adbf74ec6c6717bbb5b1749f1fbff4ca0d)
1 /**
2  * @file process.h
3  * @author longjin
4  * @brief 进程
5  * @date 2022-01-29
6  *
7  * @copyright Copyright (c) 2022
8  *
9  */
10 
11 #pragma once
12 #include "ptrace.h"
13 #include <common/cpu.h>
14 #include <common/errno.h>
15 #include <common/glib.h>
16 #include <filesystem/vfs/VFS.h>
17 #include <syscall/syscall.h>
18 
19 /**
20  * @brief 进程退出时执行的函数
21  *
22  * @param code 返回码
23  * @return ul
24  */
25 extern ul rs_process_do_exit(ul code);
26 
27 extern int rs_current_cpu_id();
28 
29 extern unsigned long head_stack_start; // 导出内核层栈基地址(定义在head.S
30 extern ul _stack_start;
31 extern void ret_from_intr(void); // 导出从中断返回的函数(定义在entry.S
32 
33 extern uint32_t rs_current_pcb_cpuid();
34 extern uint32_t rs_current_pcb_pid();
35 extern uint32_t rs_current_pcb_preempt_count();
36 extern uint32_t rs_current_pcb_flags();
37 extern int64_t rs_current_pcb_thread_rbp();
38 
39 #define PF_NEED_SCHED (1UL << 1)
40