/* Note: the TOD should store the current GMT  */
int m48_tod_set(int year, int month, int day, int hour, int minute, int second)
/* Note: the TOD should store the current GMT  */
int m48_tod_set(int year, int month, int day, int hour, int minute, int second)
{
    SYS_TOD_UNPROTECT();
    M48_ADDR[CONTROL] |= 0x80;
    M48_ADDR[YEAR] = to_bcd(year % 100);
    M48_ADDR[MONTH] = to_bcd(month);
    M48_ADDR[DAY] = to_bcd(day);
    M48_ADDR[DAY_OF_WEEK] = day_of_week(year, month, day) + 1;
    M48_ADDR[HOUR] = to_bcd(hour);
    M48_ADDR[MINUTE] = to_bcd(minute);
    M48_ADDR[SECOND] = to_bcd(second);
    M48_ADDR[CONTROL] &= ~0x80;
    SYS_TOD_PROTECT();
    return 0;
}