/* Note: the TOD should store the current GMT  */
int m48_tod_get(int *year, int *month, int *day, int *hour, int *minute, int *second)
/* Note: the TOD should store the current GMT  */
int m48_tod_get(int *year, int *month, int *day, int *hour, int *minute, int *second)
{
    int y;
    SYS_TOD_UNPROTECT();
    M48_ADDR[CONTROL] |= 0x40;
    y = from_bcd(M48_ADDR[YEAR]);
    *year = y < 80 ? 2000 + y : 1900 + y;
    *month = from_bcd(M48_ADDR[MONTH]);
    *day = from_bcd(M48_ADDR[DAY]);
    *hour = from_bcd(M48_ADDR[HOUR]);
    *minute = from_bcd(M48_ADDR[MINUTE]);
    *second = from_bcd(M48_ADDR[SECOND] & 0x7f);
    M48_ADDR[CONTROL] &= ~0x40;
    SYS_TOD_PROTECT();
    return 0;
}