From 3327052b8ea820e2bee4cedb53e3c3fcf4c43b9d Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Wed, 18 Sep 1985 06:05:21 -0800 Subject: [PATCH] add cpuspeed variable to adjust delay macro SCCS-vsn: sys/vax/vax/autoconf.c 6.15 SCCS-vsn: sys/vax/include/cpu.h 6.5 SCCS-vsn: sys/vax/vax/cpudata.c 6.5 SCCS-vsn: sys/vax/include/param.h 6.4 --- usr/src/sys/vax/include/cpu.h | 5 +++-- usr/src/sys/vax/include/param.h | 10 +++++++++- usr/src/sys/vax/vax/autoconf.c | 4 +++- usr/src/sys/vax/vax/cpudata.c | 10 +++++----- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/usr/src/sys/vax/include/cpu.h b/usr/src/sys/vax/include/cpu.h index 04f406d095..efe84598d2 100644 --- a/usr/src/sys/vax/include/cpu.h +++ b/usr/src/sys/vax/include/cpu.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)cpu.h 6.4 (Berkeley) %G% + * @(#)cpu.h 6.5 (Berkeley) %G% */ #ifndef LOCORE @@ -55,9 +55,10 @@ union cpusid { */ struct percpu { short pc_cputype; /* cpu type code */ + short pc_cpuspeed; /* relative speed of cpu */ short pc_nioa; /* number of IO adaptors/SBI's */ caddr_t *pc_ioaaddr; /* phys addresses of IO adaptors */ - int pc_ioasize; /* size of a IO adaptor */ + int pc_ioasize; /* size of an IO adaptor */ short *pc_ioatype; /* io adaptor types if no cfg reg */ }; diff --git a/usr/src/sys/vax/include/param.h b/usr/src/sys/vax/include/param.h index 8500429748..04d14ba944 100644 --- a/usr/src/sys/vax/include/param.h +++ b/usr/src/sys/vax/include/param.h @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)param.h 6.3 (Berkeley) %G% + * @(#)param.h 6.4 (Berkeley) %G% */ /* @@ -45,4 +45,12 @@ #define USERMODE(ps) (((ps) & PSL_CURMOD) == PSL_CURMOD) #define BASEPRI(ps) (((ps) & PSL_IPL) == 0) +#ifdef KERNEL +#ifndef LOCORE +int cpuspeed; +#endif +#define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } + +#else KERNEL #define DELAY(n) { register int N = (n); while (--N > 0); } +#endif KERNEL diff --git a/usr/src/sys/vax/vax/autoconf.c b/usr/src/sys/vax/vax/autoconf.c index eab8111ce4..1acf6d70d6 100644 --- a/usr/src/sys/vax/vax/autoconf.c +++ b/usr/src/sys/vax/vax/autoconf.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)autoconf.c 6.14 (Berkeley) %G% + * @(#)autoconf.c 6.15 (Berkeley) %G% */ /* @@ -59,6 +59,7 @@ int cold; /* if 1, still working on cold-start */ int nexnum; /* current nexus number */ int nsbi; /* current sbi number */ int dkn; /* number of iostat dk numbers assigned so far */ +int cpuspeed = 1; /* relative cpu speed */ /* * Addresses of the (locore) routines which bootstrap us from @@ -105,6 +106,7 @@ configure() cpusid.cpusid = mfpr(SID); for (ocp = percpu; ocp->pc_cputype; ocp++) if (ocp->pc_cputype == cpusid.cpuany.cp_type) { + cpuspeed = ocp->pc_cpuspeed; probeioa(ocp); /* * Write protect the scb and UNIBUS interrupt vectors. diff --git a/usr/src/sys/vax/vax/cpudata.c b/usr/src/sys/vax/vax/cpudata.c index 33cdaac469..4f231238e4 100644 --- a/usr/src/sys/vax/vax/cpudata.c +++ b/usr/src/sys/vax/vax/cpudata.c @@ -3,7 +3,7 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)cpudata.c 6.4 (Berkeley) %G% + * @(#)cpudata.c 6.5 (Berkeley) %G% */ #include "pte.h" @@ -101,16 +101,16 @@ short ioa730[] = { IOA_XXX730 }; struct percpu percpu[] = { #if VAX8600 - { VAX_8600, 2, ioaaddr8600, 512, (short *)0 }, + { VAX_8600, 4, 2, ioaaddr8600, 512, (short *)0 }, #endif #if VAX780 - { VAX_780, 1, (caddr_t *)0, 0, ioa780 }, + { VAX_780, 2, 1, (caddr_t *)0, 0, ioa780 }, #endif #if VAX750 - { VAX_750, 1, (caddr_t *)0, 0, ioa750 }, + { VAX_750, 1, 1, (caddr_t *)0, 0, ioa750 }, #endif #if VAX730 - { VAX_730, 1, (caddr_t *)0, 0, ioa730 }, + { VAX_730, 1, 1, (caddr_t *)0, 0, ioa730 }, #endif 0, }; -- 2.20.1