mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
acpi_tables: aml: Implement Aml::append_aml_bytes() for Buffer
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:
parent
99467982aa
commit
72d4d2c6f0
@ -1056,20 +1056,16 @@ impl Buffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Aml for Buffer {
|
impl Aml for Buffer {
|
||||||
fn to_aml_bytes(&self) -> Vec<u8> {
|
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||||
let mut bytes = Vec::new();
|
let mut tmp = Vec::new();
|
||||||
bytes.extend_from_slice(&self.data.len().to_aml_bytes());
|
tmp.extend_from_slice(&self.data.len().to_aml_bytes());
|
||||||
bytes.extend_from_slice(&self.data);
|
tmp.extend_from_slice(&self.data);
|
||||||
|
|
||||||
let mut pkg_length = create_pkg_length(&bytes, true);
|
let mut pkg_length = create_pkg_length(&tmp, true);
|
||||||
pkg_length.reverse();
|
|
||||||
for byte in pkg_length {
|
|
||||||
bytes.insert(0, byte);
|
|
||||||
}
|
|
||||||
|
|
||||||
bytes.insert(0, 0x11); /* BufferOp */
|
bytes.push(0x11); /* BufferOp */
|
||||||
|
bytes.append(&mut pkg_length);
|
||||||
bytes
|
bytes.append(&mut tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user