mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-07-22 10:55:31 +00:00
i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive.
Add a 16-bytes buffer to allow storing a 128-bit UUID value in an ACPI table. Signed-off-by: Gal Hammer <ghammer@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
df1fd4b541
commit
1c87d68c91
|
@ -139,13 +139,16 @@ def aml_name_string(offset):
|
||||||
offset += 1
|
offset += 1
|
||||||
return offset;
|
return offset;
|
||||||
|
|
||||||
# Given data offset, find 8 byte buffer offset
|
# Given data offset, find variable length byte buffer offset
|
||||||
def aml_data_buffer8(offset):
|
def aml_data_buffer(offset, length):
|
||||||
#0x08 NameOp NameString DataRef
|
#0x11 PkgLength BufferSize ByteList
|
||||||
expect = [0x11, 0x0B, 0x0A, 0x08]
|
if (length > 63):
|
||||||
|
die( "Name offset 0x%x: expected a one byte PkgLength (length<=63)" %
|
||||||
|
(offset));
|
||||||
|
expect = [0x11, length+3, 0x0A, length]
|
||||||
if (aml[offset:offset+4] != expect):
|
if (aml[offset:offset+4] != expect):
|
||||||
die( "Name offset 0x%x: expected %s actual %s" %
|
die( "Name offset 0x%x: expected %s actual %s" %
|
||||||
(offset, aml[offset:offset+4], expect))
|
(offset, expect, aml[offset:offset+4]))
|
||||||
return offset + len(expect)
|
return offset + len(expect)
|
||||||
|
|
||||||
# Given data offset, find dword const offset
|
# Given data offset, find dword const offset
|
||||||
|
@ -172,9 +175,9 @@ def aml_data_byte_const(offset):
|
||||||
(offset, aml[offset]));
|
(offset, aml[offset]));
|
||||||
return offset + 1;
|
return offset + 1;
|
||||||
|
|
||||||
# Find name'd buffer8
|
# Find name'd buffer
|
||||||
def aml_name_buffer8(offset):
|
def aml_name_buffer(offset, length):
|
||||||
return aml_data_buffer8(aml_name_string(offset) + 4)
|
return aml_data_buffer(aml_name_string(offset) + 4, length)
|
||||||
|
|
||||||
# Given name offset, find dword const offset
|
# Given name offset, find dword const offset
|
||||||
def aml_name_dword_const(offset):
|
def aml_name_dword_const(offset):
|
||||||
|
@ -308,7 +311,9 @@ def aml_package_start(offset):
|
||||||
output[array] = aml
|
output[array] = aml
|
||||||
continue
|
continue
|
||||||
if (directive == "ACPI_EXTRACT_NAME_BUFFER8"):
|
if (directive == "ACPI_EXTRACT_NAME_BUFFER8"):
|
||||||
offset = aml_name_buffer8(offset)
|
offset = aml_name_buffer(offset, 8)
|
||||||
|
elif (directive == "ACPI_EXTRACT_NAME_BUFFER16"):
|
||||||
|
offset = aml_name_buffer(offset, 16)
|
||||||
elif (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
|
elif (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
|
||||||
offset = aml_name_dword_const(offset)
|
offset = aml_name_dword_const(offset)
|
||||||
elif (directive == "ACPI_EXTRACT_NAME_WORD_CONST"):
|
elif (directive == "ACPI_EXTRACT_NAME_WORD_CONST"):
|
||||||
|
|
Loading…
Reference in a new issue