VirtualBox

Changeset 27799 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 29, 2010 5:54:17 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59458
Message:

ACPI: conditionally expose NIC object to OSX guests

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r27795 r27799  
    163163    SYSTEM_INFO_INDEX_CPU_EVENT_TYPE    = 13, /**< Type of the CPU hot-plug event */
    164164    SYSTEM_INFO_INDEX_CPU_EVENT         = 14, /**< The CPU id the event is for */
    165     SYSTEM_INFO_INDEX_END               = 15,
     165    SYSTEM_INFO_INDEX_NIC_STATUS        = 15, /**< If show NIC in ACPI */
     166    SYSTEM_INFO_INDEX_END               = 16,
    166167    SYSTEM_INFO_INDEX_INVALID           = 0x80,
    167168    SYSTEM_INFO_INDEX_VALID             = 0x200
     
    256257    /** Flag whether CPU hot plugging is enabled */
    257258    bool                fCpuHotPlug;
     259    /** If NIC ACPI object to be shown */
     260    bool                fShowNic;
    258261    /** Aligning IBase. */
    259     bool                afAlignment[4];
     262    bool                afAlignment[3];
    260263
    261264    /** ACPI port base interface. */
     
    15041507                    break;
    15051508
     1509                case SYSTEM_INFO_INDEX_NIC_STATUS:
     1510                    *pu32 = s->fShowNic ? (  STA_DEVICE_PRESENT_MASK
     1511                                           | STA_DEVICE_ENABLED_MASK
     1512                                           | STA_DEVICE_SHOW_IN_UI_MASK
     1513                                           | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)
     1514                                       : 0;
     1515                    break;
     1516
    15061517                /* This is only for compatability with older saved states that
    15071518                   may include ACPI code that read these values.  Legacy is
     
    23482359                              "ShowRtc\0"
    23492360                              "ShowCpu\0"
     2361                              "ShowNic\0"
    23502362                              "CpuHotPlug\0"
    23512363                              "AmlFilePath\0"
     
    23952407        return PDMDEV_SET_ERROR(pDevIns, rc,
    23962408                                N_("Configuration error: Failed to read \"ShowCpu\""));
     2409
     2410    /* query whether we are supposed to present NIC object */
     2411    rc = CFGMR3QueryBoolDef(pCfg, "ShowNic", &s->fShowNic, false);
     2412    if (RT_FAILURE(rc))
     2413        return PDMDEV_SET_ERROR(pDevIns, rc,
     2414                                N_("Configuration error: Failed to read \"ShowNic\""));
    23972415
    23982416    /* query whether we are allow CPU hot plugging */
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r27422 r27799  
    148148            CPET,  32,
    149149            CPEV,  32,
     150            UNIC,  32,
    150151            Offset (0x80),
    151152            ININ, 32,
     
    760761                 }
    761762             }
    762 
     763           
     764            // NIC
     765            Device (GIGE)
     766            {
     767                /*
     768                 * Address is slot 0x3, function 0 - must be consistent with where NIC really is.
     769                 * This code assumes E1K NIC of type != I82545EM, as latter goes to slot 0x11.
     770                 * Device is important, as otherwise OSX refuses to accept NIC as internal,
     771                 * which may lead to inability to use NIC for kernel debugging and high level
     772                 * applications malfunctioning.
     773                 */
     774                Name (_ADR, 0x00030000)
     775
     776                Name (_PRW, Package (0x02)
     777                            {
     778                               0x09,
     779                               0x03
     780                            })
     781
     782                Method (EWOL, 1, NotSerialized)
     783                {
     784                    Return (0x00)
     785                }
     786                Method (_STA, 0, NotSerialized)
     787                {
     788                    Return (UNIC)
     789                }
     790            }
     791           
    763792            // Control method battery
    764793            Device (BAT0)
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r27797 r27799  
    22042204        rc = CFGMR3InsertInteger(pCfg,  "SmcEnabled", fSmcEnabled);                 RC_CHECK();
    22052205        rc = CFGMR3InsertInteger(pCfg,  "ShowRtc",    fExtProfile);                 RC_CHECK();
     2206        rc = CFGMR3InsertInteger(pCfg,  "ShowNic",    fExtProfile);                 RC_CHECK();
    22062207
    22072208        rc = CFGMR3InsertInteger(pCfg,  "ShowCpu", fShowCpu);                       RC_CHECK();
     
    35503551#endif /* !VBOX_WITH_GUEST_CONTROL */
    35513552}
    3552 
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