summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-04 03:06:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-04 03:06:05 +0000
commit64cb7b92e82bd77684999d74aa01e954884e6e79 (patch)
tree3ecdcc9ae938072bcfdaa7bc53ecbe2f4a0d5ed0
parent3caed03f1967bf8dce8538bde32da448348f47ba (diff)
sync
-rw-r--r--sys/arch/alpha/pci/pci_kn20aa.c51
-rw-r--r--sys/isofs/cd9660/cd9660_rrip.c17
-rw-r--r--sys/msdosfs/msdosfs_vnops.c18
3 files changed, 57 insertions, 29 deletions
diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c
index 116587eebb4..179d7c56b1b 100644
--- a/sys/arch/alpha/pci/pci_kn20aa.c
+++ b/sys/arch/alpha/pci/pci_kn20aa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_kn20aa.c,v 1.5 1996/07/29 23:00:40 niklas Exp $ */
+/* $OpenBSD: pci_kn20aa.c,v 1.6 1996/10/04 03:06:04 deraadt Exp $ */
/* $NetBSD: pci_kn20aa.c,v 1.3.4.2 1996/06/13 18:35:31 cgd Exp $ */
/*
@@ -85,6 +85,7 @@ struct evcnt kn20aa_intr_evcnt;
void kn20aa_pci_strayintr __P((int irq));
void kn20aa_iointr __P((void *framep, int vec));
void kn20aa_enable_intr __P((int irq));
+void kn20aa_disable_intr __P((int irq));
struct kn20aa_intrhand *kn20aa_attach_intr __P((struct kn20aa_intrchain *,
int, int (*) (void *), void *));
@@ -130,16 +131,16 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp)
struct cia_config *ccp = ccv;
pci_chipset_tag_t pc = &ccp->cc_pc;
int device;
- int kn20aa_slot, kn20aa_irq;
+ int kn20aa_irq;
void *ih;
if (buspin == 0) {
/* No IRQ used. */
- return 0;
+ return 1;
}
if (buspin > 4) {
printf("pci_map_int: bad interrupt pin %d\n", buspin);
- return NULL;
+ return 1;
}
/*
@@ -153,19 +154,23 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp)
switch (device) {
case 11:
case 12:
- kn20aa_slot = (device - 11) + 0;
+ kn20aa_irq = ((device - 11) + 0) * 4;
break;
case 7:
- kn20aa_slot = 2;
+ kn20aa_irq = 8;
break;
- case 8:
- kn20aa_slot = 4;
+ case 9:
+ kn20aa_irq = 12;
break;
- case 9:
- kn20aa_slot = 3;
+ case 6: /* 21040 on AlphaStation 500 */
+ kn20aa_irq = 13;
+ break;
+
+ case 8:
+ kn20aa_irq = 16;
break;
default:
@@ -173,12 +178,13 @@ dec_kn20aa_intr_map(ccv, bustag, buspin, line, ihp)
device);
}
- kn20aa_irq = (kn20aa_slot * 4) + buspin - 1;
+ kn20aa_irq += buspin - 1;
if (kn20aa_irq > KN20AA_MAX_IRQ)
panic("pci_kn20aa_map_int: kn20aa_irq too large (%d)\n",
kn20aa_irq);
*ihp = kn20aa_irq;
+ return (0);
}
const char *
@@ -234,10 +240,13 @@ kn20aa_pci_strayintr(irq)
int irq;
{
- if (++kn20aa_pci_strayintrcnt[irq] <= PCI_STRAY_MAX)
- log(LOG_ERR, "stray PCI interrupt %d%s\n", irq,
- kn20aa_pci_strayintrcnt[irq] >= PCI_STRAY_MAX ?
- "; stopped logging" : "");
+ kn20aa_pci_strayintrcnt[irq]++;
+ if (kn20aa_pci_strayintrcnt[irq] == PCI_STRAY_MAX)
+ kn20aa_disable_intr(irq);
+
+ log(LOG_ERR, "stray kn20aa irq %d\n", irq);
+ if (kn20aa_pci_strayintrcnt[irq] == PCI_STRAY_MAX)
+ log(LOG_ERR, "disabling interrupts on kn20aa irq %d\n", irq);
}
void
@@ -289,7 +298,7 @@ kn20aa_enable_intr(irq)
{
/*
- * From disassembling the OSF/1 source code:
+ * From disassembling small bits of the OSF/1 kernel:
* the following appears to enable a given interrupt request.
* "blech." I'd give valuable body parts for better docs or
* for a good decompiler.
@@ -299,6 +308,16 @@ kn20aa_enable_intr(irq)
wbflush();
}
+void
+kn20aa_disable_intr(irq)
+ int irq;
+{
+
+ wbflush();
+ REGVAL(0x8780000000L + 0x40L) &= ~(1 << irq); /* XXX */
+ wbflush();
+}
+
struct kn20aa_intrhand *
kn20aa_attach_intr(chain, level, func, arg)
struct kn20aa_intrchain *chain;
diff --git a/sys/isofs/cd9660/cd9660_rrip.c b/sys/isofs/cd9660/cd9660_rrip.c
index 347671f3246..c4bb7b24cc2 100644
--- a/sys/isofs/cd9660/cd9660_rrip.c
+++ b/sys/isofs/cd9660/cd9660_rrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_rrip.c,v 1.2 1996/02/29 10:12:22 niklas Exp $ */
+/* $OpenBSD: cd9660_rrip.c,v 1.3 1996/10/04 03:05:30 deraadt Exp $ */
/* $NetBSD: cd9660_rrip.c,v 1.12 1996/02/09 21:32:02 christos Exp $ */
/*-
@@ -482,9 +482,18 @@ cd9660_rrip_extref(v, ana)
ISO_RRIP_ANALYZE *ana;
{
ISO_RRIP_EXTREF *p = v;
- if (isonum_711(p->len_id) != 10
- || bcmp((char *)p + 8,"RRIP_1991A",10)
- || isonum_711(p->version) != 1)
+
+ if (isonum_711(p->version) != 1)
+ return 0;
+ if (isonum_711(p->len_id) != 9
+ && isonum_711(p->len_id) != 10)
+ return 0;
+ if (isonum_711(p->len_id) == 9
+ && bcmp((char *)p + 8, "IEEE_1282", 9))
+ return 0;
+ if (isonum_711(p->len_id) == 10
+ && bcmp((char *)p + 8, "IEEE_P1282", 10)
+ && bcmp((char *)p + 8, "RRIP_1991A", 10))
return 0;
ana->fields &= ~ISO_SUSP_EXTREF;
return ISO_SUSP_EXTREF;
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index 8a09cc6a58f..2f37fd4d299 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vnops.c,v 1.5 1996/04/21 22:28:24 deraadt Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.6 1996/10/04 03:05:32 deraadt Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.48 1996/03/20 00:45:43 thorpej Exp $ */
/*-
@@ -926,14 +926,6 @@ abortit:
return (error);
}
- /*
- * Convert the filename in tcnp into a dos filename. We copy this
- * into the denode and directory entry for the destination
- * file/directory.
- */
- if ((error = uniqdosname(VTODE(tdvp), tcnp, toname)) != 0)
- goto abortit;
-
/* */
if ((error = VOP_LOCK(fvp)) != 0)
goto abortit;
@@ -1034,6 +1026,14 @@ abortit:
}
/*
+ * Convert the filename in tcnp into a dos filename. We copy this
+ * into the denode and directory entry for the destination
+ * file/directory.
+ */
+ if ((error = uniqdosname(VTODE(tdvp), tcnp, toname)) != 0)
+ goto abortit;
+
+ /*
* Since from wasn't locked at various places above,
* have to do a relookup here.
*/