mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-27 16:39:08 +00:00
Merged from sys/i386/isa/clock.c and sys/isa/sio.c revisions 1.150 and
1.292, respectively.
This commit is contained in:
parent
bef3dd268d
commit
6eeafd696c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58477
@ -58,6 +58,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/kernel.h>
|
||||
#ifndef SMP
|
||||
#include <sys/lock.h>
|
||||
@ -963,7 +964,7 @@ startrtclock()
|
||||
|
||||
set_timer_freq(timer_freq, hz);
|
||||
i8254_timecounter.tc_frequency = timer_freq;
|
||||
init_timecounter(&i8254_timecounter);
|
||||
tc_init(&i8254_timecounter);
|
||||
|
||||
#ifndef CLK_USE_TSC_CALIBRATION
|
||||
if (tsc_freq != 0) {
|
||||
@ -1013,7 +1014,7 @@ startrtclock()
|
||||
|
||||
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) {
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
init_timecounter(&tsc_timecounter);
|
||||
tc_init(&tsc_timecounter);
|
||||
}
|
||||
|
||||
#endif /* !defined(SMP) */
|
||||
@ -1101,7 +1102,7 @@ inittodr(time_t base)
|
||||
s = splclock();
|
||||
ts.tv_sec = base;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
@ -1183,7 +1184,7 @@ inittodr(time_t base)
|
||||
/* badly off, adjust it */
|
||||
ts.tv_sec = sec;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
}
|
||||
splx(s);
|
||||
return;
|
||||
@ -1499,7 +1500,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||
return (EBUSY); /* too much trouble to handle */
|
||||
set_timer_freq(freq, hz);
|
||||
i8254_timecounter.tc_frequency = freq;
|
||||
update_timecounter(&i8254_timecounter);
|
||||
tc_update(&i8254_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -1520,7 +1521,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||
if (error == 0 && req->newptr != NULL) {
|
||||
tsc_freq = freq;
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
update_timecounter(&tsc_timecounter);
|
||||
tc_update(&tsc_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/kernel.h>
|
||||
#ifndef SMP
|
||||
#include <sys/lock.h>
|
||||
@ -963,7 +964,7 @@ startrtclock()
|
||||
|
||||
set_timer_freq(timer_freq, hz);
|
||||
i8254_timecounter.tc_frequency = timer_freq;
|
||||
init_timecounter(&i8254_timecounter);
|
||||
tc_init(&i8254_timecounter);
|
||||
|
||||
#ifndef CLK_USE_TSC_CALIBRATION
|
||||
if (tsc_freq != 0) {
|
||||
@ -1013,7 +1014,7 @@ startrtclock()
|
||||
|
||||
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) {
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
init_timecounter(&tsc_timecounter);
|
||||
tc_init(&tsc_timecounter);
|
||||
}
|
||||
|
||||
#endif /* !defined(SMP) */
|
||||
@ -1101,7 +1102,7 @@ inittodr(time_t base)
|
||||
s = splclock();
|
||||
ts.tv_sec = base;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
@ -1183,7 +1184,7 @@ inittodr(time_t base)
|
||||
/* badly off, adjust it */
|
||||
ts.tv_sec = sec;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
}
|
||||
splx(s);
|
||||
return;
|
||||
@ -1499,7 +1500,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||
return (EBUSY); /* too much trouble to handle */
|
||||
set_timer_freq(freq, hz);
|
||||
i8254_timecounter.tc_frequency = freq;
|
||||
update_timecounter(&i8254_timecounter);
|
||||
tc_update(&i8254_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -1520,7 +1521,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||
if (error == 0 && req->newptr != NULL) {
|
||||
tsc_freq = freq;
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
update_timecounter(&tsc_timecounter);
|
||||
tc_update(&tsc_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
@ -155,6 +155,7 @@
|
||||
#include <sys/bus.h>
|
||||
#include <machine/bus.h>
|
||||
#include <sys/rman.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/timepps.h>
|
||||
|
||||
#ifdef PC98
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/kernel.h>
|
||||
#ifndef SMP
|
||||
#include <sys/lock.h>
|
||||
@ -963,7 +964,7 @@ startrtclock()
|
||||
|
||||
set_timer_freq(timer_freq, hz);
|
||||
i8254_timecounter.tc_frequency = timer_freq;
|
||||
init_timecounter(&i8254_timecounter);
|
||||
tc_init(&i8254_timecounter);
|
||||
|
||||
#ifndef CLK_USE_TSC_CALIBRATION
|
||||
if (tsc_freq != 0) {
|
||||
@ -1013,7 +1014,7 @@ startrtclock()
|
||||
|
||||
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) {
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
init_timecounter(&tsc_timecounter);
|
||||
tc_init(&tsc_timecounter);
|
||||
}
|
||||
|
||||
#endif /* !defined(SMP) */
|
||||
@ -1101,7 +1102,7 @@ inittodr(time_t base)
|
||||
s = splclock();
|
||||
ts.tv_sec = base;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
@ -1183,7 +1184,7 @@ inittodr(time_t base)
|
||||
/* badly off, adjust it */
|
||||
ts.tv_sec = sec;
|
||||
ts.tv_nsec = 0;
|
||||
set_timecounter(&ts);
|
||||
tc_setclock(&ts);
|
||||
}
|
||||
splx(s);
|
||||
return;
|
||||
@ -1499,7 +1500,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||
return (EBUSY); /* too much trouble to handle */
|
||||
set_timer_freq(freq, hz);
|
||||
i8254_timecounter.tc_frequency = freq;
|
||||
update_timecounter(&i8254_timecounter);
|
||||
tc_update(&i8254_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
@ -1520,7 +1521,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||
if (error == 0 && req->newptr != NULL) {
|
||||
tsc_freq = freq;
|
||||
tsc_timecounter.tc_frequency = tsc_freq;
|
||||
update_timecounter(&tsc_timecounter);
|
||||
tc_update(&tsc_timecounter);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
@ -155,6 +155,7 @@
|
||||
#include <sys/bus.h>
|
||||
#include <machine/bus.h>
|
||||
#include <sys/rman.h>
|
||||
#include <sys/timetc.h>
|
||||
#include <sys/timepps.h>
|
||||
|
||||
#ifdef PC98
|
||||
|
Loading…
Reference in New Issue
Block a user