summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1998-01-29 14:55:55 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1998-01-29 14:55:55 +0000
commit5acd61ca2571eaf897261b41beec8c9e94d22931 (patch)
tree1c0fc2601f5b57371d16e21ad782e3cc9f2a9a04 /sys/arch
parent62fe2df095ac01b185c3057650a176b785590880 (diff)
Some more arc/sgi fixes
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arc/algor/algorbus.c10
-rw-r--r--sys/arch/arc/arc/locore.S51
-rw-r--r--sys/arch/arc/dev/asc.c3
-rw-r--r--sys/arch/arc/dev/pccons.c4
-rw-r--r--sys/arch/arc/dti/btl.c2
-rw-r--r--sys/arch/arc/isa/isabus.c4
-rw-r--r--sys/arch/arc/pci/pbcpcibus.c7
-rw-r--r--sys/arch/arc/pica/picabus.c4
-rw-r--r--sys/arch/mips/mips/clock.c24
9 files changed, 81 insertions, 28 deletions
diff --git a/sys/arch/arc/algor/algorbus.c b/sys/arch/arc/algor/algorbus.c
index 5de45b8ade8..bd80dab664f 100644
--- a/sys/arch/arc/algor/algorbus.c
+++ b/sys/arch/arc/algor/algorbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: algorbus.c,v 1.3 1997/04/19 17:19:37 pefo Exp $ */
+/* $OpenBSD: algorbus.c,v 1.4 1998/01/29 14:54:45 pefo Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -75,8 +75,6 @@ int algor_iointr __P((unsigned, struct clockframe *));
int algor_clkintr __P((unsigned, struct clockframe *));
int algor_errintr __P((unsigned, struct clockframe *));
-extern int cputype;
-
int p4032_imask = 0;
int p4032_ixr = 0;
@@ -161,8 +159,8 @@ algormatch(parent, cfdata, aux)
return (0);
/* Make sure that unit exists. */
- if (cf->cf_unit != 0 ||
- cputype > nalgor_cpu_devs || algor_cpu_devs[cputype] == NULL)
+ if (cf->cf_unit != 0 || system_type > nalgor_cpu_devs
+ || algor_cpu_devs[system_type] == NULL)
return (0);
return (1);
@@ -181,7 +179,7 @@ algorattach(parent, self, aux)
printf("\n");
/* keep our CPU device description handy */
- sc->sc_devs = algor_cpu_devs[cputype];
+ sc->sc_devs = algor_cpu_devs[system_type];
/* set up interrupt handlers */
set_intr(INT_MASK_1, algor_iointr, 2);
diff --git a/sys/arch/arc/arc/locore.S b/sys/arch/arc/arc/locore.S
index 5b7279d1ba6..687abab903e 100644
--- a/sys/arch/arc/arc/locore.S
+++ b/sys/arch/arc/arc/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.13 1998/01/28 13:45:54 pefo Exp $ */
+/* $OpenBSD: locore.S,v 1.14 1998/01/29 14:54:48 pefo Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -50,7 +50,7 @@
* v 1.1 89/07/10 14:27:41 nelson Exp SPRITE (DECWRL)
*
* from: @(#)locore.s 8.5 (Berkeley) 1/4/94
- * $Id: locore.S,v 1.13 1998/01/28 13:45:54 pefo Exp $
+ * $Id: locore.S,v 1.14 1998/01/29 14:54:48 pefo Exp $
*/
/*
@@ -658,13 +658,20 @@ LEAF(idle)
li t0, (INT_MASK | SR_INT_ENAB)
mtc0 t0, COP_0_STATUS_REG # enable all interrupts
sw zero, curproc # set curproc NULL for stats
+ li t1,1
1:
+ beq t1, zero, 2f
+ addu t1, t1, 1
lw t0, whichqs # look for non-empty queue
nop
beq t0, zero, 1b
nop
b sw1
mtc0 zero, COP_0_STATUS_REG # Disable all interrupts
+2:
+ break BREAK_SOVER_VAL
+ b 1b
+ nop
END(idle)
/*
@@ -2268,6 +2275,46 @@ LEAF(R4K_TLBGetPID)
and v0, v0, VMTLB_PID # mask off PID
END(R4K_TLBGetPID)
+/*--------------------------------------------------------------------------
+ *
+ * R4K_GetCOUNT --
+ *
+ * R4K_GetCOUNT()
+ *
+ * Results:
+ * Returns the current COUNT reg.
+ *
+ * Side effects:
+ * None.
+ *
+ *--------------------------------------------------------------------------
+ */
+LEAF(R4K_GetCOUNT)
+ mfc0 v0, COP_0_COUNT
+ nop #???
+ nop #???
+ j ra
+ nop
+END(R4K_GetCOUNT)
+
+/*--------------------------------------------------------------------------
+ *
+ * R4K_SetCOMPARE --
+ *
+ * R4K_SetCOMPARE()
+ *
+ * Results:
+ * Sets a new value to the COMPARE register.
+ *
+ * Side effects:
+ * The COMPARE equal interrupt is acknowledged.
+ *
+ *--------------------------------------------------------------------------
+ */
+LEAF(R4K_SetCOMPARE)
+ j ra
+ mtc0 a0, COP_0_COMPARE
+END(R4K_SetCOMPARE)
/*----------------------------------------------------------------------------
*
diff --git a/sys/arch/arc/dev/asc.c b/sys/arch/arc/dev/asc.c
index 5ab32e0f1ca..961cdabe6d5 100644
--- a/sys/arch/arc/dev/asc.c
+++ b/sys/arch/arc/dev/asc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asc.c,v 1.7 1998/01/28 13:46:04 pefo Exp $ */
+/* $OpenBSD: asc.c,v 1.8 1998/01/29 14:54:50 pefo Exp $ */
/* $NetBSD: asc.c,v 1.10 1994/12/05 19:11:12 dean Exp $ */
/*-
@@ -148,7 +148,6 @@
#define readback(a) { register int foo; foo = (a); }
-extern int system_type;
/*
* In 4ns ticks.
diff --git a/sys/arch/arc/dev/pccons.c b/sys/arch/arc/dev/pccons.c
index 55308d76511..64c6626f705 100644
--- a/sys/arch/arc/dev/pccons.c
+++ b/sys/arch/arc/dev/pccons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccons.c,v 1.16 1998/01/28 13:46:05 pefo Exp $ */
+/* $OpenBSD: pccons.c,v 1.17 1998/01/29 14:54:51 pefo Exp $ */
/* $NetBSD: pccons.c,v 1.89 1995/05/04 19:35:20 cgd Exp $ */
/*-
@@ -82,8 +82,6 @@
#include <arc/isa/isa_machdep.h>
#include <machine/kbdreg.h>
-extern int system_type;
-
#define XFREE86_BUG_COMPAT
#ifndef BEEP_FREQ
diff --git a/sys/arch/arc/dti/btl.c b/sys/arch/arc/dti/btl.c
index 7721241efa8..3392b3b5087 100644
--- a/sys/arch/arc/dti/btl.c
+++ b/sys/arch/arc/dti/btl.c
@@ -100,8 +100,6 @@ struct bt_mbx {
struct bt_mbx_in *tmbi; /* Target Mail Box in */
};
-extern int system_type; /* XXX */
-
#define KVTOPHYS(x) ((system_type == DESKSTATION_TYNE) ? \
(((int)(x) & 0x7fffff) | 0x800000) : ((int)(x)))
#define PHYSTOKV(x) ((system_type == DESKSTATION_TYNE) ? \
diff --git a/sys/arch/arc/isa/isabus.c b/sys/arch/arc/isa/isabus.c
index 36c3fb38abc..9935f1438fc 100644
--- a/sys/arch/arc/isa/isabus.c
+++ b/sys/arch/arc/isa/isabus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isabus.c,v 1.12 1998/01/28 13:46:37 pefo Exp $ */
+/* $OpenBSD: isabus.c,v 1.13 1998/01/29 14:54:54 pefo Exp $ */
/* $NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp $ */
/*-
@@ -141,8 +141,6 @@ int isabr_iointr __P((unsigned int, struct clockframe *));
void isabr_initicu __P((void));
void intr_calculatemasks __P((void));
-extern int system_type;
-
int
isabrmatch(parent, cfdata, aux)
diff --git a/sys/arch/arc/pci/pbcpcibus.c b/sys/arch/arc/pci/pbcpcibus.c
index 5b1e0d112c7..d3055a1dae2 100644
--- a/sys/arch/arc/pci/pbcpcibus.c
+++ b/sys/arch/arc/pci/pbcpcibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pbcpcibus.c,v 1.4 1997/04/19 17:20:02 pefo Exp $ */
+/* $OpenBSD: pbcpcibus.c,v 1.5 1998/01/29 14:54:55 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -57,7 +57,6 @@
#include <arc/pci/v962pcbreg.h>
extern vm_map_t phys_map;
-extern int cputype;
extern char eth_hw_addr[]; /* Hardware ethernet address stored elsewhere */
int pbcpcibrmatch __P((struct device *, void *, void *));
@@ -113,7 +112,7 @@ pbcpcibrattach(parent, self, aux)
struct pcibr_config *lcp;
struct pcibus_attach_args pba;
- switch(cputype) {
+ switch(system_type) {
case ALGOR_P4032:
V96X_PCI_BASE0 = V96X_PCI_BASE0 & 0xffff0000;
@@ -326,7 +325,7 @@ int
pbc_ether_hw_addr(cp)
u_int8_t *cp;
{
- if(cputype == ALGOR_P4032) {
+ if(system_type == ALGOR_P4032) {
bcopy(eth_hw_addr, cp, 6);
return(0);
}
diff --git a/sys/arch/arc/pica/picabus.c b/sys/arch/arc/pica/picabus.c
index 8c54ceda7e7..13a381b5cf0 100644
--- a/sys/arch/arc/pica/picabus.c
+++ b/sys/arch/arc/pica/picabus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: picabus.c,v 1.8 1998/01/28 13:46:38 pefo Exp $ */
+/* $OpenBSD: picabus.c,v 1.9 1998/01/29 14:54:56 pefo Exp $ */
/* $NetBSD: tc.c,v 1.2 1995/03/08 00:39:05 cgd Exp $ */
/*
@@ -70,8 +70,6 @@ int pica_matchname __P((struct confargs *, char *));
int pica_iointr __P((unsigned int, struct clockframe *));
int pica_clkintr __P((unsigned int, struct clockframe *));
-extern int system_type;
-
/*
* Interrupt dispatch table.
*/
diff --git a/sys/arch/mips/mips/clock.c b/sys/arch/mips/mips/clock.c
index 59554ee908b..ced12c6498f 100644
--- a/sys/arch/mips/mips/clock.c
+++ b/sys/arch/mips/mips/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.1 1998/01/28 12:12:06 pefo Exp $ */
+/* $OpenBSD: clock.c,v 1.2 1998/01/29 14:55:54 pefo Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom.
* Copyright (c) 1988 University of Utah.
@@ -40,7 +40,7 @@
* from: Utah Hdr: clock.c 1.18 91/01/21
*
* from: @(#)clock.c 8.1 (Berkeley) 6/10/93
- * $Id: clock.c,v 1.1 1998/01/28 12:12:06 pefo Exp $
+ * $Id: clock.c,v 1.2 1998/01/29 14:55:54 pefo Exp $
*/
#include <sys/param.h>
@@ -50,7 +50,7 @@
#include <machine/autoconf.h>
#include <machine/cpu.h>
-#include <arc/arc/clockvar.h>
+#include <mips/dev/clockvar.h>
#include <mips/archtype.h>
#ifdef arc
@@ -82,6 +82,7 @@ struct cfattach clock_pica_ca = {
struct cfattach clock_algor_ca = {
sizeof(struct clock_softc), clockmatch, clockattach
};
+static int int5_dummy __P((unsigned mask, struct clockframe *cf));
#endif
#ifdef sgi
@@ -161,12 +162,14 @@ clockattach(parent, self, aux)
case ALGOR_P4032:
BUS_INTR_ESTABLISH((struct confargs *)aux,
(intr_handler_t)hardclock, self);
+ set_intr(SOFT_INT_MASK_0 << 7, int5_dummy, 1);
break;
case DESKSTATION_RPC44:
case DESKSTATION_TYNE:
(void)isa_intr_establish(ia->ia_ic,
0, 1, 3, clockintr, 0, "clock");
+ set_intr(SOFT_INT_MASK_0 << 7, int5_dummy, 1);
break;
#endif
@@ -184,6 +187,21 @@ clockattach(parent, self, aux)
printf("\n");
}
+#ifdef arc
+/*
+ * This code is a stub to take care of the unused int 5 in arc's.
+ * We may in the future use this for high precision timing...
+ */
+static int
+int5_dummy(mask, cf)
+ unsigned mask;
+ struct clockframe *cf;
+{
+ R4K_SetCOMPARE(0); /* Shut up counter int's for a while */
+ return(~0);
+}
+#endif
+
/*
* Wait "n" microseconds. This doesn't belong here. XXX.
*/