config_tools: add RTCT table support in pre-launched VMs

add RTCT table integrated with ACPI binary for pre-launched
VMs.

Tracked-On: #6015

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
This commit is contained in:
Shuang Zheng
2021-05-27 17:59:38 +00:00
committed by wenlingz
parent 701f6bf05d
commit 3d73452493
3 changed files with 30 additions and 18 deletions

View File

@@ -33,8 +33,12 @@ def asl_to_aml(dest_vm_acpi_path, dest_vm_acpi_bin_path):
os.remove(os.path.join(dest_vm_acpi_path, acpi_table[1]))
rmsg = 'failed to compile {}'.format(acpi_table[0])
break
elif acpi_table[0] == PTCT:
if PTCT in os.listdir(dest_vm_acpi_path):
elif acpi_table[0] == 'PTCT':
if 'PTCT' in os.listdir(dest_vm_acpi_path):
shutil.copyfile(os.path.join(dest_vm_acpi_path, acpi_table[0]),
os.path.join(dest_vm_acpi_bin_path, acpi_table[1]))
elif acpi_table[0] == 'RTCT':
if 'RTCT' in os.listdir(dest_vm_acpi_path):
shutil.copyfile(os.path.join(dest_vm_acpi_path, acpi_table[0]),
os.path.join(dest_vm_acpi_bin_path, acpi_table[1]))
else:
@@ -96,10 +100,14 @@ def aml_to_bin(dest_vm_acpi_path, dest_vm_acpi_bin_path, acpi_bin_name):
with open(os.path.join(dest_vm_acpi_bin_path, ACPI_TABLE_LIST[6][1]), 'rb') as asl:
acpi_bin.write(asl.read())
if PTCT in os.listdir(dest_vm_acpi_path):
acpi_bin.seek(ACPI_PTCT_ADDR_OFFSET)
if 'PTCT' in os.listdir(dest_vm_acpi_path):
acpi_bin.seek(ACPI_RTCT_ADDR_OFFSET)
with open(os.path.join(dest_vm_acpi_bin_path, ACPI_TABLE_LIST[7][1]), 'rb') as asl:
acpi_bin.write(asl.read())
elif 'RTCT' in os.listdir(dest_vm_acpi_path):
acpi_bin.seek(ACPI_RTCT_ADDR_OFFSET)
with open(os.path.join(dest_vm_acpi_bin_path, ACPI_TABLE_LIST[8][1]), 'rb') as asl:
acpi_bin.write(asl.read())
acpi_bin.seek(0xfffff)
acpi_bin.write(b'\0')