clean up some warnings, adapt to the changed state of the world.

This commit is contained in:
cgd 1998-05-01 21:14:46 +00:00
parent 5317573641
commit c0c21ff62f
11 changed files with 89 additions and 68 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: display.h,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: display.h,v 1.2 1998/05/01 21:14:46 cgd Exp $ */
/*
* IBM PC display definitions

View File

@ -53,9 +53,13 @@
#include <dev/isa/isavar.h>
#include <arm32/isa/timerreg.h>
#include <arm32/isa/isadmavar.h>
#include <arm32/shark/fiq.h>
#include <arm32/shark/sequoia.h>
extern int fiq_getregs __P((fiqhandler_t *));
extern int fiq_setregs __P((fiqhandler_t *));
static int hatOn = 0;
/* interface to high-availability timer */

View File

@ -1,4 +1,4 @@
/* $NetBSD: i8042reg.h,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: i8042reg.h,v 1.2 1998/05/01 21:14:46 cgd Exp $ */
/*
* Copyright 1997
@ -177,7 +177,7 @@ extern int i8042_wait_input __P((bus_space_tag_t,
*/
#define I8042_GETAUX_DATA(iot, ioh, status, value) \
{ \
if ((status) = i8042_wait_input((iot), (ioh), I8042_AUX_DATA)) \
if (((status) = i8042_wait_input((iot), (ioh), I8042_AUX_DATA)) != 0) \
{ \
(value) = bus_space_read_1(iot, ioh, KBOUTPO); \
I8042_DELAY; \
@ -197,7 +197,7 @@ extern int i8042_wait_input __P((bus_space_tag_t,
*/
#define I8042_GETKBD_DATA(iot, ioh, status, value) \
{ \
if ((status) = i8042_wait_input((iot), (ioh), I8042_KBD_DATA)) \
if (((status) = i8042_wait_input((iot), (ioh), I8042_KBD_DATA)) != 0) \
{ \
(value) = bus_space_read_1(iot, ioh, KBOUTPO); \
I8042_DELAY; \
@ -240,10 +240,10 @@ extern int i8042_wait_input __P((bus_space_tag_t,
*/
#define I8042_READCCB(iot, ioh, status, value) \
{ \
if ( (status) = i8042_cmd((iot), (ioh), I8042_CMD, \
I8042_NO_RESPONSE, NULL, K_RDCMDBYTE) ) \
if ( ((status) = i8042_cmd((iot), (ioh), I8042_CMD, \
I8042_NO_RESPONSE, NULL, K_RDCMDBYTE)) != 0 ) \
{ \
if ((status) = i8042_wait_input((iot),(ioh),I8042_ANY_DATA)) \
if (((status) = i8042_wait_input((iot),(ioh),I8042_ANY_DATA)) != 0) \
{ \
(value) = bus_space_read_1((iot), (ioh), KBDATAPO); \
} \
@ -266,11 +266,11 @@ extern int i8042_wait_input __P((bus_space_tag_t,
*/
#define I8042_KBDRESET(iot, ioh, status) \
{ \
if ( (status) = i8042_cmd((iot), (ioh), I8042_KBD_CMD, \
if ( ((status) = i8042_cmd((iot), (ioh), I8042_KBD_CMD, \
I8042_CHECK_RESPONSE, \
KBR_ACK, KBC_RESET) ) \
KBR_ACK, KBC_RESET)) != 0 ) \
{ \
if ((status) = i8042_wait_input((iot),(ioh),I8042_ANY_DATA)) \
if (((status) = i8042_wait_input((iot),(ioh),I8042_ANY_DATA)) != 0) \
{ \
(status) = bus_space_read_1((iot), (ioh), KBDATAPO); \
if ((status) != KBR_RSTDONE) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: kbdreg.h,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: kbdreg.h,v 1.2 1998/05/01 21:14:47 cgd Exp $ */
#ifndef _KBDREG_H
#define _KBDREG_H

View File

@ -56,6 +56,7 @@
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <machine/intr.h>
#include <machine/bus.h>
@ -113,7 +114,7 @@ i87307KbdConfig(bus_space_tag_t iot,
u_int kbdBase,
u_int irqNum )
{
u_int configured;
u_int configured = FALSE;
bus_space_handle_t ioh;
@ -246,7 +247,7 @@ int
i87307PrinterConfig(bus_space_tag_t iot,
u_int irqNum )
{
u_int configured;
u_int configured = FALSE;
bus_space_handle_t ioh;
u_char value;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ns87307reg.h,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: ns87307reg.h,v 1.2 1998/05/01 21:14:47 cgd Exp $ */
/*
* Copyright 1997
@ -305,9 +305,9 @@
#define NSIO_CONFIG_IOBASE( iot, ioh, ioBase ) \
{ \
NSIO_WRITE_REG( iot, ioh, NSIO_CFG_IOBASEH, \
(unsigned char)((ioBase >> 8) & 0xff) ); \
(unsigned char)(((ioBase) >> 8) & 0xff) ); \
NSIO_WRITE_REG( iot, ioh, NSIO_CFG_IOBASEL, \
(unsigned char)(ioBase & 0xff ) ); \
(unsigned char)(((ioBase) & 0xff ) ); \
}
/*
@ -323,9 +323,9 @@
#define NSIO_CONFIG_KBCDATA( iot, ioh, dataBase ) \
{ \
NSIO_WRITE_REG( iot, ioh, NSIO_KBC_DATAH, \
(unsigned char)((dataBase >> 8) & 0xff) ); \
(unsigned char)(((dataBase) >> 8) & 0xff) ); \
NSIO_WRITE_REG( iot, ioh, NSIO_KBC_DATAL, \
(unsigned char)(dataBase & 0xff ) ); \
(unsigned char)((dataBase) & 0xff ) ); \
}
/*
@ -341,9 +341,9 @@
#define NSIO_CONFIG_KBCCMD( iot, ioh, cmdBase ) \
{ \
NSIO_WRITE_REG( iot, ioh, NSIO_KBC_CMDH, \
(unsigned char)((cmdBase >> 8) & 0xff) ); \
(unsigned char)(((cmdBase) >> 8) & 0xff) ); \
NSIO_WRITE_REG( iot, ioh, NSIO_KBC_CMDL, \
(unsigned char)(cmdBase & 0xff ) ); \
(unsigned char)((cmdBase) & 0xff ) ); \
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccons.c,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: pccons.c,v 1.2 1998/05/01 21:14:47 cgd Exp $ */
/*
* Copyright 1997
@ -142,18 +142,20 @@
#include <i386/isa/isa_machdep.h>
#endif
#ifdef OFW
#include <dev/ofw/openfirm.h>
#endif
#ifdef SHARK
#include <arm32/shark/sequoia.h>
#include <sys/malloc.h>
#include <sys/reboot.h>
#include <machine/devmap.h>
#include <sys/msgbuf.h>
#include <machine/ofw.h>
extern int msgbufmapped;
#endif
#ifdef OFW
#include <dev/ofw/openfirm.h>
#endif
/*
** Macro defintions
*/
@ -350,12 +352,8 @@ struct cfattach pc_ca =
sizeof(struct pc_softc), pcprobe, pcattach
};
struct cfdriver pc_cd =
{
NULL, "pc", DV_TTY
};
extern struct cfdriver pc_cd;
static unsigned int addr_6845 = MONO_BASE;
/* Define globals used when acting as console at boot time.
@ -411,8 +409,7 @@ kbd_init(bus_space_tag_t iot,
bus_space_handle_t ioh)
{
int status = 1;
int i;
u_char value;
u_char value = 0; /* XXX */
/* Perfrom a controller reset if this is a cold reset happening
*/
@ -1027,7 +1024,11 @@ pcattach(struct device *parent,
** Pass child devices our io handle so they can use
** the same io space as the keyboard.
*/
#if 0
ia->ia_delaybah = sc->kbd.sc_ioh;
#else
ia->ia_aux = (void *)sc->kbd.sc_ioh;
#endif
/*
** Search for and configure any child devices.
*/
@ -1130,7 +1131,6 @@ pcopen(dev_t dev,
** Initial open of the device so set up the tty with
** default flag settings
*/
tp->t_state |= TS_WOPEN;
ttychars(tp);
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
@ -1393,7 +1393,6 @@ pcintr(void *arg)
register struct tty *tp = sc->sc_tty;
u_char *cp;
int handledInt;
u_char status;
handledInt = 1;
@ -2015,8 +2014,9 @@ pccninit(struct consdev *cp)
** otherwise we may hang trying to do console output.
*/
force_vga_mode();
#endif
pccnputc(0, '\n');
#endif
splx(s);
@ -2373,7 +2373,9 @@ sput(struct pc_softc *sc,
if (crtat == 0)
{
u_short volatile *cp;
#ifdef DOESNT_ALWAYS_DO_THE_RIGHT_THING
u_short was;
#endif
unsigned cursorat;
vm_offset_t vam_mem_data = isa_mem_data_vaddr();
@ -3108,7 +3110,7 @@ xinterpret(struct pc_softc *sc,
char *
sget(struct pc_softc *sc)
{
u_char dt;
u_char dt = 0; /* XXX */
u_char dt_make;
u_char status;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pms.c,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $ */
/* $NetBSD: pms.c,v 1.2 1998/05/01 21:14:47 cgd Exp $ */
/*
* Copyright 1997
@ -197,10 +197,7 @@ struct cfattach pms_ca =
sizeof(struct pms_softc), pmsprobe, pmsattach,
};
struct cfdriver pms_cd =
{
NULL, "pms", DV_TTY
};
extern struct cfdriver pms_cd;
/* variable to control which debugs printed if kernel compiled with
** option KERNEL_DEBUG.
@ -251,7 +248,6 @@ pmsprobe(parent, match, aux)
{
struct cfdata *cf = match;
int probeOk = 0; /* assume failure */
unsigned char status;
struct isa_attach_args *ia = aux;
KERN_DEBUG(pmsdebug, KERN_DEBUG_INFO, ("pmsprobe: entered\n"));
@ -273,10 +269,10 @@ pmsprobe(parent, match, aux)
{
/* Clear out any garbage left in there at this point in time
*/
i8042_flush(ia->ia_iot, ia->ia_delaybah);
i8042_flush(ia->ia_iot, (bus_space_handle_t)ia->ia_aux);
/* reset the mouse and check the command is received.
*/
if (!i8042_cmd(ia->ia_iot, ia->ia_delaybah, I8042_AUX_CMD,
if (!i8042_cmd(ia->ia_iot, (bus_space_handle_t)ia->ia_aux, I8042_AUX_CMD,
I8042_CHECK_RESPONSE, KBR_ACK, PMS_RESET))
{
KERN_DEBUG(pmsdebug, KERN_DEBUG_ERROR,
@ -288,7 +284,7 @@ pmsprobe(parent, match, aux)
** Test the mouse port. A value of 0 in the data
** register indicates success.
*/
if ( I8042_AUXTEST(ia->ia_iot, ia->ia_delaybah) )
if ( I8042_AUXTEST(ia->ia_iot, (bus_space_handle_t)ia->ia_aux) )
{
probeOk = 1;
}
@ -301,7 +297,7 @@ pmsprobe(parent, match, aux)
** Disable the mouse. It is enabled when
** the pms device is opened.
*/
(void) I8042_WRITECCB(ia->ia_iot, ia->ia_delaybah,
(void) I8042_WRITECCB(ia->ia_iot, (bus_space_handle_t)ia->ia_aux,
NOAUX_CMDBYTE);
}
} /* end-if irq set */
@ -361,7 +357,7 @@ pmsattach(parent, self, aux)
** Other initialization was done by pmsprobe.
*/
sc->sc_iot = ia->ia_iot;
sc->sc_ioh = ia->ia_delaybah;
sc->sc_ioh = (bus_space_handle_t)ia->ia_aux;
sc->sc_state = PMS_INIT;
@ -789,7 +785,7 @@ pmsintr(arg)
bus_space_handle_t ioh;
static signed char dx;
static signed char dy;
u_char value;
u_char value = 0; /* XXX */
iot = sc->sc_iot;
ioh = sc->sc_ioh;

View File

@ -47,11 +47,11 @@
#include <dev/isa/isareg.h>
#ifdef arm32
#include <arm32/isa/isa_machdep.h>
#include <arm32/shark/sequoia.h>
#include <arm32/shark/fiq.h>
#endif
#include <arm32/isa/isa_machdep.h>
#include <arm32/shark/sequoia.h>
#include <arm32/shark/fiq.h>
#include <machine/cpufunc.h>
@ -126,7 +126,6 @@
*/
static bus_space_handle_t sequoia_ioh;
static int ledState; /* state of the biled */
static struct timeval ledLastActive; /* last time we get net activity */
static int ledColor; /* present color of led */
static int ledBlockCount;; /* reference count of block calles */

View File

@ -52,7 +52,7 @@
** 27-Jan-1997 Maddy Added additional initial values.
**
** 24-Jan-1997 Maddy Initial Entry.
** $Id: sequoia.h,v 1.1.1.1 1998/05/01 21:08:55 cgd Exp $
** $Id: sequoia.h,v 1.2 1998/05/01 21:14:48 cgd Exp $
*/

View File

@ -127,8 +127,10 @@ extern void pmap_debug __P((int level));
#ifdef DDB
extern void db_machine_init __P((void));
#endif
extern char *strstr __P((char *s1, char *s2));
extern u_long strtoul __P((const char *s, char **ptr, int base));
int ofbus_match __P((struct device *, struct cfdata *, void *));
void ofbus_attach __P((struct device *, struct device *, void *));
/*
* Exported variables
@ -147,6 +149,20 @@ vm_offset_t cache_clean_vms[2] = {0, 0}; /* vms = plural of vm, not VMS! :-) */
int ofw_handleticks = 0; /* set to TRUE by cpu_initclocks */
/*
* Address to call from cpu_reset() to reset the machine.
* This is machine architecture dependant as it varies depending
* on where the ROM appears when you turn the MMU off.
*
* XXX not actually _used_ on shark!
*/
u_int cpu_reset_address = 0;
struct cfattach ofbus_root_ca = {
sizeof(struct device), ofbus_match, ofbus_attach
};
/*
* Exported routines
@ -351,7 +367,7 @@ void
process_kernel_args(void)
{
#ifdef BOOT_QUIETLY
#if defined(RB_QUIET) && defined(BOOT_QUIETLY)
boothowto |= RB_QUIET;
#endif
@ -391,31 +407,31 @@ process_kernel_args(void)
{
char *args = boot_args, *ptr;
if (ptr = strstr(args, "nocache")) {
if ((ptr = strstr(args, "nocache")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[7] == ' ' || ptr[7] == '\0'))
cpu_cache &= ~1;
}
if (ptr = strstr(args, "nowritebuf")) {
if ((ptr = strstr(args, "nowritebuf")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[10] == ' ' || ptr[10] == '\0'))
cpu_cache &= ~2;
}
if (ptr = strstr(args, "fpaclk2")) {
if ((ptr = strstr(args, "fpaclk2")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[7] == ' ' || ptr[7] == '\0'))
cpu_cache |= 4;
}
if (ptr = strstr(args, "icache")) {
if ((ptr = strstr(args, "icache")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[6] == ' ' || ptr[6] == '\0'))
cpu_cache |= 8;
}
if (ptr = strstr(args, "dcache")) {
if ((ptr = strstr(args, "dcache")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[6] == ' ' || ptr[6] == '\0'))
cpu_cache |= 16;
@ -445,13 +461,13 @@ process_kernel_args(void)
}
#endif
if (ptr = strstr(args, "single")) {
if ((ptr = strstr(args, "single")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[6] == ' ' || ptr[6] == '\0'))
boothowto |= RB_SINGLE;
}
if (ptr = strstr(args, "kdb")) {
if ((ptr = strstr(args, "kdb")) != NULL) {
if((ptr > boot_args || ptr[-1] == ' ') &&
(ptr[3] == ' ' || ptr[3] == '\0'))
boothowto |= RB_KDB;
@ -470,10 +486,12 @@ process_kernel_args(void)
if (ptr && (ptr > boot_args || ptr[-1] == ' '))
bufpages = (int)strtoul(ptr + 5, NULL, 10);
#ifdef RB_QUIET
if (strstr(args, "noquiet"))
boothowto &= ~RB_QUIET;
else if (strstr(args, "quiet"))
boothowto |= RB_QUIET;
#endif
}
/* Check for ofwgencfg-specific args. */
@ -492,11 +510,12 @@ void
ofrootfound(void)
{
int node;
struct ofprobe probe;
struct ofbus_attach_args aa;
if (!(node = OF_peer(0)))
panic("No OFW root");
probe.phandle = node;
if (!config_rootfound("ofroot", &probe))
panic("ofroot not configured");
aa.oba_busname = "ofw";
aa.oba_phandle = node;
if (!config_rootfound("ofbus", &aa))
panic("ofw root ofbus not configured");
}