6 #include <linux/sched.h> /* needed for HZ */
9 #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
10 #define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
12 int do_int1A(struct sigcontext_struct * context){
17 switch((context->sc_eax >> 8) & 0xff){
20 ticks = (int) (ltime * HZ);
21 context->sc_ecx = ticks >> 16;
22 context->sc_edx = ticks & 0x0000FFFF;
23 context->sc_eax = 0; /* No midnight rollover */
28 bdtime = localtime(<ime);
30 context->sc_ecx = (BIN_TO_BCD(bdtime->tm_hour)<<8) | BIN_TO_BCD(bdtime->tm_min);
31 context->sc_edx = (BIN_TO_BCD(bdtime->tm_sec)<<8);
35 bdtime = localtime(<ime);
36 context->sc_ecx = (BIN_TO_BCD(bdtime->tm_year/100)<<8) | BIN_TO_BCD((bdtime->tm_year-1900)%100);
37 context->sc_edx = (BIN_TO_BCD(bdtime->tm_mon)<<8) | BIN_TO_BCD(bdtime->tm_mday);
40 /* setting the time,date or RTC is not allow -EB */
54 fprintf(stderr,"Unable to handle int 0x1A AX %x\n", context->sc_eax);