License rust and c source files

This commit is contained in:
Jianfeng Jiang 2024-01-03 03:22:36 +00:00 committed by Tate, Hongliang Tian
parent 5fb8a9f7e5
commit faaa4438d6
559 changed files with 1192 additions and 89 deletions

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use std::{error::Error, path::PathBuf}; use std::{error::Error, path::PathBuf};
fn main() -> Result<(), Box<dyn Error + Send + Sync>> { fn main() -> Result<(), Box<dyn Error + Send + Sync>> {

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
pub mod x86; pub mod x86;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The Linux 64-bit Boot Protocol supporting module. //! The Linux 64-bit Boot Protocol supporting module.
//! //!

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The x86 boot module defines the entrypoints of Asterinas and //! The x86 boot module defines the entrypoints of Asterinas and
//! the corresponding headers for different x86 boot protocols. //! the corresponding headers for different x86 boot protocols.
//! //!

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: MPL-2.0 */
// This is the GNU Multiboot header. // This is the GNU Multiboot header.
// Reference: https://www.gnu.org/software/grub/manual/multiboot/multiboot.html // Reference: https://www.gnu.org/software/grub/manual/multiboot/multiboot.html
.section ".multiboot_header", "a" .section ".multiboot_header", "a"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{string::String, vec::Vec}; use alloc::{string::String, vec::Vec};
use multiboot2::MemoryAreaType; use multiboot2::MemoryAreaType;
use spin::Once; use spin::Once;

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: MPL-2.0 */
// This is the GNU Multiboot 2 header. // This is the GNU Multiboot 2 header.
// Reference: https://www.gnu.org/software/grub/manual/multiboot2/html_node/Index.html//Index // Reference: https://www.gnu.org/software/grub/manual/multiboot2/html_node/Index.html//Index
.section ".multiboot2_header", "a" .section ".multiboot2_header", "a"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{ use alloc::{
string::{String, ToString}, string::{String, ToString},
vec::Vec, vec::Vec,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Write; use core::fmt::Write;
use crate::sync::SpinLock; use crate::sync::SpinLock;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! CPU. //! CPU.
use core::arch::x86_64::{_fxrstor, _fxsave}; use core::arch::x86_64::{_fxrstor, _fxsave};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use acpi::{fadt::Fadt, sdt::Signature}; use acpi::{fadt::Fadt, sdt::Signature};
use x86_64::instructions::port::{ReadOnlyAccess, WriteOnlyAccess}; use x86_64::instructions::port::{ReadOnlyAccess, WriteOnlyAccess};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::marker::PhantomData; use core::marker::PhantomData;
pub use x86_64::instructions::port::{ pub use x86_64::instructions::port::{

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Device-related APIs. //! Device-related APIs.
//! This module mainly contains the APIs that should exposed to the device driver like PCI, RTC //! This module mainly contains the APIs that should exposed to the device driver like PCI, RTC

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! A port-mapped UART. Copied from uart_16550. //! A port-mapped UART. Copied from uart_16550.
use crate::arch::x86::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess}; use crate::arch::x86::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::mem::size_of; use core::mem::size_of;
use alloc::collections::BTreeMap; use alloc::collections::BTreeMap;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Debug; use core::fmt::Debug;
use alloc::vec::Vec; use alloc::vec::Vec;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
mod context_table; mod context_table;
mod fault; mod fault;
mod remapping; mod remapping;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use bitflags::bitflags; use bitflags::bitflags;
use log::debug; use log::debug;
use spin::Once; use spin::Once;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use pod::Pod; use pod::Pod;
use crate::{ use crate::{

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::sync::Mutex; use crate::sync::Mutex;
use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec::Vec}; use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec::Vec};
use spin::Once; use spin::Once;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::{fmt::Debug, mem::size_of, slice::Iter}; use core::{fmt::Debug, mem::size_of, slice::Iter};
use acpi::{sdt::Signature, AcpiTable}; use acpi::{sdt::Signature, AcpiTable};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod dmar; pub mod dmar;
pub mod remapping; pub mod remapping;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Remapping structures of DMAR table. //! Remapping structures of DMAR table.
//! This file defines these structures and provides a "Debug" implementation to see the value inside these structures. //! This file defines these structures and provides a "Debug" implementation to see the value inside these structures.
//! Most of the introduction are copied from Intel vt-directed-io-specification. //! Most of the introduction are copied from Intel vt-directed-io-specification.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use acpi::PlatformInfo; use acpi::PlatformInfo;
use alloc::vec; use alloc::vec;
use alloc::vec::Vec; use alloc::vec::Vec;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::sync::Mutex; use crate::sync::Mutex;
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::sync::Arc; use alloc::sync::Arc;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use x86::msr::{ use x86::msr::{
rdmsr, wrmsr, IA32_APIC_BASE, IA32_X2APIC_APICID, IA32_X2APIC_CUR_COUNT, IA32_X2APIC_DIV_CONF, rdmsr, wrmsr, IA32_APIC_BASE, IA32_X2APIC_APICID, IA32_X2APIC_CUR_COUNT, IA32_X2APIC_DIV_CONF,
IA32_X2APIC_EOI, IA32_X2APIC_INIT_COUNT, IA32_X2APIC_LVT_TIMER, IA32_X2APIC_SIVR, IA32_X2APIC_EOI, IA32_X2APIC_INIT_COUNT, IA32_X2APIC_LVT_TIMER, IA32_X2APIC_SIVR,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::sync::Mutex; use crate::sync::Mutex;
use crate::vm; use crate::vm;
use spin::Once; use spin::Once;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub(super) mod acpi; pub(super) mod acpi;
pub(super) mod apic; pub(super) mod apic;
pub(super) mod pic; pub(super) mod pic;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::arch::x86::device::io_port::{IoPort, WriteOnlyAccess}; use crate::arch::x86::device::io_port::{IoPort, WriteOnlyAccess};
use crate::trap::IrqLine; use crate::trap::IrqLine;
use core::sync::atomic::Ordering::Relaxed; use core::sync::atomic::Ordering::Relaxed;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::sync::atomic::AtomicU64; use core::sync::atomic::AtomicU64;
use x86::cpuid::cpuid; use x86::cpuid::cpuid;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::sync::Mutex; use crate::sync::Mutex;
use alloc::{collections::BTreeMap, fmt}; use alloc::{collections::BTreeMap, fmt};
use pod::Pod; use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod boot; pub mod boot;
pub mod console; pub mod console;
pub(crate) mod cpu; pub(crate) mod cpu;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! PCI bus io port //! PCI bus io port
use super::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess}; use super::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Providing the ability to exit QEMU and return a value as debug result. //! Providing the ability to exit QEMU and return a value as debug result.
/// The exit code of x86 QEMU isa debug device. In `qemu-system-x86_64` the /// The exit code of x86 QEMU isa debug device. In `qemu-system-x86_64` the

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use tdx_guest::{ use tdx_guest::{
tdcall::TdgVeInfo, tdcall::TdgVeInfo,
tdvmcall::{cpuid, hlt, rdmsr, wrmsr, IoSize}, tdvmcall::{cpuid, hlt, rdmsr, wrmsr, IoSize},

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc; use alloc::sync::Arc;
use core::arch::x86_64::_rdtsc; use core::arch::x86_64::_rdtsc;
use core::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use core::sync::atomic::{AtomicBool, AtomicU64, Ordering};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{trap::IrqLine, vm::paddr_to_vaddr}; use crate::{trap::IrqLine, vm::paddr_to_vaddr};
use acpi::{AcpiError, HpetInfo}; use acpi::{AcpiError, HpetInfo};
use alloc::vec::Vec; use alloc::vec::Vec;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod apic; pub mod apic;
pub mod hpet; pub mod hpet;
pub mod pit; pub mod pit;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! used for PIT Timer //! used for PIT Timer
use crate::config::TIMER_FREQ; use crate::config::TIMER_FREQ;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The module to parse kernel command-line arguments. //! The module to parse kernel command-line arguments.
//! //!
//! The format of the Asterinas command line string conforms //! The format of the Asterinas command line string conforms

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Information of memory regions in the boot phase. //! Information of memory regions in the boot phase.
//! //!

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The architecture-independent boot module, which provides a universal interface //! The architecture-independent boot module, which provides a universal interface
//! from the bootloader to the rest of the framework. //! from the bootloader to the rest of the framework.
//! //!

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{collections::VecDeque, fmt::Debug, sync::Arc, vec::Vec}; use alloc::{collections::VecDeque, fmt::Debug, sync::Arc, vec::Vec};
use log::{debug, error}; use log::{debug, error};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use int_to_c_enum::TryFromInt; use int_to_c_enum::TryFromInt;
use log::info; use log::info;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Virtio over MMIO //! Virtio over MMIO
pub mod bus; pub mod bus;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod mmio; pub mod mmio;
pub mod pci; pub mod pci;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Debug; use core::fmt::Debug;
use alloc::{collections::VecDeque, sync::Arc, vec::Vec}; use alloc::{collections::VecDeque, sync::Arc, vec::Vec};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec::Vec; use alloc::vec::Vec;
use self::{msix::CapabilityMsixData, vendor::CapabilityVndrData}; use self::{msix::CapabilityMsixData, vendor::CapabilityVndrData};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{sync::Arc, vec::Vec}; use alloc::{sync::Arc, vec::Vec};
use crate::{ use crate::{

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::bus::pci::{common_device::PciCommonDevice, device_info::PciDeviceLocation}; use crate::bus::pci::{common_device::PciCommonDevice, device_info::PciDeviceLocation};
use crate::{Error, Result}; use crate::{Error, Result};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc; use alloc::sync::Arc;
use bitflags::bitflags; use bitflags::bitflags;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec::Vec; use alloc::vec::Vec;
use super::{ use super::{

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::iter; use core::iter;
use crate::arch::pci::{PCI_ADDRESS_PORT, PCI_DATA_PORT}; use crate::arch::pci::{PCI_ADDRESS_PORT, PCI_DATA_PORT};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! PCI bus //! PCI bus
//! //!
//! Users can implement the bus under the `PciDriver` to the PCI bus to register devices, //! Users can implement the bus under the `PciDriver` to the PCI bus to register devices,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused)] #![allow(unused)]
use log::Level; use log::Level;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Arguments; use core::fmt::Arguments;
pub fn print(args: Arguments) { pub fn print(args: Arguments) {

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! CPU. //! CPU.
use crate::trap::disable_local; use crate::trap::disable_local;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
/// The error type which is returned from the APIs of this crate. /// The error type which is returned from the APIs of this crate.
#[derive(Clone, Copy, PartialEq, Eq, Debug)] #[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Error { pub enum Error {

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::{mem::size_of, ops::Range}; use core::{mem::size_of, ops::Range};
use pod::Pod; use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The framework part of Asterinas. //! The framework part of Asterinas.
#![feature(alloc_error_handler)] #![feature(alloc_error_handler)]
#![feature(const_mut_refs)] #![feature(const_mut_refs)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{config::DEFAULT_LOG_LEVEL, early_println}; use crate::{config::DEFAULT_LOG_LEVEL, early_println};
use log::{Metadata, Record}; use log::{Metadata, Record};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Panic support. //! Panic support.
use alloc::{boxed::Box, string::ToString}; use alloc::{boxed::Box, string::ToString};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The prelude. //! The prelude.
pub type Result<T> = core::result::Result<T, crate::error::Error>; pub type Result<T> = core::result::Result<T, crate::error::Error>;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::{self}; use core::fmt::{self};
use core::sync::atomic::{AtomicU64, Ordering::Relaxed}; use core::sync::atomic::{AtomicU64, Ordering::Relaxed};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
mod atomic_bits; mod atomic_bits;
mod mutex; mod mutex;
// TODO: refactor this rcu implementation // TODO: refactor this rcu implementation

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use super::WaitQueue; use super::WaitQueue;
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Read-copy update (RCU). //! Read-copy update (RCU).
use core::marker::PhantomData; use core::marker::PhantomData;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::collections::VecDeque; use alloc::collections::VecDeque;
use core::sync::atomic::{ use core::sync::atomic::{
AtomicBool, AtomicBool,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::ptr::NonNull; use core::ptr::NonNull;
use crate::prelude::*; use crate::prelude::*;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use core::fmt; use core::fmt;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use core::fmt; use core::fmt;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use core::fmt; use core::fmt;
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use super::SpinLock; use super::SpinLock;
use crate::arch::timer::add_timeout_list; use crate::arch::timer::add_timeout_list;
use crate::config::TIMER_FREQ; use crate::config::TIMER_FREQ;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Tasks are the unit of code execution. //! Tasks are the unit of code execution.
mod priority; mod priority;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::config::REAL_TIME_TASK_PRI; use crate::config::REAL_TIME_TASK_PRI;
/// The priority of a task. /// The priority of a task.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::sync::atomic::AtomicUsize; use core::sync::atomic::AtomicUsize;
use crate::cpu_local; use crate::cpu_local;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::prelude::*; use crate::prelude::*;
use crate::sync::SpinLock; use crate::sync::SpinLock;
use crate::task::Task; use crate::task::Task;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::arch::mm::PageTableFlags; use crate::arch::mm::PageTableFlags;
use crate::config::{KERNEL_STACK_SIZE, PAGE_SIZE}; use crate::config::{KERNEL_STACK_SIZE, PAGE_SIZE};
use crate::cpu::CpuSet; use crate::cpu::CpuSet;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Timer. //! Timer.
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{arch::irq::IRQ_LIST, cpu::CpuException}; use crate::{arch::irq::IRQ_LIST, cpu::CpuException};
#[cfg(feature = "intel_tdx")] #[cfg(feature = "intel_tdx")]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::arch::irq::{self, IrqCallbackHandle, NOT_USING_IRQ}; use crate::arch::irq::{self, IrqCallbackHandle, NOT_USING_IRQ};
use crate::task::{disable_preempt, DisablePreemptGuard}; use crate::task::{disable_preempt, DisablePreemptGuard};
use crate::{prelude::*, Error}; use crate::{prelude::*, Error};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
mod handler; mod handler;
mod irq; mod irq;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! User space. //! User space.
use crate::cpu::UserContext; use crate::cpu::UserContext;

View File

@ -1 +1,3 @@
// SPDX-License-Identifier: MPL-2.0
pub mod recycle_allocator; pub mod recycle_allocator;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec::Vec; use alloc::vec::Vec;
#[derive(Debug)] #[derive(Debug)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc; use alloc::sync::Arc;
use core::ops::Deref; use core::ops::Deref;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc; use alloc::sync::Arc;
use core::arch::x86_64::_mm_clflush; use core::arch::x86_64::_mm_clflush;
use core::ops::Range; use core::ops::Range;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
mod dma_coherent; mod dma_coherent;
mod dma_stream; mod dma_stream;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec; use alloc::vec;
use core::{ use core::{
iter::Iterator, iter::Iterator,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use align_ext::AlignExt; use align_ext::AlignExt;
use alloc::vec::Vec; use alloc::vec::Vec;
use buddy_system_allocator::FrameAllocator; use buddy_system_allocator::FrameAllocator;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::config::{KERNEL_HEAP_SIZE, PAGE_SIZE}; use crate::config::{KERNEL_HEAP_SIZE, PAGE_SIZE};
use crate::prelude::*; use crate::prelude::*;
use crate::sync::SpinLock; use crate::sync::SpinLock;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::prelude::*; use crate::prelude::*;
use pod::Pod; use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use super::page_table::{PageTable, PageTableConfig, UserMode}; use super::page_table::{PageTable, PageTableConfig, UserMode};
use crate::{ use crate::{
arch::mm::{PageTableEntry, PageTableFlags}, arch::mm::{PageTableEntry, PageTableFlags},

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Virtual memory (VM). //! Virtual memory (VM).
/// Virtual addresses. /// Virtual addresses.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
/// Get the offset of a field within a type as a pointer. /// Get the offset of a field within a type as a pointer.
/// ///
/// ```rust /// ```rust

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::{prelude::*, Error}; use crate::{prelude::*, Error};
use super::{frame::VmFrameFlags, frame_allocator, VmFrame, VmFrameVec, VmSegment}; use super::{frame::VmFrameFlags, frame_allocator, VmFrame, VmFrameVec, VmSegment};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use super::{paddr_to_vaddr, Paddr, Vaddr, VmAllocOptions}; use super::{paddr_to_vaddr, Paddr, Vaddr, VmAllocOptions};
use crate::{ use crate::{
arch::mm::{is_kernel_vaddr, is_user_vaddr, tlb_flush, PageTableEntry}, arch::mm::{is_kernel_vaddr, is_user_vaddr, tlb_flush, PageTableEntry},

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::arch::mm::PageTableFlags; use crate::arch::mm::PageTableFlags;
use crate::config::PAGE_SIZE; use crate::config::PAGE_SIZE;
use crate::sync::Mutex; use crate::sync::Mutex;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![cfg_attr(not(test), no_std)] #![cfg_attr(not(test), no_std)]
/// An extension trait for Rust integer types, including `u8`, `u16`, `u32`, /// An extension trait for Rust integer types, including `u8`, `u16`, `u32`,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![feature(proc_macro_span)] #![feature(proc_macro_span)]
extern crate proc_macro2; extern crate proc_macro2;

Some files were not shown because too many files have changed in this diff Show More