Skip to content

Commit e46723a

Browse files
authored
aml: make resource descriptor fields public (#228)
The AML resource descriptor structs are useful in device initialization, however the fields of such structs, except `IrqDescriptor`, are private without any interface for accessing them. This commit makes those fields public.
1 parent 5d9c8c2 commit e46723a

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

aml/src/resource.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ pub enum AddressSpaceDecodeType {
176176

177177
#[derive(Debug, PartialEq, Eq)]
178178
pub struct AddressSpaceDescriptor {
179-
resource_type: AddressSpaceResourceType,
180-
is_maximum_address_fixed: bool,
181-
is_minimum_address_fixed: bool,
182-
decode_type: AddressSpaceDecodeType,
183-
184-
granularity: u64,
185-
address_range: (u64, u64),
186-
translation_offset: u64,
187-
length: u64,
179+
pub resource_type: AddressSpaceResourceType,
180+
pub is_maximum_address_fixed: bool,
181+
pub is_minimum_address_fixed: bool,
182+
pub decode_type: AddressSpaceDecodeType,
183+
184+
pub granularity: u64,
185+
pub address_range: (u64, u64),
186+
pub translation_offset: u64,
187+
pub length: u64,
188188
}
189189

190190
#[derive(Debug, PartialEq, Eq)]
@@ -425,10 +425,10 @@ pub enum DMATransferTypePreference {
425425

426426
#[derive(Debug, PartialEq, Eq)]
427427
pub struct DMADescriptor {
428-
channel_mask: u8,
429-
supported_speeds: DMASupportedSpeed,
430-
is_bus_master: bool,
431-
transfer_type_preference: DMATransferTypePreference,
428+
pub channel_mask: u8,
429+
pub supported_speeds: DMASupportedSpeed,
430+
pub is_bus_master: bool,
431+
pub transfer_type_preference: DMATransferTypePreference,
432432
}
433433

434434
pub fn dma_format_descriptor(bytes: &[u8]) -> Result<Resource, AmlError> {
@@ -485,10 +485,10 @@ pub fn dma_format_descriptor(bytes: &[u8]) -> Result<Resource, AmlError> {
485485

486486
#[derive(Debug, PartialEq, Eq)]
487487
pub struct IOPortDescriptor {
488-
decodes_full_address: bool,
489-
memory_range: (u16, u16),
490-
base_alignment: u8,
491-
range_length: u8,
488+
pub decodes_full_address: bool,
489+
pub memory_range: (u16, u16),
490+
pub base_alignment: u8,
491+
pub range_length: u8,
492492
}
493493

494494
fn io_port_descriptor(bytes: &[u8]) -> Result<Resource, AmlError> {

0 commit comments

Comments
 (0)