Skip to content

Commit 6f1581d

Browse files
committed
Fix use of platform in no-alloc contexts + dependency issues
1 parent 25c55b1 commit 6f1581d

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2"
44

55
[package]
66
name = "acpi"
7-
version = "6.0.0"
7+
version = "6.0.1"
88
authors = ["Isaac Woods"]
99
repository = "https://github.com/rust-osdev/acpi"
1010
description = "A pure-Rust library for interacting with ACPI"
@@ -17,10 +17,10 @@ bit_field = "0.10.2"
1717
bitflags = "2.5.0"
1818
log = "0.4.20"
1919
spinning_top = "0.3.0"
20-
pci_types = { version = "0.10.0", public = true, optional = true }
20+
pci_types = { version = "0.10.0", public = true }
2121
byteorder = { version = "1.5.0", default-features = false }
2222

2323
[features]
2424
default = ["alloc", "aml"]
2525
alloc = []
26-
aml = ["alloc", "pci_types"]
26+
aml = ["alloc"]

src/platform/interrupt.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use alloc::{alloc::Global, vec::Vec};
1313
use bit_field::BitField;
1414
use core::{alloc::Allocator, pin::Pin};
1515

16+
pub use crate::sdt::madt::{Polarity, TriggerMode};
17+
1618
#[derive(Debug, Clone)]
1719
#[non_exhaustive]
1820
pub enum InterruptModel<A: Allocator = Global> {
@@ -280,31 +282,6 @@ pub enum NmiProcessor {
280282
ProcessorUid(u32),
281283
}
282284

283-
/// Polarity indicates what signal mode the interrupt line needs to be in to be considered 'active'.
284-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
285-
pub enum Polarity {
286-
SameAsBus,
287-
ActiveHigh,
288-
ActiveLow,
289-
}
290-
291-
/// Trigger mode of an interrupt, describing how the interrupt is triggered.
292-
///
293-
/// When an interrupt is `Edge` triggered, it is triggered exactly once, when the interrupt
294-
/// signal goes from its opposite polarity to its active polarity.
295-
///
296-
/// For `Level` triggered interrupts, a continuous signal is emitted so long as the interrupt
297-
/// is in its active polarity.
298-
///
299-
/// `SameAsBus`-triggered interrupts will utilize the same interrupt triggering as the system bus
300-
/// they communicate across.
301-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
302-
pub enum TriggerMode {
303-
SameAsBus,
304-
Edge,
305-
Level,
306-
}
307-
308285
/// Describes a difference in the mapping of an ISA interrupt to how it's mapped in other interrupt
309286
/// models. For example, if a device is connected to ISA IRQ 0 and IOAPIC input 2, an override will
310287
/// appear mapping source 0 to GSI 2. Currently these will only be created for ISA interrupt

src/sdt/madt.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
22
AcpiError,
33
AcpiTable,
4-
platform::interrupt::{Polarity, TriggerMode},
54
sdt::{ExtendedField, SdtHeader, Signature},
65
};
76
use bit_field::BitField;
@@ -419,6 +418,31 @@ pub struct MultiprocessorWakeupMailbox {
419418
pub reserved_for_firmware: [u64; 256],
420419
}
421420

421+
/// Polarity indicates what signal mode the interrupt line needs to be in to be considered 'active'.
422+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
423+
pub enum Polarity {
424+
SameAsBus,
425+
ActiveHigh,
426+
ActiveLow,
427+
}
428+
429+
/// Trigger mode of an interrupt, describing how the interrupt is triggered.
430+
///
431+
/// When an interrupt is `Edge` triggered, it is triggered exactly once, when the interrupt
432+
/// signal goes from its opposite polarity to its active polarity.
433+
///
434+
/// For `Level` triggered interrupts, a continuous signal is emitted so long as the interrupt
435+
/// is in its active polarity.
436+
///
437+
/// `SameAsBus`-triggered interrupts will utilize the same interrupt triggering as the system bus
438+
/// they communicate across.
439+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
440+
pub enum TriggerMode {
441+
SameAsBus,
442+
Edge,
443+
Level,
444+
}
445+
422446
pub fn parse_mps_inti_flags(flags: u16) -> Result<(Polarity, TriggerMode), AcpiError> {
423447
let polarity = match flags.get_bits(0..2) {
424448
0b00 => Polarity::SameAsBus,

0 commit comments

Comments
 (0)