diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-10-03 14:07:06 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-10-03 14:07:06 +0000 |
commit | d06ec46e13639684c063927640650c3c355dfd3e (patch) | |
tree | eeb07dbdf5cccbdd1e586829316c0040ff3a9768 | |
parent | a43dba615b676a8aa425635ec050c5ff97fa6ef4 (diff) |
Cleanup improperly shared code between the two interrupt drivers.
Pointed out by a7r.
-rw-r--r-- | sys/arch/macppc/dev/macintr.c | 12 | ||||
-rw-r--r-- | sys/arch/macppc/dev/openpic.c | 21 |
2 files changed, 26 insertions, 7 deletions
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c index 606697c90d3..4e0f5cc1379 100644 --- a/sys/arch/macppc/dev/macintr.c +++ b/sys/arch/macppc/dev/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.4 2001/09/28 04:13:12 drahn Exp $ */ +/* $OpenBSD: macintr.c,v 1.5 2001/10/03 14:07:05 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -144,7 +144,7 @@ macintr_match(parent, cf, aux) u_int8_t *interrupt_reg; typedef void (void_f) (void); extern void_f *pending_int_f; -int prog_switch (void *arg); +int macintr_prog_button (void *arg); intr_establish_t macintr_establish; intr_disestablish_t macintr_disestablish; @@ -173,7 +173,7 @@ macintr_attach(parent, self, aux) macintr_collect_preconf_intr(); mac_intr_establish(parent, 0x14, IST_LEVEL, IPL_HIGH, - prog_switch, (void *)0x14, "prog button"); + macintr_prog_button, (void *)0x14, "prog button"); ppc_intr_enable(1); @@ -202,8 +202,12 @@ macintr_collect_preconf_intr() } +/* + * programmer_button function to fix args to Debugger. + * deal with any enables/disables, if necessary. + */ int -prog_switch (void *arg) +macintr_prog_button (void *arg) { #ifdef DDB Debugger(); diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c index c5144f6b2d2..b4eceb54352 100644 --- a/sys/arch/macppc/dev/openpic.c +++ b/sys/arch/macppc/dev/openpic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openpic.c,v 1.5 2001/09/28 04:13:12 drahn Exp $ */ +/* $OpenBSD: openpic.c,v 1.6 2001/10/03 14:07:05 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -74,7 +74,7 @@ static char *intr_typename __P((int type)); static void intr_calculatemasks __P((void)); static __inline int cntlzw __P((int x)); static int mapirq __P((int irq)); -int prog_switch __P((void *arg)); +int openpic_prog_button __P((void *arg)); void openpic_enable_irq_mask __P((int irq_mask)); #define HWIRQ_MAX 27 @@ -169,7 +169,7 @@ openpic_attach(parent, self, aux) #if 1 mac_intr_establish(parent, 0x37, IST_LEVEL, - IPL_HIGH, prog_switch, (void*)0x37, "prog button"); + IPL_HIGH, openpic_prog_button, (void*)0x37, "prog button"); #endif ppc_intr_enable(1); @@ -686,3 +686,18 @@ openpic_init() install_extint(ext_intr_openpic); } + +/* + * programmer_button function to fix args to Debugger. + * deal with any enables/disables, if necessary. + */ +int +openpic_prog_button (void *arg) +{ +#ifdef DDB + Debugger(); +#else + printf("programmer button pressed, debugger not available\n"); +#endif + return 1; +} |