acpi_tables: aml: Implement Aml::append_aml_bytes() for !binary_op macro

For now it still relies on Aml::to_aml_bytes() for the children as not
all structures have been ported.

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 9cddcc8766
commit 6172b6aac5

View File

@ -998,12 +998,11 @@ macro_rules! binary_op {
}
impl<'a> Aml for $name<'a> {
fn to_aml_bytes(&self) -> Vec<u8> {
let mut bytes = vec![$opcode]; /* Op for the binary operator */
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
bytes.push($opcode); /* Op for the binary operator */
bytes.extend_from_slice(&self.a.to_aml_bytes());
bytes.extend_from_slice(&self.b.to_aml_bytes());
bytes.extend_from_slice(&self.target.to_aml_bytes());
bytes
}
}
};