- Timestamp:
- Apr 8, 2024 11:47:37 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevOxPcie958.cpp
r104224 r104225 251 251 } 252 252 else /* Access UART registers. */ 253 rc = uartRegRead(pDevIns, &pUart->UartCore, &pUartCC->UartCore, offUartReg, (uint32_t *)pv, cb); 253 { 254 AssertReturn(cb == 1, VINF_IOM_MMIO_UNUSED_00); 255 256 uint32_t u32 = 0; 257 rc = uartRegRead(pDevIns, &pUart->UartCore, &pUartCC->UartCore, offUartReg, &u32, 1); 258 Assert(rc == VINF_SUCCESS || rc == VINF_IOM_R3_IOPORT_READ); 259 260 if (rc == VINF_SUCCESS) 261 *(uint8_t *)pv = (uint8_t)u32; 262 else if (rc == VERR_IOM_IOPORT_UNUSED) 263 rc = VINF_IOM_MMIO_UNUSED_00; 264 else if (rc == VINF_IOM_R3_IOPORT_READ) 265 rc = VINF_IOM_R3_MMIO_READ; 266 } 254 267 255 268 return rc; … … 281 294 } 282 295 else /* Access UART registers. */ 283 rc = uartRegWrite(pDevIns, &pUart->UartCore, &pUartCC->UartCore, offUartReg, *(const uint32_t *)pv, cb); 296 { 297 AssertReturn(cb == 1, VINF_SUCCESS); 298 299 rc = uartRegWrite(pDevIns, &pUart->UartCore, &pUartCC->UartCore, offUartReg, *(const uint8_t *)pv, 1); 300 Assert(rc == VINF_SUCCESS || rc == VINF_IOM_R3_IOPORT_WRITE); 301 302 if (rc == VINF_IOM_R3_IOPORT_WRITE) 303 rc = VINF_IOM_R3_MMIO_WRITE; 304 } 284 305 285 306 return rc; … … 320 341 if (off < OX958_REG_UART_REGION_OFFSET) 321 342 { 343 AssertReturn(cb == 4, VINF_IOM_MMIO_UNUSED_00); 322 344 uint32_t *pu32 = (uint32_t *)pv; 323 Assert(cb == 4);324 345 325 346 switch ((uint32_t)off) … … 361 382 POX958UARTCC pUartCC = &pThisCC->aUarts[iUart]; 362 383 rc = ox958UartRegRead(pDevIns, pThis, pUart, pUartCC, offUartReg, pv, cb); 363 if (rc == VINF_IOM_R3_IOPORT_READ)364 rc = VINF_IOM_R3_MMIO_READ;365 384 } 366 385 else … … 384 403 if (off < OX958_REG_UART_REGION_OFFSET) 385 404 { 405 AssertReturn(cb == 4, VINF_SUCCESS); 386 406 const uint32_t u32 = *(const uint32_t *)pv; 387 Assert(cb == 4);388 407 389 408 switch ((uint32_t)off) … … 421 440 POX958UARTCC pUartCC = &pThisCC->aUarts[iUart]; 422 441 rc = ox958UartRegWrite(pDevIns, pThis, pUart, pUartCC, offUartReg, pv, cb); 423 if (rc == VINF_IOM_R3_IOPORT_WRITE)424 rc = VINF_IOM_R3_MMIO_WRITE;425 442 } 426 443 }
Note:
See TracChangeset
for help on using the changeset viewer.