1,6 → 1,7 |
|
#include <ll/i386/hw-instr.h> |
#include <ll/i386/cons.h> |
#include <ll/sys/ll/time.h> |
|
#include <linuxcomp.h> |
|
15,6 → 16,9 |
#include <linux/tty.h> |
#include <asm/setup.h> |
|
extern unsigned long intr_count; |
extern int activeInt; |
|
unsigned char _ctype[] = { |
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ |
_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ |
236,18 → 240,23 |
|
signed long schedule_timeout(signed long timeout) { |
|
SYS_FLAGS f; |
struct timespec t; |
struct timespec t,s,e; |
|
f = ll_fsave(); |
sti(); |
|
jiffies_to_timespec(timeout, &t); |
|
if (!activeInt && !intr_count) { |
|
nanosleep(&t,NULL); |
|
} else { |
|
ll_gettime(TIME_NEW,&s); |
ADDTIMESPEC(&t,&s,&e); |
|
while(TIMESPEC_A_LT_B(&s,&e)) ll_gettime(TIME_NEW,&s); |
|
} |
|
nanosleep(&t,NULL); |
|
ll_frestore(f); |
|
return 0; |
|
} |
254,36 → 263,25 |
|
void __const_udelay(unsigned long usecs) { |
|
SYS_FLAGS f; |
struct timespec t; |
struct timespec t,s,e; |
|
if (!activeInt && !intr_count) { |
|
f = ll_fsave(); |
sti(); |
|
t.tv_sec = 0; |
t.tv_nsec = usecs * 1000; |
t.tv_sec = 0; |
t.tv_nsec = usecs * 1000; |
|
nanosleep(&t,NULL); |
nanosleep(&t,NULL); |
|
ll_frestore(f); |
|
} |
} else { |
|
void __udelay(unsigned long usecs) { |
|
SYS_FLAGS f; |
struct timespec t; |
|
f = ll_fsave(); |
sti(); |
|
t.tv_sec = 0; |
t.tv_nsec = usecs * 1000; |
|
nanosleep(&t,NULL); |
|
ll_frestore(f); |
|
ll_gettime(TIME_NEW,&e); |
ADDUSEC2TIMESPEC(usecs,&e); |
|
ll_gettime(TIME_NEW,&s); |
while(TIMESPEC_A_LT_B(&s,&e)) ll_gettime(TIME_NEW,&s); |
|
} |
|
} |
|
void complete(struct completion *c) { |