Changeset 37512 in vbox for trunk/src/VBox
- Timestamp:
- Jun 16, 2011 5:57:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevRTC.cpp
r37511 r37512 250 250 } 251 251 252 252 253 static void rtc_raise_irq(RTCState* pThis, uint32_t iLevel) 253 254 { … … 259 260 DECLINLINE(int) to_bcd(RTCState *pThis, int a) 260 261 { 261 if (pThis->cmos_data[RTC_REG_B] & 0x04) {262 if (pThis->cmos_data[RTC_REG_B] & 0x04) 262 263 return a; 263 } else { 264 return ((a / 10) << 4) | (a % 10); 265 } 266 } 264 return ((a / 10) << 4) | (a % 10); 265 } 266 267 267 268 268 DECLINLINE(int) from_bcd(RTCState *pThis, int a) 269 269 { 270 if (pThis->cmos_data[RTC_REG_B] & 0x04) {270 if (pThis->cmos_data[RTC_REG_B] & 0x04) 271 271 return a; 272 } else { 273 return ((a >> 4) * 10) + (a & 0x0f); 274 } 275 } 272 return ((a >> 4) * 10) + (a & 0x0f); 273 } 274 276 275 277 276 static void rtc_set_time(RTCState *pThis) … … 292 291 293 292 294 /* -=-=-=-=-=- I/O Port -=-=-=-=-=- */ 293 /* -=-=-=-=-=- I/O Port Handlers -=-=-=-=-=- */ 294 295 295 296 296 /** … … 913 913 914 914 int iYear = to_bcd(pThis, (Tm.tm_year / 100) + 19); /* tm_year is 1900 based */ 915 rtc_set_memory(pThis, 0x32, iYear); 916 rtc_set_memory(pThis, 0x37, iYear); 915 rtc_set_memory(pThis, 0x32, iYear); /* 32h - Century Byte (BCD value for the century */ 916 rtc_set_memory(pThis, 0x37, iYear); /* 37h - (IBM PS/2) Date Century Byte */ 917 917 918 918 /*
Note:
See TracChangeset
for help on using the changeset viewer.