Skip to content

Commit 370c2c7

Browse files
Add SPDX headers to uefi
1 parent c576801 commit 370c2c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+176
-0
lines changed

uefi/src/allocator.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This module implements Rust's global allocator interface using UEFI's memory allocation functions.
24
//!
35
//! If the `global_allocator` feature is enabled, the [`Allocator`] will be used

uefi/src/boot.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! UEFI boot services.
24
//!
35
//! These functions will panic if called after exiting boot services.

uefi/src/data_types/chars.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! UEFI character handling
24
//!
35
//! UEFI uses both Latin-1 and UCS-2 character encoding, this module implements

uefi/src/data_types/guid.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
pub use uguid::Guid;
24

35
/// Several entities in the UEFI specification can be referred to by their GUID,

uefi/src/data_types/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Data type definitions
24
//!
35
//! This module defines the basic data types that are used throughout uefi-rs

uefi/src/data_types/opaque.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
/// Create an opaque struct suitable for use as an FFI pointer.
24
///
35
/// The internal representation uses the recommendation in the [nomicon].

uefi/src/data_types/owned_strs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::chars::{Char16, NUL_16};
24
use super::strs::{CStr16, FromSliceWithNulError};
35
use crate::data_types::strs::EqStrUntilNul;

uefi/src/data_types/strs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::chars::{Char16, Char8, NUL_16, NUL_8};
24
use super::UnalignedSlice;
35
use crate::polyfill::maybe_uninit_slice_assume_init_ref;

uefi/src/data_types/unaligned_slice.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use core::fmt::{self, Debug, Formatter};
24
use core::marker::PhantomData;
35
use core::mem::MaybeUninit;

uefi/src/fs/dir_entry_iter.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Module for directory iteration. See [`UefiDirectoryIter`].
24
35
use super::*;

uefi/src/fs/file_system/error.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::fs::{PathBuf, PathError};
24
use alloc::string::FromUtf8Error;
35
use core::fmt::{self, Debug, Display, Formatter};

uefi/src/fs/file_system/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Module for [`FileSystem`].
24
35
use crate::fs::*;

uefi/src/fs/file_system/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
mod error;
24
mod fs;
35

uefi/src/fs/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! A high-level file system API for UEFI applications close to the `std::fs`
24
//! module from Rust's standard library. The main export of this module is
35
//! [`FileSystem`].

uefi/src/fs/path/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This module offers the [`Path`] and [`PathBuf`] abstractions.
24
//!
35
//! # Interoperability with Rust strings

uefi/src/fs/path/path.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
// allow "path.rs" in "path"
24
#![allow(clippy::module_inception)]
35

uefi/src/fs/path/pathbuf.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::fs::path::Path;
24
use crate::fs::SEPARATOR;
35
use crate::{CStr16, CString16, Char16};

uefi/src/fs/path/validation.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Path validation for the purpose of the [`fs`] module. This is decoupled from
24
//! [`Path`] and [`PathBuf`], as the Rust standard library also does it this
35
//! way. Instead, the FS implementation is responsible for that.

uefi/src/fs/uefi_types.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Re-export of low-level UEFI types but prefixed with `Uefi`. This simplifies
24
//! to differ between high-level and low-level types and interfaces in this
35
//! module.

uefi/src/helpers/global_allocator.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::allocator::Allocator;
24

35
#[global_allocator]

uefi/src/helpers/logger.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This optional feature adds support for the `log` crate, providing
24
//! a custom logger implementation which writes to a UEFI text output protocol.
35
//!

uefi/src/helpers/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This module provides miscellaneous opinionated but optional helpers to
24
//! better integrate your application with the Rust runtime and the Rust
35
//! ecosystem.

uefi/src/helpers/panic_handler.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::{boot, println};
24
use cfg_if::cfg_if;
35

uefi/src/helpers/println.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::{boot, system};
24
use core::fmt::Write;
35

uefi/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Rusty wrapper for the [Unified Extensible Firmware Interface][UEFI].
24
//!
35
//! This crate makes it easy to develop Rust software that leverages **safe**,

uefi/src/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
/// Encode a string literal as a [`&CStr8`].
24
///
35
/// The encoding is done at compile time, so the result can be used in a

uefi/src/mem/memory_map/api.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Module for the traits [`MemoryMap`] and [`MemoryMapMut`].
24
35
use super::*;

uefi/src/mem/memory_map/impl_.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Module for [`MemoryMapOwned`], [`MemoryMapRef`], and [`MemoryMapRefMut`],
24
//! as well as relevant helper types, such as [`MemoryMapBackingMemory`].
35

uefi/src/mem/memory_map/iter.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::*;
24

35
/// An iterator for [`MemoryMap`].

uefi/src/mem/memory_map/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Bundles all relevant types and helpers to work with the UEFI memory map.
24
//!
35
//! To work with the memory map, you should use one of the structs

uefi/src/mem/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Types, functions, traits, and other helpers to work with memory in UEFI
24
//! libraries and applications.
35

