Changeset 100143 in vbox
- Timestamp:
- Jun 9, 2023 3:36:00 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Misc/DevPL031.cpp
r100137 r100143 122 122 /** The IRQ value. */ 123 123 uint16_t u16Irq; 124 /** Flag whether to preload the load rgeister with the current time. */ 125 bool fLoadTime; 126 /** Flag whether to use UTC for the time offset. */ 127 bool fUtcOffset; 124 128 125 129 /** @name Registers. … … 467 471 pThis->fRtcIrqMasked = false; 468 472 pThis->fRtcIrqSts = false; 473 474 if (pThis->fLoadTime) 475 { 476 RTTIMESPEC Now; 477 PDMDevHlpTMUtcNow(pDevIns, &Now); 478 if (!pThis->fUtcOffset) 479 { 480 RTTIME Time; 481 RTTimeLocalExplode(&Time, &Now); 482 RTTimeImplode(&Now, &Time); 483 } 484 485 pThis->u32RtcLr = (uint32_t)RTTimeSpecGetSeconds(&Now); 486 } 469 487 } 470 488 … … 498 516 * Validate and read the configuration. 499 517 */ 500 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Irq|MmioBase ", "");518 PDMDEV_VALIDATE_CONFIG_RETURN(pDevIns, "Irq|MmioBase|LoadTime|UtcOffset", ""); 501 519 502 520 uint16_t u16Irq = 0; … … 510 528 return PDMDEV_SET_ERROR(pDevIns, rc, 511 529 N_("Configuration error: Failed to get the \"MmioBase\" value")); 530 531 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "LoadTime", &pThis->fLoadTime, true); 532 if (RT_FAILURE(rc)) 533 return PDMDEV_SET_ERROR(pDevIns, rc, 534 N_("Configuration error: Querying \"LoadTime\" as a bool failed")); 535 536 rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "UtcOffset", &pThis->fUtcOffset, false); 537 if (RT_FAILURE(rc)) 538 return PDMDEV_SET_ERROR(pDevIns, rc, 539 N_("Configuration error: Querying \"UtcOffset\" as a bool failed")); 512 540 513 541 pThis->u16Irq = u16Irq;
Note:
See TracChangeset
for help on using the changeset viewer.