diff options
author | Martin Reindl <martin@cvs.openbsd.org> | 2005-10-15 15:01:24 +0000 |
---|---|---|
committer | Martin Reindl <martin@cvs.openbsd.org> | 2005-10-15 15:01:24 +0000 |
commit | 076ae79138725d72f6452f24a57d9c22a197f43f (patch) | |
tree | 6a57e1d9fbc74b0dd2560c863b11f69d6eacc94a | |
parent | 35706a64087bc831698cbed0cae4398b84d841c5 (diff) |
- merge adb_direct.h bits into adbvar.h
- rename ADB_HW_PB to ADB_HW_PMU
from NetBSD
ok brad@; additonal testing krw@
-rw-r--r-- | sys/arch/macppc/dev/adb.c | 7 | ||||
-rw-r--r-- | sys/arch/macppc/dev/adb_direct.c | 27 | ||||
-rw-r--r-- | sys/arch/macppc/dev/adb_direct.h | 52 | ||||
-rw-r--r-- | sys/arch/macppc/dev/adbvar.h | 8 | ||||
-rw-r--r-- | sys/arch/macppc/dev/akbd.c | 3 | ||||
-rw-r--r-- | sys/arch/macppc/dev/ams.c | 3 | ||||
-rw-r--r-- | sys/arch/macppc/dev/apm.c | 5 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/machdep.c | 3 |
8 files changed, 28 insertions, 80 deletions
diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c index 1daef3c5eef..1529a6b90d1 100644 --- a/sys/arch/macppc/dev/adb.c +++ b/sys/arch/macppc/dev/adb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adb.c,v 1.11 2005/09/30 01:28:05 deraadt Exp $ */ +/* $OpenBSD: adb.c,v 1.12 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */ /*- @@ -43,7 +43,6 @@ #include <machine/autoconf.h> #include <macppc/dev/adbvar.h> -#include <macppc/dev/adb_direct.h> #include <macppc/dev/akbdvar.h> #include <macppc/dev/viareg.h> @@ -124,7 +123,7 @@ adbattach(struct device *parent, struct device *self, void *aux) if (strcmp(ca->ca_name, "via-cuda") == 0) adbHardware = ADB_HW_CUDA; else if (strcmp(ca->ca_name, "via-pmu") == 0) - adbHardware = ADB_HW_PB; + adbHardware = ADB_HW_PMU; adb_polling = 1; ADBReInit(); @@ -149,7 +148,7 @@ adbattach(struct device *parent, struct device *self, void *aux) case ADB_HW_CUDA: printf(": via-cuda"); break; - case ADB_HW_PB: + case ADB_HW_PMU: printf(": via-pmu"); break; } diff --git a/sys/arch/macppc/dev/adb_direct.c b/sys/arch/macppc/dev/adb_direct.c index cc8823ea1a2..83aa9b73afb 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.11 2004/05/28 23:50:58 drahn Exp $ */ +/* $OpenBSD: adb_direct.c,v 1.12 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */ /* @@ -70,7 +70,6 @@ #include <macppc/dev/viareg.h> #include <macppc/dev/adbvar.h> -#include <macppc/dev/adb_direct.h> #include <macppc/dev/pm_direct.h> #define printf_intr printf @@ -616,7 +615,7 @@ int adb_intr(void *arg) { switch (adbHardware) { - case ADB_HW_PB: + case ADB_HW_PMU: pm_intr(); break; @@ -690,7 +689,7 @@ adb_pass_up(struct adbCommand *in) start = 4; break; - case ADB_HW_PB: + case ADB_HW_PMU: cmd = in->data[1]; if (in->data[0] < 2) len = 0; @@ -848,7 +847,7 @@ adb_op(Ptr buffer, Ptr compRout, Ptr data, short command) int result; switch (adbHardware) { - case ADB_HW_PB: + case ADB_HW_PMU: result = pm_adb_op((u_char *)buffer, (void *)compRout, (void *)data, (int)command); @@ -885,7 +884,7 @@ adb_hw_setup(void) switch (adbHardware) { - case ADB_HW_PB: + case ADB_HW_PMU: /* * XXX - really PM_VIA_CLR_INTR - should we put it in * pm_direct.h? @@ -948,7 +947,7 @@ adb_reinit(void) int nonewtimes; /* times thru loop w/o any new devices */ /* Make sure we are not interrupted while building the table. */ - if (adbHardware != ADB_HW_PB) /* ints must be on for PB? */ + if (adbHardware != ADB_HW_PMU) /* ints must be on for PB? */ s = splhigh(); ADBNumDevices = 0; /* no devices yet */ @@ -1175,7 +1174,7 @@ adb_reinit(void) timeout_add(&adb_cuda_timeout, ADB_TICKLE_TICKS); } - if (adbHardware != ADB_HW_PB) /* ints must be on for PB? */ + if (adbHardware != ADB_HW_PMU) /* ints must be on for PB? */ splx(s); } @@ -1202,7 +1201,7 @@ adb_cmd_result(u_char *in) return 0; return 1; - case ADB_HW_PB: + case ADB_HW_PMU: return 1; default: @@ -1285,7 +1284,7 @@ adb_setup_hw_type(void) adbSoftPower = 1; return; - case ADB_HW_PB: + case ADB_HW_PMU: adbSoftPower = 1; pm_setup_adb(); return; @@ -1383,7 +1382,7 @@ adb_read_date_time(unsigned long *time) volatile int flag = 0; switch (adbHardware) { - case ADB_HW_PB: + case ADB_HW_PMU: pm_read_date_time(time); retcode = 0; break; @@ -1452,7 +1451,7 @@ adb_set_date_time(unsigned long time) return 0; - case ADB_HW_PB: + case ADB_HW_PMU: pm_set_date_time(time); return 0; @@ -1474,7 +1473,7 @@ adb_poweroff(void) adb_polling = 1; switch (adbHardware) { - case ADB_HW_PB: + case ADB_HW_PMU: pm_adb_poweroff(); for (;;); /* wait for power off */ @@ -1575,7 +1574,7 @@ adb_restart() return; while (1); /* not return */ - case ADB_HW_PB: + case ADB_HW_PMU: pm_adb_restart(); while (1); /* not return */ } diff --git a/sys/arch/macppc/dev/adb_direct.h b/sys/arch/macppc/dev/adb_direct.h deleted file mode 100644 index 84a430d37be..00000000000 --- a/sys/arch/macppc/dev/adb_direct.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: adb_direct.h,v 1.3 2002/06/07 07:14:48 miod Exp $ */ -/* $NetBSD: adb_direct.h,v 1.1 1998/05/15 10:15:47 tsubai Exp $ */ - -/* - * Copyright (C) 1996 John P. Wittkoski - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by John P. Wittkoski. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * 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. - */ -/* From: adb_direct.h 1.4 10/23/96 jpw */ - -/* - * These are public declarations that other routines may need. - */ - -/* types of adb hardware that we (will eventually) support */ -#define ADB_HW_UNKNOWN 0x01 /* don't know */ -#define ADB_HW_PB 0x04 /* PowerBook series */ -#define ADB_HW_CUDA 0x05 /* Machines with a Cuda chip */ - -int adb_poweroff(void); -int CountADBs(void); -void ADBReInit(void); -int GetIndADB(ADBDataBlock *info, int index); -int GetADBInfo(ADBDataBlock *info, int adbAddr); -int SetADBInfo(ADBSetInfoBlock *info, int adbAddr); -int adb_read_date_time(unsigned long *); -int adb_set_date_time(unsigned long); -int adb_op_sync(Ptr, Ptr, Ptr, short); diff --git a/sys/arch/macppc/dev/adbvar.h b/sys/arch/macppc/dev/adbvar.h index 77874ef1155..5f54a821663 100644 --- a/sys/arch/macppc/dev/adbvar.h +++ b/sys/arch/macppc/dev/adbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: adbvar.h,v 1.4 2002/06/07 07:14:48 miod Exp $ */ +/* $OpenBSD: adbvar.h,v 1.5 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: adbvar.h,v 1.3 2000/06/08 22:10:46 tsubai Exp $ */ /*- @@ -75,6 +75,11 @@ struct adb_softc { /* adb_direct.c */ extern int adbHardware; +/* types of adb hardware that we (will eventually) support */ +#define ADB_HW_UNKNOWN 0x01 /* don't know */ +#define ADB_HW_PMU 0x04 /* PowerBook series */ +#define ADB_HW_CUDA 0x05 /* Machines with a Cuda chip */ + #define ADB_CMDADDR(cmd) ((u_int8_t)((cmd) & 0xf0) >> 4) #define ADBFLUSH(dev) ((((u_int8_t)(dev) & 0x0f) << 4) | 0x01) #define ADBLISTEN(dev, reg) ((((u_int8_t)(dev) & 0x0f) << 4) | 0x08 | (reg)) @@ -90,3 +95,4 @@ int adb_read_date_time(unsigned long *t); int adb_set_date_time(unsigned long t); int adb_intr(void *arg); void adb_cuda_autopoll(void); +int adb_op_sync(Ptr, Ptr, Ptr, short); diff --git a/sys/arch/macppc/dev/akbd.c b/sys/arch/macppc/dev/akbd.c index 00719ab8e27..ffd16bf9f38 100644 --- a/sys/arch/macppc/dev/akbd.c +++ b/sys/arch/macppc/dev/akbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: akbd.c,v 1.16 2003/10/16 03:54:48 deraadt Exp $ */ +/* $OpenBSD: akbd.c,v 1.17 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: akbd.c,v 1.13 2001/01/25 14:08:55 tsubai Exp $ */ /* @@ -56,7 +56,6 @@ #include <macppc/dev/akbdmap.h> #include <macppc/dev/akbdvar.h> #include <macppc/dev/amsvar.h> -#include <macppc/dev/adb_direct.h> #include "aed.h" diff --git a/sys/arch/macppc/dev/ams.c b/sys/arch/macppc/dev/ams.c index 033c5c60141..50e38a5045b 100644 --- a/sys/arch/macppc/dev/ams.c +++ b/sys/arch/macppc/dev/ams.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ams.c,v 1.9 2004/11/28 15:43:43 matthieu Exp $ */ +/* $OpenBSD: ams.c,v 1.10 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */ /* @@ -48,7 +48,6 @@ #include <macppc/dev/adbvar.h> #include <macppc/dev/aedvar.h> #include <macppc/dev/amsvar.h> -#include <macppc/dev/adb_direct.h> #include "aed.h" diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c index 3b563fd0987..41d90969592 100644 --- a/sys/arch/macppc/dev/apm.c +++ b/sys/arch/macppc/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.10 2005/03/29 14:32:57 miod Exp $ */ +/* $OpenBSD: apm.c,v 1.11 2005/10/15 15:01:23 martin Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -55,7 +55,6 @@ #include <machine/apmvar.h> #include <macppc/dev/adbvar.h> -#include <macppc/dev/adb_direct.h> #include <macppc/dev/pm_direct.h> #if defined(APMDEBUG) @@ -121,7 +120,7 @@ apmmatch(struct device *parent, void *match, void *aux) aa->adbaddr != ADBADDR_APM) return 0; - if (adbHardware != ADB_HW_PB) + if (adbHardware != ADB_HW_PMU) return 0; return 1; diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index f1b741f673f..6538e899c26 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.77 2005/10/09 14:52:12 drahn Exp $ */ +/* $OpenBSD: machdep.c,v 1.78 2005/10/15 15:01:23 martin Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -78,7 +78,6 @@ #include "adb.h" #if NADB > 0 #include <arch/macppc/dev/adbvar.h> -#include <arch/macppc/dev/adb_direct.h> #endif #ifdef DDB |