From f9ef05b6a25acf311d4a48f1ffee9e2a58957981 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Sun, 23 Feb 2025 12:52:51 +0700 Subject: [PATCH] Update table signature format --- Scripts/acpi_guru.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Scripts/acpi_guru.py b/Scripts/acpi_guru.py index 5698b59..a55bd54 100644 --- a/Scripts/acpi_guru.py +++ b/Scripts/acpi_guru.py @@ -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) {