mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-20 23:35:02 +00:00
Sync with sys/i386/isa/clock.c revision 1.128.
This commit is contained in:
parent
ba6927e973
commit
7f9848cd68
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40613
|
@ -34,7 +34,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.62 1998/10/13 02:33:21 kato Exp $
|
* $Id: clock.c,v 1.63 1998/10/13 03:24:01 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -198,7 +198,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
|
||||||
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
||||||
static void set_timer_freq(u_int freq, int intr_freq);
|
static void set_timer_freq(u_int freq, int intr_freq);
|
||||||
|
|
||||||
static struct timecounter tsc_timecounter[3] = {
|
static struct timecounter tsc_timecounter = {
|
||||||
tsc_get_timecount, /* get_timecount */
|
tsc_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -207,9 +207,9 @@ static struct timecounter tsc_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
||||||
tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
&tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static struct timecounter i8254_timecounter[3] = {
|
static struct timecounter i8254_timecounter = {
|
||||||
i8254_get_timecount, /* get_timecount */
|
i8254_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -218,7 +218,7 @@ static struct timecounter i8254_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
||||||
i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
&i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clkintr(struct clockframe frame)
|
clkintr(struct clockframe frame)
|
||||||
|
@ -952,8 +952,8 @@ startrtclock()
|
||||||
}
|
}
|
||||||
|
|
||||||
set_timer_freq(timer_freq, hz);
|
set_timer_freq(timer_freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = timer_freq;
|
i8254_timecounter.tc_frequency = timer_freq;
|
||||||
init_timecounter(i8254_timecounter);
|
init_timecounter(&i8254_timecounter);
|
||||||
|
|
||||||
#ifndef CLK_USE_TSC_CALIBRATION
|
#ifndef CLK_USE_TSC_CALIBRATION
|
||||||
if (tsc_freq != 0) {
|
if (tsc_freq != 0) {
|
||||||
|
@ -1002,8 +1002,8 @@ startrtclock()
|
||||||
#endif /* NAPM > 0 */
|
#endif /* NAPM > 0 */
|
||||||
|
|
||||||
if (tsc_present && tsc_freq != 0) {
|
if (tsc_present && tsc_freq != 0) {
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
init_timecounter(tsc_timecounter);
|
init_timecounter(&tsc_timecounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(SMP) */
|
#endif /* !defined(SMP) */
|
||||||
|
@ -1467,7 +1467,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||||
if (timer0_state != RELEASED)
|
if (timer0_state != RELEASED)
|
||||||
return (EBUSY); /* too much trouble to handle */
|
return (EBUSY); /* too much trouble to handle */
|
||||||
set_timer_freq(freq, hz);
|
set_timer_freq(freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = freq;
|
i8254_timecounter.tc_frequency = freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
@ -1487,7 +1487,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||||
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
||||||
if (error == 0 && req->newptr != NULL) {
|
if (error == 0 && req->newptr != NULL) {
|
||||||
tsc_freq = freq;
|
tsc_freq = freq;
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.62 1998/10/13 02:33:21 kato Exp $
|
* $Id: clock.c,v 1.63 1998/10/13 03:24:01 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -198,7 +198,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
|
||||||
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
||||||
static void set_timer_freq(u_int freq, int intr_freq);
|
static void set_timer_freq(u_int freq, int intr_freq);
|
||||||
|
|
||||||
static struct timecounter tsc_timecounter[3] = {
|
static struct timecounter tsc_timecounter = {
|
||||||
tsc_get_timecount, /* get_timecount */
|
tsc_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -207,9 +207,9 @@ static struct timecounter tsc_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
||||||
tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
&tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static struct timecounter i8254_timecounter[3] = {
|
static struct timecounter i8254_timecounter = {
|
||||||
i8254_get_timecount, /* get_timecount */
|
i8254_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -218,7 +218,7 @@ static struct timecounter i8254_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
||||||
i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
&i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clkintr(struct clockframe frame)
|
clkintr(struct clockframe frame)
|
||||||
|
@ -952,8 +952,8 @@ startrtclock()
|
||||||
}
|
}
|
||||||
|
|
||||||
set_timer_freq(timer_freq, hz);
|
set_timer_freq(timer_freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = timer_freq;
|
i8254_timecounter.tc_frequency = timer_freq;
|
||||||
init_timecounter(i8254_timecounter);
|
init_timecounter(&i8254_timecounter);
|
||||||
|
|
||||||
#ifndef CLK_USE_TSC_CALIBRATION
|
#ifndef CLK_USE_TSC_CALIBRATION
|
||||||
if (tsc_freq != 0) {
|
if (tsc_freq != 0) {
|
||||||
|
@ -1002,8 +1002,8 @@ startrtclock()
|
||||||
#endif /* NAPM > 0 */
|
#endif /* NAPM > 0 */
|
||||||
|
|
||||||
if (tsc_present && tsc_freq != 0) {
|
if (tsc_present && tsc_freq != 0) {
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
init_timecounter(tsc_timecounter);
|
init_timecounter(&tsc_timecounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(SMP) */
|
#endif /* !defined(SMP) */
|
||||||
|
@ -1467,7 +1467,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||||
if (timer0_state != RELEASED)
|
if (timer0_state != RELEASED)
|
||||||
return (EBUSY); /* too much trouble to handle */
|
return (EBUSY); /* too much trouble to handle */
|
||||||
set_timer_freq(freq, hz);
|
set_timer_freq(freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = freq;
|
i8254_timecounter.tc_frequency = freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
@ -1487,7 +1487,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||||
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
||||||
if (error == 0 && req->newptr != NULL) {
|
if (error == 0 && req->newptr != NULL) {
|
||||||
tsc_freq = freq;
|
tsc_freq = freq;
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.62 1998/10/13 02:33:21 kato Exp $
|
* $Id: clock.c,v 1.63 1998/10/13 03:24:01 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -198,7 +198,7 @@ static unsigned i8254_get_timecount __P((struct timecounter *tc));
|
||||||
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
static unsigned tsc_get_timecount __P((struct timecounter *tc));
|
||||||
static void set_timer_freq(u_int freq, int intr_freq);
|
static void set_timer_freq(u_int freq, int intr_freq);
|
||||||
|
|
||||||
static struct timecounter tsc_timecounter[3] = {
|
static struct timecounter tsc_timecounter = {
|
||||||
tsc_get_timecount, /* get_timecount */
|
tsc_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -207,9 +207,9 @@ static struct timecounter tsc_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
|
||||||
tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
&tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static struct timecounter i8254_timecounter[3] = {
|
static struct timecounter i8254_timecounter = {
|
||||||
i8254_get_timecount, /* get_timecount */
|
i8254_get_timecount, /* get_timecount */
|
||||||
0, /* no poll_pps */
|
0, /* no poll_pps */
|
||||||
~0u, /* counter_mask */
|
~0u, /* counter_mask */
|
||||||
|
@ -218,7 +218,7 @@ static struct timecounter i8254_timecounter[3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
SYSCTL_OPAQUE(_debug, OID_AUTO, i8254_timecounter, CTLFLAG_RD,
|
||||||
i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
&i8254_timecounter, sizeof(i8254_timecounter), "S,timecounter", "");
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clkintr(struct clockframe frame)
|
clkintr(struct clockframe frame)
|
||||||
|
@ -952,8 +952,8 @@ startrtclock()
|
||||||
}
|
}
|
||||||
|
|
||||||
set_timer_freq(timer_freq, hz);
|
set_timer_freq(timer_freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = timer_freq;
|
i8254_timecounter.tc_frequency = timer_freq;
|
||||||
init_timecounter(i8254_timecounter);
|
init_timecounter(&i8254_timecounter);
|
||||||
|
|
||||||
#ifndef CLK_USE_TSC_CALIBRATION
|
#ifndef CLK_USE_TSC_CALIBRATION
|
||||||
if (tsc_freq != 0) {
|
if (tsc_freq != 0) {
|
||||||
|
@ -1002,8 +1002,8 @@ startrtclock()
|
||||||
#endif /* NAPM > 0 */
|
#endif /* NAPM > 0 */
|
||||||
|
|
||||||
if (tsc_present && tsc_freq != 0) {
|
if (tsc_present && tsc_freq != 0) {
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
init_timecounter(tsc_timecounter);
|
init_timecounter(&tsc_timecounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(SMP) */
|
#endif /* !defined(SMP) */
|
||||||
|
@ -1467,7 +1467,7 @@ sysctl_machdep_i8254_freq SYSCTL_HANDLER_ARGS
|
||||||
if (timer0_state != RELEASED)
|
if (timer0_state != RELEASED)
|
||||||
return (EBUSY); /* too much trouble to handle */
|
return (EBUSY); /* too much trouble to handle */
|
||||||
set_timer_freq(freq, hz);
|
set_timer_freq(freq, hz);
|
||||||
i8254_timecounter[0].tc_frequency = freq;
|
i8254_timecounter.tc_frequency = freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
@ -1487,7 +1487,7 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
|
||||||
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
error = sysctl_handle_opaque(oidp, &freq, sizeof freq, req);
|
||||||
if (error == 0 && req->newptr != NULL) {
|
if (error == 0 && req->newptr != NULL) {
|
||||||
tsc_freq = freq;
|
tsc_freq = freq;
|
||||||
tsc_timecounter[0].tc_frequency = tsc_freq;
|
tsc_timecounter.tc_frequency = tsc_freq;
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue