mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
O1能跑的代码
This commit is contained in:
@ -21,6 +21,9 @@
|
||||
|
||||
#include <ktest/ktest.h>
|
||||
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize("O0")
|
||||
|
||||
spinlock_t process_global_pid_write_lock; // 增加pid的写锁
|
||||
long process_global_pid = 1; // 系统中最大的pid
|
||||
|
||||
@ -108,7 +111,6 @@ void process_exit_thread(struct process_control_block *pcb);
|
||||
* 由于程序在进入内核的时候已经保存了寄存器,因此这里不需要保存寄存器。
|
||||
* 这里切换fs和gs寄存器
|
||||
*/
|
||||
|
||||
void __switch_to(struct process_control_block *prev, struct process_control_block *next)
|
||||
{
|
||||
initial_tss[proc_current_cpu_id].rsp0 = next->thread->rbp;
|
||||
@ -1087,4 +1089,6 @@ uint64_t process_copy_thread(uint64_t clone_flags, struct process_control_block
|
||||
*/
|
||||
void process_exit_thread(struct process_control_block *pcb)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC pop_options
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <common/cpu.h>
|
||||
#include <common/glib.h>
|
||||
#include <mm/mm.h>
|
||||
@ -19,6 +18,8 @@
|
||||
#include <filesystem/VFS/VFS.h>
|
||||
#include <common/wait_queue.h>
|
||||
|
||||
// #pragma GCC push_options
|
||||
// #pragma GCC optimize("O0")
|
||||
// 进程最大可拥有的文件描述符数量
|
||||
#define PROC_MAX_FD_NUM 16
|
||||
|
||||
@ -364,3 +365,4 @@ extern struct mm_struct initial_mm;
|
||||
extern struct thread_struct initial_thread;
|
||||
extern union proc_union initial_proc_union;
|
||||
extern struct process_control_block *initial_proc[MAX_CPU_NUM];
|
||||
// #pragma GCC pop_options
|
Reference in New Issue
Block a user