VirtualBox

Changeset 20400 in vbox


Ignore:
Timestamp:
Jun 8, 2009 1:03:07 PM (16 years ago)
Author:
vboxsync
Message:

ACPI: refactoring, prepare for dynamic DSDT generation

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Makefile.kmk

    r20295 r20400  
    273273        PC/DevPIC.cpp \
    274274        PC/DevACPI.cpp \
     275        PC/ACPI/VBoxAcpi.cpp \
    275276        PC/DevRTC.cpp \
    276277        PC/DevPcBios.cpp \
     
    387388endif
    388389
     390ifdef VBOX_WITH_DYNAMIC_DSDT
     391DevicesR3_DEFS          += VBOX_WITH_DYNAMIC_DSDT
     392endif
     393
    389394ifdef VBOX_WITH_USB
    390395DevicesR3_DEFS         += VBOX_WITH_USB IN_USB_R3
     
    404409DevicesR3_DEFS.l4      += _GNU_SOURCE
    405410
    406 # DevACPI.cpp needs vboxaml.hex which we generate from PC/vbox.dsl. (bird: What's vboxaml.aml?)
     411# VBoxAcpi.cpp needs vboxaml.hex which we generate from PC/vbox.dsl. (bird: What's vboxaml.aml?)
    407412DevicesR3_CLEAN        += $(PATH_DevicesR3)/vboxaml.hex $(PATH_DevicesR3)/vboxaml.aml
    408 PC/DevACPI.cpp_DEPS     = $(PATH_DevicesR3)/vboxaml.hex
    409 PC/DevACPI.cpp_INCS     = $(PATH_DevicesR3)
     413PC/ACPI/VBoxAcpi.cpp_DEPS     = $(PATH_DevicesR3)/vboxaml.hex
     414PC/ACPI/VBoxAcpi.cpp_INCS     = $(PATH_DevicesR3)
    410415
    411416$$(PATH_DevicesR3)/vboxaml.hex: $(PATH_SUB_CURRENT)/PC/vbox.dsl | $$(dir $$@)
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r20374 r20400  
    4141#endif
    4242
    43 /* the compiled DSL */
    4443#if defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE)
    45 # include <vboxaml.hex>
     44int acpiPrepareDsdt(PPDMDEVINS pDevIns, void* *ppPtr, size_t *puDsdtLen);
     45int acpiCleanupDsdt(PPDMDEVINS pDevIns, void* pPtr);
    4646#endif /* !IN_RING3 */
    4747
     
    611611
    612612/** Differentiated System Description Table (DSDT) */
    613 static void acpiSetupDSDT(ACPIState *s, RTGCPHYS32 addr)
    614 {
    615     acpiPhyscpy(s, addr, AmlCode, sizeof(AmlCode));
     613
     614static void acpiSetupDSDT(ACPIState *s, RTGCPHYS32 addr,
     615                            void* pPtr, size_t uDsdtLen)
     616{
     617    acpiPhyscpy(s, addr, pPtr, uDsdtLen);
    616618}
    617619
     
    17471749    }
    17481750
    1749     last_addr = RT_ALIGN_32(dsdt_addr + sizeof(AmlCode), 16);
     1751    void*  pDsdtCode = NULL;
     1752    size_t uDsdtSize = 0;
     1753    rc = acpiPrepareDsdt(s->pDevIns, &pDsdtCode, &uDsdtSize);
     1754    if (RT_FAILURE(rc))
     1755        return rc;
     1756
     1757    last_addr = RT_ALIGN_32(dsdt_addr + uDsdtSize, 16);
    17501758    if (last_addr > 0x10000)
    17511759        return PDMDEV_SET_ERROR(s->pDevIns, VERR_TOO_MUCH_DATA,
     
    17581766    Log(("DSDT 0x%08X\n", dsdt_addr + addend));
    17591767    acpiSetupRSDP((ACPITBLRSDP*)s->au8RSDPPage, rsdt_addr + addend, xsdt_addr + addend);
    1760     acpiSetupDSDT(s, dsdt_addr + addend);
     1768    acpiSetupDSDT(s, dsdt_addr + addend, pDsdtCode, uDsdtSize);
     1769    acpiCleanupDsdt(s->pDevIns, pDsdtCode);
    17611770    acpiSetupFACS(s, facs_addr + addend);
    17621771    acpiSetupFADT(s, fadt_addr + addend, facs_addr + addend, dsdt_addr + addend);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette