Define new option, INACCURATE_MICROTIME_IS_OK. When this is defined,

the NTP kernel PLL is disabled, and acquire_timer0() is enabled, thus
opening the door for microtime() (and hence gettimeofday()) to return
bogus timestamps.  This option is necessary for the `pca' driver to
work, but is implemented to underscore the fact that accurate timekeeping
and the `pca' driver are incompatible at present.  If someone writes a version
of microtime() that works when the `pca' driver is being used, this can get
junked.
This commit is contained in:
Garrett Wollman 1994-04-23 21:39:18 +00:00
parent 0897a95d08
commit 9ad380ab4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1407
8 changed files with 52 additions and 14 deletions

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
* $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
*/
/*
@ -85,6 +85,9 @@ timerintr(struct intrframe frame)
int
acquire_timer0(int rate, void (*function)() )
{
#ifndef INACCURATE_MICROTIME_IS_OK
return -1;
#else
if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
return -1;
timer0_in_use = 1;
@ -97,6 +100,7 @@ acquire_timer0(int rate, void (*function)() )
if (function)
timer_func = function;
return 0;
#endif
}

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
* $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
*/
/*
@ -85,6 +85,9 @@ timerintr(struct intrframe frame)
int
acquire_timer0(int rate, void (*function)() )
{
#ifndef INACCURATE_MICROTIME_IS_OK
return -1;
#else
if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
return -1;
timer0_in_use = 1;
@ -97,6 +100,7 @@ acquire_timer0(int rate, void (*function)() )
if (function)
timer_func = function;
return 0;
#endif
}

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.62 1994/04/13 01:29:14 ache Exp $
# $Id: LINT,v 1.63 1994/04/23 12:13:27 ache Exp $
#
machine "i386"
@ -26,7 +26,7 @@ options "COM_MULTIPORT" #Multiport support in sys/isa/sio.c
options "FIFO_TRIGGER=FIFO_TRIGGER_1" #Use this fifo value in sio.c
options "COMPAT_43" #compatible with BSD 4.3
options "SYMTAB_SPACE=112466" #This kernel needs LOTS of symtable
options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable
options GATEWAY #internetwork gateway
options KTRACE #kernel tracing
@ -177,7 +177,13 @@ device snd1 at isa? port 0x388
device pca0 at isa? tty
#
# The following option must be enabled in order for the pca driver to
# work. WARNING! BEWARE! CAUTION! ACHTUNG! VAROKAA!
# Enabling this option will result in the microtime() function (and hence
# gettimeofday(2) asnd the timestamps in bpf) giving incorrect results.
# DO NOT attempt to run NTP while playing audio with this driver.
#
#options INACCURATE_MICROTIME_IS_OK
# options that have not been resolved yet
#
pseudo-device log

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.62 1994/04/13 01:29:14 ache Exp $
# $Id: LINT,v 1.63 1994/04/23 12:13:27 ache Exp $
#
machine "i386"
@ -26,7 +26,7 @@ options "COM_MULTIPORT" #Multiport support in sys/isa/sio.c
options "FIFO_TRIGGER=FIFO_TRIGGER_1" #Use this fifo value in sio.c
options "COMPAT_43" #compatible with BSD 4.3
options "SYMTAB_SPACE=112466" #This kernel needs LOTS of symtable
options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable
options GATEWAY #internetwork gateway
options KTRACE #kernel tracing
@ -177,7 +177,13 @@ device snd1 at isa? port 0x388
device pca0 at isa? tty
#
# The following option must be enabled in order for the pca driver to
# work. WARNING! BEWARE! CAUTION! ACHTUNG! VAROKAA!
# Enabling this option will result in the microtime() function (and hence
# gettimeofday(2) asnd the timestamps in bpf) giving incorrect results.
# DO NOT attempt to run NTP while playing audio with this driver.
#
#options INACCURATE_MICROTIME_IS_OK
# options that have not been resolved yet
#
pseudo-device log

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.62 1994/04/13 01:29:14 ache Exp $
# $Id: LINT,v 1.63 1994/04/23 12:13:27 ache Exp $
#
machine "i386"
@ -26,7 +26,7 @@ options "COM_MULTIPORT" #Multiport support in sys/isa/sio.c
options "FIFO_TRIGGER=FIFO_TRIGGER_1" #Use this fifo value in sio.c
options "COMPAT_43" #compatible with BSD 4.3
options "SYMTAB_SPACE=112466" #This kernel needs LOTS of symtable
options "SYMTAB_SPACE=113498" #This kernel needs LOTS of symtable
options GATEWAY #internetwork gateway
options KTRACE #kernel tracing
@ -177,7 +177,13 @@ device snd1 at isa? port 0x388
device pca0 at isa? tty
#
# The following option must be enabled in order for the pca driver to
# work. WARNING! BEWARE! CAUTION! ACHTUNG! VAROKAA!
# Enabling this option will result in the microtime() function (and hence
# gettimeofday(2) asnd the timestamps in bpf) giving incorrect results.
# DO NOT attempt to run NTP while playing audio with this driver.
#
#options INACCURATE_MICROTIME_IS_OK
# options that have not been resolved yet
#
pseudo-device log

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
* $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
*/
/*
@ -85,6 +85,9 @@ timerintr(struct intrframe frame)
int
acquire_timer0(int rate, void (*function)() )
{
#ifndef INACCURATE_MICROTIME_IS_OK
return -1;
#else
if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
return -1;
timer0_in_use = 1;
@ -97,6 +100,7 @@ acquire_timer0(int rate, void (*function)() )
if (function)
timer_func = function;
return 0;
#endif
}

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
* $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
*/
/*
@ -85,6 +85,9 @@ timerintr(struct intrframe frame)
int
acquire_timer0(int rate, void (*function)() )
{
#ifndef INACCURATE_MICROTIME_IS_OK
return -1;
#else
if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
return -1;
timer0_in_use = 1;
@ -97,6 +100,7 @@ acquire_timer0(int rate, void (*function)() )
if (function)
timer_func = function;
return 0;
#endif
}

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
* $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
*/
/*
@ -85,6 +85,9 @@ timerintr(struct intrframe frame)
int
acquire_timer0(int rate, void (*function)() )
{
#ifndef INACCURATE_MICROTIME_IS_OK
return -1;
#else
if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
return -1;
timer0_in_use = 1;
@ -97,6 +100,7 @@ acquire_timer0(int rate, void (*function)() )
if (function)
timer_func = function;
return 0;
#endif
}