Changeset 41592 in vbox
- Timestamp:
- Jun 6, 2012 8:35:54 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r41582 r41592 307 307 } 308 308 309 310 309 /** 311 310 * @callback_method_impl{FNDBGFHANDLERDEV, … … 314 313 static DECLCALLBACK(void) CMOSRTCInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) 315 314 { 316 uint8_t u8Sec; 317 uint8_t u8Min; 318 uint8_t u8Hr; 319 uint8_t u8Day; 320 uint8_t u8Month; 321 uint8_t u8Year; 322 323 u8Sec = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_SEC); 324 u8Min = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MIN); 325 u8Min = bcd2bin(u8Min); 326 u8Hr = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_HR); 315 const char * PCFailNotice = "Failed To Read Values. Time Update in Progress"; 316 uint8_t u8Sec = 0; 317 uint8_t u8Min = 0; 318 uint8_t u8Hr = 0; 319 uint8_t u8Day = 0; 320 uint8_t u8Month = 0; 321 uint8_t u8Year = 0; 327 322 328 u8Day = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_DAY); 329 u8Month = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MONTH); 330 331 u8Year = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_YEAR); 332 u8Year = bcd2bin(u8Year); 333 pHlp->pfnPrintf(pHlp, "Day:%u Month:%u Year:%u, Time: Hr:%u Min:%u Sec%u\n",u8Day, u8Month, u8Year, u8Hr, u8Min, u8Sec); 334 335 323 /*Don't move further if update is in progress*/ 324 if((pcbiosCmosRead(pDevIns, 0x0A) & 0x80 )) 325 { 326 pHlp->pfnPrintf(pHlp, " %s\n", PCFailNotice); 327 } 328 else 329 { 330 u8Sec = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_SEC); 331 u8Min = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MIN); 332 u8Hr = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_HR); 333 u8Day = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_DAY); 334 u8Month = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_MONTH); 335 u8Year = pcbiosCmosRead(pDevIns, CMOS_RTC_OFFSET_YEAR); 336 337 u8RegB = pcbiosCmosRead(pDevIns, 0x0B); 338 if (!(u8RegB & 0x04)) 339 { 340 u8Sec = (u8Sec & 0x0F) + ((u8Sec / 16) * 10); 341 u8Min = (u8Min & 0x0F) + ((u8Min / 16) * 10); 342 u8Hr = (u8Hr & 0x0F) + (( (u8Hr & 0x70) / 16) * 10) | (u8Hr & 0x80); 343 u8Day = (u8Day & 0x0F) + ((u8Day / 16) * 10); 344 u8Month = (u8Month & 0x0F) + ((u8Month / 16) * 10); 345 u8Year = (u8Year & 0x0F) + ((u8Year / 16) * 10); 346 } 347 pHlp->pfnPrintf(pHlp, " Time: Hr:%u Min:%u Sec:%u, Day:%u Month:%u Year:%u\n", u8Hr, u8Min, u8Sec, u8Day, u8Month, u8Year); 348 } 336 349 } 337 350 … … 1010 1023 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 1011 1024 1025 /* 1026 * Register debugger info callback. 1027 */ 1028 PDMDevHlpDBGFInfoRegister(pDevIns, "cmos", "Display CMOS Bank 1 Info.. " 1029 "'cmos'. No argument.", CMOSBankInfo); 1030 PDMDevHlpDBGFInfoRegister(pDevIns, "cmos2", "Display CMOS Bank 2 Info.. " 1031 "'cmos2'. No argument", CMOSBank2Info); 1032 PDMDevHlpDBGFInfoRegister(pDevIns, "rtc", "Display CMOS RTC info " 1033 "'rtc'. No argument", CMOSRTCInfo); 1012 1034 /* 1013 1035 * Validate configuration. … … 1510 1532 pThis->uBootDelay = 15; 1511 1533 1512 /*1513 * Register debugger info callback.1514 */1515 PDMDevHlpDBGFInfoRegister(pDevIns, "cmos", "Display CMOS Bank 1 Info.. "1516 "'cmos'. No argument.", CMOSBankInfo);1517 PDMDevHlpDBGFInfoRegister(pDevIns, "cmos2", "Display CMOS Bank 2 Info.. "1518 "'cmos2'. No argument", CMOSBank2Info);1519 PDMDevHlpDBGFInfoRegister(pDevIns, "rtc", "Display CMOS RTC info "1520 "'rtc'. No argument", CMOSRTCInfo);1521 1534 1522 1535 /*
Note:
See TracChangeset
for help on using the changeset viewer.