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 crate::prelude::*;
use super::{id::Sid, BlockDevice};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::{
iter::Step,
ops::{Add, Sub},

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The block devices of Asterinas.
//
//This crate provides a number of base components for block devices, including

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub(crate) use alloc::collections::{BTreeMap, VecDeque};
pub(crate) use alloc::string::String;
pub(crate) use alloc::sync::Arc;

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The console device of Asterinas.
#![no_std]
#![forbid(unsafe_code)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The framebuffer of Asterinas.
#![no_std]
#![forbid(unsafe_code)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The input devices of Asterinas.
#![no_std]
#![forbid(unsafe_code)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::mem::size_of;
use align_ext::AlignExt;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec;
use smoltcp::{phy, time::Instant};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
#![no_std]
#![forbid(unsafe_code)]
#![feature(trait_alias)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! This module provides abstractions for hardware-assisted timing mechanisms, encapsulated by the `ClockSource` struct.
//! A `ClockSource` can be constructed from any counter with a stable frequency, enabling precise time measurements to be taken
//! by retrieving instances of `Instant`.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The system time of Asterinas.
#![no_std]
#![forbid(unsafe_code)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::arch::x86::device::cmos::{get_century_register, CMOS_ADDRESS, CMOS_DATA};
use core::sync::atomic::AtomicU8;
use core::sync::atomic::Ordering::Relaxed;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! This module provide a instance of `ClockSource` based on TSC.
//!
//! Use `init` to initialize this module.

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::{
fmt::Debug,
hint::spin_loop,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod device;
use aster_frame::io_mem::IoMem;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::hint::spin_loop;
use alloc::{boxed::Box, fmt::Debug, string::ToString, sync::Arc, vec::Vec};

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Debug;
use crate::{device::VirtioDeviceError, queue::VirtQueue, transport::VirtioTransport};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
// Modified from input.rs in virtio-drivers project
//
// MIT License

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use crate::queue::QueueError;
use int_to_c_enum::TryFromInt;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::io_mem::IoMem;
use aster_network::EthernetAddr;
use aster_util::safe_ptr::SafePtr;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::{fmt::Debug, hint::spin_loop, mem::size_of};
use alloc::{boxed::Box, string::ToString, sync::Arc, vec::Vec};

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use bitflags::bitflags;
use int_to_c_enum::TryFromInt;
use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod config;
pub mod device;
pub mod header;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! The virtio of Asterinas.
#![no_std]
#![forbid(unsafe_code)]

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! Virtqueue
use crate::transport::VirtioTransport;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{boxed::Box, sync::Arc};
use aster_frame::{
bus::mmio::{

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use core::fmt::Debug;
use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc;
use aster_frame::bus::mmio::MMIO_BUS;
use spin::Once;

View File

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

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::sync::Arc;
use aster_frame::bus::pci::{
capability::vendor::CapabilityVndrData,

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use pod::Pod;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::{
bus::{
pci::{

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
pub mod capability;
pub mod common_cfg;
pub mod device;

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::vec::Vec;
use aster_frame::{bus::pci::capability::msix::CapabilityMsixData, trap::IrqLine};