Crate patina_dxe_core

Crate patina_dxe_core 

Source
Expand description

DXE Core

A pure rust implementation of the UEFI DXE Core. Please review the getting started documentation at https://OpenDevicePartnership.github.io/patina/ for more information.

§Examples

struct ExamplePlatform;

impl ComponentInfo for ExamplePlatform {
  fn configs(mut add: Add<Config>) {
    add.config(32u32);
    add.config(true);
  }

  fn components(mut add: Add<Component>) {
    add.component(ExampleComponent::default());
  }
}

impl MemoryInfo for ExamplePlatform {
  fn prioritize_32_bit_memory() -> bool {
    true
  }
}

impl CpuInfo for ExamplePlatform {
  #[cfg(target_arch = "aarch64")]
  fn gic_bases() -> GicBases {
    /// SAFETY: gicd and gicr bases correctly point to the register spaces.
    /// SAFETY: Access to these registers is exclusive to this struct instance.
    unsafe { GicBases::new(0x0, 0x0) }
  }
}

impl PlatformInfo for ExamplePlatform {
  type MemoryInfo = Self;
  type CpuInfo = Self;
  type ComponentInfo = Self;
  type Extractor = NullSectionExtractor;
}

static CORE: Core<ExamplePlatform> = Core::new(NullSectionExtractor);

§License

Copyright (c) Microsoft Corporation.

SPDX-License-Identifier: Apache-2.0

Macros§

for_each_static_allocator
Macro to iterate over all static allocators and execute an expression for each. Returns true if any allocator returns true from the expression. The variable $alloc is available in the expression and represents each allocator.
match_static_allocator
Macro to match a memory type and execute an action on the corresponding static allocator. Falls back to a default expression if the memory type doesn’t match any static allocator.
try_each_static_allocator
Macro to try an operation on each static allocator and return the first success. Sets a mutable variable to the memory type if successful. The variable $alloc is available in the expression and represents each allocator.

Structs§

Add
A struct used to allow controlled access to the Core’s storage.
Component
A marker to limit Add methods to only adding Components
Config
A marker to limit Add methods to only adding Configs.
Core
Platform configured DXE Core responsible for the DXE phase of UEFI booting.
GicBases
A configuration struct containing the GIC bases (gic_d, gic_r) for AARCH64 systems.
Service
A marker to limit Add methods to only adding Services

Traits§

ComponentInfo
A trait to be implemented by the platform to register additional components, configurations, and services.
CpuInfo
A trait to be implemented by the platform to provide configuration values and types related to the CPU.
MemoryInfo
A trait to be implemented by the platform to provide configuration values and types related to memory management to be used directly by the Patina DXE Core.
PlatformInfo
A trait to be implemented by the platform to provide configuration values and types to be used directly by the Patina DXE Core.