Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1438 → Rev 1437

/kernel/trunk/generic/src/time/clock.c
53,9 → 53,9
 
/* Pointers to public variables with time */
struct ptime {
__native seconds1;
__native seconds;
__native useconds;
__native seconds2;
__native useconds2;
};
struct ptime *public_time;
/* Variable holding fragment of second, so that we would update
82,8 → 82,7
public_time = (struct ptime *)PA2KA(faddr);
 
/* TODO: We would need some arch dependent settings here */
public_time->seconds1 = 0;
public_time->seconds2 = 0;
public_time->seconds = 0;
public_time->useconds = 0;
 
sysinfo_set_item_val("clock.faddr", NULL, (__native)faddr);
100,14 → 99,15
if (CPU->id == 0) {
secfrag += 1000000/HZ;
if (secfrag >= 1000000) {
secfrag -= 1000000;
public_time->seconds1++;
public_time->useconds = 0;
write_barrier();
public_time->useconds = secfrag;
write_barrier();
public_time->seconds2 = public_time->seconds1;
public_time->seconds++;
secfrag = 0;
} else
public_time->useconds += 1000000/HZ;
write_barrier();
public_time->useconds2 = public_time->useconds;
write_barrier();
}
}
 
/kernel/trunk/generic/include/print.h
38,6 → 38,8
 
#define EOF (-1)
 
extern int puts(const char * str);
 
extern int printf(const char *fmt, ...);
extern int sprintf(char *str, const char *fmt, ...);
extern int snprintf(char *str, size_t size, const char *fmt, ...);