Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sandpoint/sandpoint Print "interrupting at". Improv...
details: https://anonhg.NetBSD.org/src/rev/906395e1e4a8
branches: trunk
changeset: 762643:906395e1e4a8
user: phx <phx%NetBSD.org@localhost>
date: Thu Feb 24 19:32:34 2011 +0000
description:
Print "interrupting at". Improved style guide conformance.
diffstat:
sys/arch/sandpoint/sandpoint/com_eumb.c | 27 ++++++++++++++-------------
sys/arch/sandpoint/sandpoint/satmgr.c | 33 ++++++++++++++++++---------------
2 files changed, 32 insertions(+), 28 deletions(-)
diffs (168 lines):
diff -r c7557e233770 -r 906395e1e4a8 sys/arch/sandpoint/sandpoint/com_eumb.c
--- a/sys/arch/sandpoint/sandpoint/com_eumb.c Thu Feb 24 19:28:03 2011 +0000
+++ b/sys/arch/sandpoint/sandpoint/com_eumb.c Thu Feb 24 19:32:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: com_eumb.c,v 1.5 2009/07/30 05:57:27 nisimura Exp $ */
+/* $NetBSD: com_eumb.c,v 1.6 2011/02/24 19:32:34 phx Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.5 2009/07/30 05:57:27 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.6 2011/02/24 19:32:34 phx Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -56,12 +56,12 @@
static struct com_regs cnregs;
/*
- * There are two different UART configurations, single 4-wire UART
- * and dual 2-wire. DCR register selects one of the two operating
- * mode. A certain group of NAS boxes uses the 2nd UART as system
- * console while the 1st to communicate power management satellite
- * processor. "unit" locator helps to reverse the two. Default is a
- * single 4-wire UART as console.
+ * There are two different UART configurations: single 4-wire UART
+ * and dual 2-wire. The DCR register selects one of the two operating
+ * modes. A certain group of NAS boxes uses the 2nd UART as system
+ * console while using the 1st to communicate with the power management
+ * satellite processor. The "unit" locator helps to reverse the two.
+ * Default is a single 4-wire UART as console.
*/
int
com_eumb_match(device_t parent, cfdata_t cf, void *aux)
@@ -70,10 +70,10 @@
int unit = eaa->eumb_unit;
if (unit == EUMBCF_UNIT_DEFAULT && found == 0)
- return (1);
+ return 1;
if (unit == 0 || unit == 1)
- return (1);
- return (0);
+ return 1;
+ return 0;
}
void
@@ -92,8 +92,7 @@
if (com_is_console(eaa->eumb_bt, comaddr, &ioh)) {
cnregs.cr_ioh = ioh;
sc->sc_regs = cnregs;
- }
- else {
+ } else {
bus_space_map(eaa->eumb_bt, comaddr, COM_NPORTS, 0, &ioh);
COM_INIT_REGS(sc->sc_regs, eaa->eumb_bt, ioh, comaddr);
}
@@ -101,7 +100,9 @@
epicirq = (eaa->eumb_unit == 1) ? 25 : 24;
com_attach_subr(sc);
+
intr_establish(epicirq + 16, IST_LEVEL, IPL_SERIAL, comintr, sc);
+ aprint_normal_dev(self, "interrupting at irq %d\n", epicirq + 16);
}
int
diff -r c7557e233770 -r 906395e1e4a8 sys/arch/sandpoint/sandpoint/satmgr.c
--- a/sys/arch/sandpoint/sandpoint/satmgr.c Thu Feb 24 19:28:03 2011 +0000
+++ b/sys/arch/sandpoint/sandpoint/satmgr.c Thu Feb 24 19:32:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: satmgr.c,v 1.3 2011/02/10 13:54:45 nisimura Exp $ */
+/* $NetBSD: satmgr.c,v 1.4 2011/02/24 19:32:34 phx Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -71,10 +71,12 @@
uint32_t sc_ierror, sc_overr;
kmutex_t sc_lock;
kcondvar_t sc_rdcv, sc_wrcv;
- char sc_rd_buf[16], *sc_rd_lim, *sc_rd_cur, *sc_rd_ptr;
- char sc_wr_buf[16], *sc_wr_lim, *sc_wr_cur, *sc_wr_ptr;
- int sc_rd_cnt, sc_wr_cnt;
- int sc_btnstate;
+ char sc_rd_buf[16];
+ char *sc_rd_lim, *sc_rd_cur, *sc_rd_ptr;
+ char sc_wr_buf[16];
+ char *sc_wr_lim, *sc_wr_cur, *sc_wr_ptr;
+ int sc_rd_cnt, sc_wr_cnt;
+ int sc_btnstate;
struct satops *sc_ops;
};
@@ -155,10 +157,10 @@
int unit = eaa->eumb_unit;
if (unit == EUMBCF_UNIT_DEFAULT && found == 0)
- return (1);
+ return 1;
if (unit == 0 || unit == 1)
- return (1);
- return (0);
+ return 1;
+ return 0;
}
static void
@@ -208,6 +210,7 @@
epicirq = (eaa->eumb_unit == 0) ? 24 : 25;
intr_establish(epicirq + 16, IST_LEVEL, IPL_SERIAL, hwintr, sc);
+ aprint_normal_dev(self, "interrupting at irq %d\n", epicirq + 16);
sc->sc_si = softint_establish(SOFTINT_SERIAL, swintr, sc);
CSR_WRITE(sc, IER, 0x7f); /* all but MSR */
@@ -289,8 +292,7 @@
callout_setfunc(&sc->sc_ch_wdog, wdog_tickle, sc);
callout_schedule(&sc->sc_ch_wdog, 90 * hz);
send_sat(sc, "JJ");
- }
- else {
+ } else {
callout_stop(&sc->sc_ch_wdog);
send_sat(sc, "KK");
}
@@ -466,8 +468,9 @@
return (kn->kn_data > 0);
}
-static const struct filterops read_filtops =
- { 1, NULL, filt_rdetach, filt_read };
+static const struct filterops read_filtops = {
+ 1, NULL, filt_rdetach, filt_read
+};
static int
satkqfilter(dev_t dev, struct knote *kn)
@@ -482,7 +485,7 @@
break;
default:
- return (EINVAL);
+ return EINVAL;
}
kn->kn_hook = sc;
@@ -491,7 +494,7 @@
SLIST_INSERT_HEAD(klist, kn, kn_selnext);
mutex_exit(&sc->sc_lock);
- return (0);
+ return 0;
}
static int
@@ -595,7 +598,7 @@
sc->sc_rd_cnt = 0;
sc->sc_rd_ptr = ptr;
mutex_spin_exit(&sc->sc_lock);
- return; /* drop characters down to floor */
+ return; /* drop characters down to the floor */
}
cv_signal(&sc->sc_rdcv);
selnotify(&sc->sc_rsel, 0, 0);
Home |
Main Index |
Thread Index |
Old Index