mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-09 13:42:56 +00:00
Get rid of an empty RTC implementation and hook up genclock instead.
This commit is contained in:
parent
e384d8a89b
commit
943f6ddd39
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178182
@ -84,7 +84,6 @@ static long ticks_per_intr;
|
||||
|
||||
#define DIFF19041970 2082844800
|
||||
|
||||
static int clockinitted = 0;
|
||||
static timecounter_get_t decr_get_timecount;
|
||||
|
||||
static struct timecounter decr_timecounter = {
|
||||
@ -95,49 +94,6 @@ static struct timecounter decr_timecounter = {
|
||||
"decrementer" /* name */
|
||||
};
|
||||
|
||||
void
|
||||
inittodr(time_t base)
|
||||
{
|
||||
time_t deltat;
|
||||
u_int rtc_time;
|
||||
struct timespec ts;
|
||||
|
||||
/*
|
||||
* If we have an RTC device use it, otherwise use the fs time.
|
||||
*/
|
||||
{
|
||||
ts.tv_sec = base;
|
||||
ts.tv_nsec = 0;
|
||||
tc_setclock(&ts);
|
||||
return;
|
||||
}
|
||||
clockinitted = 1;
|
||||
ts.tv_sec = rtc_time - DIFF19041970;
|
||||
|
||||
deltat = ts.tv_sec - base;
|
||||
if (deltat < 0) {
|
||||
deltat = -deltat;
|
||||
}
|
||||
if (deltat < 2 * SECDAY) {
|
||||
tc_setclock(&ts);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("WARNING: clock %s %d days",
|
||||
ts.tv_sec < base ? "lost" : "gained", (int)(deltat / SECDAY));
|
||||
|
||||
printf(" -- CHECK AND RESET THE DATE!\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Similar to the above
|
||||
*/
|
||||
void
|
||||
resettodr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
decr_intr(struct trapframe *frame)
|
||||
{
|
||||
|
@ -70,3 +70,4 @@ device ugen
|
||||
#device uhci
|
||||
device umass
|
||||
device usb
|
||||
device genclock
|
||||
|
Loading…
Reference in New Issue
Block a user