diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-07-31 03:47:37 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-07-31 03:47:37 +0000 |
commit | a9b69d8576d1e4bd9cc800187743fede8b3cf1f5 (patch) | |
tree | 90bc8f18ee316a0191503cf4965252bc4c1fc7b9 /sys | |
parent | 0f1891a465db52270c5d9f624dd6f41d9721da88 (diff) |
Correction for legacy interrupt controller attachment.
The previous change would incorrectly allow the macintr interrupt
controller to configure for the openpic interrupt controller.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc/mac/macintr.c | 18 | ||||
-rw-r--r-- | sys/arch/powerpc/pci/macobio.c | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/powerpc/mac/macintr.c b/sys/arch/powerpc/mac/macintr.c index accdc2616be..c0ed02dbd22 100644 --- a/sys/arch/powerpc/mac/macintr.c +++ b/sys/arch/powerpc/mac/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.5 2000/07/28 13:09:01 rahnds Exp $ */ +/* $OpenBSD: macintr.c,v 1.6 2000/07/31 03:47:35 rahnds Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -117,12 +117,24 @@ macintr_match(parent, cf, aux) void *aux; { struct confargs *ca = aux; + char type[40]; /* - * Only check name, to allow legacy interrupt controllers - * to slip in here. + * Match entry according to "present" openfirmware entry. */ if (strcmp(ca->ca_name, "interrupt-controller") == 0 ) { + OF_getprop(ca->ca_node, "device_type", type, sizeof(type)); + if (strcmp(type, "interrupt-controller") == 0) { + return 1; + } + } + + /* + * Check name for legacy interrupt controller, this is + * faked to allow old firmware which does not have an entry + * to attach to this device. + */ + if (strcmp(ca->ca_name, "legacy-interrupt-controller") == 0 ) { return 1; } return 0; diff --git a/sys/arch/powerpc/pci/macobio.c b/sys/arch/powerpc/pci/macobio.c index dcfcf887458..5c28ecbb0ca 100644 --- a/sys/arch/powerpc/pci/macobio.c +++ b/sys/arch/powerpc/pci/macobio.c @@ -164,7 +164,7 @@ obio_attach(parent, self, aux) */ if (need_interrupt_controller) { /* force attachment of legacy interrupt controllers */ - ca.ca_name = "interrupt-controller"; + ca.ca_name = "legacy-interrupt-controller"; ca.ca_node = 0; ca.ca_nreg = 0; |