VirtualBox

Changeset 82410 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 5, 2019 12:06:44 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135247
Message:

ACPI/Main: Report NVMe controller in ACPI tables to convince OS X it's an internal (built-in) device. Largely cosmetic.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r82329 r82410  
    195195    SYSTEM_INFO_INDEX_PARALLEL1_IRQ     = 29,
    196196    SYSTEM_INFO_INDEX_PREF64_MEMORY_MAX = 30,
    197     SYSTEM_INFO_INDEX_END               = 31,
     197    SYSTEM_INFO_INDEX_NVME_ADDRESS      = 31, /**< First NVMe controller PCI address, or 0 */
     198    SYSTEM_INFO_INDEX_END               = 32,
    198199    SYSTEM_INFO_INDEX_INVALID           = 0x80,
    199200    SYSTEM_INFO_INDEX_VALID             = 0x200
     
    365366    /** Primary NIC PCI address. */
    366367    uint32_t            u32NicPciAddress;
    367     /** Primary audio card PCI address. */
     368    /** HD Audio PCI address. */
    368369    uint32_t            u32AudioPciAddress;
     370    /** Primary NVMe controller PCI address. */
     371    uint32_t            u32NvmePciAddress;
    369372    /** Flag whether S1 power state is enabled. */
    370373    bool                fS1Enabled;
     
    14391442            break;
    14401443
     1444        case SYSTEM_INFO_INDEX_NVME_ADDRESS:
     1445            *pu32 = pThis->u32NvmePciAddress;
     1446            break;
     1447
    14411448        case SYSTEM_INFO_INDEX_POWER_STATES:
    14421449            *pu32 = RT_BIT(0) | RT_BIT(5);  /* S1 and S5 always exposed */
     
    14471454            break;
    14481455
    1449        case SYSTEM_INFO_INDEX_IOC_ADDRESS:
     1456        case SYSTEM_INFO_INDEX_IOC_ADDRESS:
    14501457            *pu32 = pThis->u32IocPciAddress;
    14511458            break;
     
    36903697                                  "|NicPciAddress"
    36913698                                  "|AudioPciAddress"
     3699                                  "|NvmePciAddress"
    36923700                                  "|IocPciAddress"
    36933701                                  "|HostBusPciAddress"
     
    37733781        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"ShowCpu\""));
    37743782
    3775     /* query primary NIC PCI address */
     3783    /* query primary NIC PCI address (GIGE) */
    37763784    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "NicPciAddress", &pThis->u32NicPciAddress, 0);
    37773785    if (RT_FAILURE(rc))
    37783786        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"NicPciAddress\""));
    37793787
    3780     /* query primary NIC PCI address */
     3788    /* query HD Audio PCI address (HDAA) */
    37813789    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "AudioPciAddress", &pThis->u32AudioPciAddress, 0);
    37823790    if (RT_FAILURE(rc))
    37833791        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"AudioPciAddress\""));
     3792
     3793    /* query NVMe PCI address (NVMA) */
     3794    rc = pHlp->pfnCFGMQueryU32Def(pCfg, "NvmePciAddress", &pThis->u32NvmePciAddress, 0);
     3795    if (RT_FAILURE(rc))
     3796        return PDMDEV_SET_ERROR(pDevIns, rc, N_("Configuration error: Failed to read \"NvmePciAddress\""));
    37843797
    37853798    /* query IO controller (southbridge) PCI address */
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r76553 r82410  
    371371        PP1I,  32, // Parallel1 IRQ
    372372        PMNX,  32, // limit of 64-bit prefetch window (64KB units)
     373        NVMA,  32, // Primary NVMe controller PCI address
    373374        Offset (0x80),
    374375        ININ, 32,
     
    12201221                 }
    12211222             }
     1223
     1224            // NVMe controller. Required to convince OS X that
     1225            // the controller is an internal (built-in) device.
     1226            Device (SSD0)
     1227            {
     1228                Method(_ADR, 0, NotSerialized)
     1229                {
     1230                     Return (NVMA)
     1231                }
     1232                Method (_STA, 0, NotSerialized)
     1233                {
     1234                    if (LEqual (NVMA, Zero)) {
     1235                        Return (0x00)
     1236                    }
     1237                    else {
     1238                        Return (0x0F)
     1239                    }
     1240                }
     1241                // Port 0
     1242                Device (PRT0)
     1243                {
     1244                    Name (_ADR, 0xffff)
     1245                }
     1246            }
    12221247
    12231248            // NIC
Note: See TracChangeset for help on using the changeset viewer.

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