acpi_tables: aml: Implement Aml::append_aml_bytes() for constants

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-11-03 14:29:05 +00:00
parent 211ee1521d
commit f917198f27

View File

@ -21,8 +21,8 @@ pub const ZERO: Zero = Zero {};
pub struct Zero {}
impl Aml for Zero {
fn to_aml_bytes(&self) -> Vec<u8> {
vec![0u8]
fn append_aml_bytes(&self, v: &mut Vec<u8>) {
v.push(0u8)
}
}
@ -30,8 +30,8 @@ pub const ONE: One = One {};
pub struct One {}
impl Aml for One {
fn to_aml_bytes(&self) -> Vec<u8> {
vec![1u8]
fn append_aml_bytes(&self, v: &mut Vec<u8>) {
v.push(1u8)
}
}
@ -39,8 +39,8 @@ pub const ONES: Ones = Ones {};
pub struct Ones {}
impl Aml for Ones {
fn to_aml_bytes(&self) -> Vec<u8> {
vec![0xffu8]
fn append_aml_bytes(&self, v: &mut Vec<u8>) {
v.push(0xffu8)
}
}