uefi/src/mem/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This is a utility module with helper methods for allocations/memory.
24
35
use crate::data_types::Align;

uefi/src/polyfill.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Polyfills for functions in the standard library that are currently gated
24
//! behind unstable features.
35

uefi/src/prelude.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This module is used to simplify importing the most common UEFI types.
24
//!
35
//! This includes the system table modules, `Status` codes, etc.

uefi/src/proto/boot_policy.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Module for the [`BootPolicy`] helper type.
24
35
use core::fmt::{Display, Formatter};

uefi/src/proto/console/gop.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Graphics output protocol.
24
//!
35
//! The UEFI GOP is meant to replace existing [VGA][vga] hardware interfaces.

uefi/src/proto/console/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Console support protocols.
24
//!
35
//! The console represents the various input and output methods

uefi/src/proto/console/pointer/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Pointer device access.
24
35
use crate::proto::unsafe_protocol;

uefi/src/proto/console/serial.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Abstraction over byte stream devices, also known as serial I/O devices.
24
35
use crate::proto::unsafe_protocol;

uefi/src/proto/console/text/input.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::proto::unsafe_protocol;
24
use crate::{Char16, Event, Result, Status, StatusExt};
35
use core::mem::MaybeUninit;

uefi/src/proto/console/text/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Text I/O.
24
35
mod input;

uefi/src/proto/console/text/output.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use crate::proto::unsafe_protocol;
24
use crate::{CStr16, Result, ResultExt, Status, StatusExt};
35
use core::fmt;

uefi/src/proto/debug/context.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
// note from the spec:
24
// When the context record field is larger than the register being stored in it, the upper bits of the
35
// context record field are unused and ignored

uefi/src/proto/debug/exception.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
/// Represents supported CPU exceptions.
24
#[repr(C)]
35
#[derive(Debug)]

uefi/src/proto/debug/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Provides support for the UEFI debugging protocol.
24
//!
35
//! This protocol is designed to allow debuggers to query the state of the firmware,

uefi/src/proto/device_path/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Utilities for creating new [`DevicePaths`].
24
//!
35
//! This module contains [`DevicePathBuilder`], as well as submodules

uefi/src/proto/device_path/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Device Path protocol
24
//!
35
//! A UEFI device path is a very flexible structure for encoding a

uefi/src/proto/device_path/text.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Protocols for converting between UEFI strings and [`DevicePath`]/[`DevicePathNode`].
24
35
// Note on return types: the specification of the conversion functions

uefi/src/proto/driver/component_name.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
// This module defines the `ComponentName1` type and marks it deprecated. That
24
// causes warnings for uses within this module (e.g. the `impl ComponentName1`
35
// block), so turn off deprecated warnings. It's not yet possible to make this

uefi/src/proto/driver/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! UEFI driver model protocols.
24
35
mod component_name;

uefi/src/proto/loaded_image.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! `LoadedImage` protocol.
24

35
use crate::data_types::FromSliceWithNulError;

uefi/src/proto/media/block.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Block I/O protocols.
24

35
use crate::proto::unsafe_protocol;

uefi/src/proto/media/disk.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Disk I/O protocols.
24

35
use crate::proto::unsafe_protocol;

uefi/src/proto/media/file/dir.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::{File, FileHandle, FileInfo, FromUefi, RegularFile};
24
use crate::data_types::Align;
35
use crate::Result;

uefi/src/proto/media/file/info.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::FileAttribute;
24
use crate::data_types::Align;
35
use crate::runtime::Time;

uefi/src/proto/media/file/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! This module provides the `FileHandle` structure as well as the more specific `RegularFile` and
24
//! `Directory` structures. This module also provides the `File` trait for opening, querying,
35
//! creating, reading, and writing files.

uefi/src/proto/media/file/regular.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
use super::{File, FileHandle, FileInternal};
24
use crate::{Error, Result, Status, StatusExt};
35

uefi/src/proto/media/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! File system support protocols.
24

35
use super::file::{Directory, FileHandle};

uefi/src/proto/media/load_file.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! LoadFile and LoadFile2 protocols.
24

35
use crate::proto::unsafe_protocol;

uefi/src/proto/media/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Media access protocols.
24
//!
35
//! These protocols can be used to enumerate and access various media devices.

uefi/src/proto/media/partition.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Partition information protocol.
24

35
use crate::proto::unsafe_protocol;

uefi/src/proto/misc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Miscellaneous protocols.
24

35
use uefi_raw::protocol::misc::{

uefi/src/proto/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Protocol definitions.
24
//!
35
//! Protocols are sets of related functionality identified by a unique

uefi/src/proto/network/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Network access protocols.
24
//!
35
//! These protocols can be used to interact with network resources.

uefi/src/proto/network/pxe.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! PXE Base Code protocol.
24

35
use core::ffi::c_void;

uefi/src/proto/network/snp.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: MIT OR Apache-2.0
2+
13
//! Simple Network Protocol
24
//!
35
//! Provides a packet level interface to a network adapter.

0 commit comments

Comments
 (0)