Changeset 73768 in vbox
- Timestamp:
- Aug 19, 2018 7:07:19 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r72332 r73768 596 596 com::Utf8Str strPath; 597 597 bool fServer; 598 UartType_T uartType; 598 599 }; 599 600 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r73740 r73768 608 608 " file <file>|\n" 609 609 " <devicename>]\n" 610 " [--uarttype<1-N> 16450|16550A|16750\n" 610 611 #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) 611 612 " [--lpt<1-N> off|<I/O base> <IRQ>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r72976 r73768 1493 1493 Bstr path; 1494 1494 BOOL fServer; 1495 UartType_T UartType; 1495 1496 uart->COMGETTER(IRQ)(&ulIRQ); 1496 1497 uart->COMGETTER(IOBase)(&ulIOBase); … … 1498 1499 uart->COMGETTER(Server)(&fServer); 1499 1500 uart->COMGETTER(HostMode)(&HostMode); 1501 uart->COMGETTER(UartType)(&UartType); 1500 1502 1501 1503 if (details == VMINFO_MACHINEREADABLE) … … 1510 1512 RTPrintf("uartmode%d=\"disconnected\"\n", currentUART + 1); 1511 1513 else 1512 RTPrintf(", disconnected \n");1514 RTPrintf(", disconnected"); 1513 1515 break; 1514 1516 case PortMode_RawFile: … … 1525 1527 fServer ? "tcpserver" : "tcpclient", path.raw()); 1526 1528 else 1527 RTPrintf(", attached to tcp (%s) '%ls' \n",1529 RTPrintf(", attached to tcp (%s) '%ls'", 1528 1530 fServer ? "server" : "client", path.raw()); 1529 1531 break; … … 1533 1535 fServer ? "server" : "client", path.raw()); 1534 1536 else 1535 RTPrintf(", attached to pipe (%s) '%ls' \n",1537 RTPrintf(", attached to pipe (%s) '%ls'", 1536 1538 fServer ? "server" : "client", path.raw()); 1537 1539 break; … … 1541 1543 path.raw()); 1542 1544 else 1543 RTPrintf(", attached to device '%ls'\n", path.raw()); 1545 RTPrintf(", attached to device '%ls'", path.raw()); 1546 break; 1547 } 1548 switch (UartType) 1549 { 1550 default: 1551 case UartType_U16450: 1552 if (details == VMINFO_MACHINEREADABLE) 1553 RTPrintf("uarttype%d=\"16450\"\n", currentUART + 1); 1554 else 1555 RTPrintf(", 16450\n"); 1556 break; 1557 case UartType_U16550A: 1558 if (details == VMINFO_MACHINEREADABLE) 1559 RTPrintf("uarttype%d=\"16550A\"\n", currentUART + 1); 1560 else 1561 RTPrintf(", 16550A\n"); 1562 break; 1563 case UartType_U16750: 1564 if (details == VMINFO_MACHINEREADABLE) 1565 RTPrintf("uarttype%d=\"16750\"\n", currentUART + 1); 1566 else 1567 RTPrintf(", 16750\n"); 1544 1568 break; 1545 1569 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r72919 r73768 147 147 MODIFYVM_HIDKBD, 148 148 MODIFYVM_UARTMODE, 149 MODIFYVM_UARTTYPE, 149 150 MODIFYVM_UART, 150 151 #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) … … 334 335 { "--keyboard", MODIFYVM_HIDKBD, RTGETOPT_REQ_STRING }, 335 336 { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 337 { "--uarttype", MODIFYVM_UARTTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 336 338 { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 337 339 #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) … … 2157 2159 } 2158 2160 2161 case MODIFYVM_UARTTYPE: 2162 { 2163 ComPtr<ISerialPort> uart; 2164 2165 CHECK_ERROR_BREAK(sessionMachine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 2166 ASSERT(uart); 2167 2168 if (!RTStrICmp(ValueUnion.psz, "16450")) 2169 { 2170 CHECK_ERROR(uart, COMSETTER(UartType)(UartType_U16450)); 2171 } 2172 else if (!RTStrICmp(ValueUnion.psz, "16550A")) 2173 { 2174 CHECK_ERROR(uart, COMSETTER(UartType)(UartType_U16550A)); 2175 } 2176 else if (!RTStrICmp(ValueUnion.psz, "16750")) 2177 { 2178 CHECK_ERROR(uart, COMSETTER(UartType)(UartType_U16750)); 2179 } 2180 else 2181 return errorSyntax(USAGE_MODIFYVM, 2182 "Invalid argument to '%s'", 2183 GetOptState.pDef->pszLong); 2184 break; 2185 } 2186 2159 2187 case MODIFYVM_UART: 2160 2188 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r73743 r73768 593 593 <desc>Settings version "1.17", written by VirtualBox 6.0.x.</desc> 594 594 <!-- 595 Machine changes: nested hardware virtualization .595 Machine changes: nested hardware virtualization, UART type selection. 596 596 --> 597 597 </const> … … 18388 18388 </enum> 18389 18389 18390 <enum 18391 name="UartType" 18392 uuid="c8899d39-0b90-4265-9d02-1e38bd4d1b39" 18393 > 18394 <desc> 18395 The UART type represents the emulated UART chip for the serial port device. 18396 </desc> 18397 18398 <const name="U16450" value="0"> 18399 <desc>The most basic emulated UART which doesn't support FIFO operation.</desc> 18400 </const> 18401 <const name="U16550A" value="1"> 18402 <desc> 18403 The successor of the 16450 UART introducing a 16 byte FIFO to reduce 18404 operational overhead. 18405 </desc> 18406 </const> 18407 <const name="U16750" value="2"> 18408 <desc> 18409 This UART developed by Texas Instruments introduced a 64 byte FIFO 18410 and hardware flow control. 18411 </desc> 18412 </const> 18413 </enum> 18414 18390 18415 <interface 18391 18416 name="ISerialPort" extends="$unknown" 18392 18417 uuid="cb0a4a29-43a3-9040-0c25-34845db7b042" 18393 18418 wsmap="managed" 18394 reservedAttributes=" 2"18419 reservedAttributes="1" 18395 18420 > 18396 18421 … … 18470 18495 value is an error. Otherwise, the value of this property is ignored. 18471 18496 </desc> 18497 </attribute> 18498 18499 <attribute name="uartType" type="UartType"> 18500 <desc>Selects the emulated UART implementation.</desc> 18472 18501 </attribute> 18473 18502 -
trunk/src/VBox/Main/include/SerialPortImpl.h
r69500 r73768 79 79 HRESULT getPath(com::Utf8Str &aPath); 80 80 HRESULT setPath(const com::Utf8Str &aPath); 81 HRESULT getUartType(UartType_T *aUartType); 82 HRESULT setUartType(UartType_T aUartType); 81 83 82 84 struct Data; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r73629 r73768 2706 2706 hrc = serialPort->COMGETTER(Server)(&fServer); H(); 2707 2707 hrc = serialPort->COMGETTER(Path)(bstr.asOutParam()); H(); 2708 UartType_T eUartType; 2709 const char *pszUartType; 2710 hrc = serialPort->COMGETTER(UartType)(&eUartType); H(); 2711 switch (eUartType) 2712 { 2713 case UartType_U16450: pszUartType = "16450"; break; 2714 case UartType_U16750: pszUartType = "16750"; break; 2715 default: AssertFailed(); RT_FALL_THRU(); 2716 case UartType_U16550A: pszUartType = "16550A"; break; 2717 } 2718 InsertConfigString(pCfg, "UartType", pszUartType); 2719 2708 2720 PortMode_T eHostMode; 2709 2721 hrc = serialPort->COMGETTER(HostMode)(&eHostMode); H(); -
trunk/src/VBox/Main/src-server/SerialPortImpl.cpp
r72973 r73768 476 476 m->bd.backup(); 477 477 m->bd->fServer = RT_BOOL(aServer); 478 479 m->fModified = true; 480 // leave the lock before informing callbacks 481 alock.release(); 482 483 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); 484 m->pMachine->i_setModified(Machine::IsModified_SerialPorts); 485 mlock.release(); 486 487 m->pMachine->i_onSerialPortChange(this); 488 } 489 490 return S_OK; 491 } 492 493 HRESULT SerialPort::getUartType(UartType_T *aUartType) 494 { 495 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 496 497 *aUartType = m->bd->uartType; 498 499 return S_OK; 500 } 501 502 HRESULT SerialPort::setUartType(UartType_T aUartType) 503 { 504 /* the machine needs to be mutable */ 505 AutoMutableOrSavedOrRunningStateDependency adep(m->pMachine); 506 if (FAILED(adep.rc())) return adep.rc(); 507 508 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 509 510 if (m->bd->uartType != aUartType) 511 { 512 m->bd.backup(); 513 m->bd->uartType = aUartType; 478 514 479 515 m->fModified = true; -
trunk/src/VBox/Main/xml/Settings.cpp
r72973 r73768 2495 2495 ulIRQ(4), 2496 2496 portMode(PortMode_Disconnected), 2497 fServer(false) 2497 fServer(false), 2498 uartType(UartType_U16550A) 2498 2499 { 2499 2500 } … … 2513 2514 && portMode == s.portMode 2514 2515 && strPath == s.strPath 2515 && fServer == s.fServer); 2516 && fServer == s.fServer 2517 && uartType == s.uartType); 2516 2518 } 2517 2519 … … 3637 3639 pelmPort->getAttributeValue("server", port.fServer); 3638 3640 3641 Utf8Str strUartType; 3642 if (pelmPort->getAttributeValue("uartType", strUartType)) 3643 { 3644 if (strUartType == "16450") 3645 port.uartType = UartType_U16450; 3646 else if (strUartType == "16550A") 3647 port.uartType = UartType_U16550A; 3648 else if (strUartType == "16750") 3649 port.uartType = UartType_U16750; 3650 else 3651 throw ConfigFileError(this, pelmPort, N_("Invalid value '%s' in UART/Port/@uartType attribute"), strUartType.c_str()); 3652 } 3653 3639 3654 ll.push_back(port); 3640 3655 } … … 6011 6026 } 6012 6027 pelmPort->setAttribute("hostMode", pcszHostMode); 6028 6029 if ( m->sv >= SettingsVersion_v1_17 6030 && port.uartType != UartType_U16550A) 6031 { 6032 const char *pcszUartType; 6033 6034 switch (port.uartType) 6035 { 6036 case UartType_U16450: pcszUartType = "16450"; break; 6037 case UartType_U16550A: pcszUartType = "16550A"; break; 6038 case UartType_U16750: pcszUartType = "16750"; break; 6039 default: pcszUartType = "16550A"; break; 6040 } 6041 pelmPort->setAttribute("uartType", pcszUartType); 6042 } 6013 6043 } 6014 6044 } … … 6982 7012 return; 6983 7013 } 7014 7015 /* 7016 * Check if any serial port uses a non 16550A serial port. 7017 */ 7018 for (SerialPortsList::const_iterator it = hardwareMachine.llSerialPorts.begin(); 7019 it != hardwareMachine.llSerialPorts.end(); 7020 ++it) 7021 { 7022 const SerialPort &port = *it; 7023 if (port.uartType != UartType_U16550A) 7024 { 7025 m->sv = SettingsVersion_v1_17; 7026 return; 7027 } 7028 } 6984 7029 } 6985 7030
Note:
See TracChangeset
for help on using the changeset viewer.