System clock speed is always detected automatically.

This commit is contained in:
kato 1998-05-04 07:47:33 +00:00
parent 5b24859e0e
commit 6bcae43cf0
7 changed files with 7 additions and 103 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.51 1998/03/31 07:53:13 kato Exp $
* $Id: clock.c,v 1.52 1998/04/06 03:38:18 kato Exp $
*/
/*
@ -143,15 +143,7 @@ int statclock_disable;
u_int stat_imask = SWI_CLOCK_MASK;
#ifndef TIMER_FREQ
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
#define TIMER_FREQ 2457600;
#else /* !PC98_8M */
#define TIMER_FREQ 1996800;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
#define TIMER_FREQ 2457600;
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
#define TIMER_FREQ 1193182;
#endif /* PC98 */
@ -280,20 +272,12 @@ clkintr(struct clockframe frame)
* See microtime.s for this magic.
*/
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
#else /* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M) {
/* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
} else {
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
}
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
time.tv_usec += (27465 * timer0_prescaler_count) >> 15;
#endif
@ -831,22 +815,10 @@ startrtclock()
#ifdef PC98
findcpuspeed();
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M)
timer_freq = 1996800L; /* 1.9968 MHz */
else
timer_freq = 2457600L; /* 2.4576 MHz */
#endif /* AUTO_CLOCK */
#endif /* PC98 */
if (cpu_feature & CPUID_TSC)

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.51 1998/03/31 07:53:13 kato Exp $
* $Id: clock.c,v 1.52 1998/04/06 03:38:18 kato Exp $
*/
/*
@ -143,15 +143,7 @@ int statclock_disable;
u_int stat_imask = SWI_CLOCK_MASK;
#ifndef TIMER_FREQ
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
#define TIMER_FREQ 2457600;
#else /* !PC98_8M */
#define TIMER_FREQ 1996800;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
#define TIMER_FREQ 2457600;
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
#define TIMER_FREQ 1193182;
#endif /* PC98 */
@ -280,20 +272,12 @@ clkintr(struct clockframe frame)
* See microtime.s for this magic.
*/
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
#else /* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M) {
/* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
} else {
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
}
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
time.tv_usec += (27465 * timer0_prescaler_count) >> 15;
#endif
@ -831,22 +815,10 @@ startrtclock()
#ifdef PC98
findcpuspeed();
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M)
timer_freq = 1996800L; /* 1.9968 MHz */
else
timer_freq = 2457600L; /* 2.4576 MHz */
#endif /* AUTO_CLOCK */
#endif /* PC98 */
if (cpu_feature & CPUID_TSC)

View File

@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
# $Id: GENERIC98,v 1.35 1998/02/17 08:29:49 kato Exp $
# $Id: GENERIC98,v 1.36 1998/04/25 04:27:15 kato Exp $
# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
@ -49,7 +49,6 @@ options SYSVSHM
options SYSVSEM
options SYSVMSG
options AUTO_CLOCK
options COM_MULTIPORT
#

View File

@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
# $Id: GENERIC98,v 1.35 1998/02/17 08:29:49 kato Exp $
# $Id: GENERIC98,v 1.36 1998/04/25 04:27:15 kato Exp $
# GENERIC98 -- Generic PC98 machine with WD/SCSI disks
@ -49,7 +49,6 @@ options SYSVSHM
options SYSVSEM
options SYSVMSG
options AUTO_CLOCK
options COM_MULTIPORT
#

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
* $Id: clock.c,v 1.51 1998/03/31 07:53:13 kato Exp $
* $Id: clock.c,v 1.52 1998/04/06 03:38:18 kato Exp $
*/
/*
@ -143,15 +143,7 @@ int statclock_disable;
u_int stat_imask = SWI_CLOCK_MASK;
#ifndef TIMER_FREQ
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
#define TIMER_FREQ 2457600;
#else /* !PC98_8M */
#define TIMER_FREQ 1996800;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
#define TIMER_FREQ 2457600;
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
#define TIMER_FREQ 1193182;
#endif /* PC98 */
@ -280,20 +272,12 @@ clkintr(struct clockframe frame)
* See microtime.s for this magic.
*/
#ifdef PC98
#ifndef AUTO_CLOCK
#ifndef PC98_8M
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
#else /* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
#endif /* PC98_8M */
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M) {
/* PC98_8M */
time.tv_usec += (16411 * timer0_prescaler_count) >> 15;
} else {
time.tv_usec += (6667 * timer0_prescaler_count) >> 14;
}
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
time.tv_usec += (27465 * timer0_prescaler_count) >> 15;
#endif
@ -831,22 +815,10 @@ startrtclock()
#ifdef PC98
findcpuspeed();
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
if (pc98_machine_type & M_8M)
timer_freq = 1996800L; /* 1.9968 MHz */
else
timer_freq = 2457600L; /* 2.4576 MHz */
#endif /* AUTO_CLOCK */
#endif /* PC98 */
if (cpu_feature & CPUID_TSC)

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.c,v 1.83 1998/04/16 16:35:23 kato Exp $
* $Id: syscons.c,v 1.84 1998/04/18 05:09:07 kato Exp $
*/
#include "sc.h"
@ -4033,13 +4033,11 @@ scinit(void)
init_done = WARM;
#ifdef PC98
#ifdef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
BELL_PITCH = 1339;
} else {
BELL_PITCH = 1678;
}
#endif /* AUTO_CLOCK */
outb(0x62, 0xd);
outb(0xA2, 0xd);
/* Extract cursor location */

View File

@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: syscons.h,v 1.21 1998/01/12 15:34:18 kato Exp $
* $Id: syscons.h,v 1.22 1998/02/13 09:31:35 kato Exp $
*/
#ifndef _PC98_PC98_SYSCONS_H_
@ -98,15 +98,7 @@
#ifdef PC98
#define UJIS 0
#define SJIS 1
#ifndef AUTO_CLOCK
#ifndef PC98_8M
#define BELL_PITCH 1678
#else
#define BELL_PITCH 1339
#endif
#else /* AUTO_CLOCK */
static unsigned int BELL_PITCH = 1678;
#endif /* AUTO_CLOCK */
#else /* IBM-PC */
#define BELL_PITCH 800
#endif