mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 19:32:20 +00:00
acpi_tables: aml: Implement Aml::append_aml_bytes() for Package
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
5902ceb955
commit
f7da35857f
@ -157,21 +157,17 @@ pub struct Package<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Aml for Package<'a> {
|
impl<'a> Aml for Package<'a> {
|
||||||
fn to_aml_bytes(&self) -> Vec<u8> {
|
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||||
let mut bytes = vec![self.children.len() as u8];
|
let mut tmp = vec![self.children.len() as u8];
|
||||||
for child in &self.children {
|
for child in &self.children {
|
||||||
bytes.append(&mut child.to_aml_bytes());
|
tmp.append(&mut child.to_aml_bytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
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, 0x12); /* PackageOp */
|
bytes.push(0x12); /* PackageOp */
|
||||||
|
bytes.append(&mut pkg_length);
|
||||||
bytes
|
bytes.append(&mut tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user