o Change various attach arg and softc datatypes to ints.

o Use explicit typecasts when interfacing with MRG data

Should fix port-mac68k/6839.  Patch supplied by
Frederick Bruckman <fb@enteract.com>
This commit is contained in:
ender 1999-02-11 06:41:07 +00:00
parent 36362e2a99
commit 25e1f69c42
11 changed files with 59 additions and 59 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adb.c,v 1.26 1998/10/26 07:09:37 scottr Exp $ */
/* $NetBSD: adb.c,v 1.27 1999/02/11 06:41:07 ender Exp $ */
/*
* Copyright (C) 1994 Bradley A. Grantham
@ -169,9 +169,9 @@ adbattach(parent, dev, aux)
/* Get the ADB information */
adbaddr = GetIndADB(&adbdata, adbindex);
aa_args.origaddr = adbdata.origADBAddr;
aa_args.origaddr = (int)(adbdata.origADBAddr);
aa_args.adbaddr = adbaddr;
aa_args.handler_id = adbdata.devType;
aa_args.handler_id = (int)(adbdata.devType);
(void)config_found(dev, &aa_args, adbprint);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: adb_direct.c,v 1.19 1998/11/14 03:20:47 briggs Exp $ */
/* $NetBSD: adb_direct.c,v 1.20 1999/02/11 06:41:07 ender Exp $ */
/* From: adb_direct.c 2.02 4/18/97 jpw */
@ -170,9 +170,9 @@
struct ADBDevEntry {
void (*ServiceRtPtr) __P((void));
void *DataAreaAddr;
char devType;
char origAddr;
char currentAddr;
int devType;
int origAddr;
int currentAddr;
};
/*
@ -2060,7 +2060,7 @@ adb_reinit(void)
(Ptr)0, (short)command);
if (0x00 != send_string[0]) { /* anything come back ?? */
ADBDevTable[++ADBNumDevices].devType =
(u_char)send_string[2];
(int)(send_string[2]);
ADBDevTable[ADBNumDevices].origAddr = i;
ADBDevTable[ADBNumDevices].currentAddr = i;
ADBDevTable[ADBNumDevices].DataAreaAddr =
@ -2127,7 +2127,7 @@ adb_reinit(void)
printf_intr("new device found\n");
#endif
ADBDevTable[++ADBNumDevices].devType =
(u_char)send_string[2];
(int)(send_string[2]);
ADBDevTable[ADBNumDevices].origAddr = device;
ADBDevTable[ADBNumDevices].currentAddr = device;
/* These will be set correctly in adbsys.c */
@ -2171,7 +2171,7 @@ adb_reinit(void)
for (i = 1; i <= ADBNumDevices; i++) {
x = get_ind_adb_info(&data, i);
if (x != -1)
printf_intr("index 0x%x, addr 0x%x, type 0x%x\n",
printf_intr("index 0x%x, addr 0x%x, type 0x%hx\n",
i, x, data.devType);
}
}
@ -2522,8 +2522,8 @@ get_ind_adb_info(ADBDataBlock * info, int index)
if (0 == ADBDevTable[index].devType) /* make sure it's a valid entry */
return (-1);
info->devType = ADBDevTable[index].devType;
info->origADBAddr = ADBDevTable[index].origAddr;
info->devType = (unsigned char)(ADBDevTable[index].devType);
info->origADBAddr = (unsigned char)(ADBDevTable[index].origAddr);
info->dbServiceRtPtr = (Ptr)ADBDevTable[index].ServiceRtPtr;
info->dbDataAreaAddr = (Ptr)ADBDevTable[index].DataAreaAddr;
@ -2540,8 +2540,8 @@ get_adb_info(ADBDataBlock * info, int adbAddr)
for (i = 1; i < 15; i++)
if (ADBDevTable[i].currentAddr == adbAddr) {
info->devType = ADBDevTable[i].devType;
info->origADBAddr = ADBDevTable[i].origAddr;
info->devType = (unsigned char)(ADBDevTable[i].devType);
info->origADBAddr = (unsigned char)(ADBDevTable[i].origAddr);
info->dbServiceRtPtr = (Ptr)ADBDevTable[i].ServiceRtPtr;
info->dbDataAreaAddr = ADBDevTable[i].DataAreaAddr;
return 0; /* found */

View File

@ -1,4 +1,4 @@
/* $NetBSD: adbsys.c,v 1.39 1998/08/11 20:08:00 briggs Exp $ */
/* $NetBSD: adbsys.c,v 1.40 1999/02/11 06:41:08 ender Exp $ */
/*-
* Copyright (C) 1994 Bradley A. Grantham
@ -73,8 +73,8 @@ adb_complete(buffer, data_area, adb_command)
#endif
event.addr = adbaddr;
event.hand_id = adbdata.devType;
event.def_addr = adbdata.origADBAddr;
event.hand_id = (int)(adbdata.devType);
event.def_addr = (int)(adbdata.origADBAddr);
event.byte_count = buffer[0];
memcpy(event.bytes, buffer + 1, event.byte_count);
@ -119,7 +119,7 @@ adb_msa3_complete(buffer, data_area, adb_command)
event.addr = adbaddr;
event.hand_id = ADBMS_MSA3;
event.def_addr = adbdata.origADBAddr;
event.def_addr = (int)(adbdata.origADBAddr);
event.byte_count = buffer[0];
memcpy(event.bytes, buffer + 1, event.byte_count);
@ -186,8 +186,8 @@ adb_mm_nonemp_complete(buffer, data_area, adb_command)
buffer[3] = 0x80;
event.addr = adbaddr;
event.hand_id = adbdata.devType;
event.def_addr = adbdata.origADBAddr;
event.hand_id = (int)(adbdata.devType);
event.def_addr = (int)(adbdata.origADBAddr);
event.byte_count = buffer[0];
memcpy(event.bytes, buffer + 1, event.byte_count);
@ -421,7 +421,7 @@ adb_init()
printf("adb: ");
switch (adbdata.origADBAddr) {
case ADBADDR_SECURE:
printf("security dongle (%d)", adbdata.devType);
printf("security dongle (%d)", (int)(adbdata.devType));
break;
case ADBADDR_MAP:
switch (adbdata.devType) {
@ -492,7 +492,7 @@ adb_init()
printf("extended keyboard");
break;
default:
printf("mapped device (%d)", adbdata.devType);
printf("mapped device (%d)", (int)(adbdata.devType));
break;
}
break;
@ -557,7 +557,7 @@ adb_init()
break;
default:
printf("relative positioning device (mouse?) "
"(%d)", adbdata.devType);
"(%d)", (int)(adbdata.devType));
break;
}
break;
@ -568,13 +568,13 @@ adb_init()
break;
default:
printf("abs. pos. device (tablet?) (%d)",
adbdata.devType);
(int)(adbdata.devType));
break;
}
break;
case ADBADDR_DATATX:
printf("data transfer device (modem?) (%d)",
adbdata.devType);
(int)(adbdata.devType));
break;
case ADBADDR_MISC:
switch (adbdata.devType) {
@ -583,13 +583,13 @@ adb_init()
break;
default:
printf("misc. device (remote control?) (%d)",
adbdata.devType);
(int)(adbdata.devType));
break;
}
break;
default:
printf("unknown type device, (def %d, handler %d)",
adbdata.origADBAddr, adbdata.devType);
(int)(adbdata.origADBAddr), (int)(adbdata.devType));
break;
}
printf(" at %d\n", adbaddr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: adbsysasm.s,v 1.8 1998/10/26 07:07:34 scottr Exp $ */
/* $NetBSD: adbsysasm.s,v 1.9 1999/02/11 06:41:08 ender Exp $ */
/*-
* Copyright (C) 1994 Bradley A. Grantham
@ -43,14 +43,14 @@
/* (provided it has been set up with SetADBInfo) */
GLOBAL(adb_kbd_asmcomplete)
#if NKBD > 0
moveml #0xc0c0, sp@- | save scratch regs
moveml #0x80e0, sp@- | save scratch regs
movl d0, sp@- /* ADB command byte */
movl a2, sp@- /* data area pointer */
/* a1 is the pointer to this routine itself. */
movl a0, sp@- /* device data buffer */
jbsr _C_LABEL(kbd_adbcomplete)
addl #12, sp /* pop params */
moveml sp@+, #0x0303 | restore scratch regs
moveml sp@+, #0x0701 | restore scratch regs
#endif
rts
@ -58,14 +58,14 @@ GLOBAL(adb_kbd_asmcomplete)
/* (provided it has been set up with SetADBInfo) */
GLOBAL(adb_ms_asmcomplete)
#if NMS > 0
moveml #0xc0c0, sp@- | save scratch regs
moveml #0x80e0, sp@- | save scratch regs
movl d0, sp@- /* ADB command byte */
movl a2, sp@- /* data area pointer */
/* a1 is the pointer to this routine itself. */
movl a0, sp@- /* device data buffer */
jbsr _C_LABEL(ms_adbcomplete)
addl #12, sp /* pop params */
moveml sp@+, #0x0303 | restore scratch regs
moveml sp@+, #0x0701 | restore scratch regs
#endif
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: adbvar.h,v 1.13 1998/11/14 03:20:47 briggs Exp $ */
/* $NetBSD: adbvar.h,v 1.14 1999/02/11 06:41:08 ender Exp $ */
/*
* Copyright (C) 1994 Bradley A. Grantham
@ -36,9 +36,9 @@
* Arguments used to attach a device to the Apple Desktop Bus
*/
struct adb_attach_args {
unsigned char origaddr;
unsigned char adbaddr;
unsigned char handler_id;
int origaddr;
int adbaddr;
int handler_id;
};
typedef struct adb_trace_xlate_s {

View File

@ -1,4 +1,4 @@
/* $Id: aed.c,v 1.5 1998/12/19 21:41:13 scottr Exp $ */
/* $Id: aed.c,v 1.6 1999/02/11 06:41:08 ender Exp $ */
/*
* Copyright (C) 1994 Bradley A. Grantham
@ -538,8 +538,8 @@ aedioctl(dev, cmd, data, flag, p)
for (i = 1; i <= totaldevs; i++) {
adbaddr = GetIndADB(&adbdata, i);
di->dev[adbaddr].addr = adbaddr;
di->dev[adbaddr].default_addr = adbdata.origADBAddr;
di->dev[adbaddr].handler_id = adbdata.devType;
di->dev[adbaddr].default_addr = (int)(adbdata.origADBAddr);
di->dev[adbaddr].handler_id = (int)(adbdata.devType);
}
/* Must call ADB Manager to get devices now */

View File

@ -1,4 +1,4 @@
/* $NetBSD: aedvar.h,v 1.1 1998/10/23 01:16:23 ender Exp $ */
/* $NetBSD: aedvar.h,v 1.2 1999/02/11 06:41:09 ender Exp $ */
/*
* Copyright (C) 1994 Bradley A. Grantham
@ -42,9 +42,9 @@ struct aed_softc {
struct device sc_dev;
/* ADB info */
u_char origaddr; /* ADB device type (ADBADDR_AED) */
u_char adbaddr; /* current ADB address */
u_char handler_id; /* type of device */
int origaddr; /* ADB device type (ADBADDR_AED) */
int adbaddr; /* current ADB address */
int handler_id; /* type of device */
/* ADB event queue */
adb_event_t sc_evq[AED_MAX_EVENTS]; /* the queue */

View File

@ -1,4 +1,4 @@
/* $Id: kbd.c,v 1.1 1998/10/23 01:16:24 ender Exp $ */
/* $Id: kbd.c,v 1.2 1999/02/11 06:41:09 ender Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@ -315,7 +315,7 @@ setleds(ksc, leds)
if ((leds & 0x07) == (ksc->sc_leds & 0x07))
return (0);
addr = (int)ksc->adbaddr;
addr = ksc->adbaddr;
buffer[0] = 0;
kbd_done = 0;
@ -365,7 +365,7 @@ blinkleds(ksc)
int addr, i;
u_char blinkleds, origleds;
addr = (int)ksc->adbaddr;
addr = ksc->adbaddr;
origleds = getleds(addr);
blinkleds = LED_NUMLOCK | LED_CAPSLOCK | LED_SCROLL_LOCK;

View File

@ -1,4 +1,4 @@
/* $Id: kbdvar.h,v 1.1 1998/10/23 01:16:24 ender Exp $ */
/* $Id: kbdvar.h,v 1.2 1999/02/11 06:41:09 ender Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@ -42,9 +42,9 @@ struct kbd_softc {
struct device sc_dev;
/* ADB info */
u_int8_t origaddr; /* ADB device type (ADBADDR_KBD) */
u_int8_t adbaddr; /* current ADB address */
u_int8_t handler_id; /* type of keyboard */
int origaddr; /* ADB device type (ADBADDR_KBD) */
int adbaddr; /* current ADB address */
int handler_id; /* type of keyboard */
u_int8_t sc_leds; /* current LED state */
};

View File

@ -1,4 +1,4 @@
/* $Id: ms.c,v 1.2 1999/01/16 22:49:37 scottr Exp $ */
/* $Id: ms.c,v 1.3 1999/02/11 06:41:09 ender Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@ -117,16 +117,16 @@ msattach(parent, self, aux)
switch (sc->handler_id) {
case ADBMS_100DPI:
printf("%d-button, %d dpi mouse\n", sc->sc_buttons,
sc->sc_res);
(int)(sc->sc_res));
break;
case ADBMS_200DPI:
sc->sc_res = 200;
printf("%d-button, %d dpi mouse\n", sc->sc_buttons,
sc->sc_res);
(int)(sc->sc_res));
break;
case ADBMS_MSA3:
printf("Mouse Systems A3 mouse, %d-button, %d dpi\n",
sc->sc_buttons, sc->sc_res);
sc->sc_buttons, (int)(sc->sc_res));
break;
case ADBMS_USPEED:
printf("MicroSpeed mouse, default parameters\n");
@ -166,7 +166,7 @@ msattach(parent, self, aux)
break;
}
printf(" <%s> %d-button, %d dpi\n", sc->sc_devid,
sc->sc_buttons, sc->sc_res);
sc->sc_buttons, (int)(sc->sc_res));
}
break;
default:

View File

@ -1,4 +1,4 @@
/* $Id: msvar.h,v 1.1 1998/10/23 01:16:24 ender Exp $ */
/* $Id: msvar.h,v 1.2 1999/02/11 06:41:09 ender Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@ -40,9 +40,9 @@ struct ms_softc {
struct device sc_dev;
/* ADB info */
u_int8_t origaddr; /* ADB device type (ADBADDR_MS) */
u_int8_t adbaddr; /* current ADB address */
u_int8_t handler_id; /* type of mouse */
int origaddr; /* ADB device type (ADBADDR_MS) */
int adbaddr; /* current ADB address */
int handler_id; /* type of mouse */
/* Extended Mouse Protocol info, faked for non-EMP mice */
u_int8_t sc_class; /* mouse class (mouse, trackball) */