7 #include <linux/sched.h> /* needed for HZ */
10 #define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
11 #define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
13 int do_int1A(struct sigcontext_struct
* context
){
18 switch((context
->sc_eax
>> 8) & 0xff){
21 ticks
= (int) (ltime
* HZ
);
22 context
->sc_ecx
= ticks
>> 16;
23 context
->sc_edx
= ticks
& 0x0000FFFF;
24 context
->sc_eax
= 0; /* No midnight rollover */
29 bdtime
= localtime(<ime
);
31 context
->sc_ecx
= (BIN_TO_BCD(bdtime
->tm_hour
)<<8) | BIN_TO_BCD(bdtime
->tm_min
);
32 context
->sc_edx
= (BIN_TO_BCD(bdtime
->tm_sec
)<<8);
36 bdtime
= localtime(<ime
);
37 context
->sc_ecx
= (BIN_TO_BCD(bdtime
->tm_year
/100)<<8) | BIN_TO_BCD((bdtime
->tm_year
-1900)%100);
38 context
->sc_edx
= (BIN_TO_BCD(bdtime
->tm_mon
)<<8) | BIN_TO_BCD(bdtime
->tm_mday
);
41 /* setting the time,date or RTC is not allow -EB */
55 fprintf(stderr
,"Unable to handle int 0x1A AX %04x\n", context
->sc_eax
& 0xffffL
);