LoGin 91e9d4ab55
实现unified-init库,支持收集初始化函数到一个数组,并统一初始化 (#474)
* 添加“统一初始化”的过程宏,并把SystemError独立成crate

* 使用unified-init来初始化fbmem

* 更新workflow,增加内核自动化静态测试
2023-12-25 23:12:27 +08:00

38 lines
1.2 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use alloc::sync::Arc;
use system_error::SystemError;
use crate::process::{
fork::CloneFlags,
kthread::{KernelThreadCreateInfo, KernelThreadMechanism},
Pid,
};
impl KernelThreadMechanism {
/// 伪造trapframe创建内核线程
///
/// ## 返回值
///
/// 返回创建的内核线程的pid
pub fn __inner_create(
info: &Arc<KernelThreadCreateInfo>,
clone_flags: CloneFlags,
) -> Result<Pid, SystemError> {
unimplemented!("KernelThreadMechanism::__inner_create")
}
}
/// 内核线程引导函数的第一阶段
///
/// 当内核线程开始执行时会先执行这个函数这个函数会将伪造的trapframe中的数据弹出然后跳转到第二阶段
///
/// 跳转之后指向Box<KernelThreadClosure>的指针将传入到stage2的函数
// #[naked]
// pub(super) unsafe extern "C" fn kernel_thread_bootstrap_stage1() {
// todo!()
// }
pub(super) unsafe extern "C" fn kernel_thread_bootstrap_stage1() {
// 这个函数要是naked的只是因为现在还没有实现而naked func不能打`unimplemented!()`
// 所以先写成了普通函数
unimplemented!("kernel_thread_bootstrap_stage1")
}