VirtualBox

Changeset 59918 in vbox


Ignore:
Timestamp:
Mar 4, 2016 10:06:52 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105846
Message:

ACPI: Allow two more serial ports.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r58132 r59918  
    162162    SYSTEM_INFO_INDEX_SMC_STATUS        = 3,
    163163    SYSTEM_INFO_INDEX_FDC_STATUS        = 4,
    164     SYSTEM_INFO_INDEX_CPU0_STATUS       = 5,  /**< For compatibility with older saved states. */
    165     SYSTEM_INFO_INDEX_CPU1_STATUS       = 6,  /**< For compatibility with older saved states. */
    166     SYSTEM_INFO_INDEX_CPU2_STATUS       = 7,  /**< For compatibility with older saved states. */
    167     SYSTEM_INFO_INDEX_CPU3_STATUS       = 8,  /**< For compatibility with older saved states. */
     164    SYSTEM_INFO_INDEX_SERIAL2_IOBASE    = 5,
     165    SYSTEM_INFO_INDEX_SERIAL2_IRQ       = 6,
     166    SYSTEM_INFO_INDEX_SERIAL3_IOBASE    = 7,
     167    SYSTEM_INFO_INDEX_SERIAL3_IRQ       = 8,
    168168    SYSTEM_INFO_INDEX_HIGH_MEMORY_LENGTH= 9,
    169169    SYSTEM_INFO_INDEX_RTC_STATUS        = 10,
     
    187187    SYSTEM_INFO_INDEX_PARALLEL1_IOBASE  = 28,
    188188    SYSTEM_INFO_INDEX_PARALLEL1_IRQ     = 29,
    189     SYSTEM_INFO_INDEX_END               = 30,
     189    SYSTEM_INFO_INDEX_END               = 34,
    190190    SYSTEM_INFO_INDEX_INVALID           = 0x80,
    191191    SYSTEM_INFO_INDEX_VALID             = 0x200
     
    313313    /** Serial 1 IRQ number */
    314314    uint8_t             uSerial1Irq;
     315    /** Serial 2 IRQ number */
     316    uint8_t             uSerial2Irq;
     317    /** Serial 3 IRQ number */
     318    uint8_t             uSerial3Irq;
    315319    /** Serial 0 IO port base */
    316320    RTIOPORT            uSerial0IoPortBase;
    317321    /** Serial 1 IO port base */
    318322    RTIOPORT            uSerial1IoPortBase;
     323    /** Serial 2 IO port base */
     324    RTIOPORT            uSerial2IoPortBase;
     325    /** Serial 3 IO port base */
     326    RTIOPORT            uSerial3IoPortBase;
    319327
    320328    /** @name Parallel port config bits
     
    12721280            break;
    12731281
    1274         /* This is only for compatibility with older saved states that
    1275            may include ACPI code that read these values.  Legacy is
    1276            a wonderful thing, isn't it? :-) */
    1277         case SYSTEM_INFO_INDEX_CPU0_STATUS:
    1278         case SYSTEM_INFO_INDEX_CPU1_STATUS:
    1279         case SYSTEM_INFO_INDEX_CPU2_STATUS:
    1280         case SYSTEM_INFO_INDEX_CPU3_STATUS:
    1281             *pu32 = (   pThis->fShowCpu
    1282                      && pThis->uSystemInfoIndex - SYSTEM_INFO_INDEX_CPU0_STATUS < pThis->cCpus
    1283                      && VMCPUSET_IS_PRESENT(&pThis->CpuSetAttached,
    1284                                             pThis->uSystemInfoIndex - SYSTEM_INFO_INDEX_CPU0_STATUS) )
    1285                   ? (  STA_DEVICE_PRESENT_MASK
    1286                      | STA_DEVICE_ENABLED_MASK
    1287                      | STA_DEVICE_SHOW_IN_UI_MASK
    1288                      | STA_DEVICE_FUNCTIONING_PROPERLY_MASK)
    1289                   : 0;
    1290             break;
    1291 
    12921282        case SYSTEM_INFO_INDEX_RTC_STATUS:
    12931283            *pu32 = pThis->fShowRtc
     
    13361326        case SYSTEM_INFO_INDEX_SERIAL1_IRQ:
    13371327            *pu32 = pThis->uSerial1Irq;
     1328            break;
     1329
     1330        case SYSTEM_INFO_INDEX_SERIAL2_IOBASE:
     1331            *pu32 = pThis->uSerial2IoPortBase;
     1332            break;
     1333
     1334        case SYSTEM_INFO_INDEX_SERIAL2_IRQ:
     1335            *pu32 = pThis->uSerial2Irq;
     1336            break;
     1337
     1338        case SYSTEM_INFO_INDEX_SERIAL3_IOBASE:
     1339            *pu32 = pThis->uSerial3IoPortBase;
     1340            break;
     1341
     1342        case SYSTEM_INFO_INDEX_SERIAL3_IRQ:
     1343            *pu32 = pThis->uSerial3Irq;
    13381344            break;
    13391345
     
    30853091                              "Serial0IoPortBase\0"
    30863092                              "Serial1IoPortBase\0"
     3093                              "Serial2IoPortBase\0"
     3094                              "Serial3IoPortBase\0"
    30873095                              "Serial0Irq\0"
    30883096                              "Serial1Irq\0"
     3097                              "Serial2Irq\0"
     3098                              "Serial3Irq\0"
    30893099                              "AcpiOemId\0"
    30903100                              "AcpiCreatorId\0"
     
    32343244                                N_("Configuration error: Failed to read \"Serial1IoPortBase\""));
    32353245
     3246    /* Read serial port 2 settings; disabled if CFGM keys do not exist. */
     3247    rc = CFGMR3QueryU8Def(pCfg, "Serial2Irq", &pThis->uSerial2Irq, 0);
     3248    if (RT_FAILURE(rc))
     3249        return PDMDEV_SET_ERROR(pDevIns, rc,
     3250                                N_("Configuration error: Failed to read \"Serial2Irq\""));
     3251
     3252    rc = CFGMR3QueryU16Def(pCfg, "Serial2IoPortBase", &pThis->uSerial2IoPortBase, 0);
     3253    if (RT_FAILURE(rc))
     3254        return PDMDEV_SET_ERROR(pDevIns, rc,
     3255                                N_("Configuration error: Failed to read \"Serial2IoPortBase\""));
     3256
     3257    /* Read serial port 3 settings; disabled if CFGM keys do not exist. */
     3258    rc = CFGMR3QueryU8Def(pCfg, "Serial3Irq", &pThis->uSerial3Irq, 0);
     3259    if (RT_FAILURE(rc))
     3260        return PDMDEV_SET_ERROR(pDevIns, rc,
     3261                                N_("Configuration error: Failed to read \"Serial3Irq\""));
     3262
     3263    rc = CFGMR3QueryU16Def(pCfg, "Serial3IoPortBase", &pThis->uSerial3IoPortBase, 0);
     3264    if (RT_FAILURE(rc))
     3265        return PDMDEV_SET_ERROR(pDevIns, rc,
     3266                                N_("Configuration error: Failed to read \"Serial3IoPortBase\""));
    32363267    /*
    32373268     * Query settings for both parallel ports, if the CFGM keys don't exist pretend that
  • trunk/src/VBox/Devices/PC/vbox.dsl

    r57979 r59918  
    132132        USMC,  32, // if SMC enabled
    133133        UFDC,  32, // if floppy controller enabled
    134         // UCP0-UCP3 no longer used and only kept here for saved state compatibility
    135         UCP0,  32,
    136         UCP1,  32,
    137         UCP2,  32,
    138         UCP3,  32,
     134        SL2B,  32, // Serial2 base IO address 
     135        SL2I,  32, // Serial2 IRQ
     136        SL3B,  32, // Serial3 base IO address 
     137        SL3I,  32, // Serial3 IRQ
    139138        MEMH,  32,
    140139        URTC,  32, // if RTC shown in tables
     
    804803                }
    805804
     805                // Serial port 2
     806                Device (^SRL2)
     807                {
     808                    Name (_HID, EisaId ("PNP0501"))
     809                    Name (_UID, 0x03)
     810                    Method (_STA, 0, NotSerialized)
     811                    {
     812                        If (LEqual (SL2B, Zero))
     813                        {
     814                            Return (0x00)
     815                        }
     816                        Else
     817                        {
     818                            Return (0x0F)
     819                        }
     820                    }
     821                    Name (CRS, ResourceTemplate ()
     822                    {
     823                        IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08, _Y22)
     824                        IRQNoFlags (_Y23) {3}
     825                    })
     826                    Method (_CRS, 0, NotSerialized)
     827                    {
     828                        CreateWordField (CRS, \_SB.PCI0.SRL2._Y22._MIN, MIN1)
     829                        CreateWordField (CRS, \_SB.PCI0.SRL2._Y22._MAX, MAX1)
     830                        CreateWordField (CRS, \_SB.PCI0.SRL2._Y23._INT, IRQ1)
     831                        Store (SL2B, MIN1)
     832                        Store (SL2B, MAX1)
     833                        ShiftLeft (0x01, SL2I, IRQ1)
     834                        Return (CRS)
     835                    }
     836                }
     837
     838                // Serial port 3
     839                Device (^SRL3)
     840                {
     841                    Name (_HID, EisaId ("PNP0501"))
     842                    Name (_UID, 0x04)
     843                    Method (_STA, 0, NotSerialized)
     844                    {
     845                        If (LEqual (SL3B, Zero))
     846                        {
     847                            Return (0x00)
     848                        }
     849                        Else
     850                        {
     851                            Return (0x0F)
     852                        }
     853                    }
     854                    Name (CRS, ResourceTemplate ()
     855                    {
     856                        IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08, _Y24)
     857                        IRQNoFlags (_Y25) {3}
     858                    })
     859                    Method (_CRS, 0, NotSerialized)
     860                    {
     861                        CreateWordField (CRS, \_SB.PCI0.SRL3._Y24._MIN, MIN1)
     862                        CreateWordField (CRS, \_SB.PCI0.SRL3._Y24._MAX, MAX1)
     863                        CreateWordField (CRS, \_SB.PCI0.SRL3._Y25._INT, IRQ1)
     864                        Store (SL3B, MIN1)
     865                        Store (SL3B, MAX1)
     866                        ShiftLeft (0x01, SL3I, IRQ1)
     867                        Return (CRS)
     868                    }
     869                }
     870
    806871                // Programmable Interval Timer (i8254)
    807872                Device (TIMR)
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r59872 r59918  
    30423042            InsertConfigInteger(pCfg,  "Serial1IoPortBase", auSerialIoPortBase[1]);
    30433043            InsertConfigInteger(pCfg,  "Serial1Irq", auSerialIrq[1]);
     3044
     3045            if (auSerialIoPortBase[2])
     3046            {
     3047                InsertConfigInteger(pCfg,  "Serial2IoPortBase", auSerialIoPortBase[2]);
     3048                InsertConfigInteger(pCfg,  "Serial2Irq", auSerialIrq[2]);
     3049            }
     3050
     3051            if (auSerialIoPortBase[3])
     3052            {
     3053                InsertConfigInteger(pCfg,  "Serial3IoPortBase", auSerialIoPortBase[3]);
     3054                InsertConfigInteger(pCfg,  "Serial3Irq", auSerialIrq[3]);
     3055            }
    30443056
    30453057            InsertConfigInteger(pCfg,  "Parallel0IoPortBase", auParallelIoPortBase[0]);
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