diff --git a/build.rs b/build.rs index 0c2017fb8..cff89a754 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::{error::Error, path::PathBuf}; fn main() -> Result<(), Box> { diff --git a/framework/aster-frame/src/arch/mod.rs b/framework/aster-frame/src/arch/mod.rs index 2c243b413..bd52ba441 100644 --- a/framework/aster-frame/src/arch/mod.rs +++ b/framework/aster-frame/src/arch/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #[cfg(target_arch = "x86_64")] pub mod x86; diff --git a/framework/aster-frame/src/arch/x86/boot/linux_boot/mod.rs b/framework/aster-frame/src/arch/x86/boot/linux_boot/mod.rs index 1e94c0d64..d2df41991 100644 --- a/framework/aster-frame/src/arch/x86/boot/linux_boot/mod.rs +++ b/framework/aster-frame/src/arch/x86/boot/linux_boot/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The Linux 64-bit Boot Protocol supporting module. //! diff --git a/framework/aster-frame/src/arch/x86/boot/mod.rs b/framework/aster-frame/src/arch/x86/boot/mod.rs index ee4347c67..b23ebf0eb 100644 --- a/framework/aster-frame/src/arch/x86/boot/mod.rs +++ b/framework/aster-frame/src/arch/x86/boot/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The x86 boot module defines the entrypoints of Asterinas and //! the corresponding headers for different x86 boot protocols. //! diff --git a/framework/aster-frame/src/arch/x86/boot/multiboot/header.S b/framework/aster-frame/src/arch/x86/boot/multiboot/header.S index e7acd3ca2..fcdbde1be 100644 --- a/framework/aster-frame/src/arch/x86/boot/multiboot/header.S +++ b/framework/aster-frame/src/arch/x86/boot/multiboot/header.S @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MPL-2.0 */ + // This is the GNU Multiboot header. // Reference: https://www.gnu.org/software/grub/manual/multiboot/multiboot.html .section ".multiboot_header", "a" diff --git a/framework/aster-frame/src/arch/x86/boot/multiboot/mod.rs b/framework/aster-frame/src/arch/x86/boot/multiboot/mod.rs index 3a27a515f..227a13546 100644 --- a/framework/aster-frame/src/arch/x86/boot/multiboot/mod.rs +++ b/framework/aster-frame/src/arch/x86/boot/multiboot/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{string::String, vec::Vec}; use multiboot2::MemoryAreaType; use spin::Once; diff --git a/framework/aster-frame/src/arch/x86/boot/multiboot2/header.S b/framework/aster-frame/src/arch/x86/boot/multiboot2/header.S index 3eb833453..3819aff46 100644 --- a/framework/aster-frame/src/arch/x86/boot/multiboot2/header.S +++ b/framework/aster-frame/src/arch/x86/boot/multiboot2/header.S @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MPL-2.0 */ + // This is the GNU Multiboot 2 header. // Reference: https://www.gnu.org/software/grub/manual/multiboot2/html_node/Index.html//Index .section ".multiboot2_header", "a" diff --git a/framework/aster-frame/src/arch/x86/boot/multiboot2/mod.rs b/framework/aster-frame/src/arch/x86/boot/multiboot2/mod.rs index ff8f9b191..a5e358a8d 100644 --- a/framework/aster-frame/src/arch/x86/boot/multiboot2/mod.rs +++ b/framework/aster-frame/src/arch/x86/boot/multiboot2/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{ string::{String, ToString}, vec::Vec, diff --git a/framework/aster-frame/src/arch/x86/console.rs b/framework/aster-frame/src/arch/x86/console.rs index 826f59d86..a66f005fb 100644 --- a/framework/aster-frame/src/arch/x86/console.rs +++ b/framework/aster-frame/src/arch/x86/console.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Write; use crate::sync::SpinLock; diff --git a/framework/aster-frame/src/arch/x86/cpu.rs b/framework/aster-frame/src/arch/x86/cpu.rs index 3bacaae65..492f40cef 100644 --- a/framework/aster-frame/src/arch/x86/cpu.rs +++ b/framework/aster-frame/src/arch/x86/cpu.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! CPU. use core::arch::x86_64::{_fxrstor, _fxsave}; diff --git a/framework/aster-frame/src/arch/x86/device/cmos.rs b/framework/aster-frame/src/arch/x86/device/cmos.rs index 891616918..fef766204 100644 --- a/framework/aster-frame/src/arch/x86/device/cmos.rs +++ b/framework/aster-frame/src/arch/x86/device/cmos.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use acpi::{fadt::Fadt, sdt::Signature}; use x86_64::instructions::port::{ReadOnlyAccess, WriteOnlyAccess}; diff --git a/framework/aster-frame/src/arch/x86/device/io_port.rs b/framework/aster-frame/src/arch/x86/device/io_port.rs index 42d329f4d..e5c60c90b 100644 --- a/framework/aster-frame/src/arch/x86/device/io_port.rs +++ b/framework/aster-frame/src/arch/x86/device/io_port.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::marker::PhantomData; pub use x86_64::instructions::port::{ diff --git a/framework/aster-frame/src/arch/x86/device/mod.rs b/framework/aster-frame/src/arch/x86/device/mod.rs index 9499ac3f2..d588d790a 100644 --- a/framework/aster-frame/src/arch/x86/device/mod.rs +++ b/framework/aster-frame/src/arch/x86/device/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Device-related APIs. //! This module mainly contains the APIs that should exposed to the device driver like PCI, RTC diff --git a/framework/aster-frame/src/arch/x86/device/serial.rs b/framework/aster-frame/src/arch/x86/device/serial.rs index 8e628e995..30ae618a1 100644 --- a/framework/aster-frame/src/arch/x86/device/serial.rs +++ b/framework/aster-frame/src/arch/x86/device/serial.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! A port-mapped UART. Copied from uart_16550. use crate::arch::x86::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess}; diff --git a/framework/aster-frame/src/arch/x86/iommu/context_table.rs b/framework/aster-frame/src/arch/x86/iommu/context_table.rs index d98548167..4aa2c3cd2 100644 --- a/framework/aster-frame/src/arch/x86/iommu/context_table.rs +++ b/framework/aster-frame/src/arch/x86/iommu/context_table.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::mem::size_of; use alloc::collections::BTreeMap; diff --git a/framework/aster-frame/src/arch/x86/iommu/fault.rs b/framework/aster-frame/src/arch/x86/iommu/fault.rs index df08aef4c..a98c0667e 100644 --- a/framework/aster-frame/src/arch/x86/iommu/fault.rs +++ b/framework/aster-frame/src/arch/x86/iommu/fault.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use alloc::vec::Vec; diff --git a/framework/aster-frame/src/arch/x86/iommu/mod.rs b/framework/aster-frame/src/arch/x86/iommu/mod.rs index 7f984b78e..a40e3a072 100644 --- a/framework/aster-frame/src/arch/x86/iommu/mod.rs +++ b/framework/aster-frame/src/arch/x86/iommu/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod context_table; mod fault; mod remapping; diff --git a/framework/aster-frame/src/arch/x86/iommu/remapping.rs b/framework/aster-frame/src/arch/x86/iommu/remapping.rs index d584d69fb..d670bc29f 100644 --- a/framework/aster-frame/src/arch/x86/iommu/remapping.rs +++ b/framework/aster-frame/src/arch/x86/iommu/remapping.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitflags::bitflags; use log::debug; use spin::Once; diff --git a/framework/aster-frame/src/arch/x86/iommu/second_stage.rs b/framework/aster-frame/src/arch/x86/iommu/second_stage.rs index 7e310d919..ef8e55a38 100644 --- a/framework/aster-frame/src/arch/x86/iommu/second_stage.rs +++ b/framework/aster-frame/src/arch/x86/iommu/second_stage.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use pod::Pod; use crate::{ diff --git a/framework/aster-frame/src/arch/x86/irq.rs b/framework/aster-frame/src/arch/x86/irq.rs index 2a54aa670..064017845 100644 --- a/framework/aster-frame/src/arch/x86/irq.rs +++ b/framework/aster-frame/src/arch/x86/irq.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::sync::Mutex; use alloc::{boxed::Box, fmt::Debug, sync::Arc, vec::Vec}; use spin::Once; diff --git a/framework/aster-frame/src/arch/x86/kernel/acpi/dmar.rs b/framework/aster-frame/src/arch/x86/kernel/acpi/dmar.rs index 8c7e0130c..02575ecfd 100644 --- a/framework/aster-frame/src/arch/x86/kernel/acpi/dmar.rs +++ b/framework/aster-frame/src/arch/x86/kernel/acpi/dmar.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::{fmt::Debug, mem::size_of, slice::Iter}; use acpi::{sdt::Signature, AcpiTable}; diff --git a/framework/aster-frame/src/arch/x86/kernel/acpi/mod.rs b/framework/aster-frame/src/arch/x86/kernel/acpi/mod.rs index afc9e10dc..70e047f2d 100644 --- a/framework/aster-frame/src/arch/x86/kernel/acpi/mod.rs +++ b/framework/aster-frame/src/arch/x86/kernel/acpi/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod dmar; pub mod remapping; diff --git a/framework/aster-frame/src/arch/x86/kernel/acpi/remapping.rs b/framework/aster-frame/src/arch/x86/kernel/acpi/remapping.rs index 8c41e0889..6a6eed745 100644 --- a/framework/aster-frame/src/arch/x86/kernel/acpi/remapping.rs +++ b/framework/aster-frame/src/arch/x86/kernel/acpi/remapping.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Remapping structures of DMAR table. //! 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. diff --git a/framework/aster-frame/src/arch/x86/kernel/apic/ioapic.rs b/framework/aster-frame/src/arch/x86/kernel/apic/ioapic.rs index f0addb37a..36b3e7445 100644 --- a/framework/aster-frame/src/arch/x86/kernel/apic/ioapic.rs +++ b/framework/aster-frame/src/arch/x86/kernel/apic/ioapic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use acpi::PlatformInfo; use alloc::vec; use alloc::vec::Vec; diff --git a/framework/aster-frame/src/arch/x86/kernel/apic/mod.rs b/framework/aster-frame/src/arch/x86/kernel/apic/mod.rs index be4ecf441..7847499f1 100644 --- a/framework/aster-frame/src/arch/x86/kernel/apic/mod.rs +++ b/framework/aster-frame/src/arch/x86/kernel/apic/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::sync::Mutex; use alloc::boxed::Box; use alloc::sync::Arc; diff --git a/framework/aster-frame/src/arch/x86/kernel/apic/x2apic.rs b/framework/aster-frame/src/arch/x86/kernel/apic/x2apic.rs index bf30afed8..da31bf41f 100644 --- a/framework/aster-frame/src/arch/x86/kernel/apic/x2apic.rs +++ b/framework/aster-frame/src/arch/x86/kernel/apic/x2apic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use x86::msr::{ 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, diff --git a/framework/aster-frame/src/arch/x86/kernel/apic/xapic.rs b/framework/aster-frame/src/arch/x86/kernel/apic/xapic.rs index 76ae1d1ee..ea578dff8 100644 --- a/framework/aster-frame/src/arch/x86/kernel/apic/xapic.rs +++ b/framework/aster-frame/src/arch/x86/kernel/apic/xapic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::sync::Mutex; use crate::vm; use spin::Once; diff --git a/framework/aster-frame/src/arch/x86/kernel/mod.rs b/framework/aster-frame/src/arch/x86/kernel/mod.rs index 008c9ec8e..4af2b9660 100644 --- a/framework/aster-frame/src/arch/x86/kernel/mod.rs +++ b/framework/aster-frame/src/arch/x86/kernel/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub(super) mod acpi; pub(super) mod apic; pub(super) mod pic; diff --git a/framework/aster-frame/src/arch/x86/kernel/pic.rs b/framework/aster-frame/src/arch/x86/kernel/pic.rs index fbe04eaa0..719c8ee59 100644 --- a/framework/aster-frame/src/arch/x86/kernel/pic.rs +++ b/framework/aster-frame/src/arch/x86/kernel/pic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::arch::x86::device::io_port::{IoPort, WriteOnlyAccess}; use crate::trap::IrqLine; use core::sync::atomic::Ordering::Relaxed; diff --git a/framework/aster-frame/src/arch/x86/kernel/tsc.rs b/framework/aster-frame/src/arch/x86/kernel/tsc.rs index f6cd07aa0..41acea582 100644 --- a/framework/aster-frame/src/arch/x86/kernel/tsc.rs +++ b/framework/aster-frame/src/arch/x86/kernel/tsc.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::AtomicU64; use x86::cpuid::cpuid; diff --git a/framework/aster-frame/src/arch/x86/mm/mod.rs b/framework/aster-frame/src/arch/x86/mm/mod.rs index 1386d7a0d..2b53b0027 100644 --- a/framework/aster-frame/src/arch/x86/mm/mod.rs +++ b/framework/aster-frame/src/arch/x86/mm/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::sync::Mutex; use alloc::{collections::BTreeMap, fmt}; use pod::Pod; diff --git a/framework/aster-frame/src/arch/x86/mod.rs b/framework/aster-frame/src/arch/x86/mod.rs index 5d0dc6db4..ed2766238 100644 --- a/framework/aster-frame/src/arch/x86/mod.rs +++ b/framework/aster-frame/src/arch/x86/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod boot; pub mod console; pub(crate) mod cpu; diff --git a/framework/aster-frame/src/arch/x86/pci.rs b/framework/aster-frame/src/arch/x86/pci.rs index 34a8d9bcb..00b66265b 100644 --- a/framework/aster-frame/src/arch/x86/pci.rs +++ b/framework/aster-frame/src/arch/x86/pci.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! PCI bus io port use super::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess}; diff --git a/framework/aster-frame/src/arch/x86/qemu.rs b/framework/aster-frame/src/arch/x86/qemu.rs index 5d8fd7bfe..db93a97ff 100644 --- a/framework/aster-frame/src/arch/x86/qemu.rs +++ b/framework/aster-frame/src/arch/x86/qemu.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! 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 diff --git a/framework/aster-frame/src/arch/x86/tdx_guest.rs b/framework/aster-frame/src/arch/x86/tdx_guest.rs index 463b91dce..1d506ab2f 100644 --- a/framework/aster-frame/src/arch/x86/tdx_guest.rs +++ b/framework/aster-frame/src/arch/x86/tdx_guest.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use tdx_guest::{ tdcall::TdgVeInfo, tdvmcall::{cpuid, hlt, rdmsr, wrmsr, IoSize}, diff --git a/framework/aster-frame/src/arch/x86/timer/apic.rs b/framework/aster-frame/src/arch/x86/timer/apic.rs index 81441e5e3..437e21e89 100644 --- a/framework/aster-frame/src/arch/x86/timer/apic.rs +++ b/framework/aster-frame/src/arch/x86/timer/apic.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use core::arch::x86_64::_rdtsc; use core::sync::atomic::{AtomicBool, AtomicU64, Ordering}; diff --git a/framework/aster-frame/src/arch/x86/timer/hpet.rs b/framework/aster-frame/src/arch/x86/timer/hpet.rs index cc4ba7512..44d78c3ff 100644 --- a/framework/aster-frame/src/arch/x86/timer/hpet.rs +++ b/framework/aster-frame/src/arch/x86/timer/hpet.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{trap::IrqLine, vm::paddr_to_vaddr}; use acpi::{AcpiError, HpetInfo}; use alloc::vec::Vec; diff --git a/framework/aster-frame/src/arch/x86/timer/mod.rs b/framework/aster-frame/src/arch/x86/timer/mod.rs index aee24d1f3..4f3bccc9e 100644 --- a/framework/aster-frame/src/arch/x86/timer/mod.rs +++ b/framework/aster-frame/src/arch/x86/timer/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod apic; pub mod hpet; pub mod pit; diff --git a/framework/aster-frame/src/arch/x86/timer/pit.rs b/framework/aster-frame/src/arch/x86/timer/pit.rs index 69fce02ff..2f830ee54 100644 --- a/framework/aster-frame/src/arch/x86/timer/pit.rs +++ b/framework/aster-frame/src/arch/x86/timer/pit.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! used for PIT Timer use crate::config::TIMER_FREQ; diff --git a/framework/aster-frame/src/boot/kcmdline.rs b/framework/aster-frame/src/boot/kcmdline.rs index f68dff1b0..b8158dd21 100644 --- a/framework/aster-frame/src/boot/kcmdline.rs +++ b/framework/aster-frame/src/boot/kcmdline.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The module to parse kernel command-line arguments. //! //! The format of the Asterinas command line string conforms diff --git a/framework/aster-frame/src/boot/memory_region.rs b/framework/aster-frame/src/boot/memory_region.rs index ac2fcdd24..10fa73f39 100644 --- a/framework/aster-frame/src/boot/memory_region.rs +++ b/framework/aster-frame/src/boot/memory_region.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Information of memory regions in the boot phase. //! diff --git a/framework/aster-frame/src/boot/mod.rs b/framework/aster-frame/src/boot/mod.rs index 6afdc118a..0e92fa6cc 100644 --- a/framework/aster-frame/src/boot/mod.rs +++ b/framework/aster-frame/src/boot/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The architecture-independent boot module, which provides a universal interface //! from the bootloader to the rest of the framework. //! diff --git a/framework/aster-frame/src/bus/mmio/bus.rs b/framework/aster-frame/src/bus/mmio/bus.rs index daf3b965d..38ddac64b 100644 --- a/framework/aster-frame/src/bus/mmio/bus.rs +++ b/framework/aster-frame/src/bus/mmio/bus.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{collections::VecDeque, fmt::Debug, sync::Arc, vec::Vec}; use log::{debug, error}; diff --git a/framework/aster-frame/src/bus/mmio/device.rs b/framework/aster-frame/src/bus/mmio/device.rs index 03e2e6973..1dd0a5fba 100644 --- a/framework/aster-frame/src/bus/mmio/device.rs +++ b/framework/aster-frame/src/bus/mmio/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use int_to_c_enum::TryFromInt; use log::info; diff --git a/framework/aster-frame/src/bus/mmio/mod.rs b/framework/aster-frame/src/bus/mmio/mod.rs index 4c58bd740..f55f43e38 100644 --- a/framework/aster-frame/src/bus/mmio/mod.rs +++ b/framework/aster-frame/src/bus/mmio/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtio over MMIO pub mod bus; diff --git a/framework/aster-frame/src/bus/mod.rs b/framework/aster-frame/src/bus/mod.rs index 24e5ef347..3654081ec 100644 --- a/framework/aster-frame/src/bus/mod.rs +++ b/framework/aster-frame/src/bus/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod mmio; pub mod pci; diff --git a/framework/aster-frame/src/bus/pci/bus.rs b/framework/aster-frame/src/bus/pci/bus.rs index b487d8f07..9082f6941 100644 --- a/framework/aster-frame/src/bus/pci/bus.rs +++ b/framework/aster-frame/src/bus/pci/bus.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use alloc::{collections::VecDeque, sync::Arc, vec::Vec}; diff --git a/framework/aster-frame/src/bus/pci/capability/mod.rs b/framework/aster-frame/src/bus/pci/capability/mod.rs index 63628e74f..3cceb0354 100644 --- a/framework/aster-frame/src/bus/pci/capability/mod.rs +++ b/framework/aster-frame/src/bus/pci/capability/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec::Vec; use self::{msix::CapabilityMsixData, vendor::CapabilityVndrData}; diff --git a/framework/aster-frame/src/bus/pci/capability/msix.rs b/framework/aster-frame/src/bus/pci/capability/msix.rs index e162da67e..5305afc16 100644 --- a/framework/aster-frame/src/bus/pci/capability/msix.rs +++ b/framework/aster-frame/src/bus/pci/capability/msix.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{sync::Arc, vec::Vec}; use crate::{ diff --git a/framework/aster-frame/src/bus/pci/capability/vendor.rs b/framework/aster-frame/src/bus/pci/capability/vendor.rs index b1c5f36ec..dea1beb1f 100644 --- a/framework/aster-frame/src/bus/pci/capability/vendor.rs +++ b/framework/aster-frame/src/bus/pci/capability/vendor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::bus::pci::{common_device::PciCommonDevice, device_info::PciDeviceLocation}; use crate::{Error, Result}; diff --git a/framework/aster-frame/src/bus/pci/cfg_space.rs b/framework/aster-frame/src/bus/pci/cfg_space.rs index 775023862..9965837ea 100644 --- a/framework/aster-frame/src/bus/pci/cfg_space.rs +++ b/framework/aster-frame/src/bus/pci/cfg_space.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use bitflags::bitflags; diff --git a/framework/aster-frame/src/bus/pci/common_device.rs b/framework/aster-frame/src/bus/pci/common_device.rs index 110fdad69..ba19c64fd 100644 --- a/framework/aster-frame/src/bus/pci/common_device.rs +++ b/framework/aster-frame/src/bus/pci/common_device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec::Vec; use super::{ diff --git a/framework/aster-frame/src/bus/pci/device_info.rs b/framework/aster-frame/src/bus/pci/device_info.rs index c767d742d..46cc56d18 100644 --- a/framework/aster-frame/src/bus/pci/device_info.rs +++ b/framework/aster-frame/src/bus/pci/device_info.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::iter; use crate::arch::pci::{PCI_ADDRESS_PORT, PCI_DATA_PORT}; diff --git a/framework/aster-frame/src/bus/pci/mod.rs b/framework/aster-frame/src/bus/pci/mod.rs index d4497b547..9552a86f4 100644 --- a/framework/aster-frame/src/bus/pci/mod.rs +++ b/framework/aster-frame/src/bus/pci/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! PCI bus //! //! Users can implement the bus under the `PciDriver` to the PCI bus to register devices, diff --git a/framework/aster-frame/src/config.rs b/framework/aster-frame/src/config.rs index 416ade6c8..145e2c156 100644 --- a/framework/aster-frame/src/config.rs +++ b/framework/aster-frame/src/config.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![allow(unused)] use log::Level; diff --git a/framework/aster-frame/src/console.rs b/framework/aster-frame/src/console.rs index d0a3193ef..0f164f29c 100644 --- a/framework/aster-frame/src/console.rs +++ b/framework/aster-frame/src/console.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Arguments; pub fn print(args: Arguments) { diff --git a/framework/aster-frame/src/cpu.rs b/framework/aster-frame/src/cpu.rs index 4b94bf6b3..96a6ec981 100644 --- a/framework/aster-frame/src/cpu.rs +++ b/framework/aster-frame/src/cpu.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! CPU. use crate::trap::disable_local; diff --git a/framework/aster-frame/src/error.rs b/framework/aster-frame/src/error.rs index fa6676d10..bd859950b 100644 --- a/framework/aster-frame/src/error.rs +++ b/framework/aster-frame/src/error.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// The error type which is returned from the APIs of this crate. #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum Error { diff --git a/framework/aster-frame/src/io_mem.rs b/framework/aster-frame/src/io_mem.rs index 6ad3cb3de..55c2e0a22 100644 --- a/framework/aster-frame/src/io_mem.rs +++ b/framework/aster-frame/src/io_mem.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::{mem::size_of, ops::Range}; use pod::Pod; diff --git a/framework/aster-frame/src/lib.rs b/framework/aster-frame/src/lib.rs index 9486c2259..01468fcea 100644 --- a/framework/aster-frame/src/lib.rs +++ b/framework/aster-frame/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The framework part of Asterinas. #![feature(alloc_error_handler)] #![feature(const_mut_refs)] diff --git a/framework/aster-frame/src/logger.rs b/framework/aster-frame/src/logger.rs index 8e5f0b868..7b2316dce 100644 --- a/framework/aster-frame/src/logger.rs +++ b/framework/aster-frame/src/logger.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{config::DEFAULT_LOG_LEVEL, early_println}; use log::{Metadata, Record}; diff --git a/framework/aster-frame/src/panicking.rs b/framework/aster-frame/src/panicking.rs index 57d8a0664..b3786a44c 100644 --- a/framework/aster-frame/src/panicking.rs +++ b/framework/aster-frame/src/panicking.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Panic support. use alloc::{boxed::Box, string::ToString}; diff --git a/framework/aster-frame/src/prelude.rs b/framework/aster-frame/src/prelude.rs index bc93334ac..c7c196faa 100644 --- a/framework/aster-frame/src/prelude.rs +++ b/framework/aster-frame/src/prelude.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The prelude. pub type Result = core::result::Result; diff --git a/framework/aster-frame/src/sync/atomic_bits.rs b/framework/aster-frame/src/sync/atomic_bits.rs index 85656935c..3c6c5d34d 100644 --- a/framework/aster-frame/src/sync/atomic_bits.rs +++ b/framework/aster-frame/src/sync/atomic_bits.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::{self}; use core::sync::atomic::{AtomicU64, Ordering::Relaxed}; diff --git a/framework/aster-frame/src/sync/mod.rs b/framework/aster-frame/src/sync/mod.rs index 23b37ea10..cbe24ad2b 100644 --- a/framework/aster-frame/src/sync/mod.rs +++ b/framework/aster-frame/src/sync/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod atomic_bits; mod mutex; // TODO: refactor this rcu implementation diff --git a/framework/aster-frame/src/sync/mutex.rs b/framework/aster-frame/src/sync/mutex.rs index 1e64144d5..74a740203 100644 --- a/framework/aster-frame/src/sync/mutex.rs +++ b/framework/aster-frame/src/sync/mutex.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::WaitQueue; use core::cell::UnsafeCell; use core::ops::{Deref, DerefMut}; diff --git a/framework/aster-frame/src/sync/rcu/mod.rs b/framework/aster-frame/src/sync/rcu/mod.rs index 360ba8ddb..6bc7fffba 100644 --- a/framework/aster-frame/src/sync/rcu/mod.rs +++ b/framework/aster-frame/src/sync/rcu/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Read-copy update (RCU). use core::marker::PhantomData; diff --git a/framework/aster-frame/src/sync/rcu/monitor.rs b/framework/aster-frame/src/sync/rcu/monitor.rs index a39913fb3..d694bfa7a 100644 --- a/framework/aster-frame/src/sync/rcu/monitor.rs +++ b/framework/aster-frame/src/sync/rcu/monitor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::collections::VecDeque; use core::sync::atomic::{ AtomicBool, diff --git a/framework/aster-frame/src/sync/rcu/owner_ptr.rs b/framework/aster-frame/src/sync/rcu/owner_ptr.rs index 97775de01..7ea176fcf 100644 --- a/framework/aster-frame/src/sync/rcu/owner_ptr.rs +++ b/framework/aster-frame/src/sync/rcu/owner_ptr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::ptr::NonNull; use crate::prelude::*; diff --git a/framework/aster-frame/src/sync/rwlock.rs b/framework/aster-frame/src/sync/rwlock.rs index 7e8cbe46b..ac0797474 100644 --- a/framework/aster-frame/src/sync/rwlock.rs +++ b/framework/aster-frame/src/sync/rwlock.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::cell::UnsafeCell; use core::fmt; use core::ops::{Deref, DerefMut}; diff --git a/framework/aster-frame/src/sync/rwmutex.rs b/framework/aster-frame/src/sync/rwmutex.rs index 46078ac42..f08cf2003 100644 --- a/framework/aster-frame/src/sync/rwmutex.rs +++ b/framework/aster-frame/src/sync/rwmutex.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::cell::UnsafeCell; use core::fmt; use core::ops::{Deref, DerefMut}; diff --git a/framework/aster-frame/src/sync/spin.rs b/framework/aster-frame/src/sync/spin.rs index 5981c83dc..833ae871c 100644 --- a/framework/aster-frame/src/sync/spin.rs +++ b/framework/aster-frame/src/sync/spin.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::cell::UnsafeCell; use core::fmt; use core::ops::{Deref, DerefMut}; diff --git a/framework/aster-frame/src/sync/wait.rs b/framework/aster-frame/src/sync/wait.rs index cafa0260b..596f6c2d1 100644 --- a/framework/aster-frame/src/sync/wait.rs +++ b/framework/aster-frame/src/sync/wait.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SpinLock; use crate::arch::timer::add_timeout_list; use crate::config::TIMER_FREQ; diff --git a/framework/aster-frame/src/task/mod.rs b/framework/aster-frame/src/task/mod.rs index 4f05e9ae2..ebd821c84 100644 --- a/framework/aster-frame/src/task/mod.rs +++ b/framework/aster-frame/src/task/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Tasks are the unit of code execution. mod priority; diff --git a/framework/aster-frame/src/task/priority.rs b/framework/aster-frame/src/task/priority.rs index 6a577c4a3..8f895d14b 100644 --- a/framework/aster-frame/src/task/priority.rs +++ b/framework/aster-frame/src/task/priority.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::config::REAL_TIME_TASK_PRI; /// The priority of a task. diff --git a/framework/aster-frame/src/task/processor.rs b/framework/aster-frame/src/task/processor.rs index d2bd40cda..90034ae73 100644 --- a/framework/aster-frame/src/task/processor.rs +++ b/framework/aster-frame/src/task/processor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::AtomicUsize; use crate::cpu_local; diff --git a/framework/aster-frame/src/task/scheduler.rs b/framework/aster-frame/src/task/scheduler.rs index 40185cffd..260d14df3 100644 --- a/framework/aster-frame/src/task/scheduler.rs +++ b/framework/aster-frame/src/task/scheduler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use crate::sync::SpinLock; use crate::task::Task; diff --git a/framework/aster-frame/src/task/task.rs b/framework/aster-frame/src/task/task.rs index a8d5bae7b..0b7f5d6a6 100644 --- a/framework/aster-frame/src/task/task.rs +++ b/framework/aster-frame/src/task/task.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::arch::mm::PageTableFlags; use crate::config::{KERNEL_STACK_SIZE, PAGE_SIZE}; use crate::cpu::CpuSet; diff --git a/framework/aster-frame/src/timer.rs b/framework/aster-frame/src/timer.rs index 551528d7d..dcccd0a7d 100644 --- a/framework/aster-frame/src/timer.rs +++ b/framework/aster-frame/src/timer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Timer. #[cfg(target_arch = "x86_64")] diff --git a/framework/aster-frame/src/trap/handler.rs b/framework/aster-frame/src/trap/handler.rs index 2b945b6da..43e53ac10 100644 --- a/framework/aster-frame/src/trap/handler.rs +++ b/framework/aster-frame/src/trap/handler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{arch::irq::IRQ_LIST, cpu::CpuException}; #[cfg(feature = "intel_tdx")] diff --git a/framework/aster-frame/src/trap/irq.rs b/framework/aster-frame/src/trap/irq.rs index 0f23b5b06..97851566b 100644 --- a/framework/aster-frame/src/trap/irq.rs +++ b/framework/aster-frame/src/trap/irq.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::arch::irq::{self, IrqCallbackHandle, NOT_USING_IRQ}; use crate::task::{disable_preempt, DisablePreemptGuard}; use crate::{prelude::*, Error}; diff --git a/framework/aster-frame/src/trap/mod.rs b/framework/aster-frame/src/trap/mod.rs index 0c86e31c3..e4717e64b 100644 --- a/framework/aster-frame/src/trap/mod.rs +++ b/framework/aster-frame/src/trap/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod handler; mod irq; diff --git a/framework/aster-frame/src/user.rs b/framework/aster-frame/src/user.rs index 9b89bc6c4..d351464d3 100644 --- a/framework/aster-frame/src/user.rs +++ b/framework/aster-frame/src/user.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! User space. use crate::cpu::UserContext; diff --git a/framework/aster-frame/src/util/mod.rs b/framework/aster-frame/src/util/mod.rs index d5b1738f4..0c94155a9 100644 --- a/framework/aster-frame/src/util/mod.rs +++ b/framework/aster-frame/src/util/mod.rs @@ -1 +1,3 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod recycle_allocator; diff --git a/framework/aster-frame/src/util/recycle_allocator.rs b/framework/aster-frame/src/util/recycle_allocator.rs index 265372801..9d171a538 100644 --- a/framework/aster-frame/src/util/recycle_allocator.rs +++ b/framework/aster-frame/src/util/recycle_allocator.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec::Vec; #[derive(Debug)] diff --git a/framework/aster-frame/src/vm/dma/dma_coherent.rs b/framework/aster-frame/src/vm/dma/dma_coherent.rs index 872de9788..e49dbabc7 100644 --- a/framework/aster-frame/src/vm/dma/dma_coherent.rs +++ b/framework/aster-frame/src/vm/dma/dma_coherent.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use core::ops::Deref; diff --git a/framework/aster-frame/src/vm/dma/dma_stream.rs b/framework/aster-frame/src/vm/dma/dma_stream.rs index f78aadfa5..6f5f5c084 100644 --- a/framework/aster-frame/src/vm/dma/dma_stream.rs +++ b/framework/aster-frame/src/vm/dma/dma_stream.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use core::arch::x86_64::_mm_clflush; use core::ops::Range; diff --git a/framework/aster-frame/src/vm/dma/mod.rs b/framework/aster-frame/src/vm/dma/mod.rs index 4f13e4055..d611e17bf 100644 --- a/framework/aster-frame/src/vm/dma/mod.rs +++ b/framework/aster-frame/src/vm/dma/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod dma_coherent; mod dma_stream; diff --git a/framework/aster-frame/src/vm/frame.rs b/framework/aster-frame/src/vm/frame.rs index 35855adf9..abd5bcebd 100644 --- a/framework/aster-frame/src/vm/frame.rs +++ b/framework/aster-frame/src/vm/frame.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec; use core::{ iter::Iterator, diff --git a/framework/aster-frame/src/vm/frame_allocator.rs b/framework/aster-frame/src/vm/frame_allocator.rs index 34fb73e45..f1b1c82a6 100644 --- a/framework/aster-frame/src/vm/frame_allocator.rs +++ b/framework/aster-frame/src/vm/frame_allocator.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use align_ext::AlignExt; use alloc::vec::Vec; use buddy_system_allocator::FrameAllocator; diff --git a/framework/aster-frame/src/vm/heap_allocator.rs b/framework/aster-frame/src/vm/heap_allocator.rs index 081c39718..1d1bbaa29 100644 --- a/framework/aster-frame/src/vm/heap_allocator.rs +++ b/framework/aster-frame/src/vm/heap_allocator.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::config::{KERNEL_HEAP_SIZE, PAGE_SIZE}; use crate::prelude::*; use crate::sync::SpinLock; diff --git a/framework/aster-frame/src/vm/io.rs b/framework/aster-frame/src/vm/io.rs index f252defb7..1f71e0196 100644 --- a/framework/aster-frame/src/vm/io.rs +++ b/framework/aster-frame/src/vm/io.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use pod::Pod; diff --git a/framework/aster-frame/src/vm/memory_set.rs b/framework/aster-frame/src/vm/memory_set.rs index 7776f6cd4..6bbd67be7 100644 --- a/framework/aster-frame/src/vm/memory_set.rs +++ b/framework/aster-frame/src/vm/memory_set.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::page_table::{PageTable, PageTableConfig, UserMode}; use crate::{ arch::mm::{PageTableEntry, PageTableFlags}, diff --git a/framework/aster-frame/src/vm/mod.rs b/framework/aster-frame/src/vm/mod.rs index bdd36c179..6aaed0245 100644 --- a/framework/aster-frame/src/vm/mod.rs +++ b/framework/aster-frame/src/vm/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtual memory (VM). /// Virtual addresses. diff --git a/framework/aster-frame/src/vm/offset.rs b/framework/aster-frame/src/vm/offset.rs index d89f970e9..566d4238d 100644 --- a/framework/aster-frame/src/vm/offset.rs +++ b/framework/aster-frame/src/vm/offset.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// Get the offset of a field within a type as a pointer. /// /// ```rust diff --git a/framework/aster-frame/src/vm/options.rs b/framework/aster-frame/src/vm/options.rs index 14dcbc47a..67c5c9986 100644 --- a/framework/aster-frame/src/vm/options.rs +++ b/framework/aster-frame/src/vm/options.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{prelude::*, Error}; use super::{frame::VmFrameFlags, frame_allocator, VmFrame, VmFrameVec, VmSegment}; diff --git a/framework/aster-frame/src/vm/page_table.rs b/framework/aster-frame/src/vm/page_table.rs index d4d9b8d0b..af0922a43 100644 --- a/framework/aster-frame/src/vm/page_table.rs +++ b/framework/aster-frame/src/vm/page_table.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{paddr_to_vaddr, Paddr, Vaddr, VmAllocOptions}; use crate::{ arch::mm::{is_kernel_vaddr, is_user_vaddr, tlb_flush, PageTableEntry}, diff --git a/framework/aster-frame/src/vm/space.rs b/framework/aster-frame/src/vm/space.rs index 89a3df99b..9db926ef8 100644 --- a/framework/aster-frame/src/vm/space.rs +++ b/framework/aster-frame/src/vm/space.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::arch::mm::PageTableFlags; use crate::config::PAGE_SIZE; use crate::sync::Mutex; diff --git a/framework/libs/align_ext/src/lib.rs b/framework/libs/align_ext/src/lib.rs index f3078beb9..f9692e86c 100644 --- a/framework/libs/align_ext/src/lib.rs +++ b/framework/libs/align_ext/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![cfg_attr(not(test), no_std)] /// An extension trait for Rust integer types, including `u8`, `u16`, `u32`, diff --git a/framework/libs/ktest-proc-macro/src/lib.rs b/framework/libs/ktest-proc-macro/src/lib.rs index 30fb919e9..6edbcdbbd 100644 --- a/framework/libs/ktest-proc-macro/src/lib.rs +++ b/framework/libs/ktest-proc-macro/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![feature(proc_macro_span)] extern crate proc_macro2; diff --git a/framework/libs/ktest/src/lib.rs b/framework/libs/ktest/src/lib.rs index 7ba579502..e6a2d04d0 100644 --- a/framework/libs/ktest/src/lib.rs +++ b/framework/libs/ktest/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! # The kernel mode testing framework of Asterinas. //! //! `ktest` stands for kernel-mode testing framework. Its goal is to provide a diff --git a/framework/libs/ktest/src/path.rs b/framework/libs/ktest/src/path.rs index e62aa5eb0..434acb49b 100644 --- a/framework/libs/ktest/src/path.rs +++ b/framework/libs/ktest/src/path.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{ collections::{vec_deque, BTreeMap, VecDeque}, string::{String, ToString}, diff --git a/framework/libs/ktest/src/runner.rs b/framework/libs/ktest/src/runner.rs index 1f60ba962..9711811f2 100644 --- a/framework/libs/ktest/src/runner.rs +++ b/framework/libs/ktest/src/runner.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Test runner enabling control over the tests. //! diff --git a/framework/libs/ktest/src/tree.rs b/framework/libs/ktest/src/tree.rs index 913ebe0a5..3a99e60ba 100644 --- a/framework/libs/ktest/src/tree.rs +++ b/framework/libs/ktest/src/tree.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The source module tree of ktests. //! //! In the `KtestTree`, the root is abstract, and the children of the root are the diff --git a/framework/libs/linux-bzimage/boot-params/src/lib.rs b/framework/libs/linux-bzimage/boot-params/src/lib.rs index 8d23876dc..4cd390a87 100644 --- a/framework/libs/linux-bzimage/boot-params/src/lib.rs +++ b/framework/libs/linux-bzimage/boot-params/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The definition of Linux Boot Protocol boot_params struct. //! //! The bootloader will deliver the address of the `BootParams` struct diff --git a/framework/libs/linux-bzimage/builder/src/lib.rs b/framework/libs/linux-bzimage/builder/src/lib.rs index b62c925af..34ee01ec4 100644 --- a/framework/libs/linux-bzimage/builder/src/lib.rs +++ b/framework/libs/linux-bzimage/builder/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The linux bzImage builder. //! //! This crate is responsible for building the bzImage. It contains methods to build diff --git a/framework/libs/linux-bzimage/builder/src/mapping.rs b/framework/libs/linux-bzimage/builder/src/mapping.rs index 9e7870000..babb18cb6 100644 --- a/framework/libs/linux-bzimage/builder/src/mapping.rs +++ b/framework/libs/linux-bzimage/builder/src/mapping.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! In the setup, VA - SETUP32_LMA == FileOffset - LEGACY_SETUP_SEC_SIZE. //! And the addresses are specified in the ELF file. //! diff --git a/framework/libs/linux-bzimage/builder/src/pe_header.rs b/framework/libs/linux-bzimage/builder/src/pe_header.rs index 16c83bef1..740c5e15e 100644 --- a/framework/libs/linux-bzimage/builder/src/pe_header.rs +++ b/framework/libs/linux-bzimage/builder/src/pe_header.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Big zImage PE/COFF header generation. //! //! The definition of the PE/COFF header is in the Microsoft PE/COFF specification: diff --git a/framework/libs/linux-bzimage/setup/build.rs b/framework/libs/linux-bzimage/setup/build.rs index af5b57d4b..66d4b5311 100644 --- a/framework/libs/linux-bzimage/setup/build.rs +++ b/framework/libs/linux-bzimage/setup/build.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::path::PathBuf; fn main() { diff --git a/framework/libs/linux-bzimage/setup/src/console.rs b/framework/libs/linux-bzimage/setup/src/console.rs index 74ad42675..386f991eb 100644 --- a/framework/libs/linux-bzimage/setup/src/console.rs +++ b/framework/libs/linux-bzimage/setup/src/console.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::{self, Write}; use uart_16550::SerialPort; diff --git a/framework/libs/linux-bzimage/setup/src/loader.rs b/framework/libs/linux-bzimage/setup/src/loader.rs index 6f43a3d85..158c92ee9 100644 --- a/framework/libs/linux-bzimage/setup/src/loader.rs +++ b/framework/libs/linux-bzimage/setup/src/loader.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use xmas_elf::program::{ProgramHeader, SegmentData}; /// Load the kernel ELF payload to memory. diff --git a/framework/libs/linux-bzimage/setup/src/main.rs b/framework/libs/linux-bzimage/setup/src/main.rs index 7e9032269..bb972ea70 100644 --- a/framework/libs/linux-bzimage/setup/src/main.rs +++ b/framework/libs/linux-bzimage/setup/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The linux bzImage setup binary. //! //! With respect to the format of the bzImage, we design our bzImage setup in the similar diff --git a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/efi.rs b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/efi.rs index aeeaa8cb5..33a414e25 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/efi.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/efi.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use uefi::{ data_types::Handle, proto::loaded_image::LoadedImage, diff --git a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/header.S b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/header.S index b458b5055..863716132 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/header.S +++ b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/header.S @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MPL-2.0 */ + // The compatibility file for the Linux x86 Boot Protocol. // See https://www.kernel.org/doc/html/v5.6/x86/boot.html for // more information on the Linux x86 Boot Protocol. diff --git a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/mod.rs b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/mod.rs index d1022586a..d3acbf704 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/mod.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod efi; mod paging; mod relocation; diff --git a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/paging.rs b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/paging.rs index b11559c7a..68f92fa36 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/paging.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/paging.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module provides abstraction over the Intel IA32E paging mechanism. And //! offers method to create linear page tables. //! diff --git a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/relocation.rs b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/relocation.rs index 627019f3e..d1e34bdac 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/relocation.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/amd64_efi/relocation.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::x86::get_image_loaded_offset; struct Elf64Rela { diff --git a/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/header.S b/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/header.S index 32a48f1ec..199f9b399 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/header.S +++ b/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/header.S @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MPL-2.0 */ + // The compatibility file for the Linux x86 Boot Protocol. // See https://www.kernel.org/doc/html/v5.6/x86/boot.html for // more information on the Linux x86 Boot Protocol. diff --git a/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/mod.rs b/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/mod.rs index 504063a71..131e44a01 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/mod.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/legacy_i386/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use linux_boot_params::BootParams; use core::arch::{asm, global_asm}; diff --git a/framework/libs/linux-bzimage/setup/src/x86/mod.rs b/framework/libs/linux-bzimage/setup/src/x86/mod.rs index d500efeea..350f28c34 100644 --- a/framework/libs/linux-bzimage/setup/src/x86/mod.rs +++ b/framework/libs/linux-bzimage/setup/src/x86/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + cfg_if::cfg_if! { if #[cfg(target_arch = "x86_64")] { mod amd64_efi; diff --git a/kernel/main.rs b/kernel/main.rs index bbb7737d2..6e7a577d7 100644 --- a/kernel/main.rs +++ b/kernel/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![no_std] #![no_main] // The `export_name` attribute for the `aster_main` entrypoint requires the removal of safety check. diff --git a/regression/apps/execve/Makefile b/regression/apps/execve/Makefile index d393e1212..bf39ea0bf 100644 --- a/regression/apps/execve/Makefile +++ b/regression/apps/execve/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static diff --git a/regression/apps/execve/execve.c b/regression/apps/execve/execve.c index a7bda5d96..45bd90a0f 100644 --- a/regression/apps/execve/execve.c +++ b/regression/apps/execve/execve.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include diff --git a/regression/apps/execve/hello.c b/regression/apps/execve/hello.c index 014411efd..4402eac96 100644 --- a/regression/apps/execve/hello.c +++ b/regression/apps/execve/hello.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include int main(int argc, char *argv[], char *envp[]) { diff --git a/regression/apps/fork/Makefile b/regression/apps/fork/Makefile index 238cf33ab..00cb44cdf 100644 --- a/regression/apps/fork/Makefile +++ b/regression/apps/fork/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static -nostdlib diff --git a/regression/apps/fork/fork.s b/regression/apps/fork/fork.s index d818c6286..3bdfa103d 100644 --- a/regression/apps/fork/fork.s +++ b/regression/apps/fork/fork.s @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + .global _start .section .text diff --git a/regression/apps/fork_c/Makefile b/regression/apps/fork_c/Makefile index d393e1212..bf39ea0bf 100644 --- a/regression/apps/fork_c/Makefile +++ b/regression/apps/fork_c/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static diff --git a/regression/apps/fork_c/fork.c b/regression/apps/fork_c/fork.c index dfbfc2efc..47dd6246b 100644 --- a/regression/apps/fork_c/fork.c +++ b/regression/apps/fork_c/fork.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include diff --git a/regression/apps/hello_c/Makefile b/regression/apps/hello_c/Makefile index d6dcb9e58..e299341f1 100644 --- a/regression/apps/hello_c/Makefile +++ b/regression/apps/hello_c/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static -mno-sse diff --git a/regression/apps/hello_c/hello.c b/regression/apps/hello_c/hello.c index d7f033f7e..f77edde9c 100644 --- a/regression/apps/hello_c/hello.c +++ b/regression/apps/hello_c/hello.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include int main() { diff --git a/regression/apps/hello_pie/Makefile b/regression/apps/hello_pie/Makefile index 05ff449d2..c603a781a 100644 --- a/regression/apps/hello_pie/Makefile +++ b/regression/apps/hello_pie/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS := diff --git a/regression/apps/hello_pie/hello.c b/regression/apps/hello_pie/hello.c index 5deb4f724..e2eb146a9 100644 --- a/regression/apps/hello_pie/hello.c +++ b/regression/apps/hello_pie/hello.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include int main() { diff --git a/regression/apps/hello_world/Makefile b/regression/apps/hello_world/Makefile index 238cf33ab..00cb44cdf 100644 --- a/regression/apps/hello_world/Makefile +++ b/regression/apps/hello_world/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static -nostdlib diff --git a/regression/apps/hello_world/hello_world.s b/regression/apps/hello_world/hello_world.s index 3cf6c075a..b18b83483 100644 --- a/regression/apps/hello_world/hello_world.s +++ b/regression/apps/hello_world/hello_world.s @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + .global _start .section .text diff --git a/regression/apps/network/Makefile b/regression/apps/network/Makefile index 05ff449d2..c603a781a 100644 --- a/regression/apps/network/Makefile +++ b/regression/apps/network/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS := diff --git a/regression/apps/network/listen_backlog.c b/regression/apps/network/listen_backlog.c index a54c79b96..da57117ce 100644 --- a/regression/apps/network/listen_backlog.c +++ b/regression/apps/network/listen_backlog.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/send_buf_full.c b/regression/apps/network/send_buf_full.c index 23b5388b3..9d47b8d7f 100644 --- a/regression/apps/network/send_buf_full.c +++ b/regression/apps/network/send_buf_full.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/socketpair.c b/regression/apps/network/socketpair.c index 0441cc00b..73e66f53c 100644 --- a/regression/apps/network/socketpair.c +++ b/regression/apps/network/socketpair.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/sockoption.c b/regression/apps/network/sockoption.c index b4fa0b258..91996bd8c 100644 --- a/regression/apps/network/sockoption.c +++ b/regression/apps/network/sockoption.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/tcp_client.c b/regression/apps/network/tcp_client.c index a290bf3f2..8302ed0dd 100644 --- a/regression/apps/network/tcp_client.c +++ b/regression/apps/network/tcp_client.c @@ -1,51 +1,44 @@ -// From: https://www.geeksforgeeks.org/socket-programming-cc/. -// Some minor modifications are made to the original code base. -// Lisenced under CCBY-SA. +// SPDX-License-Identifier: MPL-2.0 -// Client side C/C++ program to demonstrate socket programming -#include #include +#include #include -#include #include +#include + #define PORT 8080 - -int main(int argc, char const* argv[]) -{ - int status, valread, client_fd; + +int main() { + int sock = 0, valread; struct sockaddr_in serv_addr; - char* hello = "Hello from client"; - char buffer[1024] = { 0 }; - if ((client_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + char *hello = "Hello from client"; + char buffer[1024] = {0}; + + // Create socket + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { printf("\n Socket creation error \n"); return -1; } - + serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(PORT); - - // Convert IPv4 and IPv6 addresses from text to binary - // form - if (inet_pton(AF_INET, "127.0.0.1", &serv_addr.sin_addr) - <= 0) { - printf( - "\nInvalid address/ Address not supported \n"); + + // Convert IPv4 address from text to binary form + if (inet_pton(AF_INET, "127.0.0.1", &(serv_addr.sin_addr)) <= 0) { + printf("\n Invalid address/ Address not supported \n"); return -1; } - - if ((status - = connect(client_fd, (struct sockaddr*)&serv_addr, - sizeof(serv_addr))) - < 0) { - printf("\nConnection Failed \n"); + + // Connect to the server + if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { + printf("\n Connection Failed \n"); return -1; } - send(client_fd, hello, strlen(hello), 0); + + // Send message to the server and receive the reply + send(sock, hello, strlen(hello), 0); printf("Hello message sent\n"); - valread = read(client_fd, buffer, 1024); - printf("%s\n", buffer); - - // closing the connected socket - close(client_fd); + valread = read(sock, buffer, 1024); + printf("Server: %s\n", buffer); return 0; -} \ No newline at end of file +} diff --git a/regression/apps/network/tcp_server.c b/regression/apps/network/tcp_server.c index 170991476..49c2be876 100644 --- a/regression/apps/network/tcp_server.c +++ b/regression/apps/network/tcp_server.c @@ -1,75 +1,65 @@ -// From: https://www.geeksforgeeks.org/socket-programming-cc/. -// Some minor modifications are made to the original code base. -// Lisenced under CCBY-SA. +// SPDX-License-Identifier: MPL-2.0 -// Server side C/C++ program to demonstrate socket programming -#include -#include #include #include #include -#include #include +#include + #define PORT 8080 -int main(int argc, char const* argv[]) -{ + +int main() { int server_fd, new_socket, valread; struct sockaddr_in address; int opt = 1; int addrlen = sizeof(address); - char buffer[1024] = { 0 }; - char* hello = "Hello from server"; - - // Creating socket file descriptor - if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + char buffer[1024] = {0}; + char *hello = "Hello from server"; + + // Create socket + if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) { perror("socket failed"); exit(EXIT_FAILURE); } - - // Forcefully attaching socket to the port 8080 - if (setsockopt(server_fd, SOL_SOCKET, - SO_REUSEADDR | SO_REUSEPORT, &opt, - sizeof(opt))) { - perror("setsockopt"); + + // Set socket options + if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt))) { + perror("setsockopt failed"); exit(EXIT_FAILURE); } + address.sin_family = AF_INET; + address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(PORT); - // Convert IPv4 and IPv6 addresses from text to binary - // form - if (inet_pton(AF_INET, "127.0.0.1", &address.sin_addr) - <= 0) { - printf( - "\nInvalid address/ Address not supported \n"); + + // Convert IPv4 address from text to binary form + if (inet_pton(AF_INET, "127.0.0.1", &(address.sin_addr)) <= 0) { + printf("\n Invalid address/ Address not supported \n"); return -1; } - - // Forcefully attaching socket to the port 8080 - if (bind(server_fd, (struct sockaddr*)&address, - sizeof(address)) - < 0) { + + // Bind the socket to specified IP and port + if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) { perror("bind failed"); exit(EXIT_FAILURE); } + + // Listen for connections if (listen(server_fd, 3) < 0) { - perror("listen"); + perror("listen failed"); exit(EXIT_FAILURE); } - if ((new_socket - = accept(server_fd, (struct sockaddr*)&address, - (socklen_t*)&addrlen)) - < 0) { - perror("accept"); + + // Accept the connection + if ((new_socket = accept(server_fd, (struct sockaddr *)&address, (socklen_t *)&addrlen)) < 0) { + perror("accept failed"); exit(EXIT_FAILURE); } + + // Read the message from the client and reply valread = read(new_socket, buffer, 1024); - printf("%s\n", buffer); + printf("Client: %s\n", buffer); send(new_socket, hello, strlen(hello), 0); printf("Hello message sent\n"); - - // closing the connected socket - close(new_socket); - // closing the listening socket - shutdown(server_fd, SHUT_RDWR); return 0; -} \ No newline at end of file +} diff --git a/regression/apps/network/udp_client.c b/regression/apps/network/udp_client.c index 2ad81b8de..0f5ce5cf0 100644 --- a/regression/apps/network/udp_client.c +++ b/regression/apps/network/udp_client.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/udp_server.c b/regression/apps/network/udp_server.c index 435097d97..12bb8c991 100644 --- a/regression/apps/network/udp_server.c +++ b/regression/apps/network/udp_server.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/unix_client.c b/regression/apps/network/unix_client.c index 041ab1f06..0befa4ee2 100644 --- a/regression/apps/network/unix_client.c +++ b/regression/apps/network/unix_client.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/network/unix_server.c b/regression/apps/network/unix_server.c index f2ca1c9cc..064b769dd 100644 --- a/regression/apps/network/unix_server.c +++ b/regression/apps/network/unix_server.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/pthread/Makefile b/regression/apps/pthread/Makefile index 2eef3474a..8f1ee0ae6 100644 --- a/regression/apps/pthread/Makefile +++ b/regression/apps/pthread/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static -lpthread diff --git a/regression/apps/pthread/pthread_test.c b/regression/apps/pthread/pthread_test.c index 138e59b57..1c601b456 100644 --- a/regression/apps/pthread/pthread_test.c +++ b/regression/apps/pthread/pthread_test.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + // This test file is from occlum pthread test. #include diff --git a/regression/apps/pty/Makefile b/regression/apps/pty/Makefile index 05ff449d2..c603a781a 100644 --- a/regression/apps/pty/Makefile +++ b/regression/apps/pty/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS := diff --git a/regression/apps/pty/open_pty.c b/regression/apps/pty/open_pty.c index 220d2f3eb..2ef2e04ff 100644 --- a/regression/apps/pty/open_pty.c +++ b/regression/apps/pty/open_pty.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #include #include #include diff --git a/regression/apps/scripts/Makefile b/regression/apps/scripts/Makefile index f2b54367a..2e1e19d5a 100644 --- a/regression/apps/scripts/Makefile +++ b/regression/apps/scripts/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + .PHONY: all all: ./*.sh diff --git a/regression/apps/scripts/network.sh b/regression/apps/scripts/network.sh index 432272b5d..0dfbc0f10 100755 --- a/regression/apps/scripts/network.sh +++ b/regression/apps/scripts/network.sh @@ -1,5 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: MPL-2.0 + set -e NETTEST_DIR=/regression/network diff --git a/regression/apps/scripts/process.sh b/regression/apps/scripts/process.sh index 9e8145891..3b00757e2 100755 --- a/regression/apps/scripts/process.sh +++ b/regression/apps/scripts/process.sh @@ -1,5 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: MPL-2.0 + set -e SCRIPT_DIR=/regression diff --git a/regression/apps/scripts/run_regression_test.sh b/regression/apps/scripts/run_regression_test.sh index 1dbba1474..57d87ae15 100755 --- a/regression/apps/scripts/run_regression_test.sh +++ b/regression/apps/scripts/run_regression_test.sh @@ -1,5 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: MPL-2.0 + set -e SCRIPT_DIR=/regression diff --git a/regression/apps/scripts/shell_cmd.sh b/regression/apps/scripts/shell_cmd.sh index 7136d793a..49d6ab2c4 100755 --- a/regression/apps/scripts/shell_cmd.sh +++ b/regression/apps/scripts/shell_cmd.sh @@ -1,5 +1,7 @@ #!/bin/sh +# SPDX-License-Identifier: MPL-2.0 + set -e set -x diff --git a/regression/apps/signal_c/Makefile b/regression/apps/signal_c/Makefile index d393e1212..bf39ea0bf 100644 --- a/regression/apps/signal_c/Makefile +++ b/regression/apps/signal_c/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 + include ../test_common.mk EXTRA_C_FLAGS :=-static diff --git a/regression/apps/signal_c/signal_test.c b/regression/apps/signal_c/signal_test.c index 8d800feef..1193173b0 100644 --- a/regression/apps/signal_c/signal_test.c +++ b/regression/apps/signal_c/signal_test.c @@ -1,4 +1,6 @@ -// This test file is from occlum, to test whether we implement signal correctly. +// SPDX-License-Identifier: MPL-2.0 + +// This test file is from occlum signal test. #define _GNU_SOURCE #include diff --git a/runner/src/gdb.rs b/runner/src/gdb.rs index 209680b4b..1985d002c 100644 --- a/runner/src/gdb.rs +++ b/runner/src/gdb.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Providing the utility to run the GDB scripts for the runner. use crate::qemu_grub_efi; diff --git a/runner/src/machine/microvm.rs b/runner/src/machine/microvm.rs index 3e8e9b104..f92a18b6d 100644 --- a/runner/src/machine/microvm.rs +++ b/runner/src/machine/microvm.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::{ fs::OpenOptions, io::{Seek, SeekFrom, Write}, diff --git a/runner/src/machine/mod.rs b/runner/src/machine/mod.rs index da68453ad..fb7c0255b 100644 --- a/runner/src/machine/mod.rs +++ b/runner/src/machine/mod.rs @@ -1,2 +1,4 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod microvm; pub mod qemu_grub_efi; diff --git a/runner/src/machine/qemu_grub_efi.rs b/runner/src/machine/qemu_grub_efi.rs index f2051d99b..46f7dd627 100644 --- a/runner/src/machine/qemu_grub_efi.rs +++ b/runner/src/machine/qemu_grub_efi.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use linux_bzimage_builder::{make_bzimage, BzImageType}; use std::{ diff --git a/runner/src/main.rs b/runner/src/main.rs index 78be09ff3..f3141d839 100644 --- a/runner/src/main.rs +++ b/runner/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! aster-runner is the Asterinas runner script to ease the pain of running //! and testing Asterinas inside a QEMU VM. It should be built and run as the //! cargo runner: https://doc.rust-lang.org/cargo/reference/config.html diff --git a/services/comps/block/src/bio.rs b/services/comps/block/src/bio.rs index dbdc2a7b9..f3ee10acd 100644 --- a/services/comps/block/src/bio.rs +++ b/services/comps/block/src/bio.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{id::Sid, BlockDevice}; diff --git a/services/comps/block/src/id.rs b/services/comps/block/src/id.rs index a193cfd33..13eb6c96e 100644 --- a/services/comps/block/src/id.rs +++ b/services/comps/block/src/id.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::{ iter::Step, ops::{Add, Sub}, diff --git a/services/comps/block/src/impl_block_device.rs b/services/comps/block/src/impl_block_device.rs index 6bc00e4d2..447a79a85 100644 --- a/services/comps/block/src/impl_block_device.rs +++ b/services/comps/block/src/impl_block_device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{ diff --git a/services/comps/block/src/lib.rs b/services/comps/block/src/lib.rs index 409907417..723f9c390 100644 --- a/services/comps/block/src/lib.rs +++ b/services/comps/block/src/lib.rs @@ -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 diff --git a/services/comps/block/src/prelude.rs b/services/comps/block/src/prelude.rs index dca1f8ff2..77dc3c68a 100644 --- a/services/comps/block/src/prelude.rs +++ b/services/comps/block/src/prelude.rs @@ -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; diff --git a/services/comps/block/src/request_queue.rs b/services/comps/block/src/request_queue.rs index d0403e9c4..749a8b15d 100644 --- a/services/comps/block/src/request_queue.rs +++ b/services/comps/block/src/request_queue.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{ diff --git a/services/comps/console/src/lib.rs b/services/comps/console/src/lib.rs index 431856d1f..c223cd994 100644 --- a/services/comps/console/src/lib.rs +++ b/services/comps/console/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The console device of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/comps/framebuffer/src/lib.rs b/services/comps/framebuffer/src/lib.rs index 05c8820b7..221e69cc5 100644 --- a/services/comps/framebuffer/src/lib.rs +++ b/services/comps/framebuffer/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The framebuffer of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/comps/input/src/lib.rs b/services/comps/input/src/lib.rs index 3edf75509..815a1e822 100644 --- a/services/comps/input/src/lib.rs +++ b/services/comps/input/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The input devices of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/comps/network/src/buffer.rs b/services/comps/network/src/buffer.rs index 0769b40fb..e0322c273 100644 --- a/services/comps/network/src/buffer.rs +++ b/services/comps/network/src/buffer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::mem::size_of; use align_ext::AlignExt; diff --git a/services/comps/network/src/driver.rs b/services/comps/network/src/driver.rs index b2d2b9c44..118a8d94e 100644 --- a/services/comps/network/src/driver.rs +++ b/services/comps/network/src/driver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec; use smoltcp::{phy, time::Instant}; diff --git a/services/comps/network/src/lib.rs b/services/comps/network/src/lib.rs index 04ea77466..9e4af881e 100644 --- a/services/comps/network/src/lib.rs +++ b/services/comps/network/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![no_std] #![forbid(unsafe_code)] #![feature(trait_alias)] diff --git a/services/comps/time/src/clocksource.rs b/services/comps/time/src/clocksource.rs index b688d4235..a3a003e8f 100644 --- a/services/comps/time/src/clocksource.rs +++ b/services/comps/time/src/clocksource.rs @@ -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`. diff --git a/services/comps/time/src/lib.rs b/services/comps/time/src/lib.rs index 9c165d56b..1f81930b1 100644 --- a/services/comps/time/src/lib.rs +++ b/services/comps/time/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The system time of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/comps/time/src/rtc.rs b/services/comps/time/src/rtc.rs index a6dc47b6c..92ed6476a 100644 --- a/services/comps/time/src/rtc.rs +++ b/services/comps/time/src/rtc.rs @@ -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; diff --git a/services/comps/time/src/tsc.rs b/services/comps/time/src/tsc.rs index d44fc34a8..97a68eec5 100644 --- a/services/comps/time/src/tsc.rs +++ b/services/comps/time/src/tsc.rs @@ -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. diff --git a/services/comps/virtio/src/device/block/device.rs b/services/comps/virtio/src/device/block/device.rs index 6ff7cf7d6..5e0613087 100644 --- a/services/comps/virtio/src/device/block/device.rs +++ b/services/comps/virtio/src/device/block/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::{ fmt::Debug, hint::spin_loop, diff --git a/services/comps/virtio/src/device/block/mod.rs b/services/comps/virtio/src/device/block/mod.rs index 8473d1cce..5e508c3ac 100644 --- a/services/comps/virtio/src/device/block/mod.rs +++ b/services/comps/virtio/src/device/block/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod device; use aster_frame::io_mem::IoMem; diff --git a/services/comps/virtio/src/device/console/config.rs b/services/comps/virtio/src/device/console/config.rs index f4e237319..411bcb9f8 100644 --- a/services/comps/virtio/src/device/console/config.rs +++ b/services/comps/virtio/src/device/console/config.rs @@ -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; diff --git a/services/comps/virtio/src/device/console/device.rs b/services/comps/virtio/src/device/console/device.rs index d791f7e33..85276b011 100644 --- a/services/comps/virtio/src/device/console/device.rs +++ b/services/comps/virtio/src/device/console/device.rs @@ -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}; diff --git a/services/comps/virtio/src/device/console/mod.rs b/services/comps/virtio/src/device/console/mod.rs index b322d6a33..b5a8fce11 100644 --- a/services/comps/virtio/src/device/console/mod.rs +++ b/services/comps/virtio/src/device/console/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod config; pub mod device; diff --git a/services/comps/virtio/src/device/input/device.rs b/services/comps/virtio/src/device/input/device.rs index f447d0f90..e5a345fc6 100644 --- a/services/comps/virtio/src/device/input/device.rs +++ b/services/comps/virtio/src/device/input/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use crate::{device::VirtioDeviceError, queue::VirtQueue, transport::VirtioTransport}; diff --git a/services/comps/virtio/src/device/input/mod.rs b/services/comps/virtio/src/device/input/mod.rs index eea3e1360..011acd005 100644 --- a/services/comps/virtio/src/device/input/mod.rs +++ b/services/comps/virtio/src/device/input/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + // Modified from input.rs in virtio-drivers project // // MIT License diff --git a/services/comps/virtio/src/device/mod.rs b/services/comps/virtio/src/device/mod.rs index a8e00cd5c..5c2defdbc 100644 --- a/services/comps/virtio/src/device/mod.rs +++ b/services/comps/virtio/src/device/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::queue::QueueError; use int_to_c_enum::TryFromInt; diff --git a/services/comps/virtio/src/device/network/config.rs b/services/comps/virtio/src/device/network/config.rs index 0fb980d5b..a819e3b04 100644 --- a/services/comps/virtio/src/device/network/config.rs +++ b/services/comps/virtio/src/device/network/config.rs @@ -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; diff --git a/services/comps/virtio/src/device/network/device.rs b/services/comps/virtio/src/device/network/device.rs index d8ba25912..aa2b1da8f 100644 --- a/services/comps/virtio/src/device/network/device.rs +++ b/services/comps/virtio/src/device/network/device.rs @@ -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}; diff --git a/services/comps/virtio/src/device/network/header.rs b/services/comps/virtio/src/device/network/header.rs index c1179ab36..2294fbb0e 100644 --- a/services/comps/virtio/src/device/network/header.rs +++ b/services/comps/virtio/src/device/network/header.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitflags::bitflags; use int_to_c_enum::TryFromInt; use pod::Pod; diff --git a/services/comps/virtio/src/device/network/mod.rs b/services/comps/virtio/src/device/network/mod.rs index b88f1c3d3..7940c4438 100644 --- a/services/comps/virtio/src/device/network/mod.rs +++ b/services/comps/virtio/src/device/network/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod config; pub mod device; pub mod header; diff --git a/services/comps/virtio/src/lib.rs b/services/comps/virtio/src/lib.rs index 6b5e89671..34d70b56b 100644 --- a/services/comps/virtio/src/lib.rs +++ b/services/comps/virtio/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The virtio of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/comps/virtio/src/queue.rs b/services/comps/virtio/src/queue.rs index 50c5c3a4c..092d139e9 100644 --- a/services/comps/virtio/src/queue.rs +++ b/services/comps/virtio/src/queue.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtqueue use crate::transport::VirtioTransport; diff --git a/services/comps/virtio/src/transport/mmio/device.rs b/services/comps/virtio/src/transport/mmio/device.rs index 60f2dce26..eca2e0a52 100644 --- a/services/comps/virtio/src/transport/mmio/device.rs +++ b/services/comps/virtio/src/transport/mmio/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{boxed::Box, sync::Arc}; use aster_frame::{ bus::mmio::{ diff --git a/services/comps/virtio/src/transport/mmio/driver.rs b/services/comps/virtio/src/transport/mmio/driver.rs index e4d21dc8b..82c88715d 100644 --- a/services/comps/virtio/src/transport/mmio/driver.rs +++ b/services/comps/virtio/src/transport/mmio/driver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{sync::Arc, vec::Vec}; use aster_frame::{ bus::{ diff --git a/services/comps/virtio/src/transport/mmio/layout.rs b/services/comps/virtio/src/transport/mmio/layout.rs index cc3a56f11..71bf7a239 100644 --- a/services/comps/virtio/src/transport/mmio/layout.rs +++ b/services/comps/virtio/src/transport/mmio/layout.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use pod::Pod; diff --git a/services/comps/virtio/src/transport/mmio/mod.rs b/services/comps/virtio/src/transport/mmio/mod.rs index 13bb42c18..d26453ff3 100644 --- a/services/comps/virtio/src/transport/mmio/mod.rs +++ b/services/comps/virtio/src/transport/mmio/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use aster_frame::bus::mmio::MMIO_BUS; use spin::Once; diff --git a/services/comps/virtio/src/transport/mmio/multiplex.rs b/services/comps/virtio/src/transport/mmio/multiplex.rs index 82ee9f27d..e4f90dcf1 100644 --- a/services/comps/virtio/src/transport/mmio/multiplex.rs +++ b/services/comps/virtio/src/transport/mmio/multiplex.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use alloc::{boxed::Box, sync::Arc, vec::Vec}; diff --git a/services/comps/virtio/src/transport/mod.rs b/services/comps/virtio/src/transport/mod.rs index 46e083b86..28a1ef1e1 100644 --- a/services/comps/virtio/src/transport/mod.rs +++ b/services/comps/virtio/src/transport/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::fmt::Debug; use alloc::boxed::Box; diff --git a/services/comps/virtio/src/transport/pci/capability.rs b/services/comps/virtio/src/transport/pci/capability.rs index f8a4c6a7a..e360c9923 100644 --- a/services/comps/virtio/src/transport/pci/capability.rs +++ b/services/comps/virtio/src/transport/pci/capability.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Arc; use aster_frame::bus::pci::{ capability::vendor::CapabilityVndrData, diff --git a/services/comps/virtio/src/transport/pci/common_cfg.rs b/services/comps/virtio/src/transport/pci/common_cfg.rs index 6d7248966..f3af5ebb5 100644 --- a/services/comps/virtio/src/transport/pci/common_cfg.rs +++ b/services/comps/virtio/src/transport/pci/common_cfg.rs @@ -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; diff --git a/services/comps/virtio/src/transport/pci/device.rs b/services/comps/virtio/src/transport/pci/device.rs index f67f1f097..019da9d96 100644 --- a/services/comps/virtio/src/transport/pci/device.rs +++ b/services/comps/virtio/src/transport/pci/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::{ bus::{ pci::{ diff --git a/services/comps/virtio/src/transport/pci/driver.rs b/services/comps/virtio/src/transport/pci/driver.rs index 5e37120f0..eb6dadaeb 100644 --- a/services/comps/virtio/src/transport/pci/driver.rs +++ b/services/comps/virtio/src/transport/pci/driver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::{sync::Arc, vec::Vec}; use aster_frame::{ bus::{ diff --git a/services/comps/virtio/src/transport/pci/mod.rs b/services/comps/virtio/src/transport/pci/mod.rs index 4fd80e8c7..a7eb1964b 100644 --- a/services/comps/virtio/src/transport/pci/mod.rs +++ b/services/comps/virtio/src/transport/pci/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod capability; pub mod common_cfg; pub mod device; diff --git a/services/comps/virtio/src/transport/pci/msix.rs b/services/comps/virtio/src/transport/pci/msix.rs index baeb093ac..b5dc34d40 100644 --- a/services/comps/virtio/src/transport/pci/msix.rs +++ b/services/comps/virtio/src/transport/pci/msix.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec::Vec; use aster_frame::{bus::pci::capability::msix::CapabilityMsixData, trap::IrqLine}; diff --git a/services/libs/aster-rights-proc/src/lib.rs b/services/libs/aster-rights-proc/src/lib.rs index 3ca7d27e2..86c4ef58b 100644 --- a/services/libs/aster-rights-proc/src/lib.rs +++ b/services/libs/aster-rights-proc/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //!This crate defines the require procedural macros to implement capability for Asterinas. //! When use this crate, typeflags and typeflags-util should also be added as dependency. //! diff --git a/services/libs/aster-rights-proc/src/require_attr.rs b/services/libs/aster-rights-proc/src/require_attr.rs index 6cf791a9f..eb48870da 100644 --- a/services/libs/aster-rights-proc/src/require_attr.rs +++ b/services/libs/aster-rights-proc/src/require_attr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! expand the require macro use proc_macro2::{Ident, TokenStream}; diff --git a/services/libs/aster-rights-proc/src/require_item.rs b/services/libs/aster-rights-proc/src/require_item.rs index a423539b5..3d7fcd513 100644 --- a/services/libs/aster-rights-proc/src/require_item.rs +++ b/services/libs/aster-rights-proc/src/require_item.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use syn::{parse::Parse, ItemFn, ItemImpl, Token}; pub enum RequireItem { diff --git a/services/libs/aster-rights/src/lib.rs b/services/libs/aster-rights/src/lib.rs index e7e929bff..9c9204551 100644 --- a/services/libs/aster-rights/src/lib.rs +++ b/services/libs/aster-rights/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![no_std] use core::ops::{Deref, DerefMut}; diff --git a/services/libs/aster-std/src/console.rs b/services/libs/aster-std/src/console.rs index d42995e2f..9368b5932 100644 --- a/services/libs/aster-std/src/console.rs +++ b/services/libs/aster-std/src/console.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! `print` and `println` macros //! //! FIXME: It will print to all `virtio-console` devices, which is not a good choice. diff --git a/services/libs/aster-std/src/device/mod.rs b/services/libs/aster-std/src/device/mod.rs index 79d1248d2..add0439d5 100644 --- a/services/libs/aster-std/src/device/mod.rs +++ b/services/libs/aster-std/src/device/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod null; mod pty; mod random; diff --git a/services/libs/aster-std/src/device/null.rs b/services/libs/aster-std/src/device/null.rs index 7137a64ed..81426c621 100644 --- a/services/libs/aster-std/src/device/null.rs +++ b/services/libs/aster-std/src/device/null.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; use crate::events::IoEvents; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/device/pty/mod.rs b/services/libs/aster-std/src/device/pty/mod.rs index 8ee323a67..45655f692 100644 --- a/services/libs/aster-std/src/device/pty/mod.rs +++ b/services/libs/aster-std/src/device/pty/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::devpts::DevPts; use crate::fs::fs_resolver::{FsPath, FsResolver}; use crate::fs::utils::{Dentry, Inode, InodeMode, InodeType}; diff --git a/services/libs/aster-std/src/device/pty/pty.rs b/services/libs/aster-std/src/device/pty/pty.rs index 748edb3ec..e10cc948b 100644 --- a/services/libs/aster-std/src/device/pty/pty.rs +++ b/services/libs/aster-std/src/device/pty/pty.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::format; use ringbuf::{ring_buffer::RbBase, HeapRb, Rb}; diff --git a/services/libs/aster-std/src/device/random.rs b/services/libs/aster-std/src/device/random.rs index 4ed22a5e2..74f13e32a 100644 --- a/services/libs/aster-std/src/device/random.rs +++ b/services/libs/aster-std/src/device/random.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::device::{Device, DeviceId, DeviceType}; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/device/tdxguest/mod.rs b/services/libs/aster-std/src/device/tdxguest/mod.rs index 6a493d8da..ba50ebace 100644 --- a/services/libs/aster-std/src/device/tdxguest/mod.rs +++ b/services/libs/aster-std/src/device/tdxguest/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; use crate::error::Error; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/device/tty/device.rs b/services/libs/aster-std/src/device/tty/device.rs index e5f8afb79..b0f76d7a0 100644 --- a/services/libs/aster-std/src/device/tty/device.rs +++ b/services/libs/aster-std/src/device/tty/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::device::{Device, DeviceId, DeviceType}; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/device/tty/driver.rs b/services/libs/aster-std/src/device/tty/driver.rs index 8801680db..951dd1084 100644 --- a/services/libs/aster-std/src/device/tty/driver.rs +++ b/services/libs/aster-std/src/device/tty/driver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub use aster_frame::arch::console::register_console_input_callback; use spin::Once; diff --git a/services/libs/aster-std/src/device/tty/line_discipline.rs b/services/libs/aster-std/src/device/tty/line_discipline.rs index 29ace5190..63117009c 100644 --- a/services/libs/aster-std/src/device/tty/line_discipline.rs +++ b/services/libs/aster-std/src/device/tty/line_discipline.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::prelude::*; use crate::process::signal::constants::{SIGINT, SIGQUIT}; diff --git a/services/libs/aster-std/src/device/tty/mod.rs b/services/libs/aster-std/src/device/tty/mod.rs index 1aea18dad..dfb1f5394 100644 --- a/services/libs/aster-std/src/device/tty/mod.rs +++ b/services/libs/aster-std/src/device/tty/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use spin::Once; use self::driver::TtyDriver; diff --git a/services/libs/aster-std/src/device/tty/termio.rs b/services/libs/aster-std/src/device/tty/termio.rs index b7074e719..d9f256e20 100644 --- a/services/libs/aster-std/src/device/tty/termio.rs +++ b/services/libs/aster-std/src/device/tty/termio.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![allow(non_camel_case_types)] use crate::prelude::*; diff --git a/services/libs/aster-std/src/device/urandom.rs b/services/libs/aster-std/src/device/urandom.rs index 687ecb762..82828d02c 100644 --- a/services/libs/aster-std/src/device/urandom.rs +++ b/services/libs/aster-std/src/device/urandom.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::device::{Device, DeviceId, DeviceType}; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/device/zero.rs b/services/libs/aster-std/src/device/zero.rs index e3b695cd9..f72c8fa02 100644 --- a/services/libs/aster-std/src/device/zero.rs +++ b/services/libs/aster-std/src/device/zero.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; use crate::events::IoEvents; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/driver/mod.rs b/services/libs/aster-std/src/driver/mod.rs index 2ef474470..750803b5e 100644 --- a/services/libs/aster-std/src/driver/mod.rs +++ b/services/libs/aster-std/src/driver/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use log::info; pub fn init() { diff --git a/services/libs/aster-std/src/error.rs b/services/libs/aster-std/src/error.rs index e23d819cd..8d2b1346d 100644 --- a/services/libs/aster-std/src/error.rs +++ b/services/libs/aster-std/src/error.rs @@ -1,4 +1,6 @@ -/// Errno. Copied from Occlum +// SPDX-License-Identifier: MPL-2.0 + +/// Error number. #[repr(i32)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum Errno { diff --git a/services/libs/aster-std/src/events/events.rs b/services/libs/aster-std/src/events/events.rs index 1c4ff51ab..0ca220e33 100644 --- a/services/libs/aster-std/src/events/events.rs +++ b/services/libs/aster-std/src/events/events.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// A trait to represent any events. /// /// # The unit event diff --git a/services/libs/aster-std/src/events/io_events.rs b/services/libs/aster-std/src/events/io_events.rs index 7f8111f34..029bddafd 100644 --- a/services/libs/aster-std/src/events/io_events.rs +++ b/services/libs/aster-std/src/events/io_events.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{Events, EventsFilter}; crate::bitflags! { diff --git a/services/libs/aster-std/src/events/mod.rs b/services/libs/aster-std/src/events/mod.rs index b977e5f87..51a625d35 100644 --- a/services/libs/aster-std/src/events/mod.rs +++ b/services/libs/aster-std/src/events/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #[allow(clippy::module_inception)] mod events; mod io_events; diff --git a/services/libs/aster-std/src/events/observer.rs b/services/libs/aster-std/src/events/observer.rs index 6f2052b49..dc5c11fa0 100644 --- a/services/libs/aster-std/src/events/observer.rs +++ b/services/libs/aster-std/src/events/observer.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::Events; /// An observer for events. diff --git a/services/libs/aster-std/src/events/subject.rs b/services/libs/aster-std/src/events/subject.rs index f5bbd4c00..376fe1eda 100644 --- a/services/libs/aster-std/src/events/subject.rs +++ b/services/libs/aster-std/src/events/subject.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use core::sync::atomic::{AtomicUsize, Ordering}; diff --git a/services/libs/aster-std/src/fs/device.rs b/services/libs/aster-std/src/fs/device.rs index d93928f5d..1f45b4370 100644 --- a/services/libs/aster-std/src/fs/device.rs +++ b/services/libs/aster-std/src/fs/device.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::fs_resolver::{FsPath, FsResolver}; use crate::fs::utils::Dentry; use crate::fs::utils::{InodeMode, InodeType}; diff --git a/services/libs/aster-std/src/fs/devpts/mod.rs b/services/libs/aster-std/src/fs/devpts/mod.rs index 99f75ff86..4af087374 100644 --- a/services/libs/aster-std/src/fs/devpts/mod.rs +++ b/services/libs/aster-std/src/fs/devpts/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::device::PtyMaster; use crate::fs::device::{Device, DeviceId, DeviceType}; use crate::fs::utils::{ diff --git a/services/libs/aster-std/src/fs/devpts/ptmx.rs b/services/libs/aster-std/src/fs/devpts/ptmx.rs index 398d86adc..1d2312069 100644 --- a/services/libs/aster-std/src/fs/devpts/ptmx.rs +++ b/services/libs/aster-std/src/fs/devpts/ptmx.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::device::PtyMaster; use crate::events::IoEvents; use crate::fs::inode_handle::FileIo; diff --git a/services/libs/aster-std/src/fs/devpts/slave.rs b/services/libs/aster-std/src/fs/devpts/slave.rs index 6bb34fbfd..1f0b29b79 100644 --- a/services/libs/aster-std/src/fs/devpts/slave.rs +++ b/services/libs/aster-std/src/fs/devpts/slave.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::inode_handle::FileIo; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/epoll/epoll_file.rs b/services/libs/aster-std/src/fs/epoll/epoll_file.rs index 528276678..8fe9d06fd 100644 --- a/services/libs/aster-std/src/fs/epoll/epoll_file.rs +++ b/services/libs/aster-std/src/fs/epoll/epoll_file.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::{IoEvents, Observer}; use crate::fs::file_handle::FileLike; use crate::fs::file_table::{FdEvents, FileDescripter}; diff --git a/services/libs/aster-std/src/fs/epoll/mod.rs b/services/libs/aster-std/src/fs/epoll/mod.rs index 66ae3bfc9..c4fbbed75 100644 --- a/services/libs/aster-std/src/fs/epoll/mod.rs +++ b/services/libs/aster-std/src/fs/epoll/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::file_table::FileDescripter; use crate::events::IoEvents; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/block_group.rs b/services/libs/aster-std/src/fs/ext2/block_group.rs index 1941328df..1d85f6b64 100644 --- a/services/libs/aster-std/src/fs/ext2/block_group.rs +++ b/services/libs/aster-std/src/fs/ext2/block_group.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::fs::Ext2; use super::inode::{Inode, InodeDesc, RawInode}; use super::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/blocks_hole.rs b/services/libs/aster-std/src/fs/ext2/blocks_hole.rs index da924b651..3214eced1 100644 --- a/services/libs/aster-std/src/fs/ext2/blocks_hole.rs +++ b/services/libs/aster-std/src/fs/ext2/blocks_hole.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitvec::prelude::BitVec; /// A blocks hole descriptor implemented by the `BitVec`. diff --git a/services/libs/aster-std/src/fs/ext2/dir.rs b/services/libs/aster-std/src/fs/ext2/dir.rs index 5f60bcdb2..5ca1faefe 100644 --- a/services/libs/aster-std/src/fs/ext2/dir.rs +++ b/services/libs/aster-std/src/fs/ext2/dir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::inode::{FileType, MAX_FNAME_LEN}; use super::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/fs.rs b/services/libs/aster-std/src/fs/ext2/fs.rs index 45b47c0a9..4113fc7cb 100644 --- a/services/libs/aster-std/src/fs/ext2/fs.rs +++ b/services/libs/aster-std/src/fs/ext2/fs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::block_group::{BlockGroup, RawGroupDescriptor}; use super::inode::{FilePerm, FileType, Inode, InodeDesc, RawInode}; use super::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/fs.rs b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/fs.rs index e65f43194..691314f70 100644 --- a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/fs.rs +++ b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/fs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::ext2::{utils::Dirty, Ext2, SuperBlock as Ext2SuperBlock, MAGIC_NUM as EXT2_MAGIC}; use crate::fs::utils::{FileSystem, FsFlags, Inode, SuperBlock, NAME_MAX}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/inode.rs b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/inode.rs index fd4ae9212..83d936a3b 100644 --- a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/inode.rs +++ b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/inode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::device::Device; use crate::fs::ext2::{FilePerm, FileType, Inode as Ext2Inode}; use crate::fs::utils::{ diff --git a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/mod.rs b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/mod.rs index 249746aab..311217dbb 100644 --- a/services/libs/aster-std/src/fs/ext2/impl_for_vfs/mod.rs +++ b/services/libs/aster-std/src/fs/ext2/impl_for_vfs/mod.rs @@ -1,2 +1,4 @@ +// SPDX-License-Identifier: MPL-2.0 + mod fs; mod inode; diff --git a/services/libs/aster-std/src/fs/ext2/inode.rs b/services/libs/aster-std/src/fs/ext2/inode.rs index 61bdf58d5..ca79ada0e 100644 --- a/services/libs/aster-std/src/fs/ext2/inode.rs +++ b/services/libs/aster-std/src/fs/ext2/inode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::blocks_hole::BlocksHoleDesc; use super::dir::{DirEntry, DirEntryReader, DirEntryWriter}; use super::fs::Ext2; diff --git a/services/libs/aster-std/src/fs/ext2/mod.rs b/services/libs/aster-std/src/fs/ext2/mod.rs index ff7774871..b1c107c24 100644 --- a/services/libs/aster-std/src/fs/ext2/mod.rs +++ b/services/libs/aster-std/src/fs/ext2/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! A safe Rust Ext2 filesystem. //! //! The Second Extended File System(Ext2) is a major rewrite of the Ext filesystem. diff --git a/services/libs/aster-std/src/fs/ext2/prelude.rs b/services/libs/aster-std/src/fs/ext2/prelude.rs index 6fc487b7a..716389edc 100644 --- a/services/libs/aster-std/src/fs/ext2/prelude.rs +++ b/services/libs/aster-std/src/fs/ext2/prelude.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub(super) use super::utils::{Dirty, IsPowerOf}; pub(super) use crate::fs::utils::{ diff --git a/services/libs/aster-std/src/fs/ext2/super_block.rs b/services/libs/aster-std/src/fs/ext2/super_block.rs index 631b96ee0..8b8c2cde9 100644 --- a/services/libs/aster-std/src/fs/ext2/super_block.rs +++ b/services/libs/aster-std/src/fs/ext2/super_block.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::inode::RawInode; use super::prelude::*; diff --git a/services/libs/aster-std/src/fs/ext2/utils.rs b/services/libs/aster-std/src/fs/ext2/utils.rs index 8d2870319..cd41c9d2a 100644 --- a/services/libs/aster-std/src/fs/ext2/utils.rs +++ b/services/libs/aster-std/src/fs/ext2/utils.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::prelude::*; use core::ops::MulAssign; diff --git a/services/libs/aster-std/src/fs/file_handle.rs b/services/libs/aster-std/src/fs/file_handle.rs index 8bc4c71bd..23e0156fd 100644 --- a/services/libs/aster-std/src/fs/file_handle.rs +++ b/services/libs/aster-std/src/fs/file_handle.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Opend File Handle use crate::events::{IoEvents, Observer}; diff --git a/services/libs/aster-std/src/fs/file_table.rs b/services/libs/aster-std/src/fs/file_table.rs index a3eeb0a0c..df48d5fde 100644 --- a/services/libs/aster-std/src/fs/file_table.rs +++ b/services/libs/aster-std/src/fs/file_table.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::{Events, Observer, Subject}; use crate::net::socket::Socket; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/fs_resolver.rs b/services/libs/aster-std/src/fs/fs_resolver.rs index 776eec7df..b98b032ef 100644 --- a/services/libs/aster-std/src/fs/fs_resolver.rs +++ b/services/libs/aster-std/src/fs/fs_resolver.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use alloc::str; diff --git a/services/libs/aster-std/src/fs/inode_handle/dyn_cap.rs b/services/libs/aster-std/src/fs/inode_handle/dyn_cap.rs index f554f4621..3e62d1b00 100644 --- a/services/libs/aster-std/src/fs/inode_handle/dyn_cap.rs +++ b/services/libs/aster-std/src/fs/inode_handle/dyn_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::prelude::*; use crate::process::signal::Poller; diff --git a/services/libs/aster-std/src/fs/inode_handle/mod.rs b/services/libs/aster-std/src/fs/inode_handle/mod.rs index e84dba0a2..695edfab0 100644 --- a/services/libs/aster-std/src/fs/inode_handle/mod.rs +++ b/services/libs/aster-std/src/fs/inode_handle/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Opend Inode-backed File Handle mod dyn_cap; diff --git a/services/libs/aster-std/src/fs/inode_handle/static_cap.rs b/services/libs/aster-std/src/fs/inode_handle/static_cap.rs index 1744f4815..77e2ac0cb 100644 --- a/services/libs/aster-std/src/fs/inode_handle/static_cap.rs +++ b/services/libs/aster-std/src/fs/inode_handle/static_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_rights::{Read, TRightSet, TRights, Write}; use aster_rights_proc::require; diff --git a/services/libs/aster-std/src/fs/mod.rs b/services/libs/aster-std/src/fs/mod.rs index 644e8d170..52bf23673 100644 --- a/services/libs/aster-std/src/fs/mod.rs +++ b/services/libs/aster-std/src/fs/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod device; pub mod devpts; pub mod epoll; diff --git a/services/libs/aster-std/src/fs/pipe.rs b/services/libs/aster-std/src/fs/pipe.rs index d7992ca49..6ccf69c79 100644 --- a/services/libs/aster-std/src/fs/pipe.rs +++ b/services/libs/aster-std/src/fs/pipe.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::{IoEvents, Observer}; use crate::prelude::*; use crate::process::signal::Poller; diff --git a/services/libs/aster-std/src/fs/procfs/mod.rs b/services/libs/aster-std/src/fs/procfs/mod.rs index f1fec834a..4a9e4c17c 100644 --- a/services/libs/aster-std/src/fs/procfs/mod.rs +++ b/services/libs/aster-std/src/fs/procfs/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicUsize, Ordering}; use crate::events::Observer; diff --git a/services/libs/aster-std/src/fs/procfs/pid/comm.rs b/services/libs/aster-std/src/fs/procfs/pid/comm.rs index 20b1e3533..7b906a7f9 100644 --- a/services/libs/aster-std/src/fs/procfs/pid/comm.rs +++ b/services/libs/aster-std/src/fs/procfs/pid/comm.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; /// Represents the inode at `/proc/[pid]/comm`. diff --git a/services/libs/aster-std/src/fs/procfs/pid/exe.rs b/services/libs/aster-std/src/fs/procfs/pid/exe.rs index 22a9f42f9..016f13746 100644 --- a/services/libs/aster-std/src/fs/procfs/pid/exe.rs +++ b/services/libs/aster-std/src/fs/procfs/pid/exe.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; /// Represents the inode at `/proc/[pid]/exe`. diff --git a/services/libs/aster-std/src/fs/procfs/pid/fd.rs b/services/libs/aster-std/src/fs/procfs/pid/fd.rs index 49c9dc004..335757b04 100644 --- a/services/libs/aster-std/src/fs/procfs/pid/fd.rs +++ b/services/libs/aster-std/src/fs/procfs/pid/fd.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; use crate::fs::file_handle::FileLike; use crate::fs::file_table::FileDescripter; diff --git a/services/libs/aster-std/src/fs/procfs/pid/mod.rs b/services/libs/aster-std/src/fs/procfs/pid/mod.rs index da4548e2a..bb4987b53 100644 --- a/services/libs/aster-std/src/fs/procfs/pid/mod.rs +++ b/services/libs/aster-std/src/fs/procfs/pid/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::Observer; use crate::fs::file_table::FdEvents; use crate::fs::utils::{DirEntryVecExt, Inode}; diff --git a/services/libs/aster-std/src/fs/procfs/self_.rs b/services/libs/aster-std/src/fs/procfs/self_.rs index a046a7655..0fa34b3f7 100644 --- a/services/libs/aster-std/src/fs/procfs/self_.rs +++ b/services/libs/aster-std/src/fs/procfs/self_.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::*; /// Represents the inode at `/proc/self`. diff --git a/services/libs/aster-std/src/fs/procfs/template/builder.rs b/services/libs/aster-std/src/fs/procfs/template/builder.rs index 60263a6ac..560db8c30 100644 --- a/services/libs/aster-std/src/fs/procfs/template/builder.rs +++ b/services/libs/aster-std/src/fs/procfs/template/builder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::utils::{FileSystem, Inode}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/procfs/template/dir.rs b/services/libs/aster-std/src/fs/procfs/template/dir.rs index 251c62312..22076b9ad 100644 --- a/services/libs/aster-std/src/fs/procfs/template/dir.rs +++ b/services/libs/aster-std/src/fs/procfs/template/dir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_util::slot_vec::SlotVec; use core::time::Duration; diff --git a/services/libs/aster-std/src/fs/procfs/template/file.rs b/services/libs/aster-std/src/fs/procfs/template/file.rs index ad810575c..5312f2600 100644 --- a/services/libs/aster-std/src/fs/procfs/template/file.rs +++ b/services/libs/aster-std/src/fs/procfs/template/file.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::fs::utils::{FileSystem, Inode, InodeMode, InodeType, IoctlCmd, Metadata}; diff --git a/services/libs/aster-std/src/fs/procfs/template/mod.rs b/services/libs/aster-std/src/fs/procfs/template/mod.rs index d15fa01a8..3eb4e5163 100644 --- a/services/libs/aster-std/src/fs/procfs/template/mod.rs +++ b/services/libs/aster-std/src/fs/procfs/template/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::fs::utils::{FileSystem, InodeMode, Metadata}; diff --git a/services/libs/aster-std/src/fs/procfs/template/sym.rs b/services/libs/aster-std/src/fs/procfs/template/sym.rs index 289438e0a..68e22496d 100644 --- a/services/libs/aster-std/src/fs/procfs/template/sym.rs +++ b/services/libs/aster-std/src/fs/procfs/template/sym.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::fs::utils::{FileSystem, Inode, InodeMode, InodeType, IoctlCmd, Metadata}; diff --git a/services/libs/aster-std/src/fs/ramfs/fs.rs b/services/libs/aster-std/src/fs/ramfs/fs.rs index 8a2f17cad..7a6ab7c49 100644 --- a/services/libs/aster-std/src/fs/ramfs/fs.rs +++ b/services/libs/aster-std/src/fs/ramfs/fs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::sync::RwLockWriteGuard; use aster_frame::vm::VmFrame; use aster_frame::vm::VmIo; diff --git a/services/libs/aster-std/src/fs/ramfs/mod.rs b/services/libs/aster-std/src/fs/ramfs/mod.rs index 9bf41b31c..c407cf701 100644 --- a/services/libs/aster-std/src/fs/ramfs/mod.rs +++ b/services/libs/aster-std/src/fs/ramfs/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Ramfs based on PageCache pub use fs::RamFS; diff --git a/services/libs/aster-std/src/fs/rootfs.rs b/services/libs/aster-std/src/fs/rootfs.rs index ea6113580..b3afaca68 100644 --- a/services/libs/aster-std/src/fs/rootfs.rs +++ b/services/libs/aster-std/src/fs/rootfs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::fs_resolver::{FsPath, FsResolver}; diff --git a/services/libs/aster-std/src/fs/utils/access_mode.rs b/services/libs/aster-std/src/fs/utils/access_mode.rs index cbf76ba37..29cf2529b 100644 --- a/services/libs/aster-std/src/fs/utils/access_mode.rs +++ b/services/libs/aster-std/src/fs/utils/access_mode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_rights::Rights; diff --git a/services/libs/aster-std/src/fs/utils/channel.rs b/services/libs/aster-std/src/fs/utils/channel.rs index 722953caf..164bd76a4 100644 --- a/services/libs/aster-std/src/fs/utils/channel.rs +++ b/services/libs/aster-std/src/fs/utils/channel.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_rights_proc::require; use core::sync::atomic::{AtomicBool, AtomicU32, Ordering}; use ringbuf::{HeapConsumer as HeapRbConsumer, HeapProducer as HeapRbProducer, HeapRb}; diff --git a/services/libs/aster-std/src/fs/utils/creation_flags.rs b/services/libs/aster-std/src/fs/utils/creation_flags.rs index dc6bfe1d5..d6e69014a 100644 --- a/services/libs/aster-std/src/fs/utils/creation_flags.rs +++ b/services/libs/aster-std/src/fs/utils/creation_flags.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitflags::bitflags; bitflags! { diff --git a/services/libs/aster-std/src/fs/utils/dentry.rs b/services/libs/aster-std/src/fs/utils/dentry.rs index a4c3d8c6e..21cf04717 100644 --- a/services/libs/aster-std/src/fs/utils/dentry.rs +++ b/services/libs/aster-std/src/fs/utils/dentry.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::device::Device; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/utils/dirent_visitor.rs b/services/libs/aster-std/src/fs/utils/dirent_visitor.rs index 2bd2642ce..d47b21574 100644 --- a/services/libs/aster-std/src/fs/utils/dirent_visitor.rs +++ b/services/libs/aster-std/src/fs/utils/dirent_visitor.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::InodeType; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/utils/direntry_vec.rs b/services/libs/aster-std/src/fs/utils/direntry_vec.rs index 45c4b6b7a..43ac243b8 100644 --- a/services/libs/aster-std/src/fs/utils/direntry_vec.rs +++ b/services/libs/aster-std/src/fs/utils/direntry_vec.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::Inode; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/utils/file_creation_mask.rs b/services/libs/aster-std/src/fs/utils/file_creation_mask.rs index 2a2e9d98f..42e54bb90 100644 --- a/services/libs/aster-std/src/fs/utils/file_creation_mask.rs +++ b/services/libs/aster-std/src/fs/utils/file_creation_mask.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// A mask for the file mode of a newly-created file or directory. /// /// This mask is always a subset of `0o777`. diff --git a/services/libs/aster-std/src/fs/utils/fs.rs b/services/libs/aster-std/src/fs/utils/fs.rs index f06a5d869..033d52dab 100644 --- a/services/libs/aster-std/src/fs/utils/fs.rs +++ b/services/libs/aster-std/src/fs/utils/fs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::Inode; use crate::prelude::*; diff --git a/services/libs/aster-std/src/fs/utils/inode.rs b/services/libs/aster-std/src/fs/utils/inode.rs index 01143dc47..e61150370 100644 --- a/services/libs/aster-std/src/fs/utils/inode.rs +++ b/services/libs/aster-std/src/fs/utils/inode.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_rights::Full; use core::time::Duration; use core2::io::{Error as IoError, ErrorKind as IoErrorKind, Result as IoResult, Write}; diff --git a/services/libs/aster-std/src/fs/utils/ioctl.rs b/services/libs/aster-std/src/fs/utils/ioctl.rs index 0901c544b..4503dcfa3 100644 --- a/services/libs/aster-std/src/fs/utils/ioctl.rs +++ b/services/libs/aster-std/src/fs/utils/ioctl.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; #[repr(u32)] diff --git a/services/libs/aster-std/src/fs/utils/mod.rs b/services/libs/aster-std/src/fs/utils/mod.rs index f5595834c..e71fc4ffc 100644 --- a/services/libs/aster-std/src/fs/utils/mod.rs +++ b/services/libs/aster-std/src/fs/utils/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! VFS components pub use access_mode::AccessMode; diff --git a/services/libs/aster-std/src/fs/utils/mount.rs b/services/libs/aster-std/src/fs/utils/mount.rs index 044a6bfdf..6cef1b12f 100644 --- a/services/libs/aster-std/src/fs/utils/mount.rs +++ b/services/libs/aster-std/src/fs/utils/mount.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{Dentry, DentryKey, FileSystem, InodeType}; diff --git a/services/libs/aster-std/src/fs/utils/page_cache.rs b/services/libs/aster-std/src/fs/utils/page_cache.rs index e685ab1db..2e2876b81 100644 --- a/services/libs/aster-std/src/fs/utils/page_cache.rs +++ b/services/libs/aster-std/src/fs/utils/page_cache.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use crate::vm::vmo::{get_page_idx_range, Pager, Vmo, VmoFlags, VmoOptions}; use aster_rights::Full; diff --git a/services/libs/aster-std/src/fs/utils/status_flags.rs b/services/libs/aster-std/src/fs/utils/status_flags.rs index 2645c332b..f2d124b94 100644 --- a/services/libs/aster-std/src/fs/utils/status_flags.rs +++ b/services/libs/aster-std/src/fs/utils/status_flags.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitflags::bitflags; bitflags! { diff --git a/services/libs/aster-std/src/lib.rs b/services/libs/aster-std/src/lib.rs index a58704a86..44063f9af 100644 --- a/services/libs/aster-std/src/lib.rs +++ b/services/libs/aster-std/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The std library of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/libs/aster-std/src/net/iface/any_socket.rs b/services/libs/aster-std/src/net/iface/any_socket.rs index fbd5e9eb0..21e3aac3f 100644 --- a/services/libs/aster-std/src/net/iface/any_socket.rs +++ b/services/libs/aster-std/src/net/iface/any_socket.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::Observer; use crate::prelude::*; diff --git a/services/libs/aster-std/src/net/iface/common.rs b/services/libs/aster-std/src/net/iface/common.rs index 01890a446..8bee94f16 100644 --- a/services/libs/aster-std/src/net/iface/common.rs +++ b/services/libs/aster-std/src/net/iface/common.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicU64, Ordering}; use super::Ipv4Address; diff --git a/services/libs/aster-std/src/net/iface/loopback.rs b/services/libs/aster-std/src/net/iface/loopback.rs index 0d40e18fc..cfb66e2f8 100644 --- a/services/libs/aster-std/src/net/iface/loopback.rs +++ b/services/libs/aster-std/src/net/iface/loopback.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{IpAddress, Ipv4Address}; use crate::prelude::*; use smoltcp::{ diff --git a/services/libs/aster-std/src/net/iface/mod.rs b/services/libs/aster-std/src/net/iface/mod.rs index 92a7013cd..bdd40c870 100644 --- a/services/libs/aster-std/src/net/iface/mod.rs +++ b/services/libs/aster-std/src/net/iface/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use self::common::IfaceCommon; use crate::prelude::*; use smoltcp::iface::SocketSet; diff --git a/services/libs/aster-std/src/net/iface/time.rs b/services/libs/aster-std/src/net/iface/time.rs index d7aced038..fe6b08e16 100644 --- a/services/libs/aster-std/src/net/iface/time.rs +++ b/services/libs/aster-std/src/net/iface/time.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::timer::read_monotonic_milli_seconds; pub(super) fn get_network_timestamp() -> smoltcp::time::Instant { diff --git a/services/libs/aster-std/src/net/iface/util.rs b/services/libs/aster-std/src/net/iface/util.rs index d4dd1acac..b693a24e9 100644 --- a/services/libs/aster-std/src/net/iface/util.rs +++ b/services/libs/aster-std/src/net/iface/util.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::timer::read_monotonic_milli_seconds; use crate::{ diff --git a/services/libs/aster-std/src/net/iface/virtio.rs b/services/libs/aster-std/src/net/iface/virtio.rs index aa49034ff..252a6083f 100644 --- a/services/libs/aster-std/src/net/iface/virtio.rs +++ b/services/libs/aster-std/src/net/iface/virtio.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::sync::SpinLock; use aster_network::AnyNetworkDevice; diff --git a/services/libs/aster-std/src/net/mod.rs b/services/libs/aster-std/src/net/mod.rs index bf368dd37..52ac4d1b7 100644 --- a/services/libs/aster-std/src/net/mod.rs +++ b/services/libs/aster-std/src/net/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{ net::iface::{Iface, IfaceLoopback, IfaceVirtio}, prelude::*, diff --git a/services/libs/aster-std/src/net/socket/ip/always_some.rs b/services/libs/aster-std/src/net/socket/ip/always_some.rs index e1ee83a5f..d359110d2 100644 --- a/services/libs/aster-std/src/net/socket/ip/always_some.rs +++ b/services/libs/aster-std/src/net/socket/ip/always_some.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use core::ops::{Deref, DerefMut}; diff --git a/services/libs/aster-std/src/net/socket/ip/common.rs b/services/libs/aster-std/src/net/socket/ip/common.rs index 0e18ff42a..c1261a718 100644 --- a/services/libs/aster-std/src/net/socket/ip/common.rs +++ b/services/libs/aster-std/src/net/socket/ip/common.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::net::iface::BindPortConfig; use crate::net::iface::Iface; use crate::net::iface::{AnyBoundSocket, AnyUnboundSocket}; diff --git a/services/libs/aster-std/src/net/socket/ip/datagram/bound.rs b/services/libs/aster-std/src/net/socket/ip/datagram/bound.rs index 9f8ee372c..6ec2352fa 100644 --- a/services/libs/aster-std/src/net/socket/ip/datagram/bound.rs +++ b/services/libs/aster-std/src/net/socket/ip/datagram/bound.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::{IoEvents, Observer}; use crate::net::iface::IpEndpoint; diff --git a/services/libs/aster-std/src/net/socket/ip/datagram/mod.rs b/services/libs/aster-std/src/net/socket/ip/datagram/mod.rs index 261035cf8..6f06da6f0 100644 --- a/services/libs/aster-std/src/net/socket/ip/datagram/mod.rs +++ b/services/libs/aster-std/src/net/socket/ip/datagram/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/net/socket/ip/datagram/unbound.rs b/services/libs/aster-std/src/net/socket/ip/datagram/unbound.rs index 102a7d818..9ea1cabf0 100644 --- a/services/libs/aster-std/src/net/socket/ip/datagram/unbound.rs +++ b/services/libs/aster-std/src/net/socket/ip/datagram/unbound.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::net::iface::IpEndpoint; diff --git a/services/libs/aster-std/src/net/socket/ip/mod.rs b/services/libs/aster-std/src/net/socket/ip/mod.rs index 1f66a3f50..b6cf51ac6 100644 --- a/services/libs/aster-std/src/net/socket/ip/mod.rs +++ b/services/libs/aster-std/src/net/socket/ip/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod always_some; mod common; mod datagram; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/connected.rs b/services/libs/aster-std/src/net/socket/ip/stream/connected.rs index a5d5d299e..c70a8f617 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/connected.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/connected.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use crate::events::{IoEvents, Observer}; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/connecting.rs b/services/libs/aster-std/src/net/socket/ip/stream/connecting.rs index d97e3ff47..9a1ff54f5 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/connecting.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/connecting.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use alloc::sync::Arc; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/init.rs b/services/libs/aster-std/src/net/socket/ip/stream/init.rs index c2d33b4d1..ec0f7f29e 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/init.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/init.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/listen.rs b/services/libs/aster-std/src/net/socket/ip/stream/listen.rs index bc3d23800..8f8cfbfe4 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/listen.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/listen.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use crate::events::{IoEvents, Observer}; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/mod.rs b/services/libs/aster-std/src/net/socket/ip/stream/mod.rs index 01b6b7ff2..c78bb6e92 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/mod.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::file_handle::FileLike; use crate::fs::utils::StatusFlags; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/options.rs b/services/libs/aster-std/src/net/socket/ip/stream/options.rs index e99a9c1e3..db633feb4 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/options.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/options.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::impl_socket_options; use super::CongestionControl; diff --git a/services/libs/aster-std/src/net/socket/ip/stream/util.rs b/services/libs/aster-std/src/net/socket/ip/stream/util.rs index c37b1c0f3..1f22ba9a9 100644 --- a/services/libs/aster-std/src/net/socket/ip/stream/util.rs +++ b/services/libs/aster-std/src/net/socket/ip/stream/util.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; #[derive(Debug, Clone, Copy, CopyGetters, Setters)] diff --git a/services/libs/aster-std/src/net/socket/mod.rs b/services/libs/aster-std/src/net/socket/mod.rs index 2d92a02fd..b629664ae 100644 --- a/services/libs/aster-std/src/net/socket/mod.rs +++ b/services/libs/aster-std/src/net/socket/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{fs::file_handle::FileLike, prelude::*}; use self::options::SocketOption; diff --git a/services/libs/aster-std/src/net/socket/options/macros.rs b/services/libs/aster-std/src/net/socket/options/macros.rs index c1f73a907..c81b4a321 100644 --- a/services/libs/aster-std/src/net/socket/options/macros.rs +++ b/services/libs/aster-std/src/net/socket/options/macros.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #[macro_export] macro_rules! impl_socket_options { ($( diff --git a/services/libs/aster-std/src/net/socket/options/mod.rs b/services/libs/aster-std/src/net/socket/options/mod.rs index 3cbb68245..8b8f66103 100644 --- a/services/libs/aster-std/src/net/socket/options/mod.rs +++ b/services/libs/aster-std/src/net/socket/options/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::impl_socket_options; use crate::prelude::*; mod macros; diff --git a/services/libs/aster-std/src/net/socket/unix/addr.rs b/services/libs/aster-std/src/net/socket/unix/addr.rs index d4f4b5e50..d470e5e31 100644 --- a/services/libs/aster-std/src/net/socket/unix/addr.rs +++ b/services/libs/aster-std/src/net/socket/unix/addr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::utils::Dentry; use crate::net::socket::util::socket_addr::SocketAddr; use crate::prelude::*; diff --git a/services/libs/aster-std/src/net/socket/unix/mod.rs b/services/libs/aster-std/src/net/socket/unix/mod.rs index 0d54d2de8..698dbf54a 100644 --- a/services/libs/aster-std/src/net/socket/unix/mod.rs +++ b/services/libs/aster-std/src/net/socket/unix/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod addr; mod stream; diff --git a/services/libs/aster-std/src/net/socket/unix/stream/connected.rs b/services/libs/aster-std/src/net/socket/unix/stream/connected.rs index f4d611b3f..f7e260222 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/connected.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/connected.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::endpoint::Endpoint; use crate::events::IoEvents; use crate::net::socket::{unix::addr::UnixSocketAddrBound, SockShutdownCmd}; diff --git a/services/libs/aster-std/src/net/socket/unix/stream/endpoint.rs b/services/libs/aster-std/src/net/socket/unix/stream/endpoint.rs index 9071fd378..30e9c8b67 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/endpoint.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/endpoint.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::process::signal::Poller; use crate::{ diff --git a/services/libs/aster-std/src/net/socket/unix/stream/init.rs b/services/libs/aster-std/src/net/socket/unix/stream/init.rs index cc6c34124..748c5ca55 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/init.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/init.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/net/socket/unix/stream/listener.rs b/services/libs/aster-std/src/net/socket/unix/stream/listener.rs index c406eb52c..4f3650a48 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/listener.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/listener.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{connected::Connected, endpoint::Endpoint, UnixStreamSocket}; use crate::events::IoEvents; use crate::fs::file_handle::FileLike; diff --git a/services/libs/aster-std/src/net/socket/unix/stream/mod.rs b/services/libs/aster-std/src/net/socket/unix/stream/mod.rs index 52fd78f7b..ca5d91ff0 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/mod.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod connected; mod endpoint; mod init; diff --git a/services/libs/aster-std/src/net/socket/unix/stream/socket.rs b/services/libs/aster-std/src/net/socket/unix/stream/socket.rs index 5eb6390b0..1ecc7a950 100644 --- a/services/libs/aster-std/src/net/socket/unix/stream/socket.rs +++ b/services/libs/aster-std/src/net/socket/unix/stream/socket.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::fs::file_handle::FileLike; use crate::fs::fs_resolver::FsPath; diff --git a/services/libs/aster-std/src/net/socket/util/mod.rs b/services/libs/aster-std/src/net/socket/util/mod.rs index cf76c1473..7478fe95e 100644 --- a/services/libs/aster-std/src/net/socket/util/mod.rs +++ b/services/libs/aster-std/src/net/socket/util/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod options; pub mod send_recv_flags; pub mod shutdown_cmd; diff --git a/services/libs/aster-std/src/net/socket/util/options.rs b/services/libs/aster-std/src/net/socket/util/options.rs index 68afa5318..20c4d4893 100644 --- a/services/libs/aster-std/src/net/socket/util/options.rs +++ b/services/libs/aster-std/src/net/socket/util/options.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::net::iface::{RECV_BUF_LEN, SEND_BUF_LEN}; diff --git a/services/libs/aster-std/src/net/socket/util/send_recv_flags.rs b/services/libs/aster-std/src/net/socket/util/send_recv_flags.rs index a8f36077b..e7fe906de 100644 --- a/services/libs/aster-std/src/net/socket/util/send_recv_flags.rs +++ b/services/libs/aster-std/src/net/socket/util/send_recv_flags.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; bitflags! { diff --git a/services/libs/aster-std/src/net/socket/util/shutdown_cmd.rs b/services/libs/aster-std/src/net/socket/util/shutdown_cmd.rs index 81fa84f9e..8eecdb4f4 100644 --- a/services/libs/aster-std/src/net/socket/util/shutdown_cmd.rs +++ b/services/libs/aster-std/src/net/socket/util/shutdown_cmd.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// Shutdown types diff --git a/services/libs/aster-std/src/net/socket/util/socket_addr.rs b/services/libs/aster-std/src/net/socket/util/socket_addr.rs index b9b92c27d..80fadb52a 100644 --- a/services/libs/aster-std/src/net/socket/util/socket_addr.rs +++ b/services/libs/aster-std/src/net/socket/util/socket_addr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::net::iface::{IpAddress, Ipv4Address}; use crate::net::iface::{IpEndpoint, IpListenEndpoint}; use crate::net::socket::unix::UnixSocketAddr; diff --git a/services/libs/aster-std/src/prelude.rs b/services/libs/aster-std/src/prelude.rs index 538603340..d40e7e016 100644 --- a/services/libs/aster-std/src/prelude.rs +++ b/services/libs/aster-std/src/prelude.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![allow(unused)] pub(crate) use alloc::boxed::Box; diff --git a/services/libs/aster-std/src/process/clone.rs b/services/libs/aster-std/src/process/clone.rs index 9ca391e71..0e3b0ea77 100644 --- a/services/libs/aster-std/src/process/clone.rs +++ b/services/libs/aster-std/src/process/clone.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::posix_thread::{PosixThread, PosixThreadBuilder, PosixThreadExt, ThreadName}; use super::process_vm::ProcessVm; use super::signal::sig_disposition::SigDispositions; diff --git a/services/libs/aster-std/src/process/credentials/credentials_.rs b/services/libs/aster-std/src/process/credentials/credentials_.rs index 6edd77758..ad3251112 100644 --- a/services/libs/aster-std/src/process/credentials/credentials_.rs +++ b/services/libs/aster-std/src/process/credentials/credentials_.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::group::AtomicGid; use super::user::AtomicUid; use super::{Gid, Uid}; diff --git a/services/libs/aster-std/src/process/credentials/group.rs b/services/libs/aster-std/src/process/credentials/group.rs index 9a0d6c5bd..82f639dbc 100644 --- a/services/libs/aster-std/src/process/credentials/group.rs +++ b/services/libs/aster-std/src/process/credentials/group.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicU32, Ordering}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/credentials/mod.rs b/services/libs/aster-std/src/process/credentials/mod.rs index f5e162a35..158182d39 100644 --- a/services/libs/aster-std/src/process/credentials/mod.rs +++ b/services/libs/aster-std/src/process/credentials/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod credentials_; mod group; mod static_cap; diff --git a/services/libs/aster-std/src/process/credentials/static_cap.rs b/services/libs/aster-std/src/process/credentials/static_cap.rs index 07e9848a3..37945db68 100644 --- a/services/libs/aster-std/src/process/credentials/static_cap.rs +++ b/services/libs/aster-std/src/process/credentials/static_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::credentials_::Credentials_; use super::{Credentials, Gid, Uid}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/credentials/user.rs b/services/libs/aster-std/src/process/credentials/user.rs index a10e8db70..34f81cda5 100644 --- a/services/libs/aster-std/src/process/credentials/user.rs +++ b/services/libs/aster-std/src/process/credentials/user.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicU32, Ordering}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/exit.rs b/services/libs/aster-std/src/process/exit.rs index 20da64981..cb45df21d 100644 --- a/services/libs/aster-std/src/process/exit.rs +++ b/services/libs/aster-std/src/process/exit.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::posix_thread::PosixThreadExt; use crate::process::signal::signals::kernel::KernelSignal; use crate::{prelude::*, process::signal::constants::SIGCHLD}; diff --git a/services/libs/aster-std/src/process/kill.rs b/services/libs/aster-std/src/process/kill.rs index 4bd565895..9c3e23cc3 100644 --- a/services/libs/aster-std/src/process/kill.rs +++ b/services/libs/aster-std/src/process/kill.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::posix_thread::PosixThreadExt; use super::signal::signals::user::UserSignal; use super::signal::signals::Signal; diff --git a/services/libs/aster-std/src/process/mod.rs b/services/libs/aster-std/src/process/mod.rs index ef96eb101..ddadb3677 100644 --- a/services/libs/aster-std/src/process/mod.rs +++ b/services/libs/aster-std/src/process/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod clone; mod credentials; mod exit; diff --git a/services/libs/aster-std/src/process/posix_thread/builder.rs b/services/libs/aster-std/src/process/posix_thread/builder.rs index 5507dace7..6cb075ce1 100644 --- a/services/libs/aster-std/src/process/posix_thread/builder.rs +++ b/services/libs/aster-std/src/process/posix_thread/builder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::user::UserSpace; use crate::{ diff --git a/services/libs/aster-std/src/process/posix_thread/futex.rs b/services/libs/aster-std/src/process/posix_thread/futex.rs index 1259f3f3f..7f7e4094d 100644 --- a/services/libs/aster-std/src/process/posix_thread/futex.rs +++ b/services/libs/aster-std/src/process/posix_thread/futex.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use aster_frame::cpu::num_cpus; diff --git a/services/libs/aster-std/src/process/posix_thread/mod.rs b/services/libs/aster-std/src/process/posix_thread/mod.rs index 4679efe92..fa18fef20 100644 --- a/services/libs/aster-std/src/process/posix_thread/mod.rs +++ b/services/libs/aster-std/src/process/posix_thread/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::kill::SignalSenderIds; use super::signal::sig_mask::SigMask; use super::signal::sig_num::SigNum; diff --git a/services/libs/aster-std/src/process/posix_thread/name.rs b/services/libs/aster-std/src/process/posix_thread/name.rs index b8a945ed8..6cc4347e6 100644 --- a/services/libs/aster-std/src/process/posix_thread/name.rs +++ b/services/libs/aster-std/src/process/posix_thread/name.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; pub const MAX_THREAD_NAME_LEN: usize = 16; diff --git a/services/libs/aster-std/src/process/posix_thread/posix_thread_ext.rs b/services/libs/aster-std/src/process/posix_thread/posix_thread_ext.rs index 8003bfbf4..035ceb4f1 100644 --- a/services/libs/aster-std/src/process/posix_thread/posix_thread_ext.rs +++ b/services/libs/aster-std/src/process/posix_thread/posix_thread_ext.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::{cpu::UserContext, user::UserSpace}; use crate::{ diff --git a/services/libs/aster-std/src/process/posix_thread/robust_list.rs b/services/libs/aster-std/src/process/posix_thread/robust_list.rs index f4b5057e2..5116d26cc 100644 --- a/services/libs/aster-std/src/process/posix_thread/robust_list.rs +++ b/services/libs/aster-std/src/process/posix_thread/robust_list.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The implementation of robust list is from occlum. use crate::{ diff --git a/services/libs/aster-std/src/process/process/builder.rs b/services/libs/aster-std/src/process/process/builder.rs index 7bbe12448..01caa00db 100644 --- a/services/libs/aster-std/src/process/process/builder.rs +++ b/services/libs/aster-std/src/process/process/builder.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileTable; use crate::fs::fs_resolver::FsResolver; use crate::fs::utils::FileCreationMask; diff --git a/services/libs/aster-std/src/process/process/job_control.rs b/services/libs/aster-std/src/process/process/job_control.rs index d5af056c6..5fda59fa6 100644 --- a/services/libs/aster-std/src/process/process/job_control.rs +++ b/services/libs/aster-std/src/process/process/job_control.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use crate::process::signal::constants::{SIGCONT, SIGHUP}; use crate::process::signal::signals::kernel::KernelSignal; diff --git a/services/libs/aster-std/src/process/process/mod.rs b/services/libs/aster-std/src/process/process/mod.rs index 6ec298178..6cde24048 100644 --- a/services/libs/aster-std/src/process/process/mod.rs +++ b/services/libs/aster-std/src/process/process/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::posix_thread::PosixThreadExt; use super::process_vm::user_heap::UserHeap; use super::process_vm::ProcessVm; diff --git a/services/libs/aster-std/src/process/process/process_group.rs b/services/libs/aster-std/src/process/process/process_group.rs index 9a69d5752..3c656bec4 100644 --- a/services/libs/aster-std/src/process/process/process_group.rs +++ b/services/libs/aster-std/src/process/process/process_group.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{Pgid, Pid, Process, Session}; use crate::prelude::*; use crate::process::signal::signals::Signal; diff --git a/services/libs/aster-std/src/process/process/session.rs b/services/libs/aster-std/src/process/process/session.rs index 66ce097d1..bb3ce6244 100644 --- a/services/libs/aster-std/src/process/process/session.rs +++ b/services/libs/aster-std/src/process/process/session.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{Pgid, Process, ProcessGroup, Sid, Terminal}; diff --git a/services/libs/aster-std/src/process/process/terminal.rs b/services/libs/aster-std/src/process/process/terminal.rs index 94d66b319..bcca5dc5a 100644 --- a/services/libs/aster-std/src/process/process/terminal.rs +++ b/services/libs/aster-std/src/process/process/terminal.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::inode_handle::FileIo; use crate::prelude::*; use crate::process::{process_table, Pgid, ProcessGroup}; diff --git a/services/libs/aster-std/src/process/process_filter.rs b/services/libs/aster-std/src/process/process_filter.rs index a3f4c494b..d558d9bf5 100644 --- a/services/libs/aster-std/src/process/process_filter.rs +++ b/services/libs/aster-std/src/process/process_filter.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{Pgid, Pid}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/process_table.rs b/services/libs/aster-std/src/process/process_table.rs index d5d216c34..84b1782f6 100644 --- a/services/libs/aster-std/src/process/process_table.rs +++ b/services/libs/aster-std/src/process/process_table.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! A global table stores the pid to process mapping. //! This table can be used to get process with pid. //! TODO: progress group, thread all need similar mapping diff --git a/services/libs/aster-std/src/process/process_vm/mod.rs b/services/libs/aster-std/src/process/process_vm/mod.rs index 468b7aa7e..d38634caa 100644 --- a/services/libs/aster-std/src/process/process_vm/mod.rs +++ b/services/libs/aster-std/src/process/process_vm/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module defines the UserVm of a process. //! The UserSpace of a process only contains the virtual-physical memory mapping. //! But we cannot know which vaddr is user heap, which vaddr is mmap areas. diff --git a/services/libs/aster-std/src/process/process_vm/user_heap.rs b/services/libs/aster-std/src/process/process_vm/user_heap.rs index 7dff106e4..ba27374e1 100644 --- a/services/libs/aster-std/src/process/process_vm/user_heap.rs +++ b/services/libs/aster-std/src/process/process_vm/user_heap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicUsize, Ordering}; use crate::vm::perms::VmPerms; diff --git a/services/libs/aster-std/src/process/program_loader/elf/aux_vec.rs b/services/libs/aster-std/src/process/program_loader/elf/aux_vec.rs index 228c8f1f4..e125cbd90 100644 --- a/services/libs/aster-std/src/process/program_loader/elf/aux_vec.rs +++ b/services/libs/aster-std/src/process/program_loader/elf/aux_vec.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// This implementation is from occlum. diff --git a/services/libs/aster-std/src/process/program_loader/elf/elf_file.rs b/services/libs/aster-std/src/process/program_loader/elf/elf_file.rs index 499f93d03..af1e43e63 100644 --- a/services/libs/aster-std/src/process/program_loader/elf/elf_file.rs +++ b/services/libs/aster-std/src/process/program_loader/elf/elf_file.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// A wrapper of xmas_elf's elf parsing use xmas_elf::{ header::{self, Header, HeaderPt1, HeaderPt2, HeaderPt2_, Machine_, Type_}, diff --git a/services/libs/aster-std/src/process/program_loader/elf/init_stack.rs b/services/libs/aster-std/src/process/program_loader/elf/init_stack.rs index 3dce8da1d..360552568 100644 --- a/services/libs/aster-std/src/process/program_loader/elf/init_stack.rs +++ b/services/libs/aster-std/src/process/program_loader/elf/init_stack.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module defines the process initial stack. //! The process initial stack, contains arguments, environmental variables and auxiliary vectors //! The data layout of init stack can be seen in Figure 3.9 in https://uclibc.org/docs/psABI-x86_64.pdf diff --git a/services/libs/aster-std/src/process/program_loader/elf/load_elf.rs b/services/libs/aster-std/src/process/program_loader/elf/load_elf.rs index f1cc047cb..6be5b846f 100644 --- a/services/libs/aster-std/src/process/program_loader/elf/load_elf.rs +++ b/services/libs/aster-std/src/process/program_loader/elf/load_elf.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module is used to parse elf file content to get elf_load_info. //! When create a process from elf file, we will use the elf_load_info to construct the VmSpace diff --git a/services/libs/aster-std/src/process/program_loader/elf/mod.rs b/services/libs/aster-std/src/process/program_loader/elf/mod.rs index 20ebdd39f..35dbc0e75 100644 --- a/services/libs/aster-std/src/process/program_loader/elf/mod.rs +++ b/services/libs/aster-std/src/process/program_loader/elf/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod aux_vec; mod elf_file; mod init_stack; diff --git a/services/libs/aster-std/src/process/program_loader/mod.rs b/services/libs/aster-std/src/process/program_loader/mod.rs index c1456e1f5..e779e4837 100644 --- a/services/libs/aster-std/src/process/program_loader/mod.rs +++ b/services/libs/aster-std/src/process/program_loader/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod elf; mod shebang; diff --git a/services/libs/aster-std/src/process/program_loader/shebang.rs b/services/libs/aster-std/src/process/program_loader/shebang.rs index 784525ac2..3aa7cb820 100644 --- a/services/libs/aster-std/src/process/program_loader/shebang.rs +++ b/services/libs/aster-std/src/process/program_loader/shebang.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// Try to parse a buffer as a shebang line. diff --git a/services/libs/aster-std/src/process/rlimit.rs b/services/libs/aster-std/src/process/rlimit.rs index 3c8b0f7d7..cbf95a029 100644 --- a/services/libs/aster-std/src/process/rlimit.rs +++ b/services/libs/aster-std/src/process/rlimit.rs @@ -1,4 +1,4 @@ -//! This implementation is from occlum +// SPDX-License-Identifier: MPL-2.0 #![allow(non_camel_case_types)] diff --git a/services/libs/aster-std/src/process/signal/c_types.rs b/services/libs/aster-std/src/process/signal/c_types.rs index 15f4a94af..47d39dda7 100644 --- a/services/libs/aster-std/src/process/signal/c_types.rs +++ b/services/libs/aster-std/src/process/signal/c_types.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![allow(non_camel_case_types)] use core::mem; diff --git a/services/libs/aster-std/src/process/signal/constants.rs b/services/libs/aster-std/src/process/signal/constants.rs index 9c4593e1a..240ac2a6f 100644 --- a/services/libs/aster-std/src/process/signal/constants.rs +++ b/services/libs/aster-std/src/process/signal/constants.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// Standard signals pub(super) const MIN_STD_SIG_NUM: u8 = 1; pub(super) const MAX_STD_SIG_NUM: u8 = 31; // inclusive diff --git a/services/libs/aster-std/src/process/signal/events.rs b/services/libs/aster-std/src/process/signal/events.rs index 37b472609..a741825ad 100644 --- a/services/libs/aster-std/src/process/signal/events.rs +++ b/services/libs/aster-std/src/process/signal/events.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::{Events, EventsFilter}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/signal/mod.rs b/services/libs/aster-std/src/process/signal/mod.rs index 950479d58..cd73cda95 100644 --- a/services/libs/aster-std/src/process/signal/mod.rs +++ b/services/libs/aster-std/src/process/signal/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod c_types; pub mod constants; mod events; diff --git a/services/libs/aster-std/src/process/signal/pauser.rs b/services/libs/aster-std/src/process/signal/pauser.rs index c277c895a..3c2e03ab1 100644 --- a/services/libs/aster-std/src/process/signal/pauser.rs +++ b/services/libs/aster-std/src/process/signal/pauser.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use core::time::Duration; diff --git a/services/libs/aster-std/src/process/signal/poll.rs b/services/libs/aster-std/src/process/signal/poll.rs index 6cb0f075b..118c9c83f 100644 --- a/services/libs/aster-std/src/process/signal/poll.rs +++ b/services/libs/aster-std/src/process/signal/poll.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::events::IoEvents; use crate::events::{Observer, Subject}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/signal/sig_action.rs b/services/libs/aster-std/src/process/signal/sig_action.rs index 937f2e75a..3203e3102 100644 --- a/services/libs/aster-std/src/process/signal/sig_action.rs +++ b/services/libs/aster-std/src/process/signal/sig_action.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{c_types::sigaction_t, constants::*, sig_mask::SigMask, sig_num::SigNum}; use crate::prelude::*; use bitflags::bitflags; diff --git a/services/libs/aster-std/src/process/signal/sig_disposition.rs b/services/libs/aster-std/src/process/signal/sig_disposition.rs index f644eb2ca..26510b661 100644 --- a/services/libs/aster-std/src/process/signal/sig_disposition.rs +++ b/services/libs/aster-std/src/process/signal/sig_disposition.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{constants::*, sig_action::SigAction, sig_num::SigNum}; #[derive(Copy, Clone)] diff --git a/services/libs/aster-std/src/process/signal/sig_mask.rs b/services/libs/aster-std/src/process/signal/sig_mask.rs index 4758832ee..d0565f13f 100644 --- a/services/libs/aster-std/src/process/signal/sig_mask.rs +++ b/services/libs/aster-std/src/process/signal/sig_mask.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{constants::MIN_STD_SIG_NUM, sig_num::SigNum}; #[derive(Debug, Copy, Clone, Default, PartialEq, Eq)] diff --git a/services/libs/aster-std/src/process/signal/sig_num.rs b/services/libs/aster-std/src/process/signal/sig_num.rs index 76a48accb..f93c764d7 100644 --- a/services/libs/aster-std/src/process/signal/sig_num.rs +++ b/services/libs/aster-std/src/process/signal/sig_num.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::constants::*; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/signal/sig_queues.rs b/services/libs/aster-std/src/process/signal/sig_queues.rs index 9b687ea8a..544fa82ce 100644 --- a/services/libs/aster-std/src/process/signal/sig_queues.rs +++ b/services/libs/aster-std/src/process/signal/sig_queues.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{constants::*, SigEvents, SigEventsFilter}; use crate::events::{Observer, Subject}; use crate::prelude::*; diff --git a/services/libs/aster-std/src/process/signal/sig_stack.rs b/services/libs/aster-std/src/process/signal/sig_stack.rs index b7ce81679..374080df9 100644 --- a/services/libs/aster-std/src/process/signal/sig_stack.rs +++ b/services/libs/aster-std/src/process/signal/sig_stack.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// User-provided signal stack. `SigStack` is per-thread, and each thread can have diff --git a/services/libs/aster-std/src/process/signal/signals/fault.rs b/services/libs/aster-std/src/process/signal/signals/fault.rs index 799af8113..586c8080a 100644 --- a/services/libs/aster-std/src/process/signal/signals/fault.rs +++ b/services/libs/aster-std/src/process/signal/signals/fault.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::cpu::{CpuException, CpuExceptionInfo}; use aster_frame::cpu::{ ALIGNMENT_CHECK, BOUND_RANGE_EXCEEDED, DIVIDE_BY_ZERO, GENERAL_PROTECTION_FAULT, diff --git a/services/libs/aster-std/src/process/signal/signals/kernel.rs b/services/libs/aster-std/src/process/signal/signals/kernel.rs index cdd17f754..abe7ad9d1 100644 --- a/services/libs/aster-std/src/process/signal/signals/kernel.rs +++ b/services/libs/aster-std/src/process/signal/signals/kernel.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::Signal; use crate::process::signal::c_types::siginfo_t; use crate::process::signal::constants::SI_KERNEL; diff --git a/services/libs/aster-std/src/process/signal/signals/mod.rs b/services/libs/aster-std/src/process/signal/signals/mod.rs index 15f77042a..07f2094c3 100644 --- a/services/libs/aster-std/src/process/signal/signals/mod.rs +++ b/services/libs/aster-std/src/process/signal/signals/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub mod fault; pub mod kernel; pub mod user; diff --git a/services/libs/aster-std/src/process/signal/signals/user.rs b/services/libs/aster-std/src/process/signal/signals/user.rs index 40d56e149..423080be3 100644 --- a/services/libs/aster-std/src/process/signal/signals/user.rs +++ b/services/libs/aster-std/src/process/signal/signals/user.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::Signal; use crate::process::signal::c_types::siginfo_t; use crate::process::signal::constants::{SI_QUEUE, SI_TKILL, SI_USER}; diff --git a/services/libs/aster-std/src/process/status.rs b/services/libs/aster-std/src/process/status.rs index 6b172d061..4c2b96d9e 100644 --- a/services/libs/aster-std/src/process/status.rs +++ b/services/libs/aster-std/src/process/status.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The process status use super::TermStatus; diff --git a/services/libs/aster-std/src/process/term_status.rs b/services/libs/aster-std/src/process/term_status.rs index 5e0e51261..05bb10f22 100644 --- a/services/libs/aster-std/src/process/term_status.rs +++ b/services/libs/aster-std/src/process/term_status.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::signal::sig_num::SigNum; #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/services/libs/aster-std/src/process/wait.rs b/services/libs/aster-std/src/process/wait.rs index 99e4d4572..f57eba0ce 100644 --- a/services/libs/aster-std/src/process/wait.rs +++ b/services/libs/aster-std/src/process/wait.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{prelude::*, process::process_table, thread::thread_table}; use super::{process_filter::ProcessFilter, ExitCode, Pid, Process}; diff --git a/services/libs/aster-std/src/sched/mod.rs b/services/libs/aster-std/src/sched/mod.rs index b6cf2d58e..bfa1437c3 100644 --- a/services/libs/aster-std/src/sched/mod.rs +++ b/services/libs/aster-std/src/sched/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod priority_scheduler; // There may be multiple scheduling policies in the system, diff --git a/services/libs/aster-std/src/sched/priority_scheduler.rs b/services/libs/aster-std/src/sched/priority_scheduler.rs index 4523c1d98..235ad706c 100644 --- a/services/libs/aster-std/src/sched/priority_scheduler.rs +++ b/services/libs/aster-std/src/sched/priority_scheduler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::task::{set_scheduler, Scheduler, Task, TaskAdapter}; use intrusive_collections::LinkedList; diff --git a/services/libs/aster-std/src/syscall/accept.rs b/services/libs/aster-std/src/syscall/accept.rs index 5977afcf9..b0756329b 100644 --- a/services/libs/aster-std/src/syscall/accept.rs +++ b/services/libs/aster-std/src/syscall/accept.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/access.rs b/services/libs/aster-std/src/syscall/access.rs index 17cc3b505..203691769 100644 --- a/services/libs/aster-std/src/syscall/access.rs +++ b/services/libs/aster-std/src/syscall/access.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{constants::*, SyscallReturn}; use crate::{log_syscall_entry, prelude::*, syscall::SYS_ACCESS, util::read_cstring_from_user}; diff --git a/services/libs/aster-std/src/syscall/arch_prctl.rs b/services/libs/aster-std/src/syscall/arch_prctl.rs index c94a4a7e0..5a0ce97a3 100644 --- a/services/libs/aster-std/src/syscall/arch_prctl.rs +++ b/services/libs/aster-std/src/syscall/arch_prctl.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::cpu::UserContext; use crate::syscall::SYS_ARCH_PRCTL; diff --git a/services/libs/aster-std/src/syscall/bind.rs b/services/libs/aster-std/src/syscall/bind.rs index ec49a746d..93630a219 100644 --- a/services/libs/aster-std/src/syscall/bind.rs +++ b/services/libs/aster-std/src/syscall/bind.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/brk.rs b/services/libs/aster-std/src/syscall/brk.rs index 528033a25..f32b3298a 100644 --- a/services/libs/aster-std/src/syscall/brk.rs +++ b/services/libs/aster-std/src/syscall/brk.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/chdir.rs b/services/libs/aster-std/src/syscall/chdir.rs index fffaa12ad..8bf5025e6 100644 --- a/services/libs/aster-std/src/syscall/chdir.rs +++ b/services/libs/aster-std/src/syscall/chdir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::FsPath, inode_handle::InodeHandle, utils::InodeType, }; diff --git a/services/libs/aster-std/src/syscall/chmod.rs b/services/libs/aster-std/src/syscall/chmod.rs index a78992ea0..e26f39818 100644 --- a/services/libs/aster-std/src/syscall/chmod.rs +++ b/services/libs/aster-std/src/syscall/chmod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/clock_gettime.rs b/services/libs/aster-std/src/syscall/clock_gettime.rs index b1ca85295..4994c5091 100644 --- a/services/libs/aster-std/src/syscall/clock_gettime.rs +++ b/services/libs/aster-std/src/syscall/clock_gettime.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use super::SYS_CLOCK_GETTIME; use crate::time::now_as_duration; diff --git a/services/libs/aster-std/src/syscall/clock_nanosleep.rs b/services/libs/aster-std/src/syscall/clock_nanosleep.rs index c94f0336d..d7254a2fb 100644 --- a/services/libs/aster-std/src/syscall/clock_nanosleep.rs +++ b/services/libs/aster-std/src/syscall/clock_nanosleep.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use super::SyscallReturn; diff --git a/services/libs/aster-std/src/syscall/clone.rs b/services/libs/aster-std/src/syscall/clone.rs index fc9d9f240..c13c18f06 100644 --- a/services/libs/aster-std/src/syscall/clone.rs +++ b/services/libs/aster-std/src/syscall/clone.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::cpu::UserContext; use crate::log_syscall_entry; diff --git a/services/libs/aster-std/src/syscall/close.rs b/services/libs/aster-std/src/syscall/close.rs index 3061664ad..d7c5bc076 100644 --- a/services/libs/aster-std/src/syscall/close.rs +++ b/services/libs/aster-std/src/syscall/close.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use super::SYS_CLOSE; use crate::log_syscall_entry; diff --git a/services/libs/aster-std/src/syscall/connect.rs b/services/libs/aster-std/src/syscall/connect.rs index 5523af8eb..a7ad69e00 100644 --- a/services/libs/aster-std/src/syscall/connect.rs +++ b/services/libs/aster-std/src/syscall/connect.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/constants.rs b/services/libs/aster-std/src/syscall/constants.rs index e919774e8..80d600ab6 100644 --- a/services/libs/aster-std/src/syscall/constants.rs +++ b/services/libs/aster-std/src/syscall/constants.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! constants used in syscall /// LONGEST ALLOWED FILENAME diff --git a/services/libs/aster-std/src/syscall/dup.rs b/services/libs/aster-std/src/syscall/dup.rs index b4e36b47e..a936243ae 100644 --- a/services/libs/aster-std/src/syscall/dup.rs +++ b/services/libs/aster-std/src/syscall/dup.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/epoll.rs b/services/libs/aster-std/src/syscall/epoll.rs index fac392135..8be2f326a 100644 --- a/services/libs/aster-std/src/syscall/epoll.rs +++ b/services/libs/aster-std/src/syscall/epoll.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/syscall/execve.rs b/services/libs/aster-std/src/syscall/execve.rs index b15e8579d..b60968dcb 100644 --- a/services/libs/aster-std/src/syscall/execve.rs +++ b/services/libs/aster-std/src/syscall/execve.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::cpu::UserContext; use aster_rights::WriteOp; diff --git a/services/libs/aster-std/src/syscall/exit.rs b/services/libs/aster-std/src/syscall/exit.rs index b1eb00a16..2a14eb0d1 100644 --- a/services/libs/aster-std/src/syscall/exit.rs +++ b/services/libs/aster-std/src/syscall/exit.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::posix_thread::PosixThreadExt; use crate::process::TermStatus; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/exit_group.rs b/services/libs/aster-std/src/syscall/exit_group.rs index aca5c0939..b5d303993 100644 --- a/services/libs/aster-std/src/syscall/exit_group.rs +++ b/services/libs/aster-std/src/syscall/exit_group.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::{do_exit_group, TermStatus}; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/fcntl.rs b/services/libs/aster-std/src/syscall/fcntl.rs index bbd1fe402..fbd21fe1a 100644 --- a/services/libs/aster-std/src/syscall/fcntl.rs +++ b/services/libs/aster-std/src/syscall/fcntl.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_FCNTL}; use crate::log_syscall_entry; use crate::{ diff --git a/services/libs/aster-std/src/syscall/fork.rs b/services/libs/aster-std/src/syscall/fork.rs index 3fcbaf047..30729377e 100644 --- a/services/libs/aster-std/src/syscall/fork.rs +++ b/services/libs/aster-std/src/syscall/fork.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{ log_syscall_entry, prelude::*, diff --git a/services/libs/aster-std/src/syscall/fsync.rs b/services/libs/aster-std/src/syscall/fsync.rs index 1e31934e7..4038e945b 100644 --- a/services/libs/aster-std/src/syscall/fsync.rs +++ b/services/libs/aster-std/src/syscall/fsync.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::{ fs::{file_table::FileDescripter, inode_handle::InodeHandle}, diff --git a/services/libs/aster-std/src/syscall/futex.rs b/services/libs/aster-std/src/syscall/futex.rs index 31d491ea8..28dfda1ca 100644 --- a/services/libs/aster-std/src/syscall/futex.rs +++ b/services/libs/aster-std/src/syscall/futex.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::posix_thread::futex::{ futex_op_and_flags_from_u32, futex_requeue, futex_wait, futex_wait_bitset, futex_wake, futex_wake_bitset, FutexOp, FutexTimeout, diff --git a/services/libs/aster-std/src/syscall/getcwd.rs b/services/libs/aster-std/src/syscall/getcwd.rs index 58d04434e..f464f9965 100644 --- a/services/libs/aster-std/src/syscall/getcwd.rs +++ b/services/libs/aster-std/src/syscall/getcwd.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::util::write_bytes_to_user; diff --git a/services/libs/aster-std/src/syscall/getdents64.rs b/services/libs/aster-std/src/syscall/getdents64.rs index c959e33e6..e8842b8c9 100644 --- a/services/libs/aster-std/src/syscall/getdents64.rs +++ b/services/libs/aster-std/src/syscall/getdents64.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, inode_handle::InodeHandle, diff --git a/services/libs/aster-std/src/syscall/getegid.rs b/services/libs/aster-std/src/syscall/getegid.rs index ee29e73c0..bbf0b24c8 100644 --- a/services/libs/aster-std/src/syscall/getegid.rs +++ b/services/libs/aster-std/src/syscall/getegid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::credentials; diff --git a/services/libs/aster-std/src/syscall/geteuid.rs b/services/libs/aster-std/src/syscall/geteuid.rs index 8a85b2861..0f980491f 100644 --- a/services/libs/aster-std/src/syscall/geteuid.rs +++ b/services/libs/aster-std/src/syscall/geteuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETEUID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getgid.rs b/services/libs/aster-std/src/syscall/getgid.rs index 7b718a60a..1d7ba7238 100644 --- a/services/libs/aster-std/src/syscall/getgid.rs +++ b/services/libs/aster-std/src/syscall/getgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETGID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getgroups.rs b/services/libs/aster-std/src/syscall/getgroups.rs index 319de710b..56985461a 100644 --- a/services/libs/aster-std/src/syscall/getgroups.rs +++ b/services/libs/aster-std/src/syscall/getgroups.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETGROUPS}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getpeername.rs b/services/libs/aster-std/src/syscall/getpeername.rs index 3ee51eeb6..01b419e0f 100644 --- a/services/libs/aster-std/src/syscall/getpeername.rs +++ b/services/libs/aster-std/src/syscall/getpeername.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getpgrp.rs b/services/libs/aster-std/src/syscall/getpgrp.rs index 2ea24c37a..7df17147d 100644 --- a/services/libs/aster-std/src/syscall/getpgrp.rs +++ b/services/libs/aster-std/src/syscall/getpgrp.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETPGRP}; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/getpid.rs b/services/libs/aster-std/src/syscall/getpid.rs index 56178967c..47835f26f 100644 --- a/services/libs/aster-std/src/syscall/getpid.rs +++ b/services/libs/aster-std/src/syscall/getpid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{log_syscall_entry, prelude::*}; use crate::syscall::SYS_GETPID; diff --git a/services/libs/aster-std/src/syscall/getppid.rs b/services/libs/aster-std/src/syscall/getppid.rs index 610d24186..6b5d42461 100644 --- a/services/libs/aster-std/src/syscall/getppid.rs +++ b/services/libs/aster-std/src/syscall/getppid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getrandom.rs b/services/libs/aster-std/src/syscall/getrandom.rs index 6c2f8d702..e2d142c9f 100644 --- a/services/libs/aster-std/src/syscall/getrandom.rs +++ b/services/libs/aster-std/src/syscall/getrandom.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::device; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getresgid.rs b/services/libs/aster-std/src/syscall/getresgid.rs index c2ae6b6f5..0a62b9ec7 100644 --- a/services/libs/aster-std/src/syscall/getresgid.rs +++ b/services/libs/aster-std/src/syscall/getresgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETRESGID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getresuid.rs b/services/libs/aster-std/src/syscall/getresuid.rs index f93b4e653..b91ea082d 100644 --- a/services/libs/aster-std/src/syscall/getresuid.rs +++ b/services/libs/aster-std/src/syscall/getresuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETRESUID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getsid.rs b/services/libs/aster-std/src/syscall/getsid.rs index 721644c3d..d527425b4 100644 --- a/services/libs/aster-std/src/syscall/getsid.rs +++ b/services/libs/aster-std/src/syscall/getsid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{process_table, Pid}; diff --git a/services/libs/aster-std/src/syscall/getsockname.rs b/services/libs/aster-std/src/syscall/getsockname.rs index 13990c609..f9f0d4fc0 100644 --- a/services/libs/aster-std/src/syscall/getsockname.rs +++ b/services/libs/aster-std/src/syscall/getsockname.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/getsockopt.rs b/services/libs/aster-std/src/syscall/getsockopt.rs index f0689af7e..1f37d459c 100644 --- a/services/libs/aster-std/src/syscall/getsockopt.rs +++ b/services/libs/aster-std/src/syscall/getsockopt.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/gettid.rs b/services/libs/aster-std/src/syscall/gettid.rs index 180e22fa0..1b56ffdcc 100644 --- a/services/libs/aster-std/src/syscall/gettid.rs +++ b/services/libs/aster-std/src/syscall/gettid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{log_syscall_entry, prelude::*}; use crate::syscall::SYS_GETTID; diff --git a/services/libs/aster-std/src/syscall/gettimeofday.rs b/services/libs/aster-std/src/syscall/gettimeofday.rs index 76d6f5bb8..a47109bbb 100644 --- a/services/libs/aster-std/src/syscall/gettimeofday.rs +++ b/services/libs/aster-std/src/syscall/gettimeofday.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use super::SYS_GETTIMEOFDAY; use crate::{ diff --git a/services/libs/aster-std/src/syscall/getuid.rs b/services/libs/aster-std/src/syscall/getuid.rs index 7bd70a11a..49fb4a778 100644 --- a/services/libs/aster-std/src/syscall/getuid.rs +++ b/services/libs/aster-std/src/syscall/getuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_GETUID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/ioctl.rs b/services/libs/aster-std/src/syscall/ioctl.rs index 6d478a4c5..dd56e419f 100644 --- a/services/libs/aster-std/src/syscall/ioctl.rs +++ b/services/libs/aster-std/src/syscall/ioctl.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::fs::utils::IoctlCmd; use crate::log_syscall_entry; diff --git a/services/libs/aster-std/src/syscall/kill.rs b/services/libs/aster-std/src/syscall/kill.rs index 6f8e04ef5..3b9223a43 100644 --- a/services/libs/aster-std/src/syscall/kill.rs +++ b/services/libs/aster-std/src/syscall/kill.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_KILL}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/link.rs b/services/libs/aster-std/src/syscall/link.rs index 36c1be857..128d232d1 100644 --- a/services/libs/aster-std/src/syscall/link.rs +++ b/services/libs/aster-std/src/syscall/link.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/listen.rs b/services/libs/aster-std/src/syscall/listen.rs index 954b473d7..66af78772 100644 --- a/services/libs/aster-std/src/syscall/listen.rs +++ b/services/libs/aster-std/src/syscall/listen.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/lseek.rs b/services/libs/aster-std/src/syscall/lseek.rs index d37e28460..10003807f 100644 --- a/services/libs/aster-std/src/syscall/lseek.rs +++ b/services/libs/aster-std/src/syscall/lseek.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{file_table::FileDescripter, utils::SeekFrom}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/madvise.rs b/services/libs/aster-std/src/syscall/madvise.rs index 491b7fc6a..575c59952 100644 --- a/services/libs/aster-std/src/syscall/madvise.rs +++ b/services/libs/aster-std/src/syscall/madvise.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::util::read_bytes_from_user; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/mkdir.rs b/services/libs/aster-std/src/syscall/mkdir.rs index f8f2193ed..b98ea48da 100644 --- a/services/libs/aster-std/src/syscall/mkdir.rs +++ b/services/libs/aster-std/src/syscall/mkdir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/mmap.rs b/services/libs/aster-std/src/syscall/mmap.rs index e739bae54..e309239c1 100644 --- a/services/libs/aster-std/src/syscall/mmap.rs +++ b/services/libs/aster-std/src/syscall/mmap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This mod defines mmap flags and the handler to syscall mmap use crate::fs::file_table::FileDescripter; diff --git a/services/libs/aster-std/src/syscall/mod.rs b/services/libs/aster-std/src/syscall/mod.rs index fad21485b..54ef4b542 100644 --- a/services/libs/aster-std/src/syscall/mod.rs +++ b/services/libs/aster-std/src/syscall/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Read the Cpu context content then dispatch syscall to corrsponding handler //! The each sub module contains functions that handle real syscall logic. use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/mprotect.rs b/services/libs/aster-std/src/syscall/mprotect.rs index 27c438b4d..7bcbe03e0 100644 --- a/services/libs/aster-std/src/syscall/mprotect.rs +++ b/services/libs/aster-std/src/syscall/mprotect.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use align_ext::AlignExt; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/munmap.rs b/services/libs/aster-std/src/syscall/munmap.rs index 786bfb022..4f1759500 100644 --- a/services/libs/aster-std/src/syscall/munmap.rs +++ b/services/libs/aster-std/src/syscall/munmap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use align_ext::AlignExt; use crate::log_syscall_entry; diff --git a/services/libs/aster-std/src/syscall/open.rs b/services/libs/aster-std/src/syscall/open.rs index df3d96f3c..dd522eb32 100644 --- a/services/libs/aster-std/src/syscall/open.rs +++ b/services/libs/aster-std/src/syscall/open.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_handle::FileLike, file_table::FileDescripter, diff --git a/services/libs/aster-std/src/syscall/pause.rs b/services/libs/aster-std/src/syscall/pause.rs index 8f5701221..5478ac100 100644 --- a/services/libs/aster-std/src/syscall/pause.rs +++ b/services/libs/aster-std/src/syscall/pause.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::signal::Pauser; diff --git a/services/libs/aster-std/src/syscall/pipe.rs b/services/libs/aster-std/src/syscall/pipe.rs index 973163d72..93d90dc71 100644 --- a/services/libs/aster-std/src/syscall/pipe.rs +++ b/services/libs/aster-std/src/syscall/pipe.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::fs::pipe::{PipeReader, PipeWriter}; use crate::fs::utils::{Channel, StatusFlags}; diff --git a/services/libs/aster-std/src/syscall/poll.rs b/services/libs/aster-std/src/syscall/poll.rs index 4833cc042..2c89df5c4 100644 --- a/services/libs/aster-std/src/syscall/poll.rs +++ b/services/libs/aster-std/src/syscall/poll.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::cell::Cell; use core::time::Duration; diff --git a/services/libs/aster-std/src/syscall/prctl.rs b/services/libs/aster-std/src/syscall/prctl.rs index 5ab582f6e..25b556827 100644 --- a/services/libs/aster-std/src/syscall/prctl.rs +++ b/services/libs/aster-std/src/syscall/prctl.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::posix_thread::PosixThreadExt; diff --git a/services/libs/aster-std/src/syscall/pread64.rs b/services/libs/aster-std/src/syscall/pread64.rs index ac0d1b882..32bef2c92 100644 --- a/services/libs/aster-std/src/syscall/pread64.rs +++ b/services/libs/aster-std/src/syscall/pread64.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::fs::utils::SeekFrom; use crate::util::write_bytes_to_user; diff --git a/services/libs/aster-std/src/syscall/prlimit64.rs b/services/libs/aster-std/src/syscall/prlimit64.rs index 6ec5da219..1a56f13c4 100644 --- a/services/libs/aster-std/src/syscall/prlimit64.rs +++ b/services/libs/aster-std/src/syscall/prlimit64.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::ResourceType; use crate::util::{read_val_from_user, write_val_to_user}; use crate::{log_syscall_entry, prelude::*, process::Pid}; diff --git a/services/libs/aster-std/src/syscall/read.rs b/services/libs/aster-std/src/syscall/read.rs index f12ba29e3..55ba05112 100644 --- a/services/libs/aster-std/src/syscall/read.rs +++ b/services/libs/aster-std/src/syscall/read.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::util::write_bytes_to_user; use crate::{fs::file_table::FileDescripter, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/readlink.rs b/services/libs/aster-std/src/syscall/readlink.rs index dbba1dad8..59bf2a924 100644 --- a/services/libs/aster-std/src/syscall/readlink.rs +++ b/services/libs/aster-std/src/syscall/readlink.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/recvfrom.rs b/services/libs/aster-std/src/syscall/recvfrom.rs index 2dd766d14..008de7192 100644 --- a/services/libs/aster-std/src/syscall/recvfrom.rs +++ b/services/libs/aster-std/src/syscall/recvfrom.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::net::socket::SendRecvFlags; diff --git a/services/libs/aster-std/src/syscall/rename.rs b/services/libs/aster-std/src/syscall/rename.rs index 2441d5567..c3398a3ab 100644 --- a/services/libs/aster-std/src/syscall/rename.rs +++ b/services/libs/aster-std/src/syscall/rename.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/rmdir.rs b/services/libs/aster-std/src/syscall/rmdir.rs index cda168e79..8008c4c79 100644 --- a/services/libs/aster-std/src/syscall/rmdir.rs +++ b/services/libs/aster-std/src/syscall/rmdir.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/rt_sigaction.rs b/services/libs/aster-std/src/syscall/rt_sigaction.rs index ef7346faa..2f2836240 100644 --- a/services/libs/aster-std/src/syscall/rt_sigaction.rs +++ b/services/libs/aster-std/src/syscall/rt_sigaction.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{ log_syscall_entry, prelude::*, diff --git a/services/libs/aster-std/src/syscall/rt_sigprocmask.rs b/services/libs/aster-std/src/syscall/rt_sigprocmask.rs index c39356707..e1b9ad181 100644 --- a/services/libs/aster-std/src/syscall/rt_sigprocmask.rs +++ b/services/libs/aster-std/src/syscall/rt_sigprocmask.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_RT_SIGPROCMASK}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/rt_sigreturn.rs b/services/libs/aster-std/src/syscall/rt_sigreturn.rs index c74e6f6e3..567632e49 100644 --- a/services/libs/aster-std/src/syscall/rt_sigreturn.rs +++ b/services/libs/aster-std/src/syscall/rt_sigreturn.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{ log_syscall_entry, prelude::*, diff --git a/services/libs/aster-std/src/syscall/sched_yield.rs b/services/libs/aster-std/src/syscall/sched_yield.rs index d448b97a7..f56655529 100644 --- a/services/libs/aster-std/src/syscall/sched_yield.rs +++ b/services/libs/aster-std/src/syscall/sched_yield.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::thread::Thread; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/select.rs b/services/libs/aster-std/src/syscall/select.rs index ddeb243f4..8a81c2eca 100644 --- a/services/libs/aster-std/src/syscall/select.rs +++ b/services/libs/aster-std/src/syscall/select.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::time::Duration; use crate::events::IoEvents; diff --git a/services/libs/aster-std/src/syscall/sendto.rs b/services/libs/aster-std/src/syscall/sendto.rs index 3bae9a713..534bd52d8 100644 --- a/services/libs/aster-std/src/syscall/sendto.rs +++ b/services/libs/aster-std/src/syscall/sendto.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::net::socket::SendRecvFlags; diff --git a/services/libs/aster-std/src/syscall/set_robust_list.rs b/services/libs/aster-std/src/syscall/set_robust_list.rs index 277fa78a5..ca0bc9b87 100644 --- a/services/libs/aster-std/src/syscall/set_robust_list.rs +++ b/services/libs/aster-std/src/syscall/set_robust_list.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_SET_ROBUST_LIST}; use crate::{ log_syscall_entry, diff --git a/services/libs/aster-std/src/syscall/set_tid_address.rs b/services/libs/aster-std/src/syscall/set_tid_address.rs index b98e07461..16129fa85 100644 --- a/services/libs/aster-std/src/syscall/set_tid_address.rs +++ b/services/libs/aster-std/src/syscall/set_tid_address.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use super::SYS_SET_TID_ADDRESS; use crate::process::posix_thread::PosixThreadExt; diff --git a/services/libs/aster-std/src/syscall/setfsgid.rs b/services/libs/aster-std/src/syscall/setfsgid.rs index e8f9f2862..cac124494 100644 --- a/services/libs/aster-std/src/syscall/setfsgid.rs +++ b/services/libs/aster-std/src/syscall/setfsgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Gid}; diff --git a/services/libs/aster-std/src/syscall/setfsuid.rs b/services/libs/aster-std/src/syscall/setfsuid.rs index 8bfc76383..5cd77a70b 100644 --- a/services/libs/aster-std/src/syscall/setfsuid.rs +++ b/services/libs/aster-std/src/syscall/setfsuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Uid}; diff --git a/services/libs/aster-std/src/syscall/setgid.rs b/services/libs/aster-std/src/syscall/setgid.rs index eeb946bbb..847303a3b 100644 --- a/services/libs/aster-std/src/syscall/setgid.rs +++ b/services/libs/aster-std/src/syscall/setgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Gid}; diff --git a/services/libs/aster-std/src/syscall/setgroups.rs b/services/libs/aster-std/src/syscall/setgroups.rs index 9acf79c01..77e028b63 100644 --- a/services/libs/aster-std/src/syscall/setgroups.rs +++ b/services/libs/aster-std/src/syscall/setgroups.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_SETGROUPS}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/setpgid.rs b/services/libs/aster-std/src/syscall/setpgid.rs index 36e8636c3..758820e05 100644 --- a/services/libs/aster-std/src/syscall/setpgid.rs +++ b/services/libs/aster-std/src/syscall/setpgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{process_table, Pgid, Pid}; diff --git a/services/libs/aster-std/src/syscall/setregid.rs b/services/libs/aster-std/src/syscall/setregid.rs index a8b730cda..eb215e431 100644 --- a/services/libs/aster-std/src/syscall/setregid.rs +++ b/services/libs/aster-std/src/syscall/setregid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Gid}; diff --git a/services/libs/aster-std/src/syscall/setresgid.rs b/services/libs/aster-std/src/syscall/setresgid.rs index 8c35b4cde..b95b1a3a9 100644 --- a/services/libs/aster-std/src/syscall/setresgid.rs +++ b/services/libs/aster-std/src/syscall/setresgid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Gid}; diff --git a/services/libs/aster-std/src/syscall/setresuid.rs b/services/libs/aster-std/src/syscall/setresuid.rs index 0eccd29df..23e0b6e48 100644 --- a/services/libs/aster-std/src/syscall/setresuid.rs +++ b/services/libs/aster-std/src/syscall/setresuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Uid}; diff --git a/services/libs/aster-std/src/syscall/setreuid.rs b/services/libs/aster-std/src/syscall/setreuid.rs index 90612db88..a662eee8d 100644 --- a/services/libs/aster-std/src/syscall/setreuid.rs +++ b/services/libs/aster-std/src/syscall/setreuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::{credentials_mut, Uid}; diff --git a/services/libs/aster-std/src/syscall/setsid.rs b/services/libs/aster-std/src/syscall/setsid.rs index 40a315f2c..d9aa56f73 100644 --- a/services/libs/aster-std/src/syscall/setsid.rs +++ b/services/libs/aster-std/src/syscall/setsid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/setsockopt.rs b/services/libs/aster-std/src/syscall/setsockopt.rs index bf7b23f45..85a930ac2 100644 --- a/services/libs/aster-std/src/syscall/setsockopt.rs +++ b/services/libs/aster-std/src/syscall/setsockopt.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/setuid.rs b/services/libs/aster-std/src/syscall/setuid.rs index d1c0a609b..137e599c8 100644 --- a/services/libs/aster-std/src/syscall/setuid.rs +++ b/services/libs/aster-std/src/syscall/setuid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::{SyscallReturn, SYS_SETUID}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/shutdown.rs b/services/libs/aster-std/src/syscall/shutdown.rs index aa300819f..3fbb0ec3e 100644 --- a/services/libs/aster-std/src/syscall/shutdown.rs +++ b/services/libs/aster-std/src/syscall/shutdown.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::log_syscall_entry; use crate::net::socket::SockShutdownCmd; diff --git a/services/libs/aster-std/src/syscall/sigaltstack.rs b/services/libs/aster-std/src/syscall/sigaltstack.rs index e64679937..c8259af47 100644 --- a/services/libs/aster-std/src/syscall/sigaltstack.rs +++ b/services/libs/aster-std/src/syscall/sigaltstack.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::process::posix_thread::PosixThreadExt; diff --git a/services/libs/aster-std/src/syscall/socket.rs b/services/libs/aster-std/src/syscall/socket.rs index c9bfd09e7..dcad0b29e 100644 --- a/services/libs/aster-std/src/syscall/socket.rs +++ b/services/libs/aster-std/src/syscall/socket.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_handle::FileLike; use crate::net::socket::ip::{DatagramSocket, StreamSocket}; use crate::net::socket::unix::UnixStreamSocket; diff --git a/services/libs/aster-std/src/syscall/socketpair.rs b/services/libs/aster-std/src/syscall/socketpair.rs index f00929433..6ab14fcfb 100644 --- a/services/libs/aster-std/src/syscall/socketpair.rs +++ b/services/libs/aster-std/src/syscall/socketpair.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::net::socket::unix::UnixStreamSocket; use crate::util::net::{CSocketAddrFamily, Protocol, SockFlags, SockType, SOCK_TYPE_MASK}; diff --git a/services/libs/aster-std/src/syscall/stat.rs b/services/libs/aster-std/src/syscall/stat.rs index 7dc19d990..e2fc86fef 100644 --- a/services/libs/aster-std/src/syscall/stat.rs +++ b/services/libs/aster-std/src/syscall/stat.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/statfs.rs b/services/libs/aster-std/src/syscall/statfs.rs index dbaa13240..f5cbf3916 100644 --- a/services/libs/aster-std/src/syscall/statfs.rs +++ b/services/libs/aster-std/src/syscall/statfs.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::FsPath, diff --git a/services/libs/aster-std/src/syscall/symlink.rs b/services/libs/aster-std/src/syscall/symlink.rs index c63a701bf..7d5a18442 100644 --- a/services/libs/aster-std/src/syscall/symlink.rs +++ b/services/libs/aster-std/src/syscall/symlink.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/sync.rs b/services/libs/aster-std/src/syscall/sync.rs index 643020113..54cf034a2 100644 --- a/services/libs/aster-std/src/syscall/sync.rs +++ b/services/libs/aster-std/src/syscall/sync.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/tgkill.rs b/services/libs/aster-std/src/syscall/tgkill.rs index 1941370c4..671524647 100644 --- a/services/libs/aster-std/src/syscall/tgkill.rs +++ b/services/libs/aster-std/src/syscall/tgkill.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/time.rs b/services/libs/aster-std/src/syscall/time.rs index 28366239f..1e9d0c1f0 100644 --- a/services/libs/aster-std/src/syscall/time.rs +++ b/services/libs/aster-std/src/syscall/time.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::log_syscall_entry; use crate::prelude::*; use crate::time::SystemTime; diff --git a/services/libs/aster-std/src/syscall/umask.rs b/services/libs/aster-std/src/syscall/umask.rs index 1b46d1197..06a132590 100644 --- a/services/libs/aster-std/src/syscall/umask.rs +++ b/services/libs/aster-std/src/syscall/umask.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::SyscallReturn; use super::SYS_UMASK; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/uname.rs b/services/libs/aster-std/src/syscall/uname.rs index f1dd60c14..82a9c9b6a 100644 --- a/services/libs/aster-std/src/syscall/uname.rs +++ b/services/libs/aster-std/src/syscall/uname.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{log_syscall_entry, prelude::*}; use crate::syscall::SYS_UNAME; diff --git a/services/libs/aster-std/src/syscall/unlink.rs b/services/libs/aster-std/src/syscall/unlink.rs index 07cd6b687..65b970e92 100644 --- a/services/libs/aster-std/src/syscall/unlink.rs +++ b/services/libs/aster-std/src/syscall/unlink.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{ file_table::FileDescripter, fs_resolver::{FsPath, AT_FDCWD}, diff --git a/services/libs/aster-std/src/syscall/utimens.rs b/services/libs/aster-std/src/syscall/utimens.rs index a96d1d391..20feeb8e3 100644 --- a/services/libs/aster-std/src/syscall/utimens.rs +++ b/services/libs/aster-std/src/syscall/utimens.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::{file_table::FileDescripter, fs_resolver::FsPath}; use crate::log_syscall_entry; use crate::prelude::*; diff --git a/services/libs/aster-std/src/syscall/wait4.rs b/services/libs/aster-std/src/syscall/wait4.rs index 6cfaba6c6..f26762bd4 100644 --- a/services/libs/aster-std/src/syscall/wait4.rs +++ b/services/libs/aster-std/src/syscall/wait4.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{ log_syscall_entry, process::{wait_child_exit, ProcessFilter}, diff --git a/services/libs/aster-std/src/syscall/waitid.rs b/services/libs/aster-std/src/syscall/waitid.rs index b3d612cc4..4358e692b 100644 --- a/services/libs/aster-std/src/syscall/waitid.rs +++ b/services/libs/aster-std/src/syscall/waitid.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::process::{wait_child_exit, ProcessFilter}; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/write.rs b/services/libs/aster-std/src/syscall/write.rs index 60df03be0..eec44d338 100644 --- a/services/libs/aster-std/src/syscall/write.rs +++ b/services/libs/aster-std/src/syscall/write.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/syscall/writev.rs b/services/libs/aster-std/src/syscall/writev.rs index b927988c9..d5d9bb9b9 100644 --- a/services/libs/aster-std/src/syscall/writev.rs +++ b/services/libs/aster-std/src/syscall/writev.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::fs::file_table::FileDescripter; use crate::{log_syscall_entry, prelude::*}; diff --git a/services/libs/aster-std/src/thread/exception.rs b/services/libs/aster-std/src/thread/exception.rs index 6a690c54a..bab26771d 100644 --- a/services/libs/aster-std/src/thread/exception.rs +++ b/services/libs/aster-std/src/thread/exception.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use crate::process::signal::signals::fault::FaultSignal; use crate::vm::page_fault_handler::PageFaultHandler; diff --git a/services/libs/aster-std/src/thread/kernel_thread.rs b/services/libs/aster-std/src/thread/kernel_thread.rs index be39fb5b3..aaa0fe91a 100644 --- a/services/libs/aster-std/src/thread/kernel_thread.rs +++ b/services/libs/aster-std/src/thread/kernel_thread.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::cpu::CpuSet; use aster_frame::task::{Priority, TaskOptions}; diff --git a/services/libs/aster-std/src/thread/mod.rs b/services/libs/aster-std/src/thread/mod.rs index c321170c7..5a73f2fc1 100644 --- a/services/libs/aster-std/src/thread/mod.rs +++ b/services/libs/aster-std/src/thread/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Posix thread implementation use core::{ diff --git a/services/libs/aster-std/src/thread/status.rs b/services/libs/aster-std/src/thread/status.rs index c715b3d4b..8a438e3ef 100644 --- a/services/libs/aster-std/src/thread/status.rs +++ b/services/libs/aster-std/src/thread/status.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #[derive(Debug, PartialEq, Clone, Copy)] pub enum ThreadStatus { Init, diff --git a/services/libs/aster-std/src/thread/task.rs b/services/libs/aster-std/src/thread/task.rs index 856161045..ceefd0974 100644 --- a/services/libs/aster-std/src/thread/task.rs +++ b/services/libs/aster-std/src/thread/task.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::{ cpu::UserContext, task::{preempt, Task, TaskOptions}, diff --git a/services/libs/aster-std/src/thread/thread_table.rs b/services/libs/aster-std/src/thread/thread_table.rs index 59e5facf8..6135e4342 100644 --- a/services/libs/aster-std/src/thread/thread_table.rs +++ b/services/libs/aster-std/src/thread/thread_table.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use super::{Thread, Tid}; diff --git a/services/libs/aster-std/src/thread/work_queue/mod.rs b/services/libs/aster-std/src/thread/work_queue/mod.rs index 4e55e7b69..390578cb7 100644 --- a/services/libs/aster-std/src/thread/work_queue/mod.rs +++ b/services/libs/aster-std/src/thread/work_queue/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::cpu::CpuSet; use spin::Once; diff --git a/services/libs/aster-std/src/thread/work_queue/simple_scheduler.rs b/services/libs/aster-std/src/thread/work_queue/simple_scheduler.rs index d8470f75b..963b44dd9 100644 --- a/services/libs/aster-std/src/thread/work_queue/simple_scheduler.rs +++ b/services/libs/aster-std/src/thread/work_queue/simple_scheduler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::sync::Weak; use super::worker_pool::{WorkerPool, WorkerScheduler}; diff --git a/services/libs/aster-std/src/thread/work_queue/work_item.rs b/services/libs/aster-std/src/thread/work_queue/work_item.rs index 919a5318d..ba308618e 100644 --- a/services/libs/aster-std/src/thread/work_queue/work_item.rs +++ b/services/libs/aster-std/src/thread/work_queue/work_item.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::cpu::CpuSet; use core::sync::atomic::AtomicBool; diff --git a/services/libs/aster-std/src/thread/work_queue/worker.rs b/services/libs/aster-std/src/thread/work_queue/worker.rs index 3ba850ed8..d60ee3335 100644 --- a/services/libs/aster-std/src/thread/work_queue/worker.rs +++ b/services/libs/aster-std/src/thread/work_queue/worker.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::worker_pool::WorkerPool; use crate::prelude::*; use crate::thread::kernel_thread::{KernelThreadExt, ThreadOptions}; diff --git a/services/libs/aster-std/src/thread/work_queue/worker_pool.rs b/services/libs/aster-std/src/thread/work_queue/worker_pool.rs index 462864cd1..b3040fa5d 100644 --- a/services/libs/aster-std/src/thread/work_queue/worker_pool.rs +++ b/services/libs/aster-std/src/thread/work_queue/worker_pool.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::sync::atomic::{AtomicBool, Ordering}; use super::{simple_scheduler::SimpleScheduler, worker::Worker, WorkItem, WorkPriority, WorkQueue}; diff --git a/services/libs/aster-std/src/time/mod.rs b/services/libs/aster-std/src/time/mod.rs index f9c8682ed..513c9e061 100644 --- a/services/libs/aster-std/src/time/mod.rs +++ b/services/libs/aster-std/src/time/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + #![allow(non_camel_case_types)] use core::time::Duration; diff --git a/services/libs/aster-std/src/time/system_time.rs b/services/libs/aster-std/src/time/system_time.rs index bca7a387b..21ad5b418 100644 --- a/services/libs/aster-std/src/time/system_time.rs +++ b/services/libs/aster-std/src/time/system_time.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_time::{read_monotonic_time, read_start_time}; use core::time::Duration; use time::{Date, Month, PrimitiveDateTime, Time}; diff --git a/services/libs/aster-std/src/util/mod.rs b/services/libs/aster-std/src/util/mod.rs index 210358bc8..62f6f8a6f 100644 --- a/services/libs/aster-std/src/util/mod.rs +++ b/services/libs/aster-std/src/util/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::vm::VmIo; pub mod net; diff --git a/services/libs/aster-std/src/util/net/addr.rs b/services/libs/aster-std/src/util/net/addr.rs index db88aa74e..0df1aea94 100644 --- a/services/libs/aster-std/src/util/net/addr.rs +++ b/services/libs/aster-std/src/util/net/addr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::net::iface::Ipv4Address; use crate::net::socket::unix::UnixSocketAddr; use crate::net::socket::SocketAddr; diff --git a/services/libs/aster-std/src/util/net/mod.rs b/services/libs/aster-std/src/util/net/mod.rs index 15a6078c8..394d343a3 100644 --- a/services/libs/aster-std/src/util/net/mod.rs +++ b/services/libs/aster-std/src/util/net/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + mod addr; mod options; mod socket; diff --git a/services/libs/aster-std/src/util/net/options/mod.rs b/services/libs/aster-std/src/util/net/options/mod.rs index cf66b4a63..8dcc2f199 100644 --- a/services/libs/aster-std/src/util/net/options/mod.rs +++ b/services/libs/aster-std/src/util/net/options/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module introduces utilities to support Linux get/setsockopt syscalls. //! //! These two syscalls are used to get/set options for a socket. These options can be at different diff --git a/services/libs/aster-std/src/util/net/options/socket.rs b/services/libs/aster-std/src/util/net/options/socket.rs index 7e627e8cd..aebdc8e88 100644 --- a/services/libs/aster-std/src/util/net/options/socket.rs +++ b/services/libs/aster-std/src/util/net/options/socket.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::RawSocketOption; use crate::net::socket::options::{ Error, Linger, RecvBuf, ReuseAddr, ReusePort, SendBuf, SocketOption, diff --git a/services/libs/aster-std/src/util/net/options/tcp.rs b/services/libs/aster-std/src/util/net/options/tcp.rs index 426e5c123..ebf608714 100644 --- a/services/libs/aster-std/src/util/net/options/tcp.rs +++ b/services/libs/aster-std/src/util/net/options/tcp.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::RawSocketOption; use crate::impl_raw_socket_option; use crate::net::socket::ip::stream::options::{Congestion, MaxSegment, NoDelay, WindowClamp}; diff --git a/services/libs/aster-std/src/util/net/options/utils.rs b/services/libs/aster-std/src/util/net/options/utils.rs index cd776f739..6a09a1100 100644 --- a/services/libs/aster-std/src/util/net/options/utils.rs +++ b/services/libs/aster-std/src/util/net/options/utils.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::net::socket::ip::stream::CongestionControl; use crate::net::socket::LingerOption; use crate::prelude::*; diff --git a/services/libs/aster-std/src/util/net/socket.rs b/services/libs/aster-std/src/util/net/socket.rs index 986d58794..6464854e7 100644 --- a/services/libs/aster-std/src/util/net/socket.rs +++ b/services/libs/aster-std/src/util/net/socket.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// Standard well-defined IP protocols. diff --git a/services/libs/aster-std/src/vdso.rs b/services/libs/aster-std/src/vdso.rs index 242b9a17f..7b577b225 100644 --- a/services/libs/aster-std/src/vdso.rs +++ b/services/libs/aster-std/src/vdso.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The Virtual Dynamic Shared Object (VDSO) module enables user space applications to access kernel space routines //! without the need for context switching. This is particularly useful for frequently invoked operations such as //! obtaining the current time, which can be more efficiently handled within the user space. diff --git a/services/libs/aster-std/src/vm/mod.rs b/services/libs/aster-std/src/vm/mod.rs index 28b205c30..b4d623ab5 100644 --- a/services/libs/aster-std/src/vm/mod.rs +++ b/services/libs/aster-std/src/vm/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtual memory (VM). //! //! There are two primary VM abstractions: diff --git a/services/libs/aster-std/src/vm/page_fault_handler.rs b/services/libs/aster-std/src/vm/page_fault_handler.rs index 6e79c68e4..9686637d8 100644 --- a/services/libs/aster-std/src/vm/page_fault_handler.rs +++ b/services/libs/aster-std/src/vm/page_fault_handler.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; /// This trait is implemented by structs which can handle a user space page fault. diff --git a/services/libs/aster-std/src/vm/perms.rs b/services/libs/aster-std/src/vm/perms.rs index 542235883..fdb2c69c2 100644 --- a/services/libs/aster-std/src/vm/perms.rs +++ b/services/libs/aster-std/src/vm/perms.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::vm::VmPerm; use aster_rights::Rights; use bitflags::bitflags; diff --git a/services/libs/aster-std/src/vm/vmar/dyn_cap.rs b/services/libs/aster-std/src/vm/vmar/dyn_cap.rs index 138dcbe38..59fa7cd76 100644 --- a/services/libs/aster-std/src/vm/vmar/dyn_cap.rs +++ b/services/libs/aster-std/src/vm/vmar/dyn_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::vm::{Vaddr, VmIo}; use aster_rights::Rights; use core::ops::Range; diff --git a/services/libs/aster-std/src/vm/vmar/mod.rs b/services/libs/aster-std/src/vm/vmar/mod.rs index ced1b01df..3b17738f4 100644 --- a/services/libs/aster-std/src/vm/vmar/mod.rs +++ b/services/libs/aster-std/src/vm/vmar/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtual Memory Address Regions (VMARs). mod dyn_cap; diff --git a/services/libs/aster-std/src/vm/vmar/options.rs b/services/libs/aster-std/src/vm/vmar/options.rs index df0ae43cf..18fe06901 100644 --- a/services/libs/aster-std/src/vm/vmar/options.rs +++ b/services/libs/aster-std/src/vm/vmar/options.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Options for allocating child VMARs. use aster_frame::config::PAGE_SIZE; diff --git a/services/libs/aster-std/src/vm/vmar/static_cap.rs b/services/libs/aster-std/src/vm/vmar/static_cap.rs index 248ac40a7..1b3fe9bc8 100644 --- a/services/libs/aster-std/src/vm/vmar/static_cap.rs +++ b/services/libs/aster-std/src/vm/vmar/static_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::ops::Range; use crate::prelude::*; diff --git a/services/libs/aster-std/src/vm/vmar/vm_mapping.rs b/services/libs/aster-std/src/vm/vmar/vm_mapping.rs index b1c4bd952..22be8143a 100644 --- a/services/libs/aster-std/src/vm/vmar/vm_mapping.rs +++ b/services/libs/aster-std/src/vm/vmar/vm_mapping.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::sync::Mutex; use aster_frame::vm::{VmFrame, VmFrameVec, VmIo, VmMapOptions, VmPerm, VmSpace}; diff --git a/services/libs/aster-std/src/vm/vmo/dyn_cap.rs b/services/libs/aster-std/src/vm/vmo/dyn_cap.rs index 0ee957d5e..c7ee7ce4b 100644 --- a/services/libs/aster-std/src/vm/vmo/dyn_cap.rs +++ b/services/libs/aster-std/src/vm/vmo/dyn_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::ops::Range; use crate::prelude::*; diff --git a/services/libs/aster-std/src/vm/vmo/mod.rs b/services/libs/aster-std/src/vm/vmo/mod.rs index b84b2ccd9..67bad9b24 100644 --- a/services/libs/aster-std/src/vm/vmo/mod.rs +++ b/services/libs/aster-std/src/vm/vmo/mod.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Virtual Memory Objects (VMOs). use core::ops::Range; diff --git a/services/libs/aster-std/src/vm/vmo/options.rs b/services/libs/aster-std/src/vm/vmo/options.rs index 88e559cc4..22d84483e 100644 --- a/services/libs/aster-std/src/vm/vmo/options.rs +++ b/services/libs/aster-std/src/vm/vmo/options.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Options for allocating root and child VMOs. use core::marker::PhantomData; diff --git a/services/libs/aster-std/src/vm/vmo/pager.rs b/services/libs/aster-std/src/vm/vmo/pager.rs index d3893c350..da25e31ce 100644 --- a/services/libs/aster-std/src/vm/vmo/pager.rs +++ b/services/libs/aster-std/src/vm/vmo/pager.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::vm::VmFrame; diff --git a/services/libs/aster-std/src/vm/vmo/static_cap.rs b/services/libs/aster-std/src/vm/vmo/static_cap.rs index b728b4e18..7824a92f5 100644 --- a/services/libs/aster-std/src/vm/vmo/static_cap.rs +++ b/services/libs/aster-std/src/vm/vmo/static_cap.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::prelude::*; use aster_frame::vm::VmIo; use aster_rights_proc::require; diff --git a/services/libs/aster-util/src/coeff.rs b/services/libs/aster-util/src/coeff.rs index 08e7158d9..ab863321c 100644 --- a/services/libs/aster-util/src/coeff.rs +++ b/services/libs/aster-util/src/coeff.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This module provides an abstraction `Coeff` to server for efficient and accurate calculation //! of fraction multiplication. diff --git a/services/libs/aster-util/src/dup.rs b/services/libs/aster-util/src/dup.rs index 0b9b9e99e..c3de639da 100644 --- a/services/libs/aster-util/src/dup.rs +++ b/services/libs/aster-util/src/dup.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + /// This trait is a _fallible_ version of `Clone`. /// /// If any object of a type `T` is duplicable, then `T` should implement diff --git a/services/libs/aster-util/src/id_allocator.rs b/services/libs/aster-util/src/id_allocator.rs index 2938b084b..6569cf5ab 100644 --- a/services/libs/aster-util/src/id_allocator.rs +++ b/services/libs/aster-util/src/id_allocator.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use bitvec::prelude::BitVec; use core::fmt::Debug; diff --git a/services/libs/aster-util/src/lib.rs b/services/libs/aster-util/src/lib.rs index 783f59b22..3777fe45c 100644 --- a/services/libs/aster-util/src/lib.rs +++ b/services/libs/aster-util/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The util of Asterinas. #![no_std] #![forbid(unsafe_code)] diff --git a/services/libs/aster-util/src/safe_ptr.rs b/services/libs/aster-util/src/safe_ptr.rs index 8d86bb25c..93fe585a8 100644 --- a/services/libs/aster-util/src/safe_ptr.rs +++ b/services/libs/aster-util/src/safe_ptr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use aster_frame::vm::Paddr; use aster_frame::vm::{HasPaddr, VmIo}; use aster_frame::Result; diff --git a/services/libs/aster-util/src/slot_vec.rs b/services/libs/aster-util/src/slot_vec.rs index 3fc35f506..5b38e6bbb 100644 --- a/services/libs/aster-util/src/slot_vec.rs +++ b/services/libs/aster-util/src/slot_vec.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use alloc::vec::Vec; /// SlotVec is the variant of Vector. diff --git a/services/libs/aster-util/src/union_read_ptr.rs b/services/libs/aster-util/src/union_read_ptr.rs index 9e902c990..a215429db 100644 --- a/services/libs/aster-util/src/union_read_ptr.rs +++ b/services/libs/aster-util/src/union_read_ptr.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use core::marker::PhantomData; use pod::Pod; diff --git a/services/libs/comp-sys/cargo-component/analysis/src/conf.rs b/services/libs/comp-sys/cargo-component/analysis/src/conf.rs index 707b2ea89..d0d1a078f 100644 --- a/services/libs/comp-sys/cargo-component/analysis/src/conf.rs +++ b/services/libs/comp-sys/cargo-component/analysis/src/conf.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + use std::collections::{BTreeMap, HashSet}; use std::{env, fs, io, path::PathBuf}; diff --git a/services/libs/comp-sys/cargo-component/analysis/src/lib.rs b/services/libs/comp-sys/cargo-component/analysis/src/lib.rs index 6382901bd..05268a661 100644 --- a/services/libs/comp-sys/cargo-component/analysis/src/lib.rs +++ b/services/libs/comp-sys/cargo-component/analysis/src/lib.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + #![feature(rustc_private)] extern crate rustc_ast; diff --git a/services/libs/comp-sys/cargo-component/build.rs b/services/libs/comp-sys/cargo-component/build.rs index fab8a69a2..1890a189b 100644 --- a/services/libs/comp-sys/cargo-component/build.rs +++ b/services/libs/comp-sys/cargo-component/build.rs @@ -1,4 +1,7 @@ -//! This implementation is from rust-clippy +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + +// This implementation is from rust clippy. We modified the code. fn main() { // Forward the profile to the main compilation diff --git a/services/libs/comp-sys/cargo-component/src/driver.rs b/services/libs/comp-sys/cargo-component/src/driver.rs index 4a378237b..43bc66f0d 100644 --- a/services/libs/comp-sys/cargo-component/src/driver.rs +++ b/services/libs/comp-sys/cargo-component/src/driver.rs @@ -1,7 +1,8 @@ -//! Licensed under the Apache License, Version 2.0 or the MIT License. -//! Copyright (C) 2023 Ant Group. +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + +// This implementation is from rust clippy. We modified the code. -//! This implementation is from rust clippy. We modified the code. #![feature(rustc_private)] #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/src/main.rs b/services/libs/comp-sys/cargo-component/src/main.rs index 9f7feace1..96a1254d8 100644 --- a/services/libs/comp-sys/cargo-component/src/main.rs +++ b/services/libs/comp-sys/cargo-component/src/main.rs @@ -1,7 +1,7 @@ -//! Licensed under the Apache License, Version 2.0 or the MIT License. -//! Copyright (C) 2023 Ant Group. +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. -//! This implementation is from rust clippy. We modified the code. +// This implementation is from rust clippy. We modified the code. use std::env; use std::path::PathBuf; diff --git a/services/libs/comp-sys/cargo-component/tests/duplicate_lib_name.rs b/services/libs/comp-sys/cargo-component/tests/duplicate_lib_name.rs index 985ec2b4f..ccc3c0fc8 100644 --- a/services/libs/comp-sys/cargo-component/tests/duplicate_lib_name.rs +++ b/services/libs/comp-sys/cargo-component/tests/duplicate_lib_name.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + //! This test checks that if two components have same name, the compiler will panic. #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/tests/missing_toml.rs b/services/libs/comp-sys/cargo-component/tests/missing_toml.rs index e9ed461e5..9c36b614b 100644 --- a/services/libs/comp-sys/cargo-component/tests/missing_toml.rs +++ b/services/libs/comp-sys/cargo-component/tests/missing_toml.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + //! This test checks that if Components.toml is missed, the compiler will panic. #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/tests/reexport.rs b/services/libs/comp-sys/cargo-component/tests/reexport.rs index 8707dedf6..c8d00d103 100644 --- a/services/libs/comp-sys/cargo-component/tests/reexport.rs +++ b/services/libs/comp-sys/cargo-component/tests/reexport.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + //! This test checks that if cargo-component can control reexported entry points. #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/tests/regression.rs b/services/libs/comp-sys/cargo-component/tests/regression.rs index 79504c968..678d688dc 100644 --- a/services/libs/comp-sys/cargo-component/tests/regression.rs +++ b/services/libs/comp-sys/cargo-component/tests/regression.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + //! This test checks that visiting controlled resources in whitelist is allowed. #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/tests/test_utils/mod.rs b/services/libs/comp-sys/cargo-component/tests/test_utils/mod.rs index 6ef8c6ee2..3724d455e 100644 --- a/services/libs/comp-sys/cargo-component/tests/test_utils/mod.rs +++ b/services/libs/comp-sys/cargo-component/tests/test_utils/mod.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + #![allow(unused)] use std::path::PathBuf; diff --git a/services/libs/comp-sys/cargo-component/tests/trait_method.rs b/services/libs/comp-sys/cargo-component/tests/trait_method.rs index d11d9626e..3b5e2ca3f 100644 --- a/services/libs/comp-sys/cargo-component/tests/trait_method.rs +++ b/services/libs/comp-sys/cargo-component/tests/trait_method.rs @@ -1,3 +1,6 @@ +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + //! This test checks that if cargo-component can control method and trait method #![feature(once_cell)] diff --git a/services/libs/comp-sys/cargo-component/tests/violate_policy.rs b/services/libs/comp-sys/cargo-component/tests/violate_policy.rs index 58802fe10..4126bc632 100644 --- a/services/libs/comp-sys/cargo-component/tests/violate_policy.rs +++ b/services/libs/comp-sys/cargo-component/tests/violate_policy.rs @@ -1,4 +1,8 @@ -//! This test checks that if controlled resource not in whitelist is visited, cargo-component will report warning message. +// Licensed under the Apache License, Version 2.0 or the MIT License. +// Copyright (C) 2023-2024 Ant Group. + +//! This test checks that if controlled resource not in whitelist is visited, cargo-component will +//! report warning message. #![feature(once_cell)] diff --git a/services/libs/comp-sys/component-macro/src/init_comp.rs b/services/libs/comp-sys/component-macro/src/init_comp.rs index 4f3f6624d..6137428a6 100644 --- a/services/libs/comp-sys/component-macro/src/init_comp.rs +++ b/services/libs/comp-sys/component-macro/src/init_comp.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use proc_macro2::{TokenStream, TokenTree}; use quote::{ToTokens, TokenStreamExt}; use syn::parse::Parse; diff --git a/services/libs/comp-sys/component-macro/src/lib.rs b/services/libs/comp-sys/component-macro/src/lib.rs index 5fb3c8f2b..0f777958b 100644 --- a/services/libs/comp-sys/component-macro/src/lib.rs +++ b/services/libs/comp-sys/component-macro/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //!This crate defines the component system related macros. //! diff --git a/services/libs/comp-sys/component-macro/src/priority.rs b/services/libs/comp-sys/component-macro/src/priority.rs index 931f27196..f77527181 100644 --- a/services/libs/comp-sys/component-macro/src/priority.rs +++ b/services/libs/comp-sys/component-macro/src/priority.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::{collections::HashMap, fs::File, io::Read, ops::Add, process::Command, str::FromStr}; use json::JsonValue; diff --git a/services/libs/comp-sys/component/src/lib.rs b/services/libs/comp-sys/component/src/lib.rs index c019bde45..1bffe3a69 100644 --- a/services/libs/comp-sys/component/src/lib.rs +++ b/services/libs/comp-sys/component/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Component system //! diff --git a/services/libs/comp-sys/component/tests/init-order/first-init/src/lib.rs b/services/libs/comp-sys/component/tests/init-order/first-init/src/lib.rs index 087509762..66c9b4181 100644 --- a/services/libs/comp-sys/component/tests/init-order/first-init/src/lib.rs +++ b/services/libs/comp-sys/component/tests/init-order/first-init/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering::Relaxed; diff --git a/services/libs/comp-sys/component/tests/init-order/second-init/src/lib.rs b/services/libs/comp-sys/component/tests/init-order/second-init/src/lib.rs index 10ff95582..03ee5d512 100644 --- a/services/libs/comp-sys/component/tests/init-order/second-init/src/lib.rs +++ b/services/libs/comp-sys/component/tests/init-order/second-init/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::sync::atomic::{Ordering::Relaxed, AtomicBool}; use component::init_component; diff --git a/services/libs/comp-sys/component/tests/init-order/second-init/tests/test.rs b/services/libs/comp-sys/component/tests/init-order/second-init/tests/test.rs index 2bb2e5c42..42cdb72f9 100644 --- a/services/libs/comp-sys/component/tests/init-order/second-init/tests/test.rs +++ b/services/libs/comp-sys/component/tests/init-order/second-init/tests/test.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use second_init::HAS_INIT; use std::sync::atomic::Ordering::Relaxed; diff --git a/services/libs/comp-sys/component/tests/init-order/src/main.rs b/services/libs/comp-sys/component/tests/init-order/src/main.rs index eb87b2175..304060cc9 100644 --- a/services/libs/comp-sys/component/tests/init-order/src/main.rs +++ b/services/libs/comp-sys/component/tests/init-order/src/main.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use std::sync::atomic::{Ordering::Relaxed, AtomicBool}; use component::init_component; diff --git a/services/libs/comp-sys/component/tests/init-order/tests/test.rs b/services/libs/comp-sys/component/tests/init-order/tests/test.rs index 64c7c8b13..92ea58979 100644 --- a/services/libs/comp-sys/component/tests/init-order/tests/test.rs +++ b/services/libs/comp-sys/component/tests/init-order/tests/test.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use first_init::HAS_INIT; use component::init_component; use std::sync::atomic::Ordering::Relaxed; diff --git a/services/libs/comp-sys/controlled/src/lib.rs b/services/libs/comp-sys/controlled/src/lib.rs index a047e8b07..d4f313dce 100644 --- a/services/libs/comp-sys/controlled/src/lib.rs +++ b/services/libs/comp-sys/controlled/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This crate defines two attribute macros `controlled` and `uncontrolled`. //! This two macros are attached to functions or static variables to enable crate level access control. //! To use these two macros, a crate must at first registers a tool named `component_access_control`, diff --git a/services/libs/cpio-decoder/src/error.rs b/services/libs/cpio-decoder/src/error.rs index 39efbae8f..61147e2bc 100644 --- a/services/libs/cpio-decoder/src/error.rs +++ b/services/libs/cpio-decoder/src/error.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + pub type Result = core::result::Result; /// Errors of CPIO decoder. diff --git a/services/libs/cpio-decoder/src/lib.rs b/services/libs/cpio-decoder/src/lib.rs index fa2924f3f..9955c83af 100644 --- a/services/libs/cpio-decoder/src/lib.rs +++ b/services/libs/cpio-decoder/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! A safe Rust CPIO (the newc format) decoder. //! //! # Example diff --git a/services/libs/cpio-decoder/src/test.rs b/services/libs/cpio-decoder/src/test.rs index 871f73959..805611d15 100644 --- a/services/libs/cpio-decoder/src/test.rs +++ b/services/libs/cpio-decoder/src/test.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use super::error::*; use super::{CpioDecoder, FileType}; use lending_iterator::LendingIterator; diff --git a/services/libs/int-to-c-enum/derive/src/lib.rs b/services/libs/int-to-c-enum/derive/src/lib.rs index a9793d2ff..4fb34c280 100644 --- a/services/libs/int-to-c-enum/derive/src/lib.rs +++ b/services/libs/int-to-c-enum/derive/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote, TokenStreamExt}; use syn::{parse_macro_input, Attribute, Data, DataEnum, DeriveInput, Generics}; diff --git a/services/libs/int-to-c-enum/src/lib.rs b/services/libs/int-to-c-enum/src/lib.rs index b3a58ec49..39b9264db 100644 --- a/services/libs/int-to-c-enum/src/lib.rs +++ b/services/libs/int-to-c-enum/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! This crate provides a derive macro named TryFromInt. This macro can be used to automatically implement TryFrom trait //! for [C-like enums](https://doc.rust-lang.org/stable/rust-by-example/custom_types/enum/c_like.html). //! diff --git a/services/libs/int-to-c-enum/tests/regression.rs b/services/libs/int-to-c-enum/tests/regression.rs index b3ede6712..2f6f61523 100644 --- a/services/libs/int-to-c-enum/tests/regression.rs +++ b/services/libs/int-to-c-enum/tests/regression.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use int_to_c_enum::TryFromInt; #[derive(TryFromInt, Debug, PartialEq, Eq)] diff --git a/services/libs/keyable-arc/src/lib.rs b/services/libs/keyable-arc/src/lib.rs index c96b71093..a1761a26f 100644 --- a/services/libs/keyable-arc/src/lib.rs +++ b/services/libs/keyable-arc/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Same as the standard `Arc`, except that it can be used as the key type of a hash table. //! //! # Motivation diff --git a/services/libs/typeflags-util/src/assert.rs b/services/libs/typeflags-util/src/assert.rs index a9f0afe55..77c7524e1 100644 --- a/services/libs/typeflags-util/src/assert.rs +++ b/services/libs/typeflags-util/src/assert.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! define macro assert_type_same use crate::same::SameAs; diff --git a/services/libs/typeflags-util/src/bool.rs b/services/libs/typeflags-util/src/bool.rs index dc9743bcb..c6cf57dfc 100644 --- a/services/libs/typeflags-util/src/bool.rs +++ b/services/libs/typeflags-util/src/bool.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Type level bools pub use core::ops::BitAnd as And; diff --git a/services/libs/typeflags-util/src/extend.rs b/services/libs/typeflags-util/src/extend.rs index 3f579c770..c0a5d5ffa 100644 --- a/services/libs/typeflags-util/src/extend.rs +++ b/services/libs/typeflags-util/src/extend.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use crate::{Cons, Nil}; /// This trait will extend a set with another item. diff --git a/services/libs/typeflags-util/src/if_.rs b/services/libs/typeflags-util/src/if_.rs index 4b1445514..5a67ae84d 100644 --- a/services/libs/typeflags-util/src/if_.rs +++ b/services/libs/typeflags-util/src/if_.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Type Level If use crate::bool::{False, True}; diff --git a/services/libs/typeflags-util/src/lib.rs b/services/libs/typeflags-util/src/lib.rs index 07b8a7404..f3e7ff607 100644 --- a/services/libs/typeflags-util/src/lib.rs +++ b/services/libs/typeflags-util/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! The content of this crate is from another project CapComp. //! This crate defines common type level operations, like SameAsOp, and Bool type operations. //! Besides, this crate defines operations to deal with type sets, like SetContain and SetInclude. diff --git a/services/libs/typeflags-util/src/same.rs b/services/libs/typeflags-util/src/same.rs index 66b19330a..aba553ae0 100644 --- a/services/libs/typeflags-util/src/same.rs +++ b/services/libs/typeflags-util/src/same.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Traits used to check if two types are the same, returning a Bool. //! This check happens at compile time diff --git a/services/libs/typeflags-util/src/set.rs b/services/libs/typeflags-util/src/set.rs index 4e21c92cb..062eac1ef 100644 --- a/services/libs/typeflags-util/src/set.rs +++ b/services/libs/typeflags-util/src/set.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //! Common types and traits to deal with type-level sets use core::marker::PhantomData; diff --git a/services/libs/typeflags/src/flag_set.rs b/services/libs/typeflags/src/flag_set.rs index 2b1fd4089..d7d1c4acd 100644 --- a/services/libs/typeflags/src/flag_set.rs +++ b/services/libs/typeflags/src/flag_set.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use itertools::Itertools; use proc_macro2::{Ident, TokenStream}; use quote::{quote, TokenStreamExt}; diff --git a/services/libs/typeflags/src/lib.rs b/services/libs/typeflags/src/lib.rs index f11eb3dcb..4037dd79f 100644 --- a/services/libs/typeflags/src/lib.rs +++ b/services/libs/typeflags/src/lib.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + //!This crate defines the procedural macro typeflags to implement capability for Asterinas. //! When using this crate, typeflags-util should also be added as dependency. //! This is due to typeflgas is a proc-macro crate, which is only allowed to export proc-macro interfaces. diff --git a/services/libs/typeflags/src/type_flag.rs b/services/libs/typeflags/src/type_flag.rs index 0d4366f38..0d42eab1a 100644 --- a/services/libs/typeflags/src/type_flag.rs +++ b/services/libs/typeflags/src/type_flag.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use proc_macro2::TokenStream; use quote::quote; use syn::{ diff --git a/services/libs/typeflags/src/util.rs b/services/libs/typeflags/src/util.rs index fcc9d53d8..7313b1786 100644 --- a/services/libs/typeflags/src/util.rs +++ b/services/libs/typeflags/src/util.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MPL-2.0 + use proc_macro2::{Ident, TokenStream}; use quote::{quote, TokenStreamExt};