add cpuspeed variable to adjust delay macro
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 18 Sep 1985 14:05:21 +0000 (06:05 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 18 Sep 1985 14:05:21 +0000 (06:05 -0800)
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
usr/src/sys/vax/include/param.h
usr/src/sys/vax/vax/autoconf.c
usr/src/sys/vax/vax/cpudata.c

index 04f406d..efe8459 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * 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
  */
 
 #ifndef LOCORE
@@ -55,9 +55,10 @@ union cpusid {
  */
 struct percpu {
        short   pc_cputype;             /* cpu type code */
  */
 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 */
        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 */
 };
 
        short   *pc_ioatype;            /* io adaptor types if no cfg reg */
 };
 
index 8500429..04d14ba 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * 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%
  */
 
 /*
  */
 
 /*
 #define        USERMODE(ps)    (((ps) & PSL_CURMOD) == PSL_CURMOD)
 #define        BASEPRI(ps)     (((ps) & PSL_IPL) == 0)
 
 #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); }
 #define        DELAY(n)        { register int N = (n); while (--N > 0); }
+#endif KERNEL
index eab8111..1acf6d7 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * 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    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
 
 /*
  * 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) {
        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.
                        probeioa(ocp);
                        /*
                         * Write protect the scb and UNIBUS interrupt vectors.
index 33cdaac..4f23123 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * 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"
  */
 
 #include "pte.h"
@@ -101,16 +101,16 @@ short ioa730[] = { IOA_XXX730 };
 
 struct percpu percpu[] = {
 #if VAX8600
 
 struct percpu percpu[] = {
 #if VAX8600
-       { VAX_8600, 2, ioaaddr8600, 512, (short *)0 },
+       { VAX_8600, 4, 2, ioaaddr8600, 512, (short *)0 },
 #endif
 #if VAX780
 #endif
 #if VAX780
-       { VAX_780, 1, (caddr_t *)0, 0, ioa780 },
+       { VAX_780, 2, 1, (caddr_t *)0, 0, ioa780 },
 #endif
 #if VAX750
 #endif
 #if VAX750
-       { VAX_750, 1, (caddr_t *)0, 0, ioa750 },
+       { VAX_750, 1, 1, (caddr_t *)0, 0, ioa750 },
 #endif
 #if VAX730
 #endif
 #if VAX730
-       { VAX_730, 1, (caddr_t *)0, 0, ioa730 },
+       { VAX_730, 1, 1, (caddr_t *)0, 0, ioa730 },
 #endif
        0,
 };
 #endif
        0,
 };