diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-08 17:45:30 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-01-08 17:45:30 +0000 |
commit | 853d5bba35b6c05d50d1cbf59f6cd4a4b9266705 (patch) | |
tree | d4580ca4036543d59a5f56f822920d3603def777 /sys | |
parent | eac48a633a72732691dccdad7d9f181f2ed8801e (diff) |
Drop native MacOS support from the adb direct code, and skip callback
wrappers used to convert between MacOS pascal calling convention and the
C calling convention, unless option MRG_ADB. No functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mac68k/conf/files.mac68k | 4 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/adb.c | 10 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/adb_direct.c | 79 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/adbsysasm.s | 6 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/adbvar.h | 6 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/akbd.c | 6 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/ams.c | 6 |
7 files changed, 33 insertions, 84 deletions
diff --git a/sys/arch/mac68k/conf/files.mac68k b/sys/arch/mac68k/conf/files.mac68k index 7842fc7ee56..553357f9d9a 100644 --- a/sys/arch/mac68k/conf/files.mac68k +++ b/sys/arch/mac68k/conf/files.mac68k @@ -1,4 +1,4 @@ -# $OpenBSD: files.mac68k,v 1.36 2006/01/08 16:36:52 miod Exp $ +# $OpenBSD: files.mac68k,v 1.37 2006/01/08 17:45:26 miod Exp $ # $NetBSD: files.mac68k,v 1.61 1997/03/01 20:22:16 scottr Exp $ # mac68k-specific configuration info @@ -22,7 +22,7 @@ file arch/mac68k/dev/nubus.c nubus device adb {} attach adb at obio file arch/mac68k/dev/adb.c adb -file arch/mac68k/dev/adbsysasm.s adb +file arch/mac68k/dev/adbsysasm.s adb & mrg_adb file arch/mac68k/dev/adb_direct.c adb file arch/mac68k/dev/pm_direct.c diff --git a/sys/arch/mac68k/dev/adb.c b/sys/arch/mac68k/dev/adb.c index 320b6362dec..be72a3f6522 100644 --- a/sys/arch/mac68k/dev/adb.c +++ b/sys/arch/mac68k/dev/adb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adb.c,v 1.16 2006/01/08 17:25:05 miod Exp $ */ +/* $OpenBSD: adb.c,v 1.17 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: adb.c,v 1.47 2005/06/16 22:43:36 jmc Exp $ */ /* @@ -292,8 +292,16 @@ 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. */ +#ifdef MRG_ADB void adb_op_comprout(void) { asm("movw #1,a2@ | update flag value"); } +#else +void +adb_op_comprout(caddr_t buffer, caddr_t data_area, int adb_command) +{ + *(u_short *)data_area = 0x01; /* update flag value */ +} +#endif diff --git a/sys/arch/mac68k/dev/adb_direct.c b/sys/arch/mac68k/dev/adb_direct.c index 70bb750fe58..4a5bd17fe6f 100644 --- a/sys/arch/mac68k/dev/adb_direct.c +++ b/sys/arch/mac68k/dev/adb_direct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adb_direct.c,v 1.16 2006/01/04 20:39:04 miod Exp $ */ +/* $OpenBSD: adb_direct.c,v 1.17 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: adb_direct.c,v 1.51 2005/06/16 22:43:36 jmc Exp $ */ /* From: adb_direct.c 2.02 4/18/97 jpw */ @@ -60,8 +60,6 @@ * adb_cuda_tickle routine can be removed. */ -#if defined(__NetBSD__) || defined(__OpenBSD__) - #include <sys/param.h> #include <sys/cdefs.h> #include <sys/pool.h> @@ -74,17 +72,6 @@ #include <machine/cpu.h> #include <mac68k/dev/adbvar.h> #define printf_intr printf -#else /* !__NetBSD__, i.e. Mac OS */ -#include "via.h" /* for macos based testing */ -/* #define ADB_DEBUG */ /* more verbose for testing */ - -/* Types of ADB hardware that we support */ -#define ADB_HW_UNKNOWN 0x0 /* don't know */ -#define ADB_HW_II 0x1 /* Mac II series */ -#define ADB_HW_IISI 0x2 /* Mac IIsi series */ -#define ADB_HW_PB 0x3 /* PowerBook series */ -#define ADB_HW_CUDA 0x4 /* Machines with a Cuda chip */ -#endif /* __NetBSD__ */ /* some misc. leftovers */ #define vPB 0x0000 @@ -289,7 +276,6 @@ int send_adb_cuda(u_char *, u_char *, void *, void *, int); void adb_intr_cuda_test(void); void adb_cuda_tickle(void); void adb_pass_up(struct adbCommand *); -void adb_op_comprout(void); void adb_reinit(void); int count_adbs(void); int get_ind_adb_info(ADBDataBlock *, int); @@ -300,7 +286,6 @@ int adb_op(Ptr, Ptr, Ptr, short); void adb_read_II(u_char *); void adb_hw_setup(void); void adb_hw_setup_IIsi(u_char *); -void adb_comp_exec(void); int adb_cmd_result(u_char *); int adb_cmd_extra(u_char *); int adb_guess_next_device(void); @@ -1668,12 +1653,6 @@ adb_soft_intr(void) u_char *comprout = 0; u_char *compdata = 0; -#if 0 - s = splhigh(); - printf_intr("sr: %x\n", (s & 0x0700)); - splx(s); -#endif - /*delay(2*ADB_DELAY);*/ while (adbInCount) { @@ -1709,9 +1688,9 @@ adb_soft_intr(void) /* call default completion routine if it's valid */ if (comprout) { -#if defined(__NetBSD__) || defined(__OpenBSD__) +#ifdef MRG_ADB __asm __volatile ( - " movml #0xffff,sp@- \n" /* save all regs */ + " movml #0xffff,sp@- \n" /* save all regs */ " movl %0,a2 \n" /* compdata */ " movl %1,a1 \n" /* comprout */ " movl %2,a0 \n" /* buffer */ @@ -1722,17 +1701,9 @@ adb_soft_intr(void) : "g"(compdata), "g"(comprout), "g"(buffer), "g"(cmd) : "d0", "a0", "a1", "a2"); -#else /* for macos based testing */ - asm - { - movem.l a0/a1/a2/d0, -(a7) - move.l compdata, a2 - move.l comprout, a1 - move.l buffer, a0 - move.w cmd, d0 - jsr(a1) - movem.l(a7)+, d0/a2/a1/a0 - } +#else + (void)((int (*)(u_char *, u_char *, int))comprout) + (buffer, compdata, cmd); #endif } @@ -2255,44 +2226,6 @@ adb_reinit(void) /* - * adb_comp_exec - * This is a general routine that calls the completion routine if there is one. - * NOTE: This routine is now only used by pm_direct.c - * All the code in this file (adb_direct.c) uses - * the adb_pass_up routine now. - */ -void -adb_comp_exec(void) -{ - if ((long)0 != adbCompRout) /* don't call if empty return location */ -#if defined(__NetBSD__) || defined(__OpenBSD__) - __asm __volatile( - " movml #0xffff,sp@- \n" /* save all registers */ - " movl %0,a2 \n" /* adbCompData */ - " movl %1,a1 \n" /* adbCompRout */ - " movl %2,a0 \n" /* adbBuffer */ - " movl %3,d0 \n" /* adbWaitingCmd */ - " jbsr a1@ \n" /* go call the routine */ - " movml sp@+,#0xffff" /* restore all registers */ - : - : "g"(adbCompData), "g"(adbCompRout), - "g"(adbBuffer), "g"(adbWaitingCmd) - : "d0", "a0", "a1", "a2"); -#else /* for Mac OS-based testing */ - asm { - movem.l a0/a1/a2/d0, -(a7) - move.l adbCompData, a2 - move.l adbCompRout, a1 - move.l adbBuffer, a0 - move.w adbWaitingCmd, d0 - jsr(a1) - movem.l(a7) +, d0/a2/a1/a0 - } -#endif -} - - -/* * adb_cmd_result * * This routine lets the caller know whether the specified adb command string diff --git a/sys/arch/mac68k/dev/adbsysasm.s b/sys/arch/mac68k/dev/adbsysasm.s index c5a78df8867..157f063f5fc 100644 --- a/sys/arch/mac68k/dev/adbsysasm.s +++ b/sys/arch/mac68k/dev/adbsysasm.s @@ -1,4 +1,4 @@ -/* $OpenBSD: adbsysasm.s,v 1.3 2006/01/04 20:39:04 miod Exp $ */ +/* $OpenBSD: adbsysasm.s,v 1.4 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: adbsysasm.s,v 1.11 2001/11/20 03:19:42 chs Exp $ */ /*- @@ -69,8 +69,6 @@ GLOBAL(adb_ms_asmcomplete) rts #endif -#ifdef MRG_ADB - #if defined(ADB_DEBUG) && 0 GLOBAL(adb_jadbprochello) .asciz "adb: hello from adbproc\n" @@ -88,5 +86,3 @@ GLOBAL(adb_jadbproc) #endif /* Don't do anything; adbattach fixes dev info for us. */ rts - -#endif /* MRG_ADB */ diff --git a/sys/arch/mac68k/dev/adbvar.h b/sys/arch/mac68k/dev/adbvar.h index e06099a3765..d23e7fc0358 100644 --- a/sys/arch/mac68k/dev/adbvar.h +++ b/sys/arch/mac68k/dev/adbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: adbvar.h,v 1.9 2006/01/04 20:39:04 miod Exp $ */ +/* $OpenBSD: adbvar.h,v 1.10 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: adbvar.h,v 1.22 2005/01/15 16:00:59 chs Exp $ */ /* @@ -57,7 +57,11 @@ extern int adb_debug; /* adb.c */ int adb_op_sync(Ptr, Ptr, Ptr, short); +#ifdef MRG_ADB void adb_op_comprout(void); +#else +void adb_op_comprout(caddr_t, caddr_t, int); +#endif /* adbsysasm.s */ void adb_kbd_asmcomplete(void); diff --git a/sys/arch/mac68k/dev/akbd.c b/sys/arch/mac68k/dev/akbd.c index a79ad6434b8..cb4d8eb7a3f 100644 --- a/sys/arch/mac68k/dev/akbd.c +++ b/sys/arch/mac68k/dev/akbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: akbd.c,v 1.3 2006/01/08 17:25:05 miod Exp $ */ +/* $OpenBSD: akbd.c,v 1.4 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: akbd.c,v 1.17 2005/01/15 16:00:59 chs Exp $ */ /* @@ -133,7 +133,11 @@ akbdattach(struct device *parent, struct device *self, void *aux) sc->sc_leds = (u_int8_t)0x00; /* initially off */ +#ifdef MRG_ADB adbinfo.siServiceRtPtr = (Ptr)adb_kbd_asmcomplete; +#else + adbinfo.siServiceRtPtr = (Ptr)kbd_adbcomplete; +#endif adbinfo.siDataAreaAddr = (caddr_t)sc; printf(": "); diff --git a/sys/arch/mac68k/dev/ams.c b/sys/arch/mac68k/dev/ams.c index c4cc4b1b0a6..800677a710d 100644 --- a/sys/arch/mac68k/dev/ams.c +++ b/sys/arch/mac68k/dev/ams.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ams.c,v 1.2 2006/01/08 17:25:05 miod Exp $ */ +/* $OpenBSD: ams.c,v 1.3 2006/01/08 17:45:29 miod Exp $ */ /* $NetBSD: ams.c,v 1.11 2000/12/19 03:13:40 tsubai Exp $ */ /* @@ -106,7 +106,11 @@ amsattach(struct device *parent, struct device *self, void *aux) sc->sc_devid[0] = 0; sc->sc_devid[4] = 0; +#ifdef MRG_ADB adbinfo.siServiceRtPtr = (Ptr)adb_ms_asmcomplete; +#else + adbinfo.siServiceRtPtr = (Ptr)ms_adbcomplete; +#endif adbinfo.siDataAreaAddr = (caddr_t)sc; ems_init(sc); |