Skip to main content

raw_acpi/madt/
platform_interrupt_source.rs

1use crate::madt::interrupt_source_override::MPSINTIFlags;
2
3#[derive(Copy, Clone)]
4pub struct PlatformInterruptSourceFlags(u32);
5impl PlatformInterruptSourceFlags {
6    /// When set, indicates that retrieval of error information is allowed from any processor and OSPM is to use the information provided by the processor ID,
7    /// EID fields of the Platform Interrupt Source Structure as a target processor hint.
8    pub const fn cpei_processor_override(&self) -> bool {
9        self.0 & 0b1 != 0
10    }
11    // JJ here, the rest of the bits are reserved; no need to implement.
12}
13
14#[derive(Copy, Clone)]
15#[repr(C, packed)]
16/// ## Platform Interrupt Source Structure
17///
18/// The Platform Interrupt Source structure is used to communicate which I/O SAPIC interrupt inputs are connected to the platform interrupt sources.
19///
20/// Platform Management Interrupts (PMIs) are used to invoke platform firmware to handle various events (similar to SMI in IA-32).
21/// The IntelĀ® ItaniumTM architecture permits the I/O SAPIC to send a vector value in the interrupt message of the PMI type.
22/// This value is specified in the I/O SAPIC Vector field of the Platform Interrupt Sources Structure.
23///
24/// INIT messages cause processors to soft reset.
25///
26/// If a platform can generate an interrupt after correcting platform errors (e.g., single bit error correction),
27/// the interrupt input line used to signal such corrected errors is specified by the Global System Interrupt field in the following table.
28/// Some systems may restrict the retrieval of corrected platform error information to a specific processor.
29/// In such cases, the firmware indicates the processor that can retrieve the corrected platform error information through the Processor ID and EID fields in the structure below.
30/// OSPM is required to program the I/O SAPIC redirection table entries with the Processor ID, EID values specified by the ACPI system firmware.
31/// On platforms where the retrieval of corrected platform error information can be performed on any processor,
32/// the firmware indicates this capability by setting the CPEI Processor Override flag in the Platform Interrupt Source Flags field of the structure below.
33/// If the CPEI Processor Override Flag is set, OSPM uses the processor specified by Processor ID,
34/// and EID fields of the structure below only as a target processor hint and the error retrieval can be performed on any processor in the system.
35/// However, firmware is required to specify valid values in Processor ID, EID fields to ensure backward compatibility.
36///
37/// If the CPEI Processor Override flag is clear, OSPM may reject a ejection request for the processor that is targeted for the corrected platform error interrupt.<br>
38/// If the CPEI Processor Override flag is set, OSPM can retarget the corrected platform error interrupt to a different processor when the target processor is ejected.
39///
40/// Note that the _MAT object can return a buffer containing Platform Interrupt Source Structure entries.
41/// It is allowed for such an entry to refer to a Global System Interrupt that is already specified by a Platform Interrupt Source Structure provided through the static MADT table,
42/// provided the value of platform interrupt source flags are identical.
43///
44/// Refer to the ItaniumTM Processor Family System Abstraction Layer (SAL) Specification for details on handling the Corrected Platform Error Interrupt.
45pub struct PlatformInterruptSource {
46    /// 8 - Platform Interrupt Source Structure
47    pub r#type: u8,
48    /// 16
49    pub length: u8,
50    /// MPS INTI flags.
51    pub flags: MPSINTIFlags,
52    /// - **0x01** - PMI
53    /// - **0x02** - INIT
54    /// - **0x03** - Corrected Platform Error Interrupt
55    ///
56    /// All other values are reserved.
57    pub interrupt_type: u8,
58    /// Processor ID of destination.
59    pub processor_id: u8,
60    /// Processor EID of destination.
61    pub processor_eid: u8,
62    /// Value that OSPM must use to program the vector field of the I/O SAPIC redirection table entry for entries with the PMI interrupt type.
63    pub io_sapic_vector: u8,
64    /// The Global System Interrupt that this platform interrupt will signal.
65    pub global_system_interrupt: u32,
66    /// Platform Interrupt Source Flags.
67    pub platform_interrupt_source_flags: PlatformInterruptSourceFlags,
68}