8 /* #define DEBUG_INT */
13 #define inline __inline__ /* So we can compile with -ansi */
14 #include <linux/sched.h> /* needed for HZ */
18 #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
19 #define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
21 void IntBarf(int i, struct sigcontext_struct *context);
23 int do_int1A(struct sigcontext_struct * context){
28 if (Options.relay_debug) {
29 fprintf(stddeb,"int1A: AX %04x, BX %04x, CX %04x, DX %04x, "
30 "SI %04x, DI %04x, DS %04x, ES %04x\n",
31 AX, BX, CX, DX, SI, DI, DS, ES);
37 ticks = (int) (ltime * HZ);
39 DX = ticks & 0x0000FFFF;
40 AX = 0; /* No midnight rollover */
41 dprintf_int(stddeb,"int1a_00 // ltime=%ld ticks=%ld\n",
47 bdtime = localtime(<ime);
49 CX = (BIN_TO_BCD(bdtime->tm_hour)<<8) | BIN_TO_BCD(bdtime->tm_min);
50 DX = (BIN_TO_BCD(bdtime->tm_sec)<<8);
54 bdtime = localtime(<ime);
55 CX = (BIN_TO_BCD(bdtime->tm_year/100)<<8) | BIN_TO_BCD((bdtime->tm_year-1900)%100);
56 DX = (BIN_TO_BCD(bdtime->tm_mon)<<8) | BIN_TO_BCD(bdtime->tm_mday);
59 /* setting the time,date or RTC is not allow -EB */
73 IntBarf(0x1a, context);