mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
acpi_tables: aml: Implement Aml::append_aml_bytes() for CreateField
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
72d4d2c6f0
commit
def371e969
@ -1088,22 +1088,20 @@ impl<'a, T> CreateField<'a, T> {
|
||||
}
|
||||
|
||||
impl<'a> Aml for CreateField<'a, u64> {
|
||||
fn to_aml_bytes(&self) -> Vec<u8> {
|
||||
let mut bytes = vec![0x8f]; /* CreateQWordFieldOp */
|
||||
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||
bytes.push(0x8f); /* CreateQWordFieldOp */
|
||||
bytes.extend_from_slice(&self.buffer.to_aml_bytes());
|
||||
bytes.extend_from_slice(&self.offset.to_aml_bytes());
|
||||
bytes.extend_from_slice(&self.field.to_aml_bytes());
|
||||
bytes
|
||||
self.field.append_aml_bytes(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Aml for CreateField<'a, u32> {
|
||||
fn to_aml_bytes(&self) -> Vec<u8> {
|
||||
let mut bytes = vec![0x8a]; /* CreateDWordFieldOp */
|
||||
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||
bytes.push(0x8a); /* CreateDWordFieldOp */
|
||||
bytes.extend_from_slice(&self.buffer.to_aml_bytes());
|
||||
bytes.extend_from_slice(&self.offset.to_aml_bytes());
|
||||
bytes.extend_from_slice(&self.field.to_aml_bytes());
|
||||
bytes
|
||||
self.field.append_aml_bytes(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user