Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 499 → Rev 500

/shark/trunk/oslib/ll/sys/ll/time.h
55,6 → 55,8
#include <ll/i386/defs.h>
BEGIN_DEF
 
#define _STRUCT_TIMESPEC
 
struct timespec {
long tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
/shark/trunk/drivers/linuxc26/linuxcomp.c
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) {
/shark/trunk/drivers/linuxc26/include/linux/kernel.h
55,8 → 55,8
#endif
 
extern struct notifier_block *panic_notifier_list;
NORET_TYPE void panic(const char * fmt, ...)
__attribute__ ((NORET_AND format (printf, 1, 2)));
void panic(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
asmlinkage NORET_TYPE void do_exit(long error_code)
ATTRIB_NORET;
NORET_TYPE void complete_and_exit(struct completion *, long)
/shark/trunk/drivers/linuxc26/include/linuxcomp.h
48,6 → 48,8
};
#endif /* _STRUCT_TIMESPEC */
 
#define __udelay __const_udelay
 
extern TIME sys_gettime(struct timespec *t);
 
#define jiffies26 (sys_gettime(NULL)*HZ/1000000) /* Has to be controlled... */