summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2013-05-10 00:18:43 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2013-05-10 00:18:43 +0000
commitabaa5a565b80e8cff5ec116cc926d41432692017 (patch)
tree1f5bc02655564c7eda074dfa30423cc1c430d353 /sys/arch
parent0d5c5b2f634a018af9c9382cdb991c51e7cfc94a (diff)
whitespaces
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/beagle/beagle/intr.c72
-rw-r--r--sys/arch/beagle/dev/intc.c4
-rw-r--r--sys/arch/beagle/dev/omap4.c4
-rw-r--r--sys/arch/beagle/dev/omgpio.c74
4 files changed, 75 insertions, 79 deletions
diff --git a/sys/arch/beagle/beagle/intr.c b/sys/arch/beagle/beagle/intr.c
index 75817d02247..2e97762694e 100644
--- a/sys/arch/beagle/beagle/intr.c
+++ b/sys/arch/beagle/beagle/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.5 2013/05/09 13:35:44 patrick Exp $ */
+/* $OpenBSD: intr.c,v 1.6 2013/05/10 00:18:42 patrick Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
*
@@ -147,18 +147,18 @@ arm_dflt_intr_string(void *cookie)
void
arm_setsoftintr(int si)
{
- struct cpu_info *ci = curcpu();
- int oldirqstate;
+ struct cpu_info *ci = curcpu();
+ int oldirqstate;
- /* XXX atomic? */
- oldirqstate = disable_interrupts(I32_bit);
- ci->ci_ipending |= SI_TO_IRQBIT(si);
+ /* XXX atomic? */
+ oldirqstate = disable_interrupts(I32_bit);
+ ci->ci_ipending |= SI_TO_IRQBIT(si);
- restore_interrupts(oldirqstate);
+ restore_interrupts(oldirqstate);
- /* Process unmasked pending soft interrupts. */
- if (ci->ci_ipending & arm_smask[ci->ci_cpl])
- arm_do_pending_intr(ci->ci_cpl);
+ /* Process unmasked pending soft interrupts. */
+ if (ci->ci_ipending & arm_smask[ci->ci_cpl])
+ arm_do_pending_intr(ci->ci_cpl);
}
void
@@ -193,7 +193,7 @@ arm_do_pending_intr(int pcpl)
DO_SOFTINT(SI_SOFTCLOCK, IPL_SOFTCLOCK);
DO_SOFTINT(SI_SOFT, IPL_SOFT);
} while (ci->ci_ipending & arm_smask[pcpl]);
-
+
/* Don't use splx... we are here already! */
arm_intr_func.setipl(pcpl);
processing = 0;
@@ -222,23 +222,23 @@ void
arm_init_smask(void)
{
static int inited = 0;
- int i;
+ int i;
if (inited)
return;
inited = 1;
- for (i = IPL_NONE; i <= IPL_HIGH; i++) {
- arm_smask[i] = 0;
- if (i < IPL_SOFT)
- arm_smask[i] |= SI_TO_IRQBIT(SI_SOFT);
- if (i < IPL_SOFTCLOCK)
- arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTCLOCK);
- if (i < IPL_SOFTNET)
- arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTNET);
- if (i < IPL_SOFTTTY)
- arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTTTY);
- }
+ for (i = IPL_NONE; i <= IPL_HIGH; i++) {
+ arm_smask[i] = 0;
+ if (i < IPL_SOFT)
+ arm_smask[i] |= SI_TO_IRQBIT(SI_SOFT);
+ if (i < IPL_SOFTCLOCK)
+ arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTCLOCK);
+ if (i < IPL_SOFTNET)
+ arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTNET);
+ if (i < IPL_SOFTTTY)
+ arm_smask[i] |= SI_TO_IRQBIT(SI_SOFTTTY);
+ }
}
/* provide functions for asm */
@@ -276,23 +276,23 @@ void
arm_splassert_check(int wantipl, const char *func)
{
struct cpu_info *ci = curcpu();
- int oldipl = ci->ci_cpl;
-
- if (oldipl < wantipl) {
- splassert_fail(wantipl, oldipl, func);
- /*
- * If the splassert_ctl is set to not panic, raise the ipl
- * in a feeble attempt to reduce damage.
- */
- arm_intr_func.setipl(wantipl);
- }
+ int oldipl = ci->ci_cpl;
+
+ if (oldipl < wantipl) {
+ splassert_fail(wantipl, oldipl, func);
+ /*
+ * If the splassert_ctl is set to not panic, raise the ipl
+ * in a feeble attempt to reduce damage.
+ */
+ arm_intr_func.setipl(wantipl);
+ }
}
#endif
void arm_dflt_delay(u_int usecs);
struct {
- void (*delay)(u_int);
+ void (*delay)(u_int);
void (*initclocks)(void);
void (*setstatclockrate)(int);
void (*mpstartclock)(void);
@@ -418,7 +418,7 @@ resettodr(void)
if (rtctime.tv_sec == 0)
return;
-
+
microtime(&rtctime);
if (todr_handle != NULL &&
@@ -430,7 +430,7 @@ void
setstatclockrate(int new)
{
if (arm_clock_func.setstatclockrate == NULL) {
- panic("arm_clock_func.setstatclockrate not intialized");
+ panic("arm_clock_func.setstatclockrate not intialized");
}
arm_clock_func.setstatclockrate(new);
}
diff --git a/sys/arch/beagle/dev/intc.c b/sys/arch/beagle/dev/intc.c
index 9b67d695f93..407ff86217c 100644
--- a/sys/arch/beagle/dev/intc.c
+++ b/sys/arch/beagle/dev/intc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intc.c,v 1.10 2011/11/10 19:37:01 uwe Exp $ */
+/* $OpenBSD: intc.c,v 1.11 2013/05/10 00:18:42 patrick Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -238,7 +238,7 @@ intc_splx(int new)
struct cpu_info *ci = curcpu();
intc_setipl(new);
- if (ci->ci_ipending & arm_smask[ci->ci_cpl])
+ if (ci->ci_ipending & arm_smask[ci->ci_cpl])
arm_do_pending_intr(ci->ci_cpl);
}
diff --git a/sys/arch/beagle/dev/omap4.c b/sys/arch/beagle/dev/omap4.c
index 14873f6c2c8..3c712246936 100644
--- a/sys/arch/beagle/dev/omap4.c
+++ b/sys/arch/beagle/dev/omap4.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap4.c,v 1.8 2013/05/09 15:16:53 patrick Exp $ */
+/* $OpenBSD: omap4.c,v 1.9 2013/05/10 00:18:42 patrick Exp $ */
/*
* Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org>
@@ -65,7 +65,7 @@ struct omap_dev omap4_devs[] = {
/*
* OMAP identification registers/fuses
*/
-
+
{ .name = "omapid",
.unit = 0,
.mem = { { OMAPID_ADDR, OMAPID_SIZE } },
diff --git a/sys/arch/beagle/dev/omgpio.c b/sys/arch/beagle/dev/omgpio.c
index 420451be70f..f8949093a50 100644
--- a/sys/arch/beagle/dev/omgpio.c
+++ b/sys/arch/beagle/dev/omgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omgpio.c,v 1.10 2013/05/03 17:54:27 patrick Exp $ */
+/* $OpenBSD: omgpio.c,v 1.11 2013/05/10 00:18:42 patrick Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
*
@@ -150,7 +150,7 @@ void omgpio_v4_set_dir(struct omgpio_softc *, unsigned int, unsigned int);
unsigned int omgpio_v4_get_dir(struct omgpio_softc *, unsigned int);
-struct cfattach omgpio_ca = {
+struct cfattach omgpio_ca = {
sizeof (struct omgpio_softc), omgpio_match, omgpio_attach
};
@@ -187,23 +187,21 @@ omgpio_attach(struct device *parent, struct device *self, void *args)
switch (board_id) {
-
- case BOARD_ID_OMAP3_BEAGLE:
- case BOARD_ID_OMAP3_OVERO:
- sc->sc_omap_ver = 3;
- sc->sc_get_bit = omgpio_v3_get_bit;
- sc->sc_set_bit = omgpio_v3_set_bit;
- sc->sc_clear_bit = omgpio_v3_clear_bit;
- sc->sc_set_dir = omgpio_v3_set_dir;
- break;
- case BOARD_ID_OMAP4_PANDA:
- sc->sc_omap_ver = 4;
- sc->sc_get_bit = omgpio_v4_get_bit;
- sc->sc_set_bit = omgpio_v4_set_bit;
- sc->sc_clear_bit = omgpio_v4_clear_bit;
- sc->sc_set_dir = omgpio_v4_set_dir;
- break;
-
+ case BOARD_ID_OMAP3_BEAGLE:
+ case BOARD_ID_OMAP3_OVERO:
+ sc->sc_omap_ver = 3;
+ sc->sc_get_bit = omgpio_v3_get_bit;
+ sc->sc_set_bit = omgpio_v3_set_bit;
+ sc->sc_clear_bit = omgpio_v3_clear_bit;
+ sc->sc_set_dir = omgpio_v3_set_dir;
+ break;
+ case BOARD_ID_OMAP4_PANDA:
+ sc->sc_omap_ver = 4;
+ sc->sc_get_bit = omgpio_v4_get_bit;
+ sc->sc_set_bit = omgpio_v4_set_bit;
+ sc->sc_clear_bit = omgpio_v4_clear_bit;
+ sc->sc_set_dir = omgpio_v4_set_dir;
+ break;
}
rev = bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO3_REVISION);
@@ -213,7 +211,7 @@ omgpio_attach(struct device *parent, struct device *self, void *args)
sc->sc_irq = oa->oa_dev->irq[0];
- if (sc->sc_omap_ver == 3) {
+ if (sc->sc_omap_ver == 3) {
bus_space_write_4(sc->sc_iot, sc->sc_ioh,
GPIO3_CLEARIRQENABLE1, ~0);
} else if (sc->sc_omap_ver == 4) {
@@ -251,7 +249,6 @@ omgpio_get_bit(unsigned int gpio)
struct omgpio_softc *sc = omgpio_cd.cd_devs[GPIO_PIN_TO_INST(gpio)];
return sc->sc_get_bit(sc, gpio);
-
}
void
@@ -281,7 +278,7 @@ unsigned int
omgpio_v3_get_bit(struct omgpio_softc *sc, unsigned int gpio)
{
u_int32_t reg;
-
+
reg = bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO3_DATAIN);
return (reg >> GPIO_PIN_TO_OFFSET(gpio)) & 0x1;
}
@@ -387,7 +384,7 @@ void
omgpio_clear_intr(struct omgpio_softc *sc, unsigned int gpio)
{
struct omgpio_softc *sc = omgpio_cd.cd_devs[GPIO_PIN_TO_INST(gpio)];
-
+
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO3_IRQSTATUS1,
1 << GPIO_PIN_TO_OFFSET(gpio));
}
@@ -396,7 +393,7 @@ void
omgpio_intr_mask(struct omgpio_softc *sc, unsigned int gpio)
{
struct omgpio_softc *sc = omgpio_cd.cd_devs[GPIO_PIN_TO_INST(gpio)];
-
+
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO3_CLEARIRQENABLE1,
1 << GPIO_PIN_TO_OFFSET(gpio));
}
@@ -405,7 +402,7 @@ void
omgpio_intr_unmask(struct omgpio_softc *sc, unsigned int gpio)
{
struct omgpio_softc *sc = omgpio_cd.cd_devs[GPIO_PIN_TO_INST(gpio)];
-
+
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO3_SETIRQENABLE1,
1 << GPIO_PIN_TO_OFFSET(gpio));
}
@@ -423,23 +420,23 @@ omgpio_intr_level(struct omgpio_softc *sc, unsigned int gpio, unsigned int level
re = bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO3_RISINGDETECT);
l0 = bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO3_LEVELDETECT0);
l1 = bus_space_read_4(sc->sc_iot, sc->sc_ioh, GPIO3_LEVELDETECT1);
-
+
bit = 1 << GPIO_PIN_TO_OFFSET(gpio);
- switch (level) {
- case IST_NONE:
+ switch (level) {
+ case IST_NONE:
fe &= ~bit;
re &= ~bit;
l0 &= ~bit;
l1 &= ~bit;
break;
- case IST_EDGE_FALLING:
+ case IST_EDGE_FALLING:
fe |= bit;
re &= ~bit;
l0 &= ~bit;
l1 &= ~bit;
break;
- case IST_EDGE_RISING:
+ case IST_EDGE_RISING:
fe &= ~bit;
re |= bit;
l0 &= ~bit;
@@ -447,29 +444,28 @@ omgpio_intr_level(struct omgpio_softc *sc, unsigned int gpio, unsigned int level
break;
case IST_PULSE: /* XXX */
/* FALLTHRU */
- case IST_EDGE_BOTH:
+ case IST_EDGE_BOTH:
fe |= bit;
re |= bit;
l0 &= ~bit;
l1 &= ~bit;
- break;
+ break;
case IST_LEVEL_LOW:
fe &= ~bit;
re &= ~bit;
l0 |= bit;
l1 &= ~bit;
- break;
+ break;
case IST_LEVEL_HIGH:
fe &= ~bit;
re &= ~bit;
l0 &= ~bit;
l1 |= bit;
- break;
break;
- default:
- panic("omgpio_intr_level: bad level: %d", level);
- break;
- }
+ default:
+ panic("omgpio_intr_level: bad level: %d", level);
+ break;
+ }
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO3_FALLINGDETECT, fe);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GPIO3_RISINGDETECT, re);
@@ -494,7 +490,7 @@ omgpio_intr_establish(struct omgpio_softc *sc, unsigned int gpio, int level, int
if (GPIO_PIN_TO_INST(gpio) > omgpio_cd.cd_ndevs)
panic("omgpio_intr_establish: bogus irqnumber %d: %s",
- gpio, name);
+ gpio, name);
sc = omgpio_cd.cd_devs[GPIO_PIN_TO_INST(gpio)];