VirtualBox

Changeset 37512 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 16, 2011 5:57:37 PM (14 years ago)
Author:
vboxsync
Message:

DevRTC: Moving the code around, adjusting it thowards our style.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r37511 r37512  
    250250}
    251251
     252
    252253static void rtc_raise_irq(RTCState* pThis, uint32_t iLevel)
    253254{
     
    259260DECLINLINE(int) to_bcd(RTCState *pThis, int a)
    260261{
    261     if (pThis->cmos_data[RTC_REG_B] & 0x04) {
     262    if (pThis->cmos_data[RTC_REG_B] & 0x04)
    262263        return a;
    263     } else {
    264         return ((a / 10) << 4) | (a % 10);
    265     }
    266 }
     264    return ((a / 10) << 4) | (a % 10);
     265}
     266
    267267
    268268DECLINLINE(int) from_bcd(RTCState *pThis, int a)
    269269{
    270     if (pThis->cmos_data[RTC_REG_B] & 0x04) {
     270    if (pThis->cmos_data[RTC_REG_B] & 0x04)
    271271        return a;
    272     } else {
    273         return ((a >> 4) * 10) + (a & 0x0f);
    274     }
    275 }
     272    return ((a >> 4) * 10) + (a & 0x0f);
     273}
     274
    276275
    277276static void rtc_set_time(RTCState *pThis)
     
    292291
    293292
    294 /* -=-=-=-=-=- I/O Port -=-=-=-=-=- */
     293/* -=-=-=-=-=- I/O Port Handlers -=-=-=-=-=- */
     294
    295295
    296296/**
     
    913913
    914914    int iYear = to_bcd(pThis, (Tm.tm_year / 100) + 19); /* tm_year is 1900 based */
    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 */
     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 */
    917917
    918918    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette