summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-16 03:54:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-16 03:54:49 +0000
commitcc4c74a8bd4068140ebd064c8104c06f467cb66a (patch)
tree5ccfdbd446f68c1fa3f2b61eeb0ac2c27ab8acd3
parentfdccbd7d14fb98668eaaf3f652e2fa34be9c59e7 (diff)
spaces
-rw-r--r--sys/arch/macppc/dev/abtn.c4
-rw-r--r--sys/arch/macppc/dev/adb.c11
-rw-r--r--sys/arch/macppc/dev/adb_direct.c62
-rw-r--r--sys/arch/macppc/dev/aed.c26
-rw-r--r--sys/arch/macppc/dev/aedvar.h4
-rw-r--r--sys/arch/macppc/dev/akbd.c20
-rw-r--r--sys/arch/macppc/dev/ams.c8
-rw-r--r--sys/arch/macppc/dev/apm.c11
-rw-r--r--sys/arch/macppc/dev/if_bm.c4
-rw-r--r--sys/arch/macppc/dev/macintr.c4
-rw-r--r--sys/arch/macppc/dev/mesh.c25
-rw-r--r--sys/arch/macppc/dev/openpic.c100
-rw-r--r--sys/arch/macppc/dev/pm_direct.c18
-rw-r--r--sys/arch/macppc/dev/pm_direct.h4
-rw-r--r--sys/arch/macppc/dev/uni_n.c5
15 files changed, 149 insertions, 157 deletions
diff --git a/sys/arch/macppc/dev/abtn.c b/sys/arch/macppc/dev/abtn.c
index a8c54e87ba3..239efcf90a9 100644
--- a/sys/arch/macppc/dev/abtn.c
+++ b/sys/arch/macppc/dev/abtn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: abtn.c,v 1.8 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: abtn.c,v 1.9 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: abtn.c,v 1.1 1999/07/12 17:48:26 tsubai Exp $ */
/*-
@@ -91,7 +91,7 @@ abtn_attach(struct device *parent, struct device *self, void *aux)
SetADBInfo(&adbinfo, sc->adbaddr);
}
-void
+void
abtn_adbcomplete(caddr_t buffer, caddr_t data, int adb_command)
{
u_int cmd, brightness;
diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c
index 1594c950975..ebb03fd70d8 100644
--- a/sys/arch/macppc/dev/adb.c
+++ b/sys/arch/macppc/dev/adb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb.c,v 1.8 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: adb.c,v 1.9 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */
/*-
@@ -60,7 +60,7 @@ int adbprint(void *, const char *);
/*
* Global variables.
*/
-int adb_polling; /* Are we polling? (Debugger mode) */
+int adb_polling; /* Are we polling? (Debugger mode) */
#ifdef ADB_DEBUG
int adb_debug; /* Output debugging messages */
#endif /* ADB_DEBUG */
@@ -97,7 +97,7 @@ adbmatch(struct device *parent, void *cf, void *aux)
/* HACK ALERT */
typedef int (clock_read_t)(int *sec, int *min, int *hour, int *day,
- int *mon, int *yr);
+ int *mon, int *yr);
typedef int (time_read_t)(u_long *sec);
typedef int (time_write_t)(u_long sec);
extern time_read_t *time_read;
@@ -153,9 +153,8 @@ adbattach(struct device *parent, struct device *self, void *aux)
printf(": via-pmu ");
break;
}
-
+
printf("%d targets\n", totaladbs);
-
#if NAED > 0
/* ADB event device for compatibility */
@@ -257,7 +256,7 @@ adbprint(void *args, const char *name)
#endif /* DIAGNOSTIC */
}
} else /* a device matched and was configured */
- printf(" addr %d: ", aa_args->adbaddr);
+ printf(" addr %d: ", aa_args->adbaddr);
return rv;
}
diff --git a/sys/arch/macppc/dev/adb_direct.c b/sys/arch/macppc/dev/adb_direct.c
index 1ea12cba65f..c245eb6bb8b 100644
--- a/sys/arch/macppc/dev/adb_direct.c
+++ b/sys/arch/macppc/dev/adb_direct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adb_direct.c,v 1.8 2002/10/18 03:49:16 drahn Exp $ */
+/* $OpenBSD: adb_direct.c,v 1.9 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */
/*
@@ -36,25 +36,25 @@
* to clean it up as much as I would like.
* But it works, so I'm happy. :-) jpw
*/
-
+
/*
* TO DO:
* - We could reduce the time spent in the adb_intr_* routines
- * by having them save the incoming and outgoing data directly
+ * by having them save the incoming and outgoing data directly
* in the adbInbound and adbOutbound queues, as it would reduce
* the number of times we need to copy the data around. It
* would also make the code more readable and easier to follow.
- * - (Related to above) Use the header part of adbCommand to
+ * - (Related to above) Use the header part of adbCommand to
* reduce the number of copies we have to do of the data.
* - (Related to above) Actually implement the adbOutbound queue.
* This is fairly easy once you switch all the intr routines
* over to using adbCommand structs directly.
* - There is a bug in the state machine of adb_intr_cuda
* code that causes hangs, especially on 030 machines, probably
- * because of some timing issues. Because I have been unable to
- * determine the exact cause of this bug, I used the timeout function
- * to check for and recover from this condition. If anyone finds
- * the actual cause of this bug, the calls to timeout and the
+ * because of some timing issues. Because I have been unable to
+ * determine the exact cause of this bug, I used the timeout function
+ * to check for and recover from this condition. If anyone finds
+ * the actual cause of this bug, the calls to timeout and the
* adb_cuda_tickle routine can be removed.
*/
@@ -154,7 +154,7 @@ struct adbCmdHoldEntry {
};
/*
- * Eventually used for two separate queues, the queue between
+ * Eventually used for two separate queues, the queue between
* the upper and lower halves, and the outgoing packet queue.
* TO DO: adbCommand can replace all of adbCmdHoldEntry eventually
*/
@@ -364,7 +364,7 @@ switch_start:
*/
/* set up data for adb_pass_up */
memcpy(packet.data, adbInputBuffer, adbInputBuffer[0] + 1);
-
+
if ((adbWaiting == 1) &&
(adbInputBuffer[4] == adbWaitingCmd) &&
((adbInputBuffer[2] == 0x00) ||
@@ -628,7 +628,7 @@ adb_intr(void *arg)
}
-/*
+/*
* adb_pass_up is called by the interrupt-time routines.
* It takes the raw packet data that was received from the
* device and puts it into the queue that the upper half
@@ -636,7 +636,7 @@ adb_intr(void *arg)
* will eventually call the upper half routine (adb_soft_intr).
*
* If in->unsol is 0, then this is either the notification
- * that the packet was sent (on a LISTEN, for example), or the
+ * that the packet was sent (on a LISTEN, for example), or the
* response from the device (on a TALK). The completion routine
* is called only if the user specified one.
*
@@ -731,14 +731,14 @@ adb_pass_up(struct adbCommand *in)
}
#ifdef ADB_DEBUG
- if (adb_debug && in->data[1] == 2)
+ if (adb_debug && in->data[1] == 2)
printf_intr("adb: caught error\n");
#endif
/* copy the packet data over */
/*
* TO DO: If the *_intr routines fed their incoming data
- * directly into an adbCommand struct, which is passed to
+ * directly into an adbCommand struct, which is passed to
* this routine, then we could eliminate this copy.
*/
memcpy(adbInbound[adbInTail].data + 1, in->data + start + 1, len);
@@ -787,7 +787,7 @@ adb_soft_intr(void)
comprout = adbInbound[adbInHead].compRout;
compdata = adbInbound[adbInHead].compData;
cmd = adbInbound[adbInHead].cmd;
-
+
/* copy over data to data area if it's valid */
/*
* Note that for unsol packets we don't want to copy the
@@ -975,7 +975,7 @@ adb_reinit(void)
* responds at that address. Then move the last device that was moved
* back to the original address. Do this for the remaining addresses
* that we determined were in use.
- *
+ *
* When finished, do this entire process over again with the updated
* list of in use addresses. Do this until no new devices have been
* found in 20 passes though the in use address list. (This probably
@@ -1261,7 +1261,7 @@ adb_op_sync(Ptr buffer, Ptr compRout, Ptr data, short command)
* This function is used by the adb_op_sync routine so it knows when the
* function is done.
*/
-void
+void
adb_op_comprout(buffer, compdata, cmd)
caddr_t buffer, compdata;
int cmd;
@@ -1271,7 +1271,7 @@ adb_op_comprout(buffer, compdata, cmd)
*p = 1;
}
-void
+void
adb_setup_hw_type(void)
{
switch (adbHardware) {
@@ -1288,8 +1288,8 @@ adb_setup_hw_type(void)
panic("unknown adb hardware");
}
}
-
-int
+
+int
count_adbs(void)
{
int i;
@@ -1304,7 +1304,7 @@ count_adbs(void)
return found;
}
-int
+int
get_ind_adb_info(ADBDataBlock * info, int index)
{
if ((index < 1) || (index > 15)) /* check range 1-15 */
@@ -1326,7 +1326,7 @@ get_ind_adb_info(ADBDataBlock * info, int index)
return (ADBDevTable[index].currentAddr);
}
-int
+int
get_adb_info(ADBDataBlock * info, int adbAddr)
{
int i;
@@ -1346,7 +1346,7 @@ get_adb_info(ADBDataBlock * info, int adbAddr)
return (-1); /* not found */
}
-int
+int
set_adb_info(ADBSetInfoBlock * info, int adbAddr)
{
int i;
@@ -1368,7 +1368,7 @@ set_adb_info(ADBSetInfoBlock * info, int adbAddr)
/* caller should really use machine-independant version: getPramTime */
/* this version does pseudo-adb access only */
-int
+int
adb_read_date_time(unsigned long *time)
{
u_char output[ADB_MAX_MSG_LENGTH];
@@ -1418,7 +1418,7 @@ adb_read_date_time(unsigned long *time)
/* caller should really use machine-independant version: setPramTime */
/* this version does pseudo-adb access only */
-int
+int
adb_set_date_time(unsigned long time)
{
u_char output[ADB_MAX_MSG_LENGTH];
@@ -1456,7 +1456,7 @@ adb_set_date_time(unsigned long time)
}
-int
+int
adb_poweroff(void)
{
u_char output[ADB_MAX_MSG_LENGTH];
@@ -1493,31 +1493,31 @@ adb_poweroff(void)
}
}
-int
+int
CountADBs(void)
{
return (count_adbs());
}
-void
+void
ADBReInit(void)
{
adb_reinit();
}
-int
+int
GetIndADB(ADBDataBlock * info, int index)
{
return (get_ind_adb_info(info, index));
}
-int
+int
GetADBInfo(ADBDataBlock * info, int adbAddr)
{
return (get_adb_info(info, adbAddr));
}
-int
+int
SetADBInfo(ADBSetInfoBlock * info, int adbAddr)
{
return (set_adb_info(info, adbAddr));
diff --git a/sys/arch/macppc/dev/aed.c b/sys/arch/macppc/dev/aed.c
index ff8fa050725..1cc6a227fd7 100644
--- a/sys/arch/macppc/dev/aed.c
+++ b/sys/arch/macppc/dev/aed.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aed.c,v 1.7 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: aed.c,v 1.8 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: aed.c,v 1.5 2000/03/23 06:40:33 thorpej Exp $ */
/*
@@ -112,11 +112,11 @@ aedattach(struct device *parent, struct device *self, void *aux)
sc->sc_rptinterval = 6;
sc->sc_repeating = -1; /* not repeating */
- /* Pull in the options flags. */
+ /* Pull in the options flags. */
sc->sc_options = (sc->sc_dev.dv_cfdata->cf_flags | aed_options);
sc->sc_ioproc = NULL;
-
+
sc->sc_buttons = 0;
sc->sc_open = 0;
@@ -125,7 +125,7 @@ aedattach(struct device *parent, struct device *self, void *aux)
}
/*
- * Given a keyboard ADB event, record the keycode and call the key
+ * Given a keyboard ADB event, record the keycode and call the key
* repeat handler, optionally passing the event through the mouse
* button emulation handler first. Pass mouse events directly to
* the handoff function.
@@ -161,7 +161,7 @@ aed_input(adb_event_t *event)
* 3rd mouse button events while the 1, 2, and 3 keys will generate
* the corresponding mouse button event.
*/
-void
+void
aed_emulate_mouse(adb_event_t *event)
{
static int emulmodkey_down = 0;
@@ -297,7 +297,7 @@ aed_emulate_mouse(adb_event_t *event)
* for the repeating key and schedules the next call at sc_rptinterval
* ticks in the future.
*/
-void
+void
aed_kbdrpt(void *kstate)
{
struct aed_softc *aed_sc = (struct aed_softc *)kstate;
@@ -321,7 +321,7 @@ aed_kbdrpt(void *kstate)
* a new repeating key event if needed, and hands the event off to the
* appropriate subsystem.
*/
-void
+void
aed_dokeyupdown(adb_event_t *event)
{
int kbd_key;
@@ -359,7 +359,7 @@ aed_handoff(adb_event_t *event)
/*
* Place the event in the event queue and wakeup any waiting processes.
*/
-void
+void
aed_enqevent(adb_event_t *event)
{
int s;
@@ -389,7 +389,7 @@ aed_enqevent(adb_event_t *event)
splx(s);
}
-int
+int
aedopen(dev_t dev, int flag, int mode, struct proc *p)
{
int unit;
@@ -416,7 +416,7 @@ aedopen(dev_t dev, int flag, int mode, struct proc *p)
}
-int
+int
aedclose(dev_t dev, int flag, int mode, struct proc *p)
{
int s = spladb();
@@ -429,7 +429,7 @@ aedclose(dev_t dev, int flag, int mode, struct proc *p)
}
-int
+int
aedread(dev_t dev, struct uio *uio, int flag)
{
int s, error;
@@ -475,7 +475,7 @@ aedread(dev_t dev, struct uio *uio, int flag)
}
-int
+int
aedwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
@@ -485,7 +485,7 @@ aedwrite(dev, uio, flag)
}
-int
+int
aedioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
switch (cmd) {
diff --git a/sys/arch/macppc/dev/aedvar.h b/sys/arch/macppc/dev/aedvar.h
index d127ed70ba5..31ec5ffb048 100644
--- a/sys/arch/macppc/dev/aedvar.h
+++ b/sys/arch/macppc/dev/aedvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aedvar.h,v 1.3 2002/06/07 07:13:37 miod Exp $ */
+/* $OpenBSD: aedvar.h,v 1.4 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: aedvar.h,v 1.2 2000/03/23 06:40:33 thorpej Exp $ */
/*
@@ -36,7 +36,7 @@
/* Event queue definitions */
#ifndef AED_MAX_EVENTS
-#define AED_MAX_EVENTS 200 /* Maximum events to be kept in queue */
+#define AED_MAX_EVENTS 200 /* Maximum events to be kept in queue */
/* maybe should be higher for slower macs? */
#endif /* AED_MAX_EVENTS */
diff --git a/sys/arch/macppc/dev/akbd.c b/sys/arch/macppc/dev/akbd.c
index e62ee90b6ac..00719ab8e27 100644
--- a/sys/arch/macppc/dev/akbd.c
+++ b/sys/arch/macppc/dev/akbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: akbd.c,v 1.15 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: akbd.c,v 1.16 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: akbd.c,v 1.13 2001/01/25 14:08:55 tsubai Exp $ */
/*
@@ -261,7 +261,7 @@ akbdattach(struct device *parent, struct device *self, void *aux)
* Handle putting the keyboard data received from the ADB into
* an ADB event record.
*/
-void
+void
kbd_adbcomplete(caddr_t buffer, caddr_t data_area, int adb_command)
{
adb_event_t event;
@@ -299,7 +299,7 @@ kbd_adbcomplete(caddr_t buffer, caddr_t data_area, int adb_command)
}
/*
- * Given a keyboard ADB event, record the keycodes and call the key
+ * Given a keyboard ADB event, record the keycodes and call the key
* repeat handler, optionally passing the event through the mouse
* button emulation handler first.
*/
@@ -351,11 +351,11 @@ getleds(int addr)
/*
* Set the keyboard LED's.
- *
+ *
* Automatically translates from ioctl/softc format to the
* actual keyboard register format
*/
-static int
+static int
setleds(struct akbd_softc *ksc, u_char leds)
{
int addr;
@@ -388,13 +388,13 @@ setleds(struct akbd_softc *ksc, u_char leds)
if ((buffer[2] & 0xf8) != leds)
return (EIO);
else
- return (0);
+ return (0);
}
/*
* Toggle all of the LED's on and off, just for show.
*/
-static void
+static void
blinkleds(struct akbd_softc *ksc)
{
int addr, i;
@@ -413,7 +413,7 @@ blinkleds(struct akbd_softc *ksc)
i = 10;
do {
(void)setleds(ksc, (u_char)0x00);
- } while (setleds(ksc, (u_char)0x00) && (i-- > 0));
+ } while (setleds(ksc, (u_char)0x00) && (i-- > 0));
return;
}
@@ -467,7 +467,7 @@ akbd_rawrepeat(void *v)
struct akbd_softc *sc = v;
int s;
- s = spltty();
+ s = spltty();
wskbd_rawinput(sc->sc_wskbddev, sc->sc_rep, sc->sc_nrep);
splx(s);
timeout_add(&sc->sc_rawrepeat_ch, hz * REP_DELAYN / 1000);
@@ -530,7 +530,7 @@ akbd_intr(adb_event_t *event)
#ifdef WSDISPLAY_COMPAT_RAWKBD
} else if (sc->sc_rawkbd) {
char cbuf[MAXKEYS *2];
- int c, j, s;
+ int c, j, s;
int npress;
j = npress = 0;
diff --git a/sys/arch/macppc/dev/ams.c b/sys/arch/macppc/dev/ams.c
index cd3d18a169e..fab8a53ef9f 100644
--- a/sys/arch/macppc/dev/ams.c
+++ b/sys/arch/macppc/dev/ams.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ams.c,v 1.7 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: ams.c,v 1.8 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */
/*
@@ -492,7 +492,7 @@ ms_processevent(adb_event_t *event, struct ams_softc *sc)
buttons &= ~button_bit;
/* Extended Protocol (up to 6 more buttons) */
for (mask = 0x80; i < max_byte;
- i += (mask == 0x80), button_bit <<= 1) {
+ i += (mask == 0x80), button_bit <<= 1) {
/* 0 when button down */
if (!(event->bytes[i] & mask))
buttons |= button_bit;
@@ -511,8 +511,8 @@ ms_processevent(adb_event_t *event, struct ams_softc *sc)
if (sc->sc_wsmousedev)
wsmouse_input(sc->sc_wsmousedev, new_event.u.m.buttons,
- new_event.u.m.dx, -new_event.u.m.dy, 0,
- WSMOUSE_INPUT_DELTA);
+ new_event.u.m.dx, -new_event.u.m.dy, 0,
+ WSMOUSE_INPUT_DELTA);
#if NAED > 0
aed_input(&new_event);
#endif
diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c
index f4f67a929df..694d306e45f 100644
--- a/sys/arch/macppc/dev/apm.c
+++ b/sys/arch/macppc/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.8 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: apm.c,v 1.9 2003/10/16 03:54:48 deraadt Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -115,7 +115,7 @@ struct filterops apmread_filtops =
int
apmmatch(struct device *parent, void *match, void *aux)
{
- struct adb_attach_args *aa = (void *)aux;
+ struct adb_attach_args *aa = (void *)aux;
if (aa->origaddr != ADBADDR_APM ||
aa->handler_id != ADBADDR_APM ||
aa->adbaddr != ADBADDR_APM)
@@ -221,7 +221,7 @@ apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
error = EBADF;
case APM_IOC_SUSPEND:
if ((flag & FWRITE) == 0)
- error = EBADF;
+ error = EBADF;
break;
case APM_IOC_PRN_CTL:
if ((flag & FWRITE) == 0)
@@ -277,7 +277,7 @@ apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
batt.draw) / 60;
power->battery_state = APM_BATT_CHARGING;
} else {
- power->minutes_left =
+ power->minutes_left =
((batt.cur_charge * 3600) / (-batt.draw)) / 60;
/* XXX - Arbitrary */
@@ -288,9 +288,8 @@ apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
else
power->battery_state = APM_BATT_LOW;
}
-
break;
-
+
default:
error = ENOTTY;
}
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c
index 4bdd439bf11..214d9b77176 100644
--- a/sys/arch/macppc/dev/if_bm.c
+++ b/sys/arch/macppc/dev/if_bm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bm.c,v 1.15 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: if_bm.c,v 1.16 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */
/*-
@@ -299,7 +299,7 @@ bmac_attach(struct device *parent, struct device *self, void *aux)
ifmedia_init(&mii->mii_media, 0, bmac_mediachange, bmac_mediastatus);
mii_attach(&sc->sc_dev, mii, 0xffffffff, MII_PHY_ANY,
- MII_OFFSET_ANY, 0);
+ MII_OFFSET_ANY, 0);
/* Choose a default media. */
if (LIST_FIRST(&mii->mii_phys) == NULL) {
diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c
index 202e4866775..aaf830e9240 100644
--- a/sys/arch/macppc/dev/macintr.c
+++ b/sys/arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macintr.c,v 1.19 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: macintr.c,v 1.20 2003/10/16 03:54:48 deraadt Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -97,7 +97,7 @@ void macintr_attach(struct device *, struct device *, void *);
void mac_do_pending_int(void);
void mac_ext_intr(void);
-struct cfattach macintr_ca = {
+struct cfattach macintr_ca = {
sizeof(struct macintr_softc),
macintr_match,
macintr_attach
diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c
index 26b4c33018d..d93add530f7 100644
--- a/sys/arch/macppc/dev/mesh.c
+++ b/sys/arch/macppc/dev/mesh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mesh.c,v 1.6 2002/09/15 09:01:58 deraadt Exp $ */
+/* $OpenBSD: mesh.c,v 1.7 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */
/*-
@@ -194,7 +194,7 @@ struct cfattach mesh_ca = {
};
-struct cfdriver mesh_cd = {
+struct cfdriver mesh_cd = {
NULL, "mesh", DV_DULL
};
@@ -229,7 +229,7 @@ mesh_attach(parent, self, aux)
struct confargs *ca = aux;
int i, error;
u_int *reg;
-
+
printf("MESH_ATTACH called\n");
reg = ca->ca_reg;
@@ -431,10 +431,10 @@ mesh_intr(arg)
break;
case MESH_MSGIN:
mesh_msgin(sc, scb);
- printf("mesh_intr:case MESH_MSGIN\n");
+ printf("mesh_intr:case MESH_MSGIN\n");
break;
case MESH_COMPLETE:
- printf("mesh_intr:case MESH_COMPLETE\n");
+ printf("mesh_intr:case MESH_COMPLETE\n");
mesh_done(sc, scb);
break;
@@ -955,7 +955,7 @@ mesh_scsi_cmd(xs)
scb->target = sc_link->target;
sc->sc_imsglen = 0; /* XXX ? */
-
+
printf("messh_scsi_cmd,scb->target=%d\n",scb->target);
if (flags & SCSI_POLL){
@@ -993,7 +993,7 @@ mesh_scsi_cmd(xs)
if (mesh_poll(sc, xs))
printf("mesh: timeout again\n");
}
- printf("mesh_scsi_cmd: returning COMPLETE\n");
+ printf("mesh_scsi_cmd: returning COMPLETE\n");
return COMPLETE;
}
@@ -1031,7 +1031,7 @@ mesh_poll(sc, xs)
{
int count = xs->timeout;
printf("in mesh_poll,timeout=%d\n",xs->timeout);
-
+
while (count) {
if (mesh_read_reg(sc, MESH_INTERRUPT))
@@ -1105,12 +1105,11 @@ mesh_timeout(arg)
printf("mesh: timeout state=%x\n", sc->sc_nextstate);
intr = mesh_read_reg(sc, MESH_INTERRUPT);
-
exception = mesh_read_reg(sc, MESH_EXCEPTION);
-
+
error = mesh_read_reg(sc, MESH_ERROR);
-
+
status0 = mesh_read_reg(sc, MESH_BUS_STATUS0);
status1 = mesh_read_reg(sc, MESH_BUS_STATUS1);
@@ -1120,7 +1119,7 @@ printf("intr 0x%02x, except 0x%02x, err 0x%02x\n", intr, exception, error);
#endif
s = splbio();
-
+
if (sc->sc_flags & MESH_DMA_ACTIVE) {
printf("mesh: resetting dma\n");
dbdma_reset(sc->sc_dmareg);
@@ -1128,7 +1127,7 @@ printf("intr 0x%02x, except 0x%02x, err 0x%02x\n", intr, exception, error);
scb->xs->error = XS_TIMEOUT;
mesh_set_reg(sc, MESH_SEQUENCE, MESH_CMD_BUSFREE);
-
+
sc->sc_nextstate = MESH_COMPLETE;
splx(s);
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index 2ed2a407107..68a3ca20c58 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.23 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: openpic.c,v 1.24 2003/10/16 03:54:48 deraadt Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -94,7 +94,7 @@ void openpic_do_pending_int(void);
void openpic_collect_preconf_intr(void);
void ext_intr_openpic(void);
-struct cfattach openpic_ca = {
+struct cfattach openpic_ca = {
sizeof(struct openpic_softc),
openpic_match,
openpic_attach
@@ -151,7 +151,7 @@ openpic_attach(struct device *parent, struct device *self, void *aux)
mac_intr_establish_func = openpic_intr_establish;
mac_intr_disestablish_func = openpic_intr_disestablish;
install_extint(ext_intr_openpic);
-
+
#if 1
openpic_collect_preconf_intr();
#endif
@@ -309,13 +309,13 @@ intr_typename(int type)
{
switch (type) {
- case IST_NONE:
+ case IST_NONE:
return ("none");
- case IST_PULSE:
+ case IST_PULSE:
return ("pulsed");
- case IST_EDGE:
+ case IST_EDGE:
return ("edge-triggered");
- case IST_LEVEL:
+ case IST_LEVEL:
return ("level-triggered");
default:
panic("intr_typename: invalid type %d", type);
@@ -587,8 +587,8 @@ openpic_read_irq(int cpu)
void
openpic_eoi(int cpu)
{
- openpic_write(OPENPIC_EOI(cpu), 0);
- openpic_read(OPENPIC_EOI(cpu));
+ openpic_write(OPENPIC_EOI(cpu), 0);
+ openpic_read(OPENPIC_EOI(cpu));
}
void
@@ -612,7 +612,7 @@ ext_intr_openpic()
r_imen = 1 << irq;
if ((pcpl & r_imen) != 0) {
- ipending |= r_imen; /* Masked! Mark this as pending */
+ ipending |= r_imen; /* Masked! Mark this as pending */
openpic_disable_irq(realirq);
openpic_eoi(0);
} else {
@@ -641,50 +641,50 @@ ext_intr_openpic()
}
ppc_intr_enable(1);
- splx(pcpl); /* Process pendings. */
+ splx(pcpl); /* Process pendings. */
}
void
openpic_init()
{
- int irq;
- u_int x;
-
- /* disable all interrupts */
- for (irq = 0; irq < 255; irq++)
- openpic_write(OPENPIC_SRC_VECTOR(irq), OPENPIC_IMASK);
- openpic_set_priority(0, 15);
-
- /* we don't need 8259 pass through mode */
- x = openpic_read(OPENPIC_CONFIG);
- x |= OPENPIC_CONFIG_8259_PASSTHRU_DISABLE;
- openpic_write(OPENPIC_CONFIG, x);
-
- /* send all interrupts to cpu 0 */
- for (irq = 0; irq < ICU_LEN; irq++)
- openpic_write(OPENPIC_IDEST(irq), 1 << 0);
- for (irq = 0; irq < ICU_LEN; irq++) {
- x = irq;
- x |= OPENPIC_IMASK;
- x |= OPENPIC_POLARITY_POSITIVE;
- x |= OPENPIC_SENSE_LEVEL;
- x |= 8 << OPENPIC_PRIORITY_SHIFT;
- openpic_write(OPENPIC_SRC_VECTOR(irq), x);
- }
-
- /* XXX set spurious intr vector */
-
- openpic_set_priority(0, 0);
-
- /* clear all pending interrunts */
- for (irq = 0; irq < ICU_LEN; irq++) {
- openpic_read_irq(0);
- openpic_eoi(0);
- }
-
- for (irq = 0; irq < ICU_LEN; irq++)
- openpic_disable_irq(irq);
-
- install_extint(ext_intr_openpic);
+ int irq;
+ u_int x;
+
+ /* disable all interrupts */
+ for (irq = 0; irq < 255; irq++)
+ openpic_write(OPENPIC_SRC_VECTOR(irq), OPENPIC_IMASK);
+ openpic_set_priority(0, 15);
+
+ /* we don't need 8259 pass through mode */
+ x = openpic_read(OPENPIC_CONFIG);
+ x |= OPENPIC_CONFIG_8259_PASSTHRU_DISABLE;
+ openpic_write(OPENPIC_CONFIG, x);
+
+ /* send all interrupts to cpu 0 */
+ for (irq = 0; irq < ICU_LEN; irq++)
+ openpic_write(OPENPIC_IDEST(irq), 1 << 0);
+ for (irq = 0; irq < ICU_LEN; irq++) {
+ x = irq;
+ x |= OPENPIC_IMASK;
+ x |= OPENPIC_POLARITY_POSITIVE;
+ x |= OPENPIC_SENSE_LEVEL;
+ x |= 8 << OPENPIC_PRIORITY_SHIFT;
+ openpic_write(OPENPIC_SRC_VECTOR(irq), x);
+ }
+
+ /* XXX set spurious intr vector */
+
+ openpic_set_priority(0, 0);
+
+ /* clear all pending interrunts */
+ for (irq = 0; irq < ICU_LEN; irq++) {
+ openpic_read_irq(0);
+ openpic_eoi(0);
+ }
+
+ for (irq = 0; irq < ICU_LEN; irq++)
+ openpic_disable_irq(irq);
+
+ install_extint(ext_intr_openpic);
}
/*
diff --git a/sys/arch/macppc/dev/pm_direct.c b/sys/arch/macppc/dev/pm_direct.c
index e0dcd8df642..616c12ee46f 100644
--- a/sys/arch/macppc/dev/pm_direct.c
+++ b/sys/arch/macppc/dev/pm_direct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pm_direct.c,v 1.12 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: pm_direct.c,v 1.13 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: pm_direct.c,v 1.9 2000/06/08 22:10:46 tsubai Exp $ */
/*
@@ -326,9 +326,7 @@ pm_receive_pm2(u_char *data)
via_reg_or(VIA1, vACR, 0x1c);
return rval;
-}
-
-
+}
/*
* Send data to PM for the PB Duo series and the PB 5XX series
@@ -346,10 +344,8 @@ pm_send_pm2(data)
rval = 0xffffcd36;
if (pm_wait_busy((int)ADBDelay*32) != 0) {
PM_SET_STATE_ACKON();
-
via_reg_or(VIA1, vACR, 0x1c);
-
- return rval;
+ return rval;
}
PM_SET_STATE_ACKON();
@@ -376,7 +372,7 @@ pm_pmgrop_pm2(PMData *pmdata)
u_char via1_vIER;
int rval = 0;
int num_pm_data = 0;
- u_char pm_cmd;
+ u_char pm_cmd;
short pm_num_rx_data;
u_char pm_data;
u_char *pm_buf;
@@ -408,7 +404,7 @@ pm_pmgrop_pm2(PMData *pmdata)
if ((rval = pm_send_pm2((u_char)(num_pm_data & 0xff))) != 0)
break; /* timeout */
pmdata->command = 0;
- }
+ }
/* send PM data */
pm_buf = (u_char *)pmdata->s_buf;
for (i = 0 ; i < num_pm_data; i++)
@@ -656,9 +652,9 @@ pm_adb_op(u_char *buffer, void *compRout, void *data, int command)
pmdata.num_data = 4;
pmdata.s_buf = pmdata.data;
pmdata.r_buf = pmdata.data;
- pmdata.data[0] = 0x00;
+ pmdata.data[0] = 0x00;
pmdata.data[1] = 0x86; /* magic spell for awaking the PM */
- pmdata.data[2] = 0x00;
+ pmdata.data[2] = 0x00;
pmdata.data[3] = 0x0c; /* each bit may express the existent ADB device */
rval = pmgrop(&pmdata);
diff --git a/sys/arch/macppc/dev/pm_direct.h b/sys/arch/macppc/dev/pm_direct.h
index d96370161e6..ce2aea3f6ba 100644
--- a/sys/arch/macppc/dev/pm_direct.h
+++ b/sys/arch/macppc/dev/pm_direct.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pm_direct.h,v 1.4 2002/06/07 15:49:57 miod Exp $ */
+/* $OpenBSD: pm_direct.h,v 1.5 2003/10/16 03:54:48 deraadt Exp $ */
/* $NetBSD: pm_direct.h,v 1.5 1999/07/12 15:54:55 tsubai Exp $ */
/*
@@ -134,4 +134,4 @@ enum {
#define PMU_PWR_AC_PRESENT (1 << 0)
#define PMU_PWR_BATT_PRESENT (1 << 2)
-#endif
+#endif
diff --git a/sys/arch/macppc/dev/uni_n.c b/sys/arch/macppc/dev/uni_n.c
index fc9a148844a..6de710fb511 100644
--- a/sys/arch/macppc/dev/uni_n.c
+++ b/sys/arch/macppc/dev/uni_n.c
@@ -1,10 +1,9 @@
-/* $OpenBSD: uni_n.c,v 1.8 2003/10/16 03:31:25 drahn Exp $ */
+/* $OpenBSD: uni_n.c,v 1.9 2003/10/16 03:54:48 deraadt Exp $ */
/*
* Copyright (c) 1998-2001 Dale Rahn.
* All rights reserved.
*
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -24,7 +23,7 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ */
#include <sys/param.h>
#include <sys/device.h>