Update table signature format

This commit is contained in:
Hoang Hong Quan
2025-02-23 12:52:51 +07:00
parent dc9d5b765e
commit f9ef05b6a2

View File

@@ -411,7 +411,7 @@ class ACPIGuru:
for table_name in self.sorted_nicely(list(self.acpi.acpi_tables)):
ssdt_name = "SSDT-PLUG"
table = self.acpi.acpi_tables[table_name]
if not table.get("signature","").lower() in ("dsdt","ssdt"):
if not table.get("signature") in (b"DSDT",b"SSDT"):
continue # We're not checking data tables
#print(" Checking {}...".format(table_name))
try: cpu_name = self.acpi.get_processor_paths(table=table)[0][0]
@@ -486,11 +486,26 @@ DefinitionBlock ("", "SSDT", 2, "ZPSS", "CpuPlugA", 0x00003000)
Scope ([[parent]])
{""".replace("[[parent]]",parent)
# Ensure our name scheme won't conflict
schemes = ("C000","CP00","P000","PR00","CX00","PX00")
# Walk the processor objects, and add them to the SSDT
for i,proc_uid in enumerate(proc_list):
proc,uid = proc_uid
adr = hex(i)[2:].upper()
name = "CP00"[:-len(adr)]+adr
name = None
for s in schemes:
name_check = s[:-len(adr)]+adr
check_path = "{}.{}".format(parent,name_check)
if self.acpi.get_path_of_type(obj_type="Device",obj=check_path,table=table):
continue # Already defined - skip
# If we got here - we found an unused name
name = name_check
break
if not name:
#print(" - Could not find an available name scheme! Aborting.")
#print("")
#self.u.grab("Press [enter] to return to main menu...")
return
ssdt+="""
Processor ([[name]], [[uid]], 0x00000510, 0x06)
{