9 #include <linux/sched.h> /* needed for HZ */
12 #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
13 #define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
15 int do_int1A(struct sigcontext_struct
* context
){
20 if (Options
.relay_debug
) {
21 printf("int1A: AX %04x, BX %04x, CX %04x, DX %04x, "
22 "SI %04x, DI %04x, DS %04x, ES %04x\n",
23 AX
, BX
, CX
, DX
, SI
, DI
, DS
, ES
);
29 ticks
= (int) (ltime
* HZ
);
31 DX
= ticks
& 0x0000FFFF;
32 AX
= 0; /* No midnight rollover */
33 printf("int1a_00 // ltime=%ld ticks=%ld\n", ltime
, ticks
);
38 bdtime
= localtime(<ime
);
40 CX
= (BIN_TO_BCD(bdtime
->tm_hour
)<<8) | BIN_TO_BCD(bdtime
->tm_min
);
41 DX
= (BIN_TO_BCD(bdtime
->tm_sec
)<<8);
45 bdtime
= localtime(<ime
);
46 CX
= (BIN_TO_BCD(bdtime
->tm_year
/100)<<8) | BIN_TO_BCD((bdtime
->tm_year
-1900)%100);
47 DX
= (BIN_TO_BCD(bdtime
->tm_mon
)<<8) | BIN_TO_BCD(bdtime
->tm_mday
);
50 /* setting the time,date or RTC is not allow -EB */
64 IntBarf(0x1a, context
);