Skip to content

Commit 06f86ca

Browse files
authored
Ingest Patina version 23.0.0 (#207)
Update to Patina major version 23. To do this, the following changes are needed: 1. Update serial port creation for new mutable access and construction 2. Update patina_performance configuration to PlatformInfo 3. Update various SDK paths/names from SDK refactor
1 parent 2f75f65 commit 06f86ca

8 files changed

Lines changed: 84 additions & 86 deletions

File tree

Cargo.lock

Lines changed: 34 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ path = "src/lib.rs"
2626
[dependencies]
2727

2828
# Patina dependencies
29-
patina = { version = "22" }
30-
patina_acpi = { version = "22" }
31-
patina_adv_logger = { version = "22" }
32-
patina_debugger = { version = "22" }
33-
patina_dxe_core = { version = "22" }
34-
patina_ffs_extractors = { version = "22" }
35-
patina_mm = { version = "22" }
36-
patina_performance = { version = "22" }
37-
patina_samples = { version = "22" }
38-
patina_smbios = { version = "22" }
39-
patina_stacktrace = { version = "22" }
40-
patina_test = { version = "22", features = ["test-runner"] }
29+
patina = { version = "23" }
30+
patina_acpi = { version = "23" }
31+
patina_adv_logger = { version = "23" }
32+
patina_debugger = { version = "23" }
33+
patina_dxe_core = { version = "23" }
34+
patina_ffs_extractors = { version = "23" }
35+
patina_mm = { version = "23" }
36+
patina_performance = { version = "23" }
37+
patina_samples = { version = "23" }
38+
patina_smbios = { version = "23" }
39+
patina_stacktrace = { version = "23" }
40+
patina_test = { version = "23", features = ["test-runner"] }
4141

4242
# Other dependencies
4343
log = { version = "^0.4", default-features = false, features = [

bin/arm_virt_dxe_core.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
use core::{ffi::c_void, panic::PanicInfo};
1414
#[cfg(feature = "build_debugger")]
15-
use patina::serial::virtio::VirtioSerial;
16-
use patina::{log::Format, serial::uart::UartPl011};
15+
use patina::peripheral::serial::virtio::VirtioSerial;
16+
use patina::{debug::log::Format, performance::config::PerformanceConfig, peripheral::serial::uart::UartPl011};
1717
use patina_adv_logger::{
1818
component::AdvancedLoggerComponent,
1919
logger::{AdvancedLogger, TargetFilter},
@@ -47,7 +47,8 @@ static LOGGER: AdvancedLogger<UartPl011> = AdvancedLogger::new(
4747
TargetFilter { target: "efi_memory_map", log_level: log::LevelFilter::Off, hw_filter_override: None },
4848
],
4949
log::LevelFilter::Info,
50-
UartPl011::new(PL011_UART_BASE),
50+
// SAFETY: PL011_UART_BASE is the valid PL011 UART MMIO base owned by this logger.
51+
unsafe { UartPl011::new(PL011_UART_BASE) },
5152
);
5253

5354
#[cfg(feature = "enable_debugger")]
@@ -99,12 +100,7 @@ impl ComponentInfo for ArmVirt {
99100
#[cfg(feature = "exit_on_patina_test_failure")]
100101
qemu_fail();
101102
}));
102-
add.component(patina_performance::component::Performance::new().with_measurements(
103-
patina::performance::Measurement::DriverBindingStart // Adds driver binding start measurements.
104-
| patina::performance::Measurement::DriverBindingStop // Adds driver binding stop measurements.
105-
| patina::performance::Measurement::LoadImage // Adds load image measurements.
106-
| patina::performance::Measurement::StartImage, // Adds start image measurements.
107-
));
103+
add.component(patina_performance::component::Performance::new());
108104
add.component(patina_acpi::component::AcpiComponent::default());
109105
}
110106

@@ -116,6 +112,12 @@ impl PlatformInfo for ArmVirt {
116112
type MemoryInfo = Self;
117113
type ComponentInfo = Self;
118114
type Extractor = CompositeSectionExtractor;
115+
116+
const DEFAULT_PERFORMANCE_CONFIG: PerformanceConfig = PerformanceConfig::new()
117+
.with_measurement(patina::performance::Measurement::DriverBindingStart)
118+
.with_measurement(patina::performance::Measurement::DriverBindingStop)
119+
.with_measurement(patina::performance::Measurement::LoadImage)
120+
.with_measurement(patina::performance::Measurement::StartImage);
119121
}
120122

121123
static CORE: Core<ArmVirt> = Core::new(CompositeSectionExtractor::new());

bin/ovmf_dxe_core.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
use core::{ffi::c_void, panic::PanicInfo};
1414
use patina::{
15-
log::{Format, SerialLogger},
16-
serial::uart::Uart16550,
15+
debug::log::{Format, SerialLogger},
16+
peripheral::serial::uart::Uart16550,
1717
};
1818
use patina_dxe_core::*;
1919
use patina_ffs_extractors::CompositeSectionExtractor;
@@ -44,17 +44,19 @@ static LOGGER: SerialLogger<Uart16550> = SerialLogger::new(
4444
("goblin", log::LevelFilter::Off),
4545
],
4646
log::LevelFilter::Info,
47-
Uart16550::Io { base: 0x402 },
47+
// SAFETY: 0x402 is the QEMU OVMF debug-console I/O port owned by this logger.
48+
unsafe { Uart16550::new_io(0x402) },
4849
);
4950

5051
const PM_TIMER_PORT: u16 = 0x608;
5152
const _ENABLE_DEBUGGER: bool = cfg!(feature = "enable_debugger");
5253

5354
#[cfg(feature = "build_debugger")]
5455
static DEBUGGER: patina_debugger::PatinaDebugger<Uart16550> =
55-
patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
56-
.with_force_enable(_ENABLE_DEBUGGER)
57-
.with_log_policy(patina_debugger::DebuggerLoggingPolicy::FullLogging);
56+
// SAFETY: 0x3F8 is the standard COM1 I/O port owned by the debugger.
57+
patina_debugger::PatinaDebugger::new(unsafe { Uart16550::new_io(0x3F8) })
58+
.with_force_enable(_ENABLE_DEBUGGER)
59+
.with_log_policy(patina_debugger::DebuggerLoggingPolicy::FullLogging);
5860

5961
struct Ovmf;
6062

0 commit comments

Comments
 (0)