chore: 将工具链更新到2024-07-23 (#864)

* chore: 将工具链更新到2024-07-23
This commit is contained in:
LoGin
2024-07-25 00:55:02 +08:00
committed by GitHub
parent 634349e0eb
commit bd70d2d1f4
150 changed files with 237 additions and 200 deletions

View File

@ -1,4 +1,5 @@
/// 每个架构都需要实现的IO接口
#[allow(unused)]
pub trait PortIOArch {
unsafe fn in8(port: u16) -> u8;
unsafe fn in16(port: u16) -> u16;

View File

@ -156,6 +156,7 @@ impl LocalApicTimerIntrController {
local_apic_timer.start_current();
}
#[allow(dead_code)]
pub(super) fn disable(&self) {
let cpu_id = smp_get_processor_id();
let local_apic_timer = local_apic_timer_instance_mut(cpu_id);

View File

@ -179,6 +179,7 @@ bitflags! {
}
}
#[allow(dead_code)]
pub(super) fn irq_msi_compose_msg(cfg: &HardwareIrqConfig, msg: &mut MsiMsg, dmar: bool) {
*msg = MsiMsg::new_zeroed();

View File

@ -35,6 +35,7 @@ extern "C" {
}
#[no_mangle]
#[allow(static_mut_refs)]
unsafe extern "C" fn kernel_main(
mb2_info: u64,
mb2_magic: u64,
@ -66,6 +67,7 @@ unsafe extern "C" fn kernel_main(
/// 在内存管理初始化之前的架构相关的早期初始化
#[inline(never)]
#[allow(static_mut_refs)]
pub fn early_setup_arch() -> Result<(), SystemError> {
let stack_start = unsafe { *(head_stack_start as *const u64) } as usize;
debug!("head_stack_start={:#x}\n", stack_start);

View File

@ -564,6 +564,7 @@ pub unsafe fn set_system_trap_gate(irq: u32, ist: u8, vaddr: VirtAddr) {
set_gate(idt_entry, 0xEF, ist, vaddr);
}
#[allow(static_mut_refs)]
unsafe fn get_idt_entry(irq: u32) -> &'static mut [u64] {
assert!(irq < 256);
let mut idt_vaddr =

View File

@ -26,6 +26,7 @@ pub struct X86MsiDataNormal {
}
#[derive(Debug)]
#[allow(dead_code)]
pub struct X86MsiDataDmar {
pub dmar_subhandle: u32,
}

View File

@ -396,6 +396,7 @@ impl SigContext {
}
}
/// @brief 信号处理备用栈的信息
#[allow(dead_code)]
#[derive(Debug, Clone, Copy)]
pub struct SigStack {
pub sp: *mut c_void,

View File

@ -42,6 +42,7 @@ pub struct MSRBitmap {
pub data: [u8; PAGE_SIZE],
}
#[allow(dead_code)]
#[derive(Debug)]
pub struct VcpuData {
/// The virtual and physical address of the Vmxon naturally aligned 4-KByte region of memory
@ -73,6 +74,7 @@ pub enum VcpuState {
Act = 2,
}
#[allow(dead_code)]
#[derive(Debug)]
pub struct VmxVcpu {
pub vcpu_id: u32,
@ -318,13 +320,13 @@ impl VmxVcpu {
)?;
vmx_vmwrite(
VmcsFields::HOST_GDTR_BASE as u32,
pseudo_descriptpr.base.to_bits() as u64,
pseudo_descriptpr.base as usize as u64,
)?;
vmx_vmwrite(VmcsFields::HOST_IDTR_BASE as u32, unsafe {
let mut pseudo_descriptpr: x86::dtables::DescriptorTablePointer<u64> =
Default::default();
x86::dtables::sidt(&mut pseudo_descriptpr);
pseudo_descriptpr.base.to_bits() as u64
pseudo_descriptpr.base as usize as u64
})?;
// fast entry into the kernel

View File

@ -64,10 +64,10 @@ pub fn vmx_vmlaunch() -> Result<(), SystemError> {
"push rsi",
"push rdi",
"vmwrite {0:r}, rsp",
"lea rax, 1f[rip]",
"lea rax, 2f[rip]",
"vmwrite {1:r}, rax",
"vmlaunch",
"1:",
"2:",
"pop rdi",
"pop rsi",
"pop rdx",

View File

@ -30,6 +30,7 @@ pub use interrupt::X86_64InterruptArch as CurrentIrqArch;
pub use crate::arch::asm::pio::X86_64PortIOArch as CurrentPortIOArch;
pub use kvm::X86_64KVMArch as KVMArch;
#[allow(unused_imports)]
pub use crate::arch::ipc::signal::X86_64SignalArch as CurrentSignalArch;
pub use crate::arch::time::X86_64TimeArch as CurrentTimeArch;

View File

@ -42,9 +42,8 @@ impl KernelThreadMechanism {
frame.rip = kernel_thread_bootstrap_stage1 as usize as u64;
// fork失败的话子线程不会执行。否则将导致内存安全问题。
let pid = ProcessManager::fork(&frame, clone_flags).map_err(|e| {
let pid = ProcessManager::fork(&frame, clone_flags).inspect_err(|_e| {
unsafe { KernelThreadCreateInfo::parse_unsafe_arc_ptr(create_info) };
e
})?;
ProcessManager::find(pid)

View File

@ -59,6 +59,7 @@ impl TSSManager {
x86::task::load_tr(selector);
}
#[allow(static_mut_refs)]
unsafe fn set_tss_descriptor(index: u16, vaddr: VirtAddr) {
const LIMIT: u64 = 103;
let gdt_vaddr = VirtAddr::new(&GDT_Table as *const _ as usize);

View File

@ -259,6 +259,7 @@ impl X86_64SMPArch {
}
impl SmpCpuManager {
#[allow(static_mut_refs)]
pub fn arch_init(_boot_cpu: ProcessorId) {
assert!(smp_get_processor_id().data() == 0);
// 写入APU_START_CR3这个值会在AP处理器启动时设置到CR3寄存器

View File

@ -1,6 +1,6 @@
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": "64",