### Extract ACPI Scope with DSDT.get_scope Source: https://context7.com/corpnewt/ssdttime/llms.txt Extracts all lines belonging to an ACPI scope starting at a given index. It tracks brace depth to determine when the scope closes. Useful for analyzing specific device scopes. ```python # Retrieve the full text of the first EC device scope ec = d.get_device_paths_with_hid("PNP0C09")[0] scope_lines = d.get_scope(ec[1]) # ec[1] is the line index scope_text = "\n".join(scope_lines) has_gpe = "_GPE" in scope_text has_crs = "_CRS" in scope_text has_hid = "_HID" in scope_text # A valid real EC must have all three: is_valid_ec = all([has_hid, has_crs, has_gpe]) ``` -------------------------------- ### Generate SSDT-PNLF for Laptop Backlight Control Source: https://context7.com/corpnewt/ssdttime/llms.txt Creates a PNLF device under \_SB for laptop backlight control via WhateverGreen. Accepts a _UID to select PWM max and optionally includes iGPU register code for dynamic scaling. ```python s.ssdt_pnlf() # _UID values: # 14 = Arrandale / Sandy Bridge / Ivy Bridge (PWMMax 0x0710) # 15 = Haswell / Broadwell (PWMMax 0x0AD9) ``` -------------------------------- ### Initialize SSDT Class Source: https://context7.com/corpnewt/ssdttime/llms.txt Instantiate the SSDT class to begin the process. This step locates or downloads the 'iasl' compiler, loads existing settings, and sets default generation parameters. ```python from Scripts import dsdt, plist, reveal, run, utils # The class is instantiated once and then driven by the interactive main() loop. # Settings are read from Scripts/settings.json if it exists. s = SSDT() # s.match_mode – 0 (Least Strict) … 3 (NormalizeHeaders) # s.iasl_legacy – True uses the legacy iasl compiler # s.resize_window – True allows the terminal to be auto-resized ``` -------------------------------- ### Generate SSDT-PNLF for Skylake/Kaby Lake Backlight Source: https://context7.com/corpnewt/ssdttime/llms.txt Generates an SSDT for PNLF backlight control, compatible with Skylake, Kaby Lake, and some Haswell processors. Requires PWMMax 0x056C. ```python # Output: Results/SSDT-PNLF.{dsl,aml} # Device definition: # Device (PNLF) { # Name (_HID, EisaId ("APP0002")) # Name (_CID, "backlight") # Name (_UID, 0x13) // UID 19 = CoffeeLake # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0B) } ... } # } ``` -------------------------------- ### Generate SSDT-USBX for USB Power Properties Source: https://context7.com/corpnewt/ssdttime/llms.txt Builds a generic USBX device to inject USB power properties via _DSM. Properties are interactively editable before building. ```python # Interactive: allows adding/removing/editing properties before building. # Default properties: # kUSBSleepPowerSupply -> 0x13EC # kUSBSleepPortCurrentLimit -> 0x0834 # kUSBWakePowerSupply -> 0x13EC # kUSBWakePortCurrentLimit -> 0x0834 s.ssdt_usbx() # Output: Results/SSDT-USBX.{dsl,aml} # SSDT body: # Scope (\_SB) { # Device (USBX) { # Name (_ADR, Zero) # Method (_DSM, 4, NotSerialized) { ... } # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0F) } ... } # } # } ``` -------------------------------- ### Launch SSDTTime on Different Platforms Source: https://context7.com/corpnewt/ssdttime/llms.txt Execute the appropriate script to launch SSDTTime based on your operating system. Linux and Windows also offer an option to dump live ACPI tables before proceeding. ```bash python3 SSDTTime.py ``` ```bash bash SSDTTime.command ``` ```bash SSDTTime.bat ``` -------------------------------- ### SSDT.make_plist Source: https://context7.com/corpnewt/ssdttime/llms.txt Builds OpenCore and Clover patch plists by accumulating ACPI Add entries, binary find/replace Patch entries, and Delete/DropTables entries. It creates or updates `patches_OC.plist` and `patches_Clover.plist` in the `Results/` folder. ```APIDOC ## `SSDT.make_plist(oc_acpi, cl_acpi, patches, drops, replace)` – Build Bootloader Patch Plists Accumulates ACPI `Add` entries, binary find/replace `Patch` entries, and `Delete`/`DropTables` entries into `patches_OC.plist` (OpenCore) and `patches_Clover.plist`, creating or updating those files in the `Results/` folder. ```python # oc_acpi – dict with keys "Comment", "Enabled", "Path" (OpenCore ACPI->Add entry) # cl_acpi – string filename for Clover ACPI->SortedOrder # patches – list of dicts: {"Comment": str, "Find": hex_str, "Replace": hex_str} # drops – list of dicts for ACPI->Delete / DropTables # replace – if True, remove conflicting existing entries before adding oc_entry = {"Comment": "My SSDT", "Enabled": True, "Path": "SSDT-CUSTOM.aml"} patches = [{"Comment": "HPET _CRS to XCRS", "Find": "5F435253", "Replace": "58435253"}] s.make_plist(oc_entry, "SSDT-CUSTOM.aml", patches, drops=[], replace=True) # Results/patches_OC.plist: # # ACPI # Add... # Patch... # # ``` ``` -------------------------------- ### Build Bootloader Patch Plists with SSDT.make_plist Source: https://context7.com/corpnewt/ssdttime/llms.txt Accumulates ACPI Add, Patch, and Drop entries into OpenCore and Clover plists. Use 'replace=True' to remove conflicting existing entries before adding new ones. ```python # oc_acpi – dict with keys "Comment", "Enabled", "Path" (OpenCore ACPI->Add entry) # cl_acpi – string filename for Clover ACPI->SortedOrder # patches – list of dicts: {"Comment": str, "Find": hex_str, "Replace": hex_str} # drops – list of dicts for ACPI->Delete / DropTables # replace – if True, remove conflicting existing entries before adding oc_entry = {"Comment": "My SSDT", "Enabled": True, "Path": "SSDT-CUSTOM.aml"} patches = [{"Comment": "HPET _CRS to XCRS", "Find": "5F435253", "Replace": "58435253"}] s.make_plist(oc_entry, "SSDT-CUSTOM.aml", patches, drops=[], replace=True) # Results/patches_OC.plist: # # ACPI # Add... # Patch... # # ``` -------------------------------- ### Merge Patches into config.plist with PatchMerge (Python) Source: https://context7.com/corpnewt/ssdttime/llms.txt Python class for merging generated patch plists into a bootloader config.plist. Instantiate with configuration options like config path, results directory, and overwrite behavior. ```python from PatchMerge import PatchMerge pm = PatchMerge( config = "/Volumes/EFI/OC/config.plist", results = "./Results", overwrite = True, interactive = False ) # pm.merge() drives the actual merge; in non-interactive mode it # applies all found patches_OC.plist entries automatically. ``` -------------------------------- ### Find Devices by Hardware ID with DSDT.get_device_paths_with_hid Source: https://context7.com/corpnewt/ssdttime/llms.txt Searches disassembled ACPI tables for devices with a matching Hardware ID (_HID). Returns a list of tuples containing the device path, line index, and type. ```python # Find all Embedded Controller devices ec_list = d.get_device_paths_with_hid("PNP0C09") for path, idx, dtype in ec_list: print(path) # e.g. "\_SB.PCI0.LPCB.EC0" # Find HPET hpets = d.get_device_paths_with_hid("PNP0103") # Find AWAC awacs = d.get_device_paths_with_hid("ACPI000E") ``` -------------------------------- ### Merge Patches into config.plist with PatchMerge.py (CLI) Source: https://context7.com/corpnewt/ssdttime/llms.txt Command-line utility to merge generated patch plists (patches_OC.plist, patches_Clover.plist) into an existing bootloader config.plist. Use '--overwrite' to replace existing entries. ```bash # Interactive TUI python3 PatchMerge.py # Non-interactive command-line usage python3 PatchMerge.py \ --config /Volumes/EFI/OC/config.plist \ --results ./Results \ --overwrite ``` -------------------------------- ### DSDT.get_device_paths_with_hid Source: https://context7.com/corpnewt/ssdttime/llms.txt Searches the disassembled ACPI table for `_HID` declarations matching the given Hardware ID string and returns a list of `(path, line_index, type)` tuples for the owning `Device` node. ```APIDOC ## `DSDT.get_device_paths_with_hid(hid, table)` – Find Devices by Hardware ID Searches the disassembled table for `_HID` declarations matching the given HID string and returns a list of `(path, line_index, type)` tuples for the owning `Device` node. ```python # Find all Embedded Controller devices ec_list = d.get_device_paths_with_hid("PNP0C09") for path, idx, dtype in ec_list: print(path) # e.g. "\_SB.PCI0.LPCB.EC0" # Find HPET hpets = d.get_device_paths_with_hid("PNP0103") # Find AWAC awacs = d.get_device_paths_with_hid("ACPI000E") ``` ``` -------------------------------- ### DSDT.load Source: https://context7.com/corpnewt/ssdttime/llms.txt Disassembles ACPI tables by copying the provided `.aml` file(s) to a temporary directory, calling `iasl -da -dl -l` to disassemble them, and parsing the resulting `.dsl` files into in-memory structures. ```APIDOC ## `DSDT.load(table_path)` – Disassemble ACPI Tables The core of the `Scripts/dsdt.py` module. Copies the provided `.aml` file(s) to a temp directory, calls `iasl -da -dl -l` to disassemble them, parses the resulting `.dsl` files into in-memory structures (lines, scopes, paths, raw bytes), and merges the result into `self.acpi_tables`. ```python from Scripts.dsdt import DSDT d = DSDT() # Returns (loaded_tables_dict, failed_list) loaded, failed = d.load("/path/to/DSDT.aml") if loaded: table = list(loaded.values())[0] print(table["signature"]) # b'DSDT' print(len(table["lines"])) # number of text lines after disassembly print(table["length"]) # byte length of binary table print(table["id"]) # OEM table ID bytes ``` ``` -------------------------------- ### Compute Minimal Unique Patch Padding with DSDT.get_shortest_unique_pad Source: https://context7.com/corpnewt/ssdttime/llms.txt Finds the shortest left and right byte padding around a hex pattern to make it unique within the ACPI table. This ensures bootloader find/replace patches match exactly once. Primarily for internal use during patch construction. ```python # Internal use – called when constructing every binary patch: sta_hex = "5F535441" # _STA sta_path = d.get_method_paths("\_SB.PCI0.LPCB.EC0._STA")[0] sta_index = d.find_next_hex(sta_path[1])[1] padl, padr = d.get_shortest_unique_pad(sta_hex, sta_index) patch = { "Comment": "EC0 _STA to XSTA rename", "Find": padl + sta_hex + padr, # e.g. "... 5F535441 ..." "Replace": padl + "58535441" + padr # XSTA } ``` -------------------------------- ### Generate SSDT-USB-Reset for USB Re-enumeration Source: https://context7.com/corpnewt/ssdttime/llms.txt Finds USB root hub devices and generates a per-device _STA returning zero under macOS, forcing re-enumeration for tools like USBMap. Renames illegal controller names simultaneously. ```python s.ssdt_rhub() # Output: Results/SSDT-USB-Reset.{dsl,aml} # Per-hub scope example: # Scope (\_SB.PCI0.XHC.RHUB) { # Method (_STA, 0, NotSerialized) { # If (_OSI ("Darwin")) { Return (Zero) } # Else { Return (0x0F) } # } # } ``` -------------------------------- ### Compile and Save SSDT Source: https://context7.com/corpnewt/ssdttime/llms.txt Writes DSL source to Results/.dsl, compiles using iasl, and opens the output folder. Returns True on success, False on compile failure. ```python # Internal helper used by all generation methods: custom_dsl = """ DefinitionBlock ("", "SSDT", 2, "CORP", "TEST", 0x00000000) { Scope (\_SB) { } }""" success = s.write_ssdt("SSDT-TEST", custom_dsl) # On success: Results/SSDT-TEST.dsl and Results/SSDT-TEST.aml exist. # On failure: iasl error output is printed; Results/SSDT-TEST.dsl is kept. ``` -------------------------------- ### DSDT.get_shortest_unique_pad Source: https://context7.com/corpnewt/ssdttime/llms.txt Computes the shortest left and right byte padding around a given hex pattern that makes the combined sequence unique across the entire binary ACPI table. This ensures a bootloader find/replace patch matches exactly once. ```APIDOC ## `DSDT.get_shortest_unique_pad(current_hex, index, table)` – Compute Minimal Unique Patch Finds the shortest left+right byte padding around a hex pattern that makes the combined sequence unique across the entire binary table, ensuring a bootloader find/replace patch will match exactly once. ```python # Internal use – called when constructing every binary patch: sta_hex = "5F535441" # _STA sta_path = d.get_method_paths("\_SB.PCI0.LPCB.EC0._STA")[0] sta_index = d.find_next_hex(sta_path[1])[1] padl, padr = d.get_shortest_unique_pad(sta_hex, sta_index) patch = { "Comment": "EC0 _STA to XSTA rename", "Find": padl + sta_hex + padr, # e.g. "... 5F535441 ..." "Replace": padl + "58535441" + padr # XSTA } ``` ``` -------------------------------- ### Generate SSDT-XOSI to Spoof Windows Versions Source: https://context7.com/corpnewt/ssdttime/llms.txt Replaces the _OSI method with XOSI to spoof Windows versions up to a target. Auto-detects the highest version in DSDT. Handles OSID method. ```python s.ssdt_xosi() # Interactive: selects highest Windows version string to spoof. # Auto-detects the highest version already present in the DSDT. # Output: Results/SSDT-XOSI.{dsl,aml} # Generated XOSI method snippet: # Method (XOSI, 1, NotSerialized) { # Store (Package () { # "Windows 2000", "Windows 2001", ..., "Windows 2021" # }, Local0) # If (_OSI ("Darwin")) { # Return (LNotEqual (Match (Local0, MEQ, Arg0, ...), Ones)) # } # Else { Return (_OSI (Arg0)) } # } ``` -------------------------------- ### PatchMerge Source: https://context7.com/corpnewt/ssdttime/llms.txt A companion utility for merging generated `patches_OC.plist` or `patches_Clover.plist` directly into an existing bootloader `config.plist`, eliminating manual copying of entries. ```APIDOC ## `PatchMerge` – Merge Patches into config.plist `PatchMerge.py` provides a companion utility (and importable class) for merging the generated `patches_OC.plist` or `patches_Clover.plist` directly into an existing bootloader `config.plist`, eliminating the need to copy entries manually. ```bash # Interactive TUI python3 PatchMerge.py # Non-interactive command-line usage python3 PatchMerge.py \ --config /Volumes/EFI/OC/config.plist \ --results ./Results \ --overwrite ``` ```python from PatchMerge import PatchMerge pm = PatchMerge( config = "/Volumes/EFI/OC/config.plist", results = "./Results", overwrite = True, interactive = False ) # pm.merge() drives the actual merge; in non-interactive mode it # applies all found patches_OC.plist entries automatically. ``` ``` -------------------------------- ### Generate SSDT-PLUG/SSDT-PLUG-ALT for CPU Power Management Source: https://context7.com/corpnewt/ssdttime/llms.txt Generates an SSDT to set plugin-type = 1, enabling macOS's native CPU power management (XCPM). It searches for Processor objects or ACPI0007 CPU devices. ```python s.plugin_type() # Output: Results/SSDT-PLUG.{dsl,aml} (legacy Processor objects) # or Results/SSDT-PLUG-ALT.{dsl,aml} (modern ACPI0007 devices) # SSDT-PLUG example: # External (\_PR.CPU0, ProcessorObj) # Scope (\_PR.CPU0) { # Method (_DSM, 4, NotSerialized) { # If (_OSI ("Darwin")) { # Return (Package (0x02) { "plugin-type", One }) # } # } # } ``` -------------------------------- ### Generate SSDT-ALS0 for Ambient Light Sensor Source: https://context7.com/corpnewt/ssdttime/llms.txt Generates an SSDT for an ambient light sensor. If a sensor exists but is gated, it forces enablement. Otherwise, creates a fake ALS0 device. ```python s.ambient_light_sensor() # Output: Results/SSDT-ALS0.{dsl,aml} # Fake sensor SSDT: # Scope (_SB) { # Device (ALS0) { # Name (_HID, "ACPI0008") # Name (_CID, "smc-als") # Name (_ALI, 0x012C) # Name (_ALR, Package (0x01) { Package (0x02) { 0x64, 0x012C } }) # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0F) } ... } # } # } ``` -------------------------------- ### Disassemble ACPI Tables with DSDT.load Source: https://context7.com/corpnewt/ssdttime/llms.txt Disassembles ACPI tables from a provided .aml file into in-memory structures. It calls 'iasl -da -dl -l' and parses the resulting .dsl files. Returns a dictionary of loaded tables and a list of failed tables. ```python from Scripts.dsdt import DSDT d = DSDT() # Returns (loaded_tables_dict, failed_list) loaded, failed = d.load("/path/to/DSDT.aml") if loaded: table = list(loaded.values())[0] print(table["signature"]) # b'DSDT' print(len(table["lines"])) # number of text lines after disassembly print(table["length"]) # byte length of binary table print(table["id"]) # OEM table ID bytes ``` -------------------------------- ### Generate SSDT-EC for Embedded Controller Source: https://context7.com/corpnewt/ssdttime/llms.txt Creates an SSDT-EC to manage the Embedded Controller. For desktops, it disables the real EC and injects a fake one with a specific HID. For laptops, it handles renaming or injecting a fake EC if none exists. ```python # Desktop variant s.fake_ec(laptop=False) # Laptop variant – named "FakeEC Laptop" in the menu s.fake_ec(laptop=True) # Output: Results/SSDT-EC.{dsl,aml} # Example desktop SSDT body: # Scope (\_SB.PCI0.LPCB) # { # Device (EC) # { # Name (_HID, "ACID0001") # Method (_STA, 0, NotSerialized) { # If (_OSI ("Darwin")) { Return (0x0F) } # Else { Return (Zero) } # } # } # } ``` -------------------------------- ### Generate SSDT-IMEI for IMEI Bridge Source: https://context7.com/corpnewt/ssdttime/llms.txt Adds a missing IMEI device for specific CPU/chipset mismatches. Optionally embeds a device-id spoof in _DSM or relies on config.plist. ```python s.imei_bridge() # Approach 1: Sandy Bridge CPU + 7-series chipset -> device-id 0x3A1C0000 # Approach 2: Ivy Bridge CPU + 6-series chipset -> device-id 0x3A1E0000 # Approach 3: No embedded fake -> use DeviceProperties in config.plist # Output: Results/SSDT-IMEI.{dsl,aml} # Example with SNB+7-series spoof: # Scope (\_SB.PCI0) { # Device (IMEI) { # Name (_ADR, 0x00160000) # Method (_DSM, 4, NotSerialized) { # Return (Package (0x02) { # "device-id", Buffer (0x04) { 0x3A, 0x1C, 0x00, 0x00 } # }) # } # } # } ``` -------------------------------- ### Generate SSDT-PMC for Native NVRAM Source: https://context7.com/corpnewt/ssdttime/llms.txt Adds a PMCR device with HID APP9876 into the LPC bus, exposing the Power Management Controller memory range for native NVRAM on 300-series Intel motherboards. ```python s.ssdt_pmc() # Output: Results/SSDT-PMC.{dsl,aml} # SSDT body: # Scope (\_SB.PCI0.LPCB) { # Device (PMCR) { # Name (_HID, EisaId ("APP9876")) # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0B) } ... } # Name (_CRS, ResourceTemplate () { # Memory32Fixed (ReadWrite, 0xFE000000, 0x00010000) # }) # } # } ``` -------------------------------- ### Generate SSDT-Bridge for PCI DeviceProperties Injection Source: https://context7.com/corpnewt/ssdttime/llms.txt Generates intermediate PCI bridge Device entries required for DeviceProperties injection on devices lacking explicit ACPI bridges. Accepts device paths in macOS or Windows format. ```python s.pci_bridge() # Interactive: enter paths such as: # PciRoot(0x0)/Pci(0x1C,0x4)/Pci(0x0,0x0) # or Windows format: # PCIROOT(0)#PCI(1C04)#PCI(0000) # Optionally append a 4-char device name: PciRoot(0x0)/Pci(0x1C,0x4)/Pci(0x0,0x0) GFX0 # Output: Results/SSDT-Bridge.{dsl,aml} # Generated bridge example: # Scope (\_SB.PCI0) { # Device (BRG0) { # Name (_ADR, 0x001C0004) # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0F) } ... } # Device (GFX0) { # Name (_ADR, Zero) # Method (_STA, ...) { ... } # } # } # } ``` -------------------------------- ### Generate SSDT-HPET for IRQ Conflicts Source: https://context7.com/corpnewt/ssdttime/llms.txt Generates an SSDT-HPET to resolve IRQ conflicts for macOS. It overrides the HPET device's _CRS and produces binary patches to nullify IRQ lines from legacy devices. ```python # Interactive – prompts for IRQ removal strategy (C = conflicting IRQs from legacy # devices [default], O = all conflicting IRQs, L = all legacy IRQs, N = none). # Produces: Results/SSDT-HPET.{dsl,aml}, Results/patches_OC.plist, # Results/patches_Clover.plist s.fix_hpet() # Generated SSDT snippet (real HPET exists): # DefinitionBlock ("", "SSDT", 2, "CORP", "HPET", 0x00000000) # { # External (\_SB.PCI0.LPCB.HPET, DeviceObj) # External (\_SB.PCI0.LPCB.HPET.XCRS, MethodObj) # Scope (\_SB.PCI0.LPCB.HPET) # { # Name (BUFX, ResourceTemplate () { IRQNoFlags (){0,8} ... }) # Method (_CRS, 0, Serialized) { ... } # } # } ``` -------------------------------- ### Load ACPI Tables with SSDT.load_dsdt Source: https://context7.com/corpnewt/ssdttime/llms.txt Load ACPI tables from a specified file path or directory. The function automatically detects and attempts pre-patches for common issues, saving a patched copy to the Results folder. ```python s = SSDT() # Load a directory exported by OpenCore's SysReport or acpidump result_path = s.load_dsdt("/path/to/ACPI/") # Load a single file result_path = s.load_dsdt("/path/to/DSDT.aml") # result_path is the parent folder of the loaded tables, or None on failure. # On success, s.d.acpi_tables is populated, e.g.: # {"DSDT.aml": {"table": , "lines": [...], "raw": , ...}, ...} ``` -------------------------------- ### Generate SSDT-SBUS-MCHC for SMBus Compatibility Source: https://context7.com/corpnewt/ssdttime/llms.txt Auto-detects SMBus controller and generates an SSDT to add MCHC and BUS0 devices for macOS SMBus compatibility. Conditionally injects MCHC if not present. ```python s.smbus() # Output: Results/SSDT-SBUS-MCHC.{dsl,aml} # If CondRefOf(MCHC) is false, injects: # Scope (\_SB.PCI0) { # Device (MCHC) { Name (_ADR, Zero) ... } # } # Device (\_SB.PCI0.SBUS.BUS0) { # Name (_CID, "smbus") # Name (_ADR, Zero) # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0F) } ... } # } ``` -------------------------------- ### Patch DMAR Table to Remove Reserved Memory Regions Source: https://context7.com/corpnewt/ssdttime/llms.txt Reads the DMAR ACPI table, strips 'Reserved Memory Region' subtables, and outputs a replacement DMAR.aml. Also adds a delete entry for the original DMAR in patches_OC.plist. ```python s.fix_dmar() # Output: Results/DMAR.{dsl,aml} # patches_OC.plist gains an ACPI->Delete entry for the original DMAR. # patches_Clover.plist gains an ACPI->DropTables entry. # OEM ID and Table ID fields are normalised to "CORP" / "DMAR". ``` -------------------------------- ### DSDT.get_scope Source: https://context7.com/corpnewt/ssdttime/llms.txt Returns all lines belonging to the ACPI scope that opens at a given index, tracking brace depth to determine when the scope closes. ```APIDOC ## `DSDT.get_scope(starting_index, table)` – Extract ACPI Scope Returns all lines belonging to the ACPI scope that opens at `starting_index`, tracking brace depth to know when the scope closes. ```python # Retrieve the full text of the first EC device scope ec = d.get_device_paths_with_hid("PNP0C09")[0] scope_lines = d.get_scope(ec[1]) # ec[1] is the line index scope_text = "\n".join(scope_lines) has_gpe = "_GPE" in scope_text has_crs = "_CRS" in scope_text has_hid = "_HID" in scope_text # A valid real EC must have all three: is_valid_ec = all([has_hid, has_crs, has_gpe]) ``` ``` -------------------------------- ### Generate SSDT-RTCAWAC for AWAC/RTC Compatibility Source: https://context7.com/corpnewt/ssdttime/llms.txt Handles AWAC and RTC presence, disabling AWAC for macOS, enabling or faking an RTC device, and correcting skipped IO port ranges. ```python s.ssdt_awac() # Output: Results/SSDT-RTCAWAC.{dsl,aml} # If AWAC is present and has STAS variable: # External (STAS, IntObj) # Scope (\) { # Method (_INI, ...) { If (_OSI("Darwin")) { Store (One, STAS) } } # } # If no RTC exists, a fake RTC0 device is injected: # Device (RTC0) { # Name (_HID, EisaId ("PNP0B00")) # Name (_CRS, ResourceTemplate () { IO(...) IRQNoFlags (){8} }) # Method (_STA, ...) { If (_OSI("Darwin")) { Return (0x0F) } ... } # } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.