ANSIfy KNF.
This commit is contained in:
parent
d4a4f7bbb8
commit
b3f7b11fe7
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcic_shb.c,v 1.4 2000/09/01 10:43:33 tsubai Exp $ */
|
||||
/* $NetBSD: pcic_shb.c,v 1.5 2002/02/12 15:26:45 uch Exp $ */
|
||||
|
||||
#define PCICSHBDEBUG
|
||||
|
||||
|
@ -80,12 +80,12 @@ int pcicshb_debug = 1 /* XXX */ ;
|
|||
#define DPRINTF(arg)
|
||||
#endif
|
||||
|
||||
int pcic_shb_probe __P((struct device *, struct cfdata *, void *));
|
||||
void pcic_shb_attach __P((struct device *, struct device *, void *));
|
||||
int pcic_shb_probe(struct device *, struct cfdata *, void *);
|
||||
void pcic_shb_attach(struct device *, struct device *, void *);
|
||||
|
||||
void *pcic_shb_chip_intr_establish __P((pcmcia_chipset_handle_t,
|
||||
struct pcmcia_function *, int, int (*) (void *), void *));
|
||||
void pcic_shb_chip_intr_disestablish __P((pcmcia_chipset_handle_t, void *));
|
||||
void *pcic_shb_chip_intr_establish(pcmcia_chipset_handle_t,
|
||||
struct pcmcia_function *, int, int (*) (void *), void *);
|
||||
void pcic_shb_chip_intr_disestablish(pcmcia_chipset_handle_t, void *);
|
||||
|
||||
struct cfattach pcic_shb_ca = {
|
||||
sizeof(struct shpcic_softc),
|
||||
|
@ -112,10 +112,7 @@ static struct pcmcia_chip_functions pcic_shb_functions = {
|
|||
};
|
||||
|
||||
int
|
||||
pcic_shb_probe(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
pcic_shb_probe(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct shb_attach_args *ia = aux;
|
||||
#if 0
|
||||
|
@ -187,9 +184,7 @@ pcic_shb_probe(parent, match, aux)
|
|||
}
|
||||
|
||||
void
|
||||
pcic_shb_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
pcic_shb_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct shpcic_softc *sc = (void *) self;
|
||||
struct shb_attach_args *ia = aux;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcic_shbsubr.c,v 1.3 2000/06/29 07:44:02 mrg Exp $ */
|
||||
/* $NetBSD: pcic_shbsubr.c,v 1.4 2002/02/12 15:26:45 uch Exp $ */
|
||||
|
||||
#define SHPCICSUBRDEBUG
|
||||
|
||||
|
@ -115,12 +115,8 @@ int shpcicsubr_debug = 0 /* XXX */ ;
|
|||
#define DPRINTF(arg)
|
||||
#endif
|
||||
|
||||
void pcic_shb_bus_width_probe (sc, iot, ioh, base, length)
|
||||
struct shpcic_softc *sc;
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
bus_addr_t base;
|
||||
u_int32_t length;
|
||||
void pcic_shb_bus_width_probe (struct shpcic_softc *sc, bus_space_tag_t iot,
|
||||
bus_space_handle_t ioh, bus_addr_t base, u_int32_t length)
|
||||
{
|
||||
#if 0
|
||||
bus_space_handle_t ioh_high;
|
||||
|
@ -220,7 +216,7 @@ pcic_shb_chip_intr_establish(pch, pf, ipl, fct, arg)
|
|||
pcmcia_chipset_handle_t pch;
|
||||
struct pcmcia_function *pf;
|
||||
int ipl;
|
||||
int (*fct) __P((void *));
|
||||
int (*fct)(void *);
|
||||
void *arg;
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
@ -265,9 +261,7 @@ pcic_shb_chip_intr_establish(pch, pf, ipl, fct, arg)
|
|||
}
|
||||
|
||||
void
|
||||
pcic_shb_chip_intr_disestablish(pch, ih)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
void *ih;
|
||||
pcic_shb_chip_intr_disestablish(pcmcia_chipset_handle_t pch, void *ih)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sci.c,v 1.17 2002/02/01 17:52:56 uch Exp $ */
|
||||
/* $NetBSD: sci.c,v 1.18 2002/02/12 15:26:46 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
|
||||
|
@ -126,15 +126,15 @@
|
|||
|
||||
#include <machine/shbvar.h>
|
||||
|
||||
static void scistart __P((struct tty *));
|
||||
static int sciparam __P((struct tty *, struct termios *));
|
||||
static void scistart(struct tty *);
|
||||
static int sciparam(struct tty *, struct termios *);
|
||||
|
||||
void scicnprobe __P((struct consdev *));
|
||||
void scicninit __P((struct consdev *));
|
||||
void scicnputc __P((dev_t, int));
|
||||
int scicngetc __P((dev_t));
|
||||
void scicnpoolc __P((dev_t, int));
|
||||
int sciintr __P((void *));
|
||||
void scicnprobe(struct consdev *);
|
||||
void scicninit(struct consdev *);
|
||||
void scicnputc(dev_t, int);
|
||||
int scicngetc(dev_t);
|
||||
void scicnpoolc(dev_t, int);
|
||||
int sciintr(void *);
|
||||
|
||||
struct sci_softc {
|
||||
struct device sc_dev; /* boilerplate */
|
||||
|
@ -189,27 +189,27 @@ struct sci_softc {
|
|||
};
|
||||
|
||||
/* controller driver configuration */
|
||||
static int sci_match __P((struct device *, struct cfdata *, void *));
|
||||
static void sci_attach __P((struct device *, struct device *, void *));
|
||||
static int sci_match(struct device *, struct cfdata *, void *);
|
||||
static void sci_attach(struct device *, struct device *, void *);
|
||||
|
||||
void sci_break __P((struct sci_softc *, int));
|
||||
void sci_iflush __P((struct sci_softc *));
|
||||
void sci_break(struct sci_softc *, int);
|
||||
void sci_iflush(struct sci_softc *);
|
||||
|
||||
#define integrate static inline
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void scisoft __P((void *));
|
||||
void scisoft(void *);
|
||||
#else
|
||||
#ifndef __NO_SOFT_SERIAL_INTERRUPT
|
||||
void scisoft __P((void));
|
||||
void scisoft(void);
|
||||
#else
|
||||
void scisoft __P((void *));
|
||||
void scisoft(void *);
|
||||
#endif
|
||||
#endif
|
||||
integrate void sci_rxsoft __P((struct sci_softc *, struct tty *));
|
||||
integrate void sci_txsoft __P((struct sci_softc *, struct tty *));
|
||||
integrate void sci_stsoft __P((struct sci_softc *, struct tty *));
|
||||
integrate void sci_schedrx __P((struct sci_softc *));
|
||||
void scidiag __P((void *));
|
||||
integrate void sci_rxsoft(struct sci_softc *, struct tty *);
|
||||
integrate void sci_txsoft(struct sci_softc *, struct tty *);
|
||||
integrate void sci_stsoft(struct sci_softc *, struct tty *);
|
||||
integrate void sci_schedrx(struct sci_softc *);
|
||||
void scidiag(void *);
|
||||
|
||||
#define SCIUNIT_MASK 0x7ffff
|
||||
#define SCIDIALOUT_MASK 0x80000
|
||||
|
@ -266,7 +266,7 @@ extern struct cfdriver sci_cd;
|
|||
|
||||
cdev_decl(sci);
|
||||
|
||||
void InitializeSci __P((unsigned int));
|
||||
void InitializeSci (unsigned int);
|
||||
|
||||
/*
|
||||
* following functions are debugging prupose only
|
||||
|
@ -275,18 +275,17 @@ void InitializeSci __P((unsigned int));
|
|||
#define I2C_ADRS (*(volatile unsigned int *)0xa8000000)
|
||||
#define USART_ON (unsigned int)~0x08
|
||||
|
||||
static void WaitFor __P((int));
|
||||
void sci_putc __P((unsigned char));
|
||||
unsigned char sci_getc __P((void));
|
||||
int SciErrCheck __P((void));
|
||||
static void WaitFor(int);
|
||||
void sci_putc(unsigned char);
|
||||
unsigned char sci_getc(void);
|
||||
int SciErrCheck(void);
|
||||
|
||||
/*
|
||||
* WaitFor
|
||||
* : int mSec;
|
||||
*/
|
||||
static void
|
||||
WaitFor(mSec)
|
||||
int mSec;
|
||||
WaitFor(int mSec)
|
||||
{
|
||||
|
||||
/* Disable Under Flow interrupt, rising edge, 1/4 */
|
||||
|
@ -313,8 +312,7 @@ WaitFor(mSec)
|
|||
*/
|
||||
|
||||
void
|
||||
InitializeSci(bps)
|
||||
unsigned int bps;
|
||||
InitializeSci(unsigned int bps)
|
||||
{
|
||||
|
||||
/* Initialize SCR */
|
||||
|
@ -349,8 +347,7 @@ InitializeSci(bps)
|
|||
* : unsigned char c;
|
||||
*/
|
||||
void
|
||||
sci_putc(c)
|
||||
unsigned char c;
|
||||
sci_putc(unsigned char c)
|
||||
{
|
||||
|
||||
if (c == '\n')
|
||||
|
@ -411,10 +408,7 @@ sci_getc(void)
|
|||
|
||||
|
||||
static int
|
||||
sci_match(parent, cfp, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cfp;
|
||||
void *aux;
|
||||
sci_match(struct device *parent, struct cfdata *cfp, void *aux)
|
||||
{
|
||||
struct shb_attach_args *sa = aux;
|
||||
|
||||
|
@ -427,9 +421,7 @@ sci_match(parent, cfp, aux)
|
|||
}
|
||||
|
||||
static void
|
||||
sci_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
sci_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct sci_softc *sc = (struct sci_softc *)self;
|
||||
struct tty *tp;
|
||||
|
@ -488,8 +480,7 @@ sci_attach(parent, self, aux)
|
|||
* Start or restart transmission.
|
||||
*/
|
||||
static void
|
||||
scistart(tp)
|
||||
struct tty *tp;
|
||||
scistart(struct tty *tp)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(tp->t_dev)];
|
||||
int s;
|
||||
|
@ -549,9 +540,7 @@ out:
|
|||
* making sure all the changes could be done.
|
||||
*/
|
||||
static int
|
||||
sciparam(tp, t)
|
||||
struct tty *tp;
|
||||
struct termios *t;
|
||||
sciparam(struct tty *tp, struct termios *t)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(tp->t_dev)];
|
||||
int ospeed = t->c_ospeed;
|
||||
|
@ -662,8 +651,7 @@ sciparam(tp, t)
|
|||
}
|
||||
|
||||
void
|
||||
sci_iflush(sc)
|
||||
struct sci_softc *sc;
|
||||
sci_iflush(struct sci_softc *sc)
|
||||
{
|
||||
unsigned char err_c;
|
||||
volatile unsigned char c;
|
||||
|
@ -683,10 +671,7 @@ sci_iflush(sc)
|
|||
}
|
||||
|
||||
int
|
||||
sciopen(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
sciopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
int unit = SCIUNIT(dev);
|
||||
struct sci_softc *sc;
|
||||
|
@ -801,10 +786,7 @@ bad:
|
|||
}
|
||||
|
||||
int
|
||||
sciclose(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
sciclose(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -823,10 +805,7 @@ sciclose(dev, flag, mode, p)
|
|||
}
|
||||
|
||||
int
|
||||
sciread(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
sciread(dev_t dev, struct uio *uio, int flag)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -835,10 +814,7 @@ sciread(dev, uio, flag)
|
|||
}
|
||||
|
||||
int
|
||||
sciwrite(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
sciwrite(dev_t dev, struct uio *uio, int flag)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -847,10 +823,7 @@ sciwrite(dev, uio, flag)
|
|||
}
|
||||
|
||||
int
|
||||
scipoll(dev, events, p)
|
||||
dev_t dev;
|
||||
int events;
|
||||
struct proc *p;
|
||||
scipoll(dev_t dev, int events, struct proc *p)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -859,8 +832,7 @@ scipoll(dev, events, p)
|
|||
}
|
||||
|
||||
struct tty *
|
||||
scitty(dev)
|
||||
dev_t dev;
|
||||
scitty(dev_t dev)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -869,12 +841,7 @@ scitty(dev)
|
|||
}
|
||||
|
||||
int
|
||||
sciioctl(dev, cmd, data, flag, p)
|
||||
dev_t dev;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
sciioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -927,8 +894,7 @@ sciioctl(dev, cmd, data, flag, p)
|
|||
}
|
||||
|
||||
integrate void
|
||||
sci_schedrx(sc)
|
||||
struct sci_softc *sc;
|
||||
sci_schedrx(struct sci_softc *sc)
|
||||
{
|
||||
|
||||
sc->sc_rx_ready = 1;
|
||||
|
@ -949,9 +915,7 @@ sci_schedrx(sc)
|
|||
}
|
||||
|
||||
void
|
||||
sci_break(sc, onoff)
|
||||
struct sci_softc *sc;
|
||||
int onoff;
|
||||
sci_break(struct sci_softc *sc, int onoff)
|
||||
{
|
||||
|
||||
if (onoff)
|
||||
|
@ -975,9 +939,7 @@ sci_break(sc, onoff)
|
|||
* Stop output, e.g., for ^S or output flush.
|
||||
*/
|
||||
void
|
||||
scistop(tp, flag)
|
||||
struct tty *tp;
|
||||
int flag;
|
||||
scistop(struct tty *tp, int flag)
|
||||
{
|
||||
struct sci_softc *sc = sci_cd.cd_devs[SCIUNIT(tp->t_dev)];
|
||||
int s;
|
||||
|
@ -994,8 +956,7 @@ scistop(tp, flag)
|
|||
}
|
||||
|
||||
void
|
||||
scidiag(arg)
|
||||
void *arg;
|
||||
scidiag(void *arg)
|
||||
{
|
||||
struct sci_softc *sc = arg;
|
||||
int overflows, floods;
|
||||
|
@ -1016,11 +977,9 @@ scidiag(arg)
|
|||
}
|
||||
|
||||
integrate void
|
||||
sci_rxsoft(sc, tp)
|
||||
struct sci_softc *sc;
|
||||
struct tty *tp;
|
||||
sci_rxsoft(struct sci_softc *sc, struct tty *tp)
|
||||
{
|
||||
int (*rint) __P((int c, struct tty *tp)) = tp->t_linesw->l_rint;
|
||||
int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint;
|
||||
u_char *get, *end;
|
||||
u_int cc, scc;
|
||||
u_char ssr;
|
||||
|
@ -1116,9 +1075,7 @@ sci_txsoft(sc, tp)
|
|||
}
|
||||
|
||||
integrate void
|
||||
sci_stsoft(sc, tp)
|
||||
struct sci_softc *sc;
|
||||
struct tty *tp;
|
||||
sci_stsoft(struct sci_softc *sc, struct tty *tp)
|
||||
{
|
||||
#if 0
|
||||
/* XXX (msaitoh) */
|
||||
|
@ -1157,8 +1114,7 @@ sci_stsoft(sc, tp)
|
|||
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void
|
||||
scisoft(arg)
|
||||
void *arg;
|
||||
scisoft(void *arg)
|
||||
{
|
||||
struct sci_softc *sc = arg;
|
||||
struct tty *tp;
|
||||
|
@ -1172,8 +1128,7 @@ void
|
|||
#ifndef __NO_SOFT_SERIAL_INTERRUPT
|
||||
scisoft()
|
||||
#else
|
||||
scisoft(arg)
|
||||
void *arg;
|
||||
scisoft(void *arg)
|
||||
#endif
|
||||
{
|
||||
struct sci_softc *sc;
|
||||
|
@ -1228,8 +1183,7 @@ scisoft(arg)
|
|||
}
|
||||
|
||||
int
|
||||
sciintr(arg)
|
||||
void *arg;
|
||||
sciintr(void *arg)
|
||||
{
|
||||
struct sci_softc *sc = arg;
|
||||
u_char *put, *end;
|
||||
|
@ -1465,8 +1419,7 @@ scicnprobe(cp)
|
|||
}
|
||||
|
||||
void
|
||||
scicninit(cp)
|
||||
struct consdev *cp;
|
||||
scicninit(struct consdev *cp)
|
||||
{
|
||||
|
||||
InitializeSci(scicn_speed);
|
||||
|
@ -1474,8 +1427,7 @@ scicninit(cp)
|
|||
}
|
||||
|
||||
int
|
||||
scicngetc(dev)
|
||||
dev_t dev;
|
||||
scicngetc(dev_t dev)
|
||||
{
|
||||
int c;
|
||||
int s;
|
||||
|
@ -1488,9 +1440,7 @@ scicngetc(dev)
|
|||
}
|
||||
|
||||
void
|
||||
scicnputc(dev, c)
|
||||
dev_t dev;
|
||||
int c;
|
||||
scicnputc(dev_t dev, int c)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: scif.c,v 1.19 2002/02/01 17:52:56 uch Exp $ */
|
||||
/* $NetBSD: scif.c,v 1.20 2002/02/12 15:26:46 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved.
|
||||
|
@ -126,16 +126,16 @@
|
|||
|
||||
#include <machine/shbvar.h>
|
||||
|
||||
static void scifstart __P((struct tty *));
|
||||
static int scifparam __P((struct tty *, struct termios *));
|
||||
static void scifstart(struct tty *);
|
||||
static int scifparam(struct tty *, struct termios *);
|
||||
|
||||
void scifcnprobe __P((struct consdev *));
|
||||
void scifcninit __P((struct consdev *));
|
||||
void scifcnputc __P((dev_t, int));
|
||||
int scifcngetc __P((dev_t));
|
||||
void scifcnpoolc __P((dev_t, int));
|
||||
void scif_intr_init __P((void));
|
||||
int scifintr __P((void *));
|
||||
void scifcnprobe(struct consdev *);
|
||||
void scifcninit(struct consdev *);
|
||||
void scifcnputc(dev_t, int);
|
||||
int scifcngetc(dev_t);
|
||||
void scifcnpoolc(dev_t, int);
|
||||
void scif_intr_init(void);
|
||||
int scifintr(void *);
|
||||
|
||||
struct scif_softc {
|
||||
struct device sc_dev; /* boilerplate */
|
||||
|
@ -190,27 +190,27 @@ struct scif_softc {
|
|||
};
|
||||
|
||||
/* controller driver configuration */
|
||||
static int scif_match __P((struct device *, struct cfdata *, void *));
|
||||
static void scif_attach __P((struct device *, struct device *, void *));
|
||||
static int scif_match(struct device *, struct cfdata *, void *);
|
||||
static void scif_attach(struct device *, struct device *, void *);
|
||||
|
||||
void scif_break __P((struct scif_softc *, int));
|
||||
void scif_iflush __P((struct scif_softc *));
|
||||
void scif_break(struct scif_softc *, int);
|
||||
void scif_iflush(struct scif_softc *);
|
||||
|
||||
#define integrate static inline
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void scifsoft __P((void *));
|
||||
void scifsoft(void *);
|
||||
#else
|
||||
#ifndef __NO_SOFT_SERIAL_INTERRUPT
|
||||
void scifsoft __P((void));
|
||||
void scifsoft(void);
|
||||
#else
|
||||
void scifsoft __P((void *));
|
||||
void scifsoft(void *);
|
||||
#endif
|
||||
#endif
|
||||
integrate void scif_rxsoft __P((struct scif_softc *, struct tty *));
|
||||
integrate void scif_txsoft __P((struct scif_softc *, struct tty *));
|
||||
integrate void scif_stsoft __P((struct scif_softc *, struct tty *));
|
||||
integrate void scif_schedrx __P((struct scif_softc *));
|
||||
void scifdiag __P((void *));
|
||||
integrate void scif_rxsoft(struct scif_softc *, struct tty *);
|
||||
integrate void scif_txsoft(struct scif_softc *, struct tty *);
|
||||
integrate void scif_stsoft(struct scif_softc *, struct tty *);
|
||||
integrate void scif_schedrx(struct scif_softc *);
|
||||
void scifdiag(void *);
|
||||
|
||||
|
||||
#define SCIFUNIT_MASK 0x7ffff
|
||||
|
@ -268,7 +268,7 @@ extern struct cfdriver scif_cd;
|
|||
|
||||
cdev_decl(scif);
|
||||
|
||||
void InitializeScif __P((unsigned int));
|
||||
void InitializeScif (unsigned int);
|
||||
|
||||
/*
|
||||
* following functions are debugging prupose only
|
||||
|
@ -276,18 +276,17 @@ void InitializeScif __P((unsigned int));
|
|||
#define CR 0x0D
|
||||
#define USART_ON (unsigned int)~0x08
|
||||
|
||||
static void WaitFor __P((int));
|
||||
void scif_putc __P((unsigned char));
|
||||
unsigned char scif_getc __P((void));
|
||||
int ScifErrCheck __P((void));
|
||||
static void WaitFor(int);
|
||||
void scif_putc(unsigned char);
|
||||
unsigned char scif_getc(void);
|
||||
int ScifErrCheck(void);
|
||||
|
||||
/*
|
||||
* WaitFor
|
||||
* : int mSec;
|
||||
*/
|
||||
static void
|
||||
WaitFor(mSec)
|
||||
int mSec;
|
||||
WaitFor(int mSec)
|
||||
{
|
||||
|
||||
/* Disable Under Flow interrupt, rising edge, 1/4 */
|
||||
|
@ -314,8 +313,7 @@ WaitFor(mSec)
|
|||
*/
|
||||
|
||||
void
|
||||
InitializeScif(bps)
|
||||
unsigned int bps;
|
||||
InitializeScif(unsigned int bps)
|
||||
{
|
||||
|
||||
/* Initialize SCR */
|
||||
|
@ -358,8 +356,7 @@ InitializeScif(bps)
|
|||
*/
|
||||
|
||||
void
|
||||
scif_putc(c)
|
||||
unsigned char c;
|
||||
scif_putc(unsigned char c)
|
||||
{
|
||||
|
||||
if (c == '\n')
|
||||
|
@ -445,10 +442,7 @@ scif_getc(void)
|
|||
|
||||
|
||||
static int
|
||||
scif_match(parent, cfp, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cfp;
|
||||
void *aux;
|
||||
scif_match(struct device *parent, struct cfdata *cfp, void *aux)
|
||||
{
|
||||
struct shb_attach_args *sa = aux;
|
||||
|
||||
|
@ -461,9 +455,7 @@ scif_match(parent, cfp, aux)
|
|||
}
|
||||
|
||||
static void
|
||||
scif_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
scif_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct scif_softc *sc = (struct scif_softc *)self;
|
||||
struct tty *tp;
|
||||
|
@ -523,8 +515,7 @@ scif_attach(parent, self, aux)
|
|||
* Start or restart transmission.
|
||||
*/
|
||||
static void
|
||||
scifstart(tp)
|
||||
struct tty *tp;
|
||||
scifstart(struct tty *tp)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(tp->t_dev)];
|
||||
int s;
|
||||
|
@ -593,9 +584,7 @@ out:
|
|||
* making sure all the changes could be done.
|
||||
*/
|
||||
static int
|
||||
scifparam(tp, t)
|
||||
struct tty *tp;
|
||||
struct termios *t;
|
||||
scifparam(struct tty *tp, struct termios *t)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(tp->t_dev)];
|
||||
int ospeed = t->c_ospeed;
|
||||
|
@ -718,8 +707,7 @@ scifparam(tp, t)
|
|||
}
|
||||
|
||||
void
|
||||
scif_iflush(sc)
|
||||
struct scif_softc *sc;
|
||||
scif_iflush(struct scif_softc *sc)
|
||||
{
|
||||
int i;
|
||||
unsigned char c;
|
||||
|
@ -734,10 +722,7 @@ scif_iflush(sc)
|
|||
}
|
||||
|
||||
int
|
||||
scifopen(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
scifopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
int unit = SCIFUNIT(dev);
|
||||
struct scif_softc *sc;
|
||||
|
@ -852,10 +837,7 @@ bad:
|
|||
}
|
||||
|
||||
int
|
||||
scifclose(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
scifclose(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -874,10 +856,7 @@ scifclose(dev, flag, mode, p)
|
|||
}
|
||||
|
||||
int
|
||||
scifread(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
scifread(dev_t dev, struct uio *uio, int flag)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -886,10 +865,7 @@ scifread(dev, uio, flag)
|
|||
}
|
||||
|
||||
int
|
||||
scifwrite(dev, uio, flag)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flag;
|
||||
scifwrite(dev_t dev, struct uio *uio, int flag)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -898,10 +874,7 @@ scifwrite(dev, uio, flag)
|
|||
}
|
||||
|
||||
int
|
||||
scifpoll(dev, events, p)
|
||||
dev_t dev;
|
||||
int events;
|
||||
struct proc *p;
|
||||
scifpoll(dev_t dev, int events, struct proc *p)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -910,8 +883,7 @@ scifpoll(dev, events, p)
|
|||
}
|
||||
|
||||
struct tty *
|
||||
sciftty(dev)
|
||||
dev_t dev;
|
||||
sciftty(dev_t dev)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -920,12 +892,7 @@ sciftty(dev)
|
|||
}
|
||||
|
||||
int
|
||||
scifioctl(dev, cmd, data, flag, p)
|
||||
dev_t dev;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
scifioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
@ -978,8 +945,7 @@ scifioctl(dev, cmd, data, flag, p)
|
|||
}
|
||||
|
||||
integrate void
|
||||
scif_schedrx(sc)
|
||||
struct scif_softc *sc;
|
||||
scif_schedrx(struct scif_softc *sc)
|
||||
{
|
||||
|
||||
sc->sc_rx_ready = 1;
|
||||
|
@ -1000,9 +966,7 @@ scif_schedrx(sc)
|
|||
}
|
||||
|
||||
void
|
||||
scif_break(sc, onoff)
|
||||
struct scif_softc *sc;
|
||||
int onoff;
|
||||
scif_break(struct scif_softc *sc, int onoff)
|
||||
{
|
||||
|
||||
if (onoff)
|
||||
|
@ -1026,9 +990,7 @@ scif_break(sc, onoff)
|
|||
* Stop output, e.g., for ^S or output flush.
|
||||
*/
|
||||
void
|
||||
scifstop(tp, flag)
|
||||
struct tty *tp;
|
||||
int flag;
|
||||
scifstop(struct tty *tp, int flag)
|
||||
{
|
||||
struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(tp->t_dev)];
|
||||
int s;
|
||||
|
@ -1051,8 +1013,7 @@ scif_intr_init()
|
|||
}
|
||||
|
||||
void
|
||||
scifdiag(arg)
|
||||
void *arg;
|
||||
scifdiag(void *arg)
|
||||
{
|
||||
struct scif_softc *sc = arg;
|
||||
int overflows, floods;
|
||||
|
@ -1073,11 +1034,9 @@ scifdiag(arg)
|
|||
}
|
||||
|
||||
integrate void
|
||||
scif_rxsoft(sc, tp)
|
||||
struct scif_softc *sc;
|
||||
struct tty *tp;
|
||||
scif_rxsoft(struct scif_softc *sc, struct tty *tp)
|
||||
{
|
||||
int (*rint) __P((int c, struct tty *tp)) = tp->t_linesw->l_rint;
|
||||
int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint;
|
||||
u_char *get, *end;
|
||||
u_int cc, scc;
|
||||
u_char ssr2;
|
||||
|
@ -1159,9 +1118,7 @@ scif_rxsoft(sc, tp)
|
|||
}
|
||||
|
||||
integrate void
|
||||
scif_txsoft(sc, tp)
|
||||
struct scif_softc *sc;
|
||||
struct tty *tp;
|
||||
scif_txsoft(struct scif_softc *sc, struct tty *tp)
|
||||
{
|
||||
|
||||
CLR(tp->t_state, TS_BUSY);
|
||||
|
@ -1173,9 +1130,7 @@ scif_txsoft(sc, tp)
|
|||
}
|
||||
|
||||
integrate void
|
||||
scif_stsoft(sc, tp)
|
||||
struct scif_softc *sc;
|
||||
struct tty *tp;
|
||||
scif_stsoft(struct scif_softc *sc, struct tty *tp)
|
||||
{
|
||||
#if 0
|
||||
/* XXX (msaitoh) */
|
||||
|
@ -1214,8 +1169,7 @@ scif_stsoft(sc, tp)
|
|||
|
||||
#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
void
|
||||
scifsoft(arg)
|
||||
void *arg;
|
||||
scifsoft(void *arg)
|
||||
{
|
||||
struct scif_softc *sc = arg;
|
||||
struct tty *tp;
|
||||
|
@ -1229,8 +1183,7 @@ void
|
|||
#ifndef __NO_SOFT_SERIAL_INTERRUPT
|
||||
scifsoft()
|
||||
#else
|
||||
scifsoft(arg)
|
||||
void *arg;
|
||||
scifsoft(void *arg)
|
||||
#endif
|
||||
{
|
||||
struct scif_softc *sc;
|
||||
|
@ -1285,8 +1238,7 @@ scifsoft(arg)
|
|||
}
|
||||
|
||||
int
|
||||
scifintr(arg)
|
||||
void *arg;
|
||||
scifintr(void *arg)
|
||||
{
|
||||
struct scif_softc *sc = arg;
|
||||
u_char *put, *end;
|
||||
|
@ -1503,15 +1455,14 @@ scifintr(arg)
|
|||
#endif
|
||||
|
||||
#if NRND > 0 && defined(RND_SCIF)
|
||||
rnd_add_uint32(&sc->rnd_source, iir | lsr);
|
||||
rnd_add_uint32(&sc->rnd_source, iir | lsr);
|
||||
#endif
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
scifcnprobe(cp)
|
||||
struct consdev *cp;
|
||||
scifcnprobe(struct consdev *cp)
|
||||
{
|
||||
int maj;
|
||||
|
||||
|
@ -1530,8 +1481,7 @@ scifcnprobe(cp)
|
|||
}
|
||||
|
||||
void
|
||||
scifcninit(cp)
|
||||
struct consdev *cp;
|
||||
scifcninit(struct consdev *cp)
|
||||
{
|
||||
|
||||
InitializeScif(scifcn_speed);
|
||||
|
@ -1539,8 +1489,7 @@ scifcninit(cp)
|
|||
}
|
||||
|
||||
int
|
||||
scifcngetc(dev)
|
||||
dev_t dev;
|
||||
scifcngetc(dev_t dev)
|
||||
{
|
||||
int c;
|
||||
int s;
|
||||
|
@ -1553,9 +1502,7 @@ scifcngetc(dev)
|
|||
}
|
||||
|
||||
void
|
||||
scifcnputc(dev, c)
|
||||
dev_t dev;
|
||||
int c;
|
||||
scifcnputc(dev_t dev, int c)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: shpcic.c,v 1.5 2001/12/15 13:23:21 soren Exp $ */
|
||||
/* $NetBSD: shpcic.c,v 1.6 2002/02/12 15:26:46 uch Exp $ */
|
||||
|
||||
#define SHPCICDEBUG
|
||||
|
||||
|
@ -70,30 +70,29 @@ int shpcic_debug = 0;
|
|||
|
||||
#define SHPCIC_MEM_ALIGN SHPCIC_MEM_PAGESIZE
|
||||
|
||||
void shpcic_attach_socket __P((struct shpcic_handle *));
|
||||
void shpcic_init_socket __P((struct shpcic_handle *));
|
||||
void shpcic_attach_socket(struct shpcic_handle *);
|
||||
void shpcic_init_socket(struct shpcic_handle *);
|
||||
|
||||
int shpcic_submatch __P((struct device *, struct cfdata *, void *));
|
||||
int shpcic_print __P((void *arg, const char *pnp));
|
||||
int shpcic_intr_socket __P((struct shpcic_handle *));
|
||||
int shpcic_submatch(struct device *, struct cfdata *, void *);
|
||||
int shpcic_print (void *, const char *);
|
||||
int shpcic_intr_socket(struct shpcic_handle *);
|
||||
|
||||
void shpcic_attach_card __P((struct shpcic_handle *));
|
||||
void shpcic_detach_card __P((struct shpcic_handle *, int));
|
||||
void shpcic_deactivate_card __P((struct shpcic_handle *));
|
||||
void shpcic_attach_card(struct shpcic_handle *);
|
||||
void shpcic_detach_card(struct shpcic_handle *, int);
|
||||
void shpcic_deactivate_card(struct shpcic_handle *);
|
||||
|
||||
void shpcic_chip_do_mem_map __P((struct shpcic_handle *, int));
|
||||
void shpcic_chip_do_io_map __P((struct shpcic_handle *, int));
|
||||
void shpcic_chip_do_mem_map(struct shpcic_handle *, int);
|
||||
void shpcic_chip_do_io_map(struct shpcic_handle *, int);
|
||||
|
||||
void shpcic_create_event_thread __P((void *));
|
||||
void shpcic_event_thread __P((void *));
|
||||
void shpcic_create_event_thread(void *);
|
||||
void shpcic_event_thread(void *);
|
||||
|
||||
void shpcic_queue_event __P((struct shpcic_handle *, int));
|
||||
void shpcic_queue_event(struct shpcic_handle *, int);
|
||||
|
||||
/* static void shpcic_wait_ready __P((struct shpcic_handle *)); */
|
||||
/* static void shpcic_wait_ready(struct shpcic_handle *); */
|
||||
|
||||
int
|
||||
shpcic_ident_ok(ident)
|
||||
int ident;
|
||||
shpcic_ident_ok(int ident)
|
||||
{
|
||||
/* this is very empirical and heuristic */
|
||||
|
||||
|
@ -111,16 +110,16 @@ shpcic_ident_ok(ident)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_vendor(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_vendor(struct shpcic_handle *h)
|
||||
{
|
||||
|
||||
return (PCIC_VENDOR_HITACHI);
|
||||
}
|
||||
|
||||
char *
|
||||
shpcic_vendor_to_string(vendor)
|
||||
int vendor;
|
||||
shpcic_vendor_to_string(int vendor)
|
||||
{
|
||||
|
||||
switch (vendor) {
|
||||
case PCIC_VENDOR_HITACHI:
|
||||
return ("Hitachi SH");
|
||||
|
@ -130,8 +129,7 @@ shpcic_vendor_to_string(vendor)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_attach(sc)
|
||||
struct shpcic_softc *sc;
|
||||
shpcic_attach(struct shpcic_softc *sc)
|
||||
{
|
||||
int vendor, count, i;
|
||||
|
||||
|
@ -215,8 +213,7 @@ shpcic_attach(sc)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_attach_sockets(sc)
|
||||
struct shpcic_softc *sc;
|
||||
shpcic_attach_sockets(struct shpcic_softc *sc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -226,8 +223,7 @@ shpcic_attach_sockets(sc)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_attach_socket(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_attach_socket(struct shpcic_handle *h)
|
||||
{
|
||||
struct pcmciabus_attach_args paa;
|
||||
|
||||
|
@ -256,8 +252,7 @@ shpcic_attach_socket(h)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_create_event_thread(arg)
|
||||
void *arg;
|
||||
shpcic_create_event_thread(void *arg)
|
||||
{
|
||||
struct shpcic_handle *h = arg;
|
||||
const char *cs;
|
||||
|
@ -288,8 +283,7 @@ shpcic_create_event_thread(arg)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_event_thread(arg)
|
||||
void *arg;
|
||||
shpcic_event_thread(void *arg)
|
||||
{
|
||||
struct shpcic_handle *h = arg;
|
||||
struct shpcic_event *pe;
|
||||
|
@ -375,8 +369,7 @@ shpcic_event_thread(arg)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_init_socket(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_init_socket(struct shpcic_handle *h)
|
||||
{
|
||||
int reg;
|
||||
|
||||
|
@ -414,10 +407,7 @@ shpcic_init_socket(h)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_submatch(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
shpcic_submatch(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
|
||||
struct pcmciabus_attach_args *paa = aux;
|
||||
|
@ -480,9 +470,7 @@ shpcic_submatch(parent, cf, aux)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_print(arg, pnp)
|
||||
void *arg;
|
||||
const char *pnp;
|
||||
shpcic_print(void *arg, const char *pnp)
|
||||
{
|
||||
struct pcmciabus_attach_args *paa = arg;
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) paa->pch;
|
||||
|
@ -512,8 +500,7 @@ shpcic_print(arg, pnp)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_intr(arg)
|
||||
void *arg;
|
||||
shpcic_intr(void *arg)
|
||||
{
|
||||
struct shpcic_softc *sc = arg;
|
||||
int i, ret = 0;
|
||||
|
@ -528,8 +515,7 @@ shpcic_intr(arg)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_intr_socket(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_intr_socket(struct shpcic_handle *h)
|
||||
{
|
||||
int cscreg;
|
||||
|
||||
|
@ -589,9 +575,7 @@ shpcic_intr_socket(h)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_queue_event(h, event)
|
||||
struct shpcic_handle *h;
|
||||
int event;
|
||||
shpcic_queue_event(struct shpcic_handle *h, int event)
|
||||
{
|
||||
struct shpcic_event *pe;
|
||||
int s;
|
||||
|
@ -608,8 +592,7 @@ shpcic_queue_event(h, event)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_attach_card(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_attach_card(struct shpcic_handle *h)
|
||||
{
|
||||
|
||||
if (!(h->flags & SHPCIC_FLAG_CARDP)) {
|
||||
|
@ -623,9 +606,7 @@ shpcic_attach_card(h)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_detach_card(h, flags)
|
||||
struct shpcic_handle *h;
|
||||
int flags; /* DETACH_* */
|
||||
shpcic_detach_card(struct shpcic_handle *h, int flags)
|
||||
{
|
||||
|
||||
if (h->flags & SHPCIC_FLAG_CARDP) {
|
||||
|
@ -639,8 +620,7 @@ shpcic_detach_card(h, flags)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_deactivate_card(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_deactivate_card(struct shpcic_handle *h)
|
||||
{
|
||||
|
||||
/* call the MI deactivate function */
|
||||
|
@ -656,10 +636,8 @@ shpcic_deactivate_card(h)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_chip_mem_alloc(pch, size, pcmhp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
bus_size_t size;
|
||||
struct pcmcia_mem_handle *pcmhp;
|
||||
shpcic_chip_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size,
|
||||
struct pcmcia_mem_handle *pcmhp)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
bus_space_handle_t memh = 0;
|
||||
|
@ -705,9 +683,8 @@ shpcic_chip_mem_alloc(pch, size, pcmhp)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_chip_mem_free(pch, pcmhp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
struct pcmcia_mem_handle *pcmhp;
|
||||
shpcic_chip_mem_free(pcmcia_chipset_handle_t pch,
|
||||
struct pcmcia_mem_handle *pcmhp)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
||||
|
@ -715,14 +692,9 @@ shpcic_chip_mem_free(pch, pcmhp)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_chip_mem_map(pch, kind, card_addr, size, pcmhp, offsetp, windowp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
int kind;
|
||||
bus_addr_t card_addr;
|
||||
bus_size_t size;
|
||||
struct pcmcia_mem_handle *pcmhp;
|
||||
bus_size_t *offsetp;
|
||||
int *windowp;
|
||||
shpcic_chip_mem_map(pcmcia_chipset_handle_t pch, int kind,
|
||||
bus_addr_t card_addr, bus_size_t size, struct pcmcia_mem_handle *pcmhp,
|
||||
bus_size_t *offsetp, int *windowp)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
bus_addr_t busaddr;
|
||||
|
@ -791,9 +763,7 @@ shpcic_chip_mem_map(pch, kind, card_addr, size, pcmhp, offsetp, windowp)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_chip_mem_unmap(pch, window)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
int window;
|
||||
shpcic_chip_mem_unmap(pcmcia_chipset_handle_t pch, int window)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
||||
|
@ -804,12 +774,8 @@ shpcic_chip_mem_unmap(pch, window)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_chip_io_alloc(pch, start, size, align, pcihp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
bus_addr_t start;
|
||||
bus_size_t size;
|
||||
bus_size_t align;
|
||||
struct pcmcia_io_handle *pcihp;
|
||||
shpcic_chip_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start,
|
||||
bus_size_t size, bus_size_t align, struct pcmcia_io_handle *pcihp)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
bus_space_tag_t iot;
|
||||
|
@ -849,9 +815,8 @@ shpcic_chip_io_alloc(pch, start, size, align, pcihp)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_chip_io_free(pch, pcihp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
struct pcmcia_io_handle *pcihp;
|
||||
shpcic_chip_io_free(pcmcia_chipset_handle_t pch,
|
||||
struct pcmcia_io_handle *pcihp)
|
||||
{
|
||||
bus_space_tag_t iot = pcihp->iot;
|
||||
bus_space_handle_t ioh = pcihp->ioh;
|
||||
|
@ -864,13 +829,8 @@ shpcic_chip_io_free(pch, pcihp)
|
|||
}
|
||||
|
||||
int
|
||||
shpcic_chip_io_map(pch, width, offset, size, pcihp, windowp)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
int width;
|
||||
bus_addr_t offset;
|
||||
bus_size_t size;
|
||||
struct pcmcia_io_handle *pcihp;
|
||||
int *windowp;
|
||||
shpcic_chip_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset,
|
||||
bus_size_t size, struct pcmcia_io_handle *pcihp, int *windowp)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
bus_addr_t ioaddr = pcihp->addr + offset;
|
||||
|
@ -935,9 +895,7 @@ shpcic_chip_io_map(pch, width, offset, size, pcihp, windowp)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_chip_io_unmap(pch, window)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
int window;
|
||||
shpcic_chip_io_unmap(pcmcia_chipset_handle_t pch, int window)
|
||||
{
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
||||
|
@ -949,8 +907,7 @@ shpcic_chip_io_unmap(pch, window)
|
|||
|
||||
#if 0
|
||||
static void
|
||||
shpcic_wait_ready(h)
|
||||
struct shpcic_handle *h;
|
||||
shpcic_wait_ready(struct shpcic_handle *h)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -974,8 +931,7 @@ shpcic_wait_ready(h)
|
|||
#endif
|
||||
|
||||
void
|
||||
shpcic_chip_socket_enable(pch)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
shpcic_chip_socket_enable(pcmcia_chipset_handle_t pch)
|
||||
{
|
||||
#if 0
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
@ -1078,8 +1034,7 @@ shpcic_chip_socket_enable(pch)
|
|||
}
|
||||
|
||||
void
|
||||
shpcic_chip_socket_disable(pch)
|
||||
pcmcia_chipset_handle_t pch;
|
||||
shpcic_chip_socket_disable(pcmcia_chipset_handle_t pch)
|
||||
{
|
||||
#if 0
|
||||
struct shpcic_handle *h = (struct shpcic_handle *) pch;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: shpcicvar.h,v 1.2 2001/12/15 13:23:21 soren Exp $ */
|
||||
/* $NetBSD: shpcicvar.h,v 1.3 2002/02/12 15:26:46 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
|
||||
|
@ -135,41 +135,39 @@ struct shpcic_softc {
|
|||
};
|
||||
|
||||
|
||||
int shpcic_ident_ok __P((int));
|
||||
int shpcic_vendor __P((struct shpcic_handle *));
|
||||
char *shpcic_vendor_to_string __P((int));
|
||||
int shpcic_ident_ok(int);
|
||||
int shpcic_vendor(struct shpcic_handle *);
|
||||
char *shpcic_vendor_to_string(int);
|
||||
|
||||
void shpcic_attach __P((struct shpcic_softc *));
|
||||
void shpcic_attach_sockets __P((struct shpcic_softc *));
|
||||
int shpcic_intr __P((void *arg));
|
||||
void shpcic_attach(struct shpcic_softc *);
|
||||
void shpcic_attach_sockets(struct shpcic_softc *);
|
||||
int shpcic_intr(void *arg);
|
||||
|
||||
static inline int shpcic_read __P((struct shpcic_handle *, int));
|
||||
static inline void shpcic_write __P((struct shpcic_handle *, int, int));
|
||||
static inline int shpcic_read(struct shpcic_handle *, int);
|
||||
static inline void shpcic_write(struct shpcic_handle *, int, int);
|
||||
|
||||
int shpcic_chip_mem_alloc __P((pcmcia_chipset_handle_t, bus_size_t,
|
||||
struct pcmcia_mem_handle *));
|
||||
void shpcic_chip_mem_free __P((pcmcia_chipset_handle_t,
|
||||
struct pcmcia_mem_handle *));
|
||||
int shpcic_chip_mem_map __P((pcmcia_chipset_handle_t, int, bus_addr_t,
|
||||
bus_size_t, struct pcmcia_mem_handle *, bus_size_t *, int *));
|
||||
void shpcic_chip_mem_unmap __P((pcmcia_chipset_handle_t, int));
|
||||
int shpcic_chip_mem_alloc(pcmcia_chipset_handle_t, bus_size_t,
|
||||
struct pcmcia_mem_handle *);
|
||||
void shpcic_chip_mem_free(pcmcia_chipset_handle_t,
|
||||
struct pcmcia_mem_handle *);
|
||||
int shpcic_chip_mem_map(pcmcia_chipset_handle_t, int, bus_addr_t,
|
||||
bus_size_t, struct pcmcia_mem_handle *, bus_size_t *, int *);
|
||||
void shpcic_chip_mem_unmap(pcmcia_chipset_handle_t, int);
|
||||
|
||||
int shpcic_chip_io_alloc __P((pcmcia_chipset_handle_t, bus_addr_t,
|
||||
bus_size_t, bus_size_t, struct pcmcia_io_handle *));
|
||||
void shpcic_chip_io_free __P((pcmcia_chipset_handle_t,
|
||||
struct pcmcia_io_handle *));
|
||||
int shpcic_chip_io_map __P((pcmcia_chipset_handle_t, int, bus_addr_t,
|
||||
bus_size_t, struct pcmcia_io_handle *, int *));
|
||||
void shpcic_chip_io_unmap __P((pcmcia_chipset_handle_t, int));
|
||||
int shpcic_chip_io_alloc(pcmcia_chipset_handle_t, bus_addr_t,
|
||||
bus_size_t, bus_size_t, struct pcmcia_io_handle *);
|
||||
void shpcic_chip_io_free(pcmcia_chipset_handle_t,
|
||||
struct pcmcia_io_handle *);
|
||||
int shpcic_chip_io_map(pcmcia_chipset_handle_t, int, bus_addr_t,
|
||||
bus_size_t, struct pcmcia_io_handle *, int *);
|
||||
void shpcic_chip_io_unmap(pcmcia_chipset_handle_t, int);
|
||||
|
||||
void shpcic_chip_socket_enable __P((pcmcia_chipset_handle_t));
|
||||
void shpcic_chip_socket_disable __P((pcmcia_chipset_handle_t));
|
||||
void shpcic_chip_socket_enable(pcmcia_chipset_handle_t);
|
||||
void shpcic_chip_socket_disable(pcmcia_chipset_handle_t);
|
||||
|
||||
static __inline int shpcic_read __P((struct shpcic_handle *, int));
|
||||
static __inline int shpcic_read(struct shpcic_handle *, int);
|
||||
static __inline int
|
||||
shpcic_read(h, idx)
|
||||
struct shpcic_handle *h;
|
||||
int idx;
|
||||
shpcic_read(struct shpcic_handle *h, int idx)
|
||||
{
|
||||
static int prev_idx = 0;
|
||||
|
||||
|
@ -180,12 +178,9 @@ shpcic_read(h, idx)
|
|||
return (bus_space_read_stream_2(h->sc->iot, h->sc->ioh, idx));
|
||||
}
|
||||
|
||||
static __inline void shpcic_write __P((struct shpcic_handle *, int, int));
|
||||
static __inline void shpcic_write(struct shpcic_handle *, int, int);
|
||||
static __inline void
|
||||
shpcic_write(h, idx, data)
|
||||
struct shpcic_handle *h;
|
||||
int idx;
|
||||
int data;
|
||||
shpcic_write(struct shpcic_handle *h, int idx, int data)
|
||||
{
|
||||
static int prev_idx;
|
||||
if (idx == -1){
|
||||
|
@ -195,8 +190,8 @@ shpcic_write(h, idx, data)
|
|||
bus_space_write_stream_2(h->sc->iot, h->sc->ioh, idx, (data));
|
||||
}
|
||||
|
||||
void *pcic_shb_chip_intr_establish __P((pcmcia_chipset_handle_t,
|
||||
struct pcmcia_function *, int, int (*) (void *), void *));
|
||||
void pcic_shb_chip_intr_disestablish __P((pcmcia_chipset_handle_t, void *));
|
||||
void pcic_shb_bus_width_probe __P((struct shpcic_softc *, bus_space_tag_t,
|
||||
bus_space_handle_t, bus_addr_t, u_int32_t));
|
||||
void *pcic_shb_chip_intr_establish(pcmcia_chipset_handle_t,
|
||||
struct pcmcia_function *, int, int (*) (void *), void *);
|
||||
void pcic_shb_chip_intr_disestablish(pcmcia_chipset_handle_t, void *);
|
||||
void pcic_shb_bus_width_probe(struct shpcic_softc *, bus_space_tag_t,
|
||||
bus_space_handle_t, bus_addr_t, u_int32_t);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wdog.c,v 1.4 2000/10/31 02:04:12 msaitoh Exp $ */
|
||||
/* $NetBSD: wdog.c,v 1.5 2002/02/12 15:26:46 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 2000 SAITOH Masanobu. All rights reserved.
|
||||
|
@ -51,9 +51,9 @@ struct wdog_softc {
|
|||
int flags;
|
||||
};
|
||||
|
||||
static int wdogmatch __P((struct device *, struct cfdata *, void *));
|
||||
static void wdogattach __P((struct device *, struct device *, void *));
|
||||
static int wdogintr __P((void *));
|
||||
static int wdogmatch(struct device *, struct cfdata *, void *);
|
||||
static void wdogattach(struct device *, struct device *, void *);
|
||||
static int wdogintr(void *);
|
||||
|
||||
struct cfattach wdog_ca = {
|
||||
sizeof(struct wdog_softc), wdogmatch, wdogattach
|
||||
|
@ -62,26 +62,21 @@ struct cfattach wdog_ca = {
|
|||
extern struct cfdriver wdog_cd;
|
||||
|
||||
void
|
||||
wdog_wr_cnt(x)
|
||||
unsigned char x;
|
||||
wdog_wr_cnt(unsigned char x)
|
||||
{
|
||||
|
||||
SHREG_WTCNT_W = WTCNT_W_M | (unsigned short) x;
|
||||
}
|
||||
|
||||
void
|
||||
wdog_wr_csr(x)
|
||||
unsigned char x;
|
||||
wdog_wr_csr(unsigned char x)
|
||||
{
|
||||
|
||||
SHREG_WTCSR_W = WTCSR_W_M | (unsigned short) x;
|
||||
}
|
||||
|
||||
static int
|
||||
wdogmatch(parent, cfp, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cfp;
|
||||
void *aux;
|
||||
wdogmatch(struct device *parent, struct cfdata *cfp, void *aux)
|
||||
{
|
||||
struct shb_attach_args *sa = aux;
|
||||
|
||||
|
@ -98,9 +93,7 @@ wdogmatch(parent, cfp, aux)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
wdogattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
wdogattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct wdog_softc *sc = (struct wdog_softc *)self;
|
||||
struct shb_attach_args *sa = aux;
|
||||
|
@ -117,10 +110,7 @@ wdogattach(parent, self, aux)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
wdogopen(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
wdogopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
struct wdog_softc *sc = wdog_cd.cd_devs[0]; /* XXX */
|
||||
|
||||
|
@ -134,10 +124,7 @@ wdogopen(dev, flag, mode, p)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
wdogclose(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
wdogclose(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
struct wdog_softc *sc = wdog_cd.cd_devs[0]; /* XXX */
|
||||
|
||||
|
@ -151,12 +138,7 @@ extern unsigned int maxwdog;
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
wdogioctl (dev, cmd, data, flag, p)
|
||||
dev_t dev;
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
int flag;
|
||||
struct proc *p;
|
||||
wdogioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
int error = 0;
|
||||
int request;
|
||||
|
@ -205,8 +187,7 @@ wdogioctl (dev, cmd, data, flag, p)
|
|||
}
|
||||
|
||||
int
|
||||
wdogintr(arg)
|
||||
void *arg;
|
||||
wdogintr(void *arg)
|
||||
{
|
||||
struct trapframe *frame = arg;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bootinfo.h,v 1.1 1999/09/13 10:31:14 itojun Exp $ */
|
||||
/* $NetBSD: bootinfo.h,v 1.2 2002/02/12 15:26:47 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997
|
||||
|
@ -122,7 +122,7 @@ struct btinfo_biosgeom {
|
|||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
void *lookup_bootinfo __P((int));
|
||||
void *lookup_bootinfo(int);
|
||||
#endif
|
||||
#endif /* _LOCORE */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bswap.h,v 1.1 1999/09/13 10:31:14 itojun Exp $ */
|
||||
/* $NetBSD: bswap.h,v 1.2 2002/02/12 15:26:47 uch Exp $ */
|
||||
|
||||
/* Written by Manuel Bouyer. Public domain */
|
||||
|
||||
|
@ -10,40 +10,38 @@
|
|||
#ifndef _KERNEL
|
||||
|
||||
__BEGIN_DECLS
|
||||
u_int16_t bswap16 __P((u_int16_t));
|
||||
u_int32_t bswap32 __P((u_int32_t));
|
||||
u_int64_t bswap64 __P((u_int64_t));
|
||||
u_int16_t bswap16(u_int16_t);
|
||||
u_int32_t bswap32(u_int32_t);
|
||||
u_int64_t bswap64(u_int64_t);
|
||||
__END_DECLS
|
||||
|
||||
#else /* _KERNEL */
|
||||
|
||||
__BEGIN_DECLS
|
||||
static __inline u_int16_t bswap16 __P((u_int16_t));
|
||||
static __inline u_int32_t bswap32 __P((u_int32_t));
|
||||
u_int64_t bswap64 __P((u_int64_t));
|
||||
static __inline u_int16_t bswap16(u_int16_t);
|
||||
static __inline u_int32_t bswap32(u_int32_t);
|
||||
u_int64_t bswap64(u_int64_t);
|
||||
__END_DECLS
|
||||
|
||||
static __inline u_int16_t
|
||||
bswap16(x)
|
||||
u_int16_t x;
|
||||
bswap16(u_int16_t x)
|
||||
{
|
||||
u_int16_t rval;
|
||||
|
||||
__asm __volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x));
|
||||
|
||||
return rval;
|
||||
return (rval);
|
||||
}
|
||||
|
||||
static __inline u_int32_t
|
||||
bswap32(x)
|
||||
u_int32_t x;
|
||||
bswap32(u_int32_t x)
|
||||
{
|
||||
u_int32_t rval;
|
||||
|
||||
__asm __volatile ("swap.b %1,%0; swap.w %0,%0; swap.b %0,%0"
|
||||
: "=r"(rval) : "r"(x));
|
||||
|
||||
return rval;
|
||||
return (rval);
|
||||
}
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bus.h,v 1.6 2001/07/19 15:32:18 thorpej Exp $ */
|
||||
/* $NetBSD: bus.h,v 1.7 2002/02/12 15:26:47 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -112,250 +112,224 @@ typedef int bus_space_tag_t;
|
|||
typedef u_long bus_space_handle_t;
|
||||
|
||||
/*
|
||||
* int bus_space_map __P((bus_space_tag_t t, bus_addr_t addr,
|
||||
* bus_size_t size, int flags, bus_space_handle_t *bshp));
|
||||
* int bus_space_map (bus_space_tag_t t, bus_addr_t addr,
|
||||
* bus_size_t size, int flags, bus_space_handle_t *bshp);
|
||||
*
|
||||
* Map a region of bus space.
|
||||
*/
|
||||
#define BUS_SPACE_MAP_CACHEABLE 0x01
|
||||
#define BUS_SPACE_MAP_LINEAR 0x02
|
||||
|
||||
int bus_space_map __P((bus_space_tag_t, bus_addr_t, bus_size_t size,
|
||||
int, bus_space_handle_t *));
|
||||
int bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t size,
|
||||
int, bus_space_handle_t *);
|
||||
|
||||
#ifdef SH4_PCMCIA
|
||||
int shpcmcia_memio_map __P((bus_space_tag_t, bus_addr_t, bus_size_t size,
|
||||
int, bus_space_handle_t *));
|
||||
int shpcmcia_memio_map(bus_space_tag_t, bus_addr_t, bus_size_t size,
|
||||
int, bus_space_handle_t *);
|
||||
|
||||
int shpcmcia_mem_add_mapping __P((bus_addr_t, bus_size_t, int,
|
||||
bus_space_handle_t *));
|
||||
void shpcmcia_memio_unmap __P((bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t));
|
||||
void shpcmcia_memio_free __P((bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t));
|
||||
int shpcmcia_memio_subregion __P((bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t, bus_size_t,
|
||||
bus_space_handle_t *));
|
||||
int shpcmcia_mem_add_mapping(bus_addr_t, bus_size_t, int,
|
||||
bus_space_handle_t *);
|
||||
void shpcmcia_memio_unmap(bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t);
|
||||
void shpcmcia_memio_free(bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t);
|
||||
int shpcmcia_memio_subregion(bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t, bus_size_t, bus_space_handle_t *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* u_intN_t bus_space_read_N __P((bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset));
|
||||
* u_intN_t bus_space_read_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset);
|
||||
*
|
||||
* Read a 1, 2, 4, or 8 byte quantity from bus space
|
||||
* described by tag/handle/offset.
|
||||
*/
|
||||
static __inline u_int8_t bus_space_read_1
|
||||
__P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
static __inline u_int16_t bus_space_read_2
|
||||
__P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
static __inline u_int32_t bus_space_read_4
|
||||
__P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
|
||||
u_int8_t
|
||||
bus_space_read_1(tag, bsh, offset)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return *(volatile u_int8_t *)(bsh + offset);
|
||||
}
|
||||
|
||||
u_int16_t
|
||||
bus_space_read_2(tag, bsh, offset)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
bus_space_read_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return bswap16(*(volatile u_int16_t *)(bsh + offset));
|
||||
}
|
||||
|
||||
u_int32_t
|
||||
bus_space_read_4(tag, bsh, offset)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
bus_space_read_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return bswap32(*(volatile u_int32_t *)(bsh + offset));
|
||||
}
|
||||
|
||||
static __inline u_int16_t bus_space_read_stream_2
|
||||
__P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
|
||||
static __inline u_int32_t bus_space_read_stream_4
|
||||
__P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
|
||||
u_int16_t
|
||||
bus_space_read_stream_2(tag, bsh, offset)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
bus_space_read_stream_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return *(volatile u_int16_t *)(bsh + offset);
|
||||
}
|
||||
|
||||
u_int32_t
|
||||
bus_space_read_stream_4(tag, bsh, offset)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
bus_space_read_stream_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset)
|
||||
{
|
||||
|
||||
return *(volatile u_int32_t *)(bsh + offset);
|
||||
}
|
||||
|
||||
/*
|
||||
* void bus_space_read_multi_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_read_multi_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* u_intN_t *addr, size_t count));
|
||||
* u_intN_t *addr, size_t count);
|
||||
*
|
||||
* Read `count' 1, 2, 4, or 8 byte quantities from bus space
|
||||
* described by tag/handle/offset and copy into buffer provided.
|
||||
*/
|
||||
static __inline void bus_space_read_multi_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t));
|
||||
static __inline void bus_space_read_multi_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_read_multi_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_read_multi_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t);
|
||||
static __inline void bus_space_read_multi_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_read_multi_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_read_multi_1(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
*addr++ = bus_space_read_1(tag, bsh, offset);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_read_multi_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
*addr++ = bus_space_read_2(tag, bsh, offset);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_read_multi_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
*addr++ = bus_space_read_4(tag, bsh, offset);
|
||||
}
|
||||
|
||||
static __inline void bus_space_read_multi_stream_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_read_multi_stream_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_read_multi_stream_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_read_multi_stream_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_read_multi_stream_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_multi_stream_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
*addr++ = *(volatile u_int16_t *)(bsh + offset);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_read_multi_stream_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_multi_stream_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
*addr++ = *(volatile u_int32_t *)(bsh + offset);
|
||||
}
|
||||
|
||||
/*
|
||||
* int bus_space_alloc __P((bus_space_tag_t t, bus_addr_t rstart,
|
||||
* int bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart,
|
||||
* bus_addr_t rend, bus_size_t size, bus_size_t align,
|
||||
* bus_size_t boundary, int flags, bus_addr_t *addrp,
|
||||
* bus_space_handle_t *bshp));
|
||||
* bus_space_handle_t *bshp);
|
||||
*
|
||||
* Allocate a region of bus space.
|
||||
*/
|
||||
int sh_memio_alloc __P((bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t,
|
||||
bus_size_t, bus_size_t, int,
|
||||
bus_addr_t *, bus_space_handle_t *));
|
||||
int sh_memio_alloc(bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t,
|
||||
bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
|
||||
|
||||
#define bus_space_alloc(t, rs, re, s, a, b, f, ap, hp) \
|
||||
sh_memio_alloc((t), (rs), (re), (s), (a), (b), (f), (ap), (hp))
|
||||
|
||||
/*
|
||||
* int bus_space_free __P((bus_space_tag_t t,
|
||||
* bus_space_handle_t bsh, bus_size_t size));
|
||||
* int bus_space_free(bus_space_tag_t t,
|
||||
* bus_space_handle_t bsh, bus_size_t size);
|
||||
*
|
||||
* Free a region of bus space.
|
||||
*/
|
||||
void sh_memio_free __P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
void sh_memio_free(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
|
||||
#define bus_space_free(t, h, s) \
|
||||
sh_memio_free((t), (h), (s))
|
||||
|
||||
/*
|
||||
* int bus_space_unmap __P((bus_space_tag_t t,
|
||||
* bus_space_handle_t bsh, bus_size_t size));
|
||||
* int bus_space_unmap(bus_space_tag_t t,
|
||||
* bus_space_handle_t bsh, bus_size_t size);
|
||||
*
|
||||
* Unmap a region of bus space.
|
||||
*/
|
||||
void sh_memio_unmap __P((bus_space_tag_t, bus_space_handle_t, bus_size_t));
|
||||
void sh_memio_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
|
||||
|
||||
#define bus_space_unmap(t, h, s) \
|
||||
sh_memio_unmap((t), (h), (s))
|
||||
|
||||
/*
|
||||
* int bus_space_subregion __P((bus_space_tag_t t,
|
||||
* int bus_space_subregion(bus_space_tag_t t,
|
||||
* bus_space_handle_t bsh, bus_size_t offset, bus_size_t size,
|
||||
* bus_space_handle_t *nbshp));
|
||||
* bus_space_handle_t *nbshp);
|
||||
*
|
||||
* Get a new handle for a subregion of an already-mapped area of bus space.
|
||||
*/
|
||||
int sh_memio_subregion __P((bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t, bus_size_t, bus_space_handle_t *));
|
||||
int sh_memio_subregion(bus_space_tag_t, bus_space_handle_t,
|
||||
bus_size_t, bus_size_t, bus_space_handle_t *);
|
||||
|
||||
#define bus_space_subregion(t, h, o, s, nhp) \
|
||||
sh_memio_subregion((t), (h), (o), (s), (nhp))
|
||||
|
||||
/*
|
||||
* void bus_space_read_region_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_read_region_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* u_intN_t *addr, size_t count));
|
||||
* u_intN_t *addr, size_t count);
|
||||
*
|
||||
* Read `count' 1, 2, 4, or 8 byte quantities from bus space
|
||||
* described by tag/handle and starting at `offset' and copy into
|
||||
* buffer provided.
|
||||
*/
|
||||
static __inline void bus_space_read_region_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t));
|
||||
static __inline void bus_space_read_region_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_read_region_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_read_region_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t);
|
||||
static __inline void bus_space_read_region_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_read_region_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_read_region_1(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int8_t *p = (u_int8_t *)(bsh + offset);
|
||||
|
||||
|
@ -364,12 +338,8 @@ bus_space_read_region_1(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_read_region_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int16_t *p = (u_int16_t *)(bsh + offset);
|
||||
|
||||
|
@ -378,12 +348,8 @@ bus_space_read_region_2(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_read_region_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int32_t *p = (u_int32_t *)(bsh + offset);
|
||||
|
||||
|
@ -392,27 +358,23 @@ bus_space_read_region_4(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
/*
|
||||
* void bus_space_write_region_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_write_region_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* const u_intN_t *addr, size_t count));
|
||||
* const u_intN_t *addr, size_t count);
|
||||
*
|
||||
* Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided
|
||||
* to bus space described by tag/handle starting at `offset'.
|
||||
*/
|
||||
static __inline void bus_space_write_region_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t));
|
||||
static __inline void bus_space_write_region_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_write_region_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_write_region_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int8_t *, bus_size_t);
|
||||
static __inline void bus_space_write_region_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_write_region_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, const u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_write_region_1(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
const u_int8_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const u_int8_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int8_t *p = (u_int8_t *)(bsh + offset);
|
||||
|
||||
|
@ -421,12 +383,8 @@ bus_space_write_region_1(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_write_region_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
const u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int16_t *p = (u_int16_t *)(bsh + offset);
|
||||
|
||||
|
@ -435,12 +393,8 @@ bus_space_write_region_2(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_write_region_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
const u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, const u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
u_int32_t *p = (u_int32_t *)(bsh + offset);
|
||||
|
||||
|
@ -449,228 +403,190 @@ bus_space_write_region_4(tag, bsh, offset, addr, count)
|
|||
}
|
||||
|
||||
/*
|
||||
* void bus_space_write_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_write_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* u_intN_t value));
|
||||
* u_intN_t value);
|
||||
*
|
||||
* Write the 1, 2, 4, or 8 byte value `value' to bus space
|
||||
* described by tag/handle/offset.
|
||||
*/
|
||||
static __inline void bus_space_write_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t));
|
||||
static __inline void bus_space_write_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t));
|
||||
static __inline void bus_space_write_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t));
|
||||
static __inline void bus_space_write_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t);
|
||||
static __inline void bus_space_write_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t);
|
||||
static __inline void bus_space_write_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t);
|
||||
|
||||
void
|
||||
bus_space_write_1(tag, bsh, offset, value)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t value;
|
||||
bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t value)
|
||||
{
|
||||
|
||||
*(volatile u_int8_t *)(bsh + offset) = value;
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_2(tag, bsh, offset, value)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t value;
|
||||
bus_space_write_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t value)
|
||||
{
|
||||
|
||||
*(volatile u_int16_t *)(bsh + offset) = bswap16(value);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_4(tag, bsh, offset, value)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t value;
|
||||
bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t value)
|
||||
{
|
||||
|
||||
*(volatile u_int32_t *)(bsh + offset) = bswap32(value);
|
||||
}
|
||||
|
||||
static __inline void bus_space_write_stream_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t));
|
||||
static __inline void bus_space_write_stream_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t));
|
||||
static __inline void bus_space_write_stream_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t);
|
||||
static __inline void bus_space_write_stream_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t);
|
||||
|
||||
void
|
||||
bus_space_write_stream_2(tag, bsh, offset, value)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t value;
|
||||
bus_space_write_stream_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t value)
|
||||
{
|
||||
|
||||
*(volatile u_int16_t *)(bsh + offset) = value;
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_stream_4(tag, bsh, offset, value)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t value;
|
||||
bus_space_write_stream_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t value)
|
||||
{
|
||||
|
||||
*(volatile u_int32_t *)(bsh + offset) = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* void bus_space_write_multi_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_write_multi_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* const u_intN_t *addr, size_t count));
|
||||
* const u_intN_t *addr, size_t count);
|
||||
*
|
||||
* Write `count' 1, 2, 4, or 8 byte quantities from the buffer
|
||||
* provided to bus space described by tag/handle/offset.
|
||||
*/
|
||||
static __inline void bus_space_write_multi_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t));
|
||||
static __inline void bus_space_write_multi_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_write_multi_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_write_multi_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t);
|
||||
static __inline void bus_space_write_multi_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_write_multi_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_write_multi_1(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_1(tag, bsh, offset, *addr++);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_multi_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_2(tag, bsh, offset, *addr++);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_multi_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_4(tag, bsh, offset, *addr++);
|
||||
}
|
||||
|
||||
static __inline void bus_space_write_multi_stream_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t));
|
||||
static __inline void bus_space_write_multi_stream_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t));
|
||||
static __inline void bus_space_write_multi_stream_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t);
|
||||
static __inline void bus_space_write_multi_stream_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_write_multi_stream_2(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_multi_stream_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_stream_2(tag, bsh, offset, *addr++);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_write_multi_stream_4(tag, bsh, offset, addr, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t *addr;
|
||||
bus_size_t count;
|
||||
bus_space_write_multi_stream_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t *addr, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_stream_4(tag, bsh, offset, *addr++);
|
||||
}
|
||||
|
||||
/*
|
||||
* void bus_space_set_multi_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_set_multi_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset, u_intN_t val,
|
||||
* size_t count));
|
||||
* size_t count);
|
||||
*
|
||||
* Write the 1, 2, 4, or 8 byte value `val' to bus space described
|
||||
* by tag/handle/offset `count' times.
|
||||
*/
|
||||
static __inline void bus_space_set_multi_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t));
|
||||
static __inline void bus_space_set_multi_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t));
|
||||
static __inline void bus_space_set_multi_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t));
|
||||
static __inline void bus_space_set_multi_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t);
|
||||
static __inline void bus_space_set_multi_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t);
|
||||
static __inline void bus_space_set_multi_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_set_multi_1(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t val, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_1(tag, bsh, offset, val);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_set_multi_2(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t val, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_2(tag, bsh, offset, val);
|
||||
}
|
||||
|
||||
void
|
||||
bus_space_set_multi_4(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t val, bus_size_t count)
|
||||
{
|
||||
|
||||
while (count--)
|
||||
bus_space_write_4(tag, bsh, offset, val);
|
||||
}
|
||||
|
||||
/*
|
||||
* void bus_space_set_region_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_set_region_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset, u_intN_t val,
|
||||
* size_t count));
|
||||
* size_t count);
|
||||
*
|
||||
* Write `count' 1, 2, 4, or 8 byte value `val' to bus space described
|
||||
* by tag/handle starting at `offset'.
|
||||
*/
|
||||
static __inline void bus_space_set_region_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t));
|
||||
static __inline void bus_space_set_region_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t));
|
||||
static __inline void bus_space_set_region_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t));
|
||||
static __inline void bus_space_set_region_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t);
|
||||
static __inline void bus_space_set_region_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t);
|
||||
static __inline void bus_space_set_region_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_set_region_1(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int8_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int8_t val, bus_size_t count)
|
||||
{
|
||||
volatile u_int8_t *addr = (void *)(bsh + offset);
|
||||
|
||||
|
@ -679,12 +595,8 @@ bus_space_set_region_1(tag, bsh, offset, val, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_set_region_2(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int16_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int16_t val, bus_size_t count)
|
||||
{
|
||||
volatile u_int16_t *addr = (void *)(bsh + offset);
|
||||
|
||||
|
@ -694,12 +606,8 @@ bus_space_set_region_2(tag, bsh, offset, val, count)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_set_region_4(tag, bsh, offset, val, count)
|
||||
bus_space_tag_t tag;
|
||||
bus_space_handle_t bsh;
|
||||
bus_size_t offset;
|
||||
u_int32_t val;
|
||||
bus_size_t count;
|
||||
bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
|
||||
bus_size_t offset, u_int32_t val, bus_size_t count)
|
||||
{
|
||||
volatile u_int32_t *addr = (void *)(bsh + offset);
|
||||
|
||||
|
@ -709,32 +617,27 @@ bus_space_set_region_4(tag, bsh, offset, val, count)
|
|||
}
|
||||
|
||||
/*
|
||||
* void bus_space_copy_region_N __P((bus_space_tag_t tag,
|
||||
* void bus_space_copy_region_N(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh1, bus_size_t off1,
|
||||
* bus_space_handle_t bsh2, bus_size_t off2,
|
||||
* size_t count));
|
||||
* size_t count);
|
||||
*
|
||||
* Copy `count' 1, 2, 4, or 8 byte values from bus space starting
|
||||
* at tag/bsh1/off1 to bus space starting at tag/bsh2/off2.
|
||||
*/
|
||||
static __inline void bus_space_copy_region_1 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t));
|
||||
static __inline void bus_space_copy_region_2 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t));
|
||||
static __inline void bus_space_copy_region_4 __P((bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t));
|
||||
static __inline void bus_space_copy_region_1(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t);
|
||||
static __inline void bus_space_copy_region_2(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t);
|
||||
static __inline void bus_space_copy_region_4(bus_space_tag_t,
|
||||
bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t,
|
||||
bus_size_t);
|
||||
|
||||
void
|
||||
bus_space_copy_region_1(t, h1, o1, h2, o2, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h1;
|
||||
bus_size_t o1;
|
||||
bus_space_handle_t h2;
|
||||
bus_size_t o2;
|
||||
bus_size_t c;
|
||||
bus_space_copy_region_1(bus_space_tag_t t, bus_space_handle_t h1,
|
||||
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
|
||||
{
|
||||
volatile u_int8_t *addr1 = (void *)(h1 + o1);
|
||||
volatile u_int8_t *addr2 = (void *)(h2 + o2);
|
||||
|
@ -751,13 +654,8 @@ bus_space_copy_region_1(t, h1, o1, h2, o2, c)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_copy_region_2(t, h1, o1, h2, o2, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h1;
|
||||
bus_size_t o1;
|
||||
bus_space_handle_t h2;
|
||||
bus_size_t o2;
|
||||
bus_size_t c;
|
||||
bus_space_copy_region_2(bus_space_tag_t t, bus_space_handle_t h1,
|
||||
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
|
||||
{
|
||||
volatile u_int16_t *addr1 = (void *)(h1 + o1);
|
||||
volatile u_int16_t *addr2 = (void *)(h2 + o2);
|
||||
|
@ -774,13 +672,8 @@ bus_space_copy_region_2(t, h1, o1, h2, o2, c)
|
|||
}
|
||||
|
||||
void
|
||||
bus_space_copy_region_4(t, h1, o1, h2, o2, c)
|
||||
bus_space_tag_t t;
|
||||
bus_space_handle_t h1;
|
||||
bus_size_t o1;
|
||||
bus_space_handle_t h2;
|
||||
bus_size_t o2;
|
||||
bus_size_t c;
|
||||
bus_space_copy_region_4(bus_space_tag_t t, bus_space_handle_t h1,
|
||||
bus_size_t o1, bus_space_handle_t h2, bus_size_t o2, bus_size_t c)
|
||||
{
|
||||
volatile u_int32_t *addr1 = (void *)(h1 + o1);
|
||||
volatile u_int32_t *addr2 = (void *)(h2 + o2);
|
||||
|
@ -811,9 +704,9 @@ bus_space_copy_region_4(t, h1, o1, h2, o2, c)
|
|||
/*
|
||||
* Bus read/write barrier methods.
|
||||
*
|
||||
* void bus_space_barrier __P((bus_space_tag_t tag,
|
||||
* void bus_space_barrier(bus_space_tag_t tag,
|
||||
* bus_space_handle_t bsh, bus_size_t offset,
|
||||
* bus_size_t len, int flags));
|
||||
* bus_size_t len, int flags);
|
||||
*
|
||||
* Note: the sh3 does not currently require barriers, but we must
|
||||
* provide the flags to MI code.
|
||||
|
@ -888,33 +781,33 @@ struct sh3_bus_dma_tag {
|
|||
/*
|
||||
* DMA mapping methods.
|
||||
*/
|
||||
int (*_dmamap_create) __P((bus_dma_tag_t, bus_size_t, int,
|
||||
bus_size_t, bus_size_t, int, bus_dmamap_t *));
|
||||
void (*_dmamap_destroy) __P((bus_dma_tag_t, bus_dmamap_t));
|
||||
int (*_dmamap_load) __P((bus_dma_tag_t, bus_dmamap_t, void *,
|
||||
bus_size_t, struct proc *, int));
|
||||
int (*_dmamap_load_mbuf) __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
struct mbuf *, int));
|
||||
int (*_dmamap_load_uio) __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
struct uio *, int));
|
||||
int (*_dmamap_load_raw) __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dma_segment_t *, int, bus_size_t, int));
|
||||
void (*_dmamap_unload) __P((bus_dma_tag_t, bus_dmamap_t));
|
||||
void (*_dmamap_sync) __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dmasync_op_t));
|
||||
int (*_dmamap_create)(bus_dma_tag_t, bus_size_t, int,
|
||||
bus_size_t, bus_size_t, int, bus_dmamap_t *);
|
||||
void (*_dmamap_destroy)(bus_dma_tag_t, bus_dmamap_t);
|
||||
int (*_dmamap_load)(bus_dma_tag_t, bus_dmamap_t, void *,
|
||||
bus_size_t, struct proc *, int);
|
||||
int (*_dmamap_load_mbuf)(bus_dma_tag_t, bus_dmamap_t,
|
||||
struct mbuf *, int);
|
||||
int (*_dmamap_load_uio)(bus_dma_tag_t, bus_dmamap_t,
|
||||
struct uio *, int);
|
||||
int (*_dmamap_load_raw)(bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dma_segment_t *, int, bus_size_t, int);
|
||||
void (*_dmamap_unload)(bus_dma_tag_t, bus_dmamap_t);
|
||||
void (*_dmamap_sync)(bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dmasync_op_t);
|
||||
|
||||
/*
|
||||
* DMA memory utility functions.
|
||||
*/
|
||||
int (*_dmamem_alloc) __P((bus_dma_tag_t, bus_size_t, bus_size_t,
|
||||
bus_size_t, bus_dma_segment_t *, int, int *, int));
|
||||
void (*_dmamem_free) __P((bus_dma_tag_t,
|
||||
bus_dma_segment_t *, int));
|
||||
int (*_dmamem_map) __P((bus_dma_tag_t, bus_dma_segment_t *,
|
||||
int, size_t, caddr_t *, int));
|
||||
void (*_dmamem_unmap) __P((bus_dma_tag_t, caddr_t, size_t));
|
||||
paddr_t (*_dmamem_mmap) __P((bus_dma_tag_t, bus_dma_segment_t *,
|
||||
int, off_t, int, int));
|
||||
int (*_dmamem_alloc)(bus_dma_tag_t, bus_size_t, bus_size_t,
|
||||
bus_size_t, bus_dma_segment_t *, int, int *, int);
|
||||
void (*_dmamem_free)(bus_dma_tag_t,
|
||||
bus_dma_segment_t *, int);
|
||||
int (*_dmamem_map)(bus_dma_tag_t, bus_dma_segment_t *,
|
||||
int, size_t, caddr_t *, int);
|
||||
void (*_dmamem_unmap)(bus_dma_tag_t, caddr_t, size_t);
|
||||
paddr_t (*_dmamem_mmap)(bus_dma_tag_t, bus_dma_segment_t *,
|
||||
int, off_t, int, int);
|
||||
};
|
||||
|
||||
#define bus_dmamap_create(t, s, n, m, b, f, p) \
|
||||
|
@ -971,36 +864,36 @@ struct sh3_bus_dmamap {
|
|||
};
|
||||
|
||||
#ifdef _SH3_BUS_DMA_PRIVATE
|
||||
int _bus_dmamap_create __P((bus_dma_tag_t, bus_size_t, int, bus_size_t,
|
||||
bus_size_t, int, bus_dmamap_t *));
|
||||
void _bus_dmamap_destroy __P((bus_dma_tag_t, bus_dmamap_t));
|
||||
int _bus_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *,
|
||||
bus_size_t, struct proc *, int));
|
||||
int _bus_dmamap_load_mbuf __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
struct mbuf *, int));
|
||||
int _bus_dmamap_load_uio __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
struct uio *, int));
|
||||
int _bus_dmamap_load_raw __P((bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dma_segment_t *, int, bus_size_t, int));
|
||||
void _bus_dmamap_unload __P((bus_dma_tag_t, bus_dmamap_t));
|
||||
void _bus_dmamap_sync __P((bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t));
|
||||
int _bus_dmamap_create(bus_dma_tag_t, bus_size_t, int, bus_size_t,
|
||||
bus_size_t, int, bus_dmamap_t *);
|
||||
void _bus_dmamap_destroy(bus_dma_tag_t, bus_dmamap_t);
|
||||
int _bus_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *,
|
||||
bus_size_t, struct proc *, int);
|
||||
int _bus_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t,
|
||||
struct mbuf *, int);
|
||||
int _bus_dmamap_load_uio(bus_dma_tag_t, bus_dmamap_t,
|
||||
struct uio *, int);
|
||||
int _bus_dmamap_load_raw(bus_dma_tag_t, bus_dmamap_t,
|
||||
bus_dma_segment_t *, int, bus_size_t, int);
|
||||
void _bus_dmamap_unload(bus_dma_tag_t, bus_dmamap_t);
|
||||
void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t);
|
||||
|
||||
int _bus_dmamem_alloc __P((bus_dma_tag_t tag, bus_size_t size,
|
||||
int _bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size,
|
||||
bus_size_t alignment, bus_size_t boundary,
|
||||
bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags));
|
||||
void _bus_dmamem_free __P((bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs));
|
||||
int _bus_dmamem_map __P((bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs, size_t size, caddr_t *kvap, int flags));
|
||||
void _bus_dmamem_unmap __P((bus_dma_tag_t tag, caddr_t kva,
|
||||
size_t size));
|
||||
paddr_t _bus_dmamem_mmap __P((bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs, off_t off, int prot, int flags));
|
||||
bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags);
|
||||
void _bus_dmamem_free(bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs);
|
||||
int _bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs, size_t size, caddr_t *kvap, int flags);
|
||||
void _bus_dmamem_unmap(bus_dma_tag_t tag, caddr_t kva,
|
||||
size_t size);
|
||||
paddr_t _bus_dmamem_mmap(bus_dma_tag_t tag, bus_dma_segment_t *segs,
|
||||
int nsegs, off_t off, int prot, int flags);
|
||||
|
||||
int _bus_dmamem_alloc_range __P((bus_dma_tag_t tag, bus_size_t size,
|
||||
int _bus_dmamem_alloc_range(bus_dma_tag_t tag, bus_size_t size,
|
||||
bus_size_t alignment, bus_size_t boundary,
|
||||
bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags,
|
||||
vm_offset_t low, vm_offset_t high));
|
||||
vm_offset_t low, vm_offset_t high);
|
||||
#endif /* _SH3_BUS_DMA_PRIVATE */
|
||||
|
||||
#endif /* 0 */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpu.h,v 1.14 2002/02/11 18:04:24 uch Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.15 2002/02/12 15:26:47 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -124,7 +124,7 @@ int want_resched; /* resched() was called */
|
|||
* We need a machine-independent name for this.
|
||||
*/
|
||||
#define DELAY(x) delay(x)
|
||||
void delay __P((int));
|
||||
void delay(int);
|
||||
|
||||
/*
|
||||
* Logical address space of SH3 CPU.
|
||||
|
@ -181,46 +181,42 @@ extern struct cpu_nocpuid_nameclass sh3_nocpuid_cpus[];
|
|||
extern struct cpu_cpuid_nameclass sh3_cpuid_cpus[];
|
||||
|
||||
/* autoconf.c */
|
||||
void configure __P((void));
|
||||
void configure(void);
|
||||
|
||||
/* sh3_machdep.c */
|
||||
void sh3_startup __P((void));
|
||||
void sh3_startup(void);
|
||||
|
||||
/* machdep.c */
|
||||
void delay __P((int));
|
||||
void dumpconf __P((void));
|
||||
void cpu_reset __P((void));
|
||||
void delay(int);
|
||||
void dumpconf(void);
|
||||
void cpu_reset(void);
|
||||
|
||||
/* locore.s */
|
||||
struct region_descriptor;
|
||||
void lgdt __P((struct region_descriptor *));
|
||||
void fillw __P((short, void *, size_t));
|
||||
void
|
||||
bcopyb __P((caddr_t from, caddr_t to, size_t len));
|
||||
void
|
||||
bcopyw __P((caddr_t from, caddr_t to, size_t len));
|
||||
void
|
||||
setPageDirReg __P((int pgdir));
|
||||
|
||||
void lgdt(struct region_descriptor *);
|
||||
void fillw(short, void *, size_t);
|
||||
void bcopyb (caddr_t, caddr_t, size_t);
|
||||
void bcopyw(caddr_t, caddr_t, size_t);
|
||||
void setPageDirReg(int);
|
||||
|
||||
struct pcb;
|
||||
void savectx __P((struct pcb *));
|
||||
void switch_exit __P((struct proc *));
|
||||
void proc_trampoline __P((void));
|
||||
void savectx(struct pcb *);
|
||||
void switch_exit(struct proc *);
|
||||
void proc_trampoline(void);
|
||||
|
||||
/* clock.c */
|
||||
void startrtclock __P((void));
|
||||
void startrtclock(void);
|
||||
|
||||
/* npx.c */
|
||||
void npxdrop __P((void));
|
||||
void npxsave __P((void));
|
||||
void npxdrop(void);
|
||||
void npxsave(void);
|
||||
|
||||
/* vm_machdep.c */
|
||||
int kvtop __P((caddr_t));
|
||||
int kvtop(caddr_t);
|
||||
|
||||
#ifdef MATH_EMULATE
|
||||
/* math_emulate.c */
|
||||
int math_emulate __P((struct trapframe *));
|
||||
int math_emulate(struct trapframe *);
|
||||
#endif
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpufunc.h,v 1.9 2002/02/11 18:03:05 uch Exp $ */
|
||||
/* $NetBSD: cpufunc.h,v 1.10 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Charles Hannum.
|
||||
|
@ -133,7 +133,8 @@ enable_intr(void)
|
|||
static __inline void
|
||||
breakpoint()
|
||||
{
|
||||
__asm __volatile ("trapa #0xc3");
|
||||
|
||||
__asm __volatile("trapa #0xc3");
|
||||
}
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disklabel.h,v 1.1 1999/09/13 10:31:17 itojun Exp $ */
|
||||
/* $NetBSD: disklabel.h,v 1.2 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christopher G. Demetriou
|
||||
|
@ -51,7 +51,7 @@ struct cpu_disklabel {
|
|||
|
||||
#ifdef _KERNEL
|
||||
struct disklabel;
|
||||
int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
|
||||
int bounds_check_with_label(struct buf *, struct disklabel *, int);
|
||||
#endif
|
||||
|
||||
#endif /* _MACHINE_DISKLABEL_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: intr.h,v 1.12 2001/09/16 16:34:34 wiz Exp $ */
|
||||
/* $NetBSD: intr.h,v 1.13 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1997 Charles M. Hannum. All rights reserved.
|
||||
|
@ -49,18 +49,17 @@
|
|||
volatile int cpl, ipending, astpending;
|
||||
int imask[NIPL];
|
||||
|
||||
extern void Xspllower __P((void));
|
||||
extern void Xspllower(void);
|
||||
|
||||
static __inline int splraise __P((int));
|
||||
static __inline void spllower __P((int));
|
||||
static __inline void softintr __P((int));
|
||||
static __inline int splraise(int);
|
||||
static __inline void spllower(int);
|
||||
static __inline void softintr(int);
|
||||
|
||||
/*
|
||||
* Add a mask to cpl, and return the old value of cpl.
|
||||
*/
|
||||
static __inline int
|
||||
splraise(ncpl)
|
||||
register int ncpl;
|
||||
splraise(int ncpl)
|
||||
{
|
||||
int ocpl ;
|
||||
|
||||
|
@ -75,8 +74,7 @@ splraise(ncpl)
|
|||
* interrupts are pending, call Xspllower() to process them.
|
||||
*/
|
||||
static __inline void
|
||||
spllower(ncpl)
|
||||
register int ncpl;
|
||||
spllower(int ncpl)
|
||||
{
|
||||
|
||||
cpl = ncpl;
|
||||
|
@ -122,8 +120,7 @@ spllower(ncpl)
|
|||
* We hand-code this to ensure that it's atomic.
|
||||
*/
|
||||
static __inline void
|
||||
softintr(mask)
|
||||
register int mask;
|
||||
softintr(int mask)
|
||||
{
|
||||
extern void enable_interrupt(void); /* XXX */
|
||||
extern void disable_interrupt(void);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.h,v 1.15 2002/02/11 18:05:17 uch Exp $ */
|
||||
/* $NetBSD: pmap.h,v 1.16 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
|
@ -379,23 +379,23 @@ extern int pmap_pg_g; /* do we support PG_G? */
|
|||
* prototypes
|
||||
*/
|
||||
|
||||
void pmap_activate __P((struct proc *));
|
||||
void pmap_bootstrap __P((vaddr_t));
|
||||
boolean_t pmap_change_attrs __P((struct vm_page *, int, int));
|
||||
void pmap_deactivate __P((struct proc *));
|
||||
void pmap_page_remove __P((struct vm_page *));
|
||||
static void pmap_protect __P((struct pmap *, vaddr_t,
|
||||
vaddr_t, vm_prot_t));
|
||||
void pmap_remove __P((struct pmap *, vaddr_t, vaddr_t));
|
||||
boolean_t pmap_test_attrs __P((struct vm_page *, int));
|
||||
void pmap_transfer __P((struct pmap *, struct pmap *, vaddr_t,
|
||||
vsize_t, vaddr_t, boolean_t));
|
||||
static void pmap_update_pg __P((vaddr_t));
|
||||
static void pmap_update_2pg __P((vaddr_t,vaddr_t));
|
||||
void pmap_write_protect __P((struct pmap *, vaddr_t,
|
||||
vaddr_t, vm_prot_t));
|
||||
void pmap_activate(struct proc *);
|
||||
void pmap_bootstrap(vaddr_t);
|
||||
boolean_t pmap_change_attrs(struct vm_page *, int, int);
|
||||
void pmap_deactivate(struct proc *);
|
||||
void pmap_page_remove (struct vm_page *);
|
||||
static void pmap_protect(struct pmap *, vaddr_t,
|
||||
vaddr_t, vm_prot_t);
|
||||
void pmap_remove(struct pmap *, vaddr_t, vaddr_t);
|
||||
boolean_t pmap_test_attrs(struct vm_page *, int);
|
||||
void pmap_transfer(struct pmap *, struct pmap *, vaddr_t,
|
||||
vsize_t, vaddr_t, boolean_t);
|
||||
static void pmap_update_pg(vaddr_t);
|
||||
static void pmap_update_2pg(vaddr_t,vaddr_t);
|
||||
void pmap_write_protect(struct pmap *, vaddr_t,
|
||||
vaddr_t, vm_prot_t);
|
||||
|
||||
vaddr_t reserve_dumppages __P((vaddr_t)); /* XXX: not a pmap fn */
|
||||
vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */
|
||||
|
||||
#define PMAP_GROWKERNEL /* turn on pmap_growkernel interface */
|
||||
|
||||
|
@ -428,8 +428,7 @@ vaddr_t reserve_dumppages __P((vaddr_t)); /* XXX: not a pmap fn */
|
|||
*/
|
||||
|
||||
__inline static void
|
||||
pmap_update_pg(va)
|
||||
vaddr_t va;
|
||||
pmap_update_pg(vaddr_t va)
|
||||
{
|
||||
#ifdef SH4
|
||||
#if 1
|
||||
|
@ -478,11 +477,9 @@ pmap_update_2pg(va, vb)
|
|||
*/
|
||||
|
||||
__inline static void
|
||||
pmap_protect(pmap, sva, eva, prot)
|
||||
struct pmap *pmap;
|
||||
vaddr_t sva, eva;
|
||||
vm_prot_t prot;
|
||||
pmap_protect(struct pmap *pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot)
|
||||
{
|
||||
|
||||
if ((prot & VM_PROT_WRITE) == 0) {
|
||||
if (prot & (VM_PROT_READ|VM_PROT_EXECUTE)) {
|
||||
pmap_write_protect(pmap, sva, eva, prot);
|
||||
|
@ -492,9 +489,9 @@ pmap_protect(pmap, sva, eva, prot)
|
|||
}
|
||||
}
|
||||
|
||||
vaddr_t pmap_map __P((vaddr_t, paddr_t, paddr_t, vm_prot_t));
|
||||
paddr_t vtophys __P((vaddr_t));
|
||||
void pmap_emulate_reference __P((struct proc *, vaddr_t, int, int));
|
||||
vaddr_t pmap_map(vaddr_t, paddr_t, paddr_t, vm_prot_t);
|
||||
paddr_t vtophys(vaddr_t);
|
||||
void pmap_emulate_reference(struct proc *, vaddr_t, int, int);
|
||||
|
||||
/* XXX */
|
||||
#define PG_U 0 /* referenced bit */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: shbvar.h,v 1.1 1999/09/13 10:31:22 itojun Exp $ */
|
||||
/* $NetBSD: shbvar.h,v 1.2 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -172,7 +172,7 @@ struct shb_softc {
|
|||
*/
|
||||
|
||||
/* SHB interrupt sharing types */
|
||||
char *shb_intr_typename __P((int type));
|
||||
char *shb_intr_typename(int);
|
||||
|
||||
#define ICU_LEN 32
|
||||
#define SHB_MAX_HARDINTR 16
|
||||
|
@ -183,7 +183,7 @@ char *shb_intr_typename __P((int type));
|
|||
*/
|
||||
|
||||
struct intrhand {
|
||||
int (*ih_fun) __P((void *));
|
||||
int (*ih_fun)(void *);
|
||||
void *ih_arg;
|
||||
u_long ih_count;
|
||||
struct intrhand *ih_next;
|
||||
|
@ -191,9 +191,8 @@ struct intrhand {
|
|||
int ih_irq;
|
||||
};
|
||||
|
||||
void *shb_intr_establish __P((int irq, int type,
|
||||
int level, int (*ih_fun)(void *), void *ih_arg));
|
||||
void shb_intr_disestablish __P((void *, void *));
|
||||
int sh_intr_alloc __P((int mask, int type, int *irq));
|
||||
void *shb_intr_establish(int, int, int, int (*_fun)(void *), void *);
|
||||
void shb_intr_disestablish(void *, void *);
|
||||
int sh_intr_alloc(int, int, int *);
|
||||
|
||||
#endif /* !_DEV_SHB_SHBVAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wdogvar.h,v 1.3 2000/10/31 02:04:13 msaitoh Exp $ */
|
||||
/* $NetBSD: wdogvar.h,v 1.4 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
#ifndef _SH3_WDOGVAR_H_
|
||||
#define _SH3_WDOGVAR_H_
|
||||
|
@ -16,8 +16,8 @@
|
|||
|
||||
#ifdef _KERNEL
|
||||
extern unsigned int maxwdog;
|
||||
extern void wdog_wr_cnt __P((unsigned char));
|
||||
extern void wdog_wr_csr __P((unsigned char));
|
||||
extern void wdog_wr_cnt(unsigned char);
|
||||
extern void wdog_wr_csr(unsigned char);
|
||||
#endif
|
||||
|
||||
#endif /* !_SH3_WDOGVAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: clock.c,v 1.18 2002/02/01 17:52:56 uch Exp $ */
|
||||
/* $NetBSD: clock.c,v 1.19 2002/02/12 15:26:48 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994 Charles Hannum.
|
||||
|
@ -108,10 +108,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <machine/cpufunc.h>
|
||||
#include <machine/shbvar.h>
|
||||
|
||||
void findcpuspeed __P((void));
|
||||
int clockintr __P((void *));
|
||||
int gettick __P((void));
|
||||
void rtcinit __P((void));
|
||||
void findcpuspeed(void);
|
||||
int clockintr(void *);
|
||||
int gettick(void);
|
||||
void rtcinit(void);
|
||||
|
||||
int timer0speed;
|
||||
|
||||
|
@ -137,8 +137,7 @@ startrtclock()
|
|||
* Fill in *tvp with current time with microsecond resolution.
|
||||
*/
|
||||
void
|
||||
microtime(tvp)
|
||||
struct timeval *tvp;
|
||||
microtime(struct timeval *tvp)
|
||||
{
|
||||
int s = splclock();
|
||||
long diff;
|
||||
|
@ -191,8 +190,7 @@ microtime(tvp)
|
|||
unsigned int maxwdog;
|
||||
|
||||
int
|
||||
clockintr(arg)
|
||||
void *arg;
|
||||
clockintr(void *arg)
|
||||
{
|
||||
struct clockframe *frame = arg; /* not strictly necessary */
|
||||
|
||||
|
@ -237,8 +235,7 @@ gettick()
|
|||
* wave' mode counts at 2:1).
|
||||
*/
|
||||
void
|
||||
delay(n)
|
||||
int n;
|
||||
delay(int n)
|
||||
{
|
||||
unsigned int limit, tick, otick;
|
||||
|
||||
|
@ -338,8 +335,7 @@ static int timeset;
|
|||
* from a filesystem.
|
||||
*/
|
||||
void
|
||||
inittodr(base)
|
||||
time_t base;
|
||||
inittodr(time_t base)
|
||||
{
|
||||
struct clock_ymdhms dt;
|
||||
int doreset = 0;
|
||||
|
@ -478,7 +474,6 @@ resettodr()
|
|||
}
|
||||
|
||||
void
|
||||
setstatclockrate(arg)
|
||||
int arg;
|
||||
setstatclockrate(int arg)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: coff_exec.c,v 1.12 2001/12/14 23:30:03 thorpej Exp $ */
|
||||
/* $NetBSD: coff_exec.c,v 1.13 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Scott Bartram
|
||||
|
@ -46,13 +46,8 @@
|
|||
|
||||
#include <sys/exec_coff.h>
|
||||
|
||||
#if 0
|
||||
int coff_load_shlib __P((struct proc *, char *, struct exec_package *));
|
||||
#endif
|
||||
|
||||
static int coff_find_section __P((struct proc *, struct vnode *,
|
||||
struct coff_filehdr *, struct coff_scnhdr *,
|
||||
int));
|
||||
static int coff_find_section(struct proc *, struct vnode *,
|
||||
struct coff_filehdr *, struct coff_scnhdr *, int);
|
||||
|
||||
/*
|
||||
* exec_coff_makecmds(): Check if it's an coff-format executable.
|
||||
|
@ -67,9 +62,7 @@ static int coff_find_section __P((struct proc *, struct vnode *,
|
|||
*/
|
||||
|
||||
int
|
||||
exec_coff_makecmds(p, epp)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
exec_coff_makecmds(struct proc *p, struct exec_package *epp)
|
||||
{
|
||||
int error;
|
||||
struct coff_filehdr *fp = epp->ep_hdr;
|
||||
|
@ -121,9 +114,7 @@ exec_coff_makecmds(p, epp)
|
|||
*/
|
||||
|
||||
int
|
||||
exec_coff_setup_stack(p, epp)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
exec_coff_setup_stack(struct proc *p, struct exec_package *epp)
|
||||
{
|
||||
DPRINTF(("enter exec_coff_setup_stack\n"));
|
||||
|
||||
|
@ -143,16 +134,16 @@ exec_coff_setup_stack(p, epp)
|
|||
* <stack> ep_minsaddr
|
||||
*/
|
||||
DPRINTF(("VMCMD: addr %lx size %lx\n", epp->ep_maxsaddr,
|
||||
(epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr));
|
||||
(epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
|
||||
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
|
||||
epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE);
|
||||
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
|
||||
epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE);
|
||||
DPRINTF(("VMCMD: addr %lx size %lx\n",
|
||||
epp->ep_minsaddr - epp->ep_ssize,
|
||||
epp->ep_ssize));
|
||||
epp->ep_minsaddr - epp->ep_ssize,
|
||||
epp->ep_ssize));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
|
||||
(epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
(epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -163,11 +154,8 @@ exec_coff_setup_stack(p, epp)
|
|||
*/
|
||||
|
||||
int
|
||||
exec_coff_prep_omagic(p, epp, fp, ap)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
struct coff_filehdr *fp;
|
||||
struct coff_aouthdr *ap;
|
||||
exec_coff_prep_omagic(struct proc *p, struct exec_package *epp,
|
||||
struct coff_filehdr *fp, struct coff_aouthdr *ap)
|
||||
{
|
||||
epp->ep_taddr = COFF_SEGMENT_ALIGN(fp, ap, ap->a_tstart);
|
||||
epp->ep_tsize = ap->a_tsize;
|
||||
|
@ -177,24 +165,24 @@ exec_coff_prep_omagic(p, epp, fp, ap)
|
|||
|
||||
/* set up command for text and data segments */
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn,
|
||||
ap->a_tsize + ap->a_dsize, epp->ep_taddr, epp->ep_vp,
|
||||
COFF_TXTOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
ap->a_tsize + ap->a_dsize, epp->ep_taddr, epp->ep_vp,
|
||||
COFF_TXTOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
/* set up command for bss segment */
|
||||
#ifdef __sh__
|
||||
if (ap->a_bsize > 0)
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize,
|
||||
COFF_ROUND(ap->a_dstart + ap->a_dsize, COFF_LDPGSZ),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
COFF_ROUND(ap->a_dstart + ap->a_dsize, COFF_LDPGSZ),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
#else
|
||||
if (ap->a_bsize > 0)
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize,
|
||||
COFF_SEGMENT_ALIGN(fp, ap,
|
||||
ap->a_dstart + ap->a_dsize),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
COFF_SEGMENT_ALIGN(fp, ap,
|
||||
ap->a_dstart + ap->a_dsize),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
#endif
|
||||
|
||||
return exec_coff_setup_stack(p, epp);
|
||||
|
@ -220,21 +208,21 @@ exec_coff_prep_nmagic(p, epp, fp, ap)
|
|||
|
||||
/* set up command for text segment */
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_tsize,
|
||||
epp->ep_taddr, epp->ep_vp, COFF_TXTOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
epp->ep_taddr, epp->ep_vp, COFF_TXTOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
|
||||
/* set up command for data segment */
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_dsize,
|
||||
epp->ep_daddr, epp->ep_vp, COFF_DATOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
epp->ep_daddr, epp->ep_vp, COFF_DATOFF(fp, ap),
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
/* set up command for bss segment */
|
||||
if (ap->a_bsize > 0)
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize,
|
||||
COFF_SEGMENT_ALIGN(fp, ap,
|
||||
ap->a_dstart + ap->a_dsize),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
COFF_SEGMENT_ALIGN(fp, ap,
|
||||
ap->a_dstart + ap->a_dsize),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
return exec_coff_setup_stack(p, epp);
|
||||
}
|
||||
|
@ -246,12 +234,8 @@ exec_coff_prep_nmagic(p, epp, fp, ap)
|
|||
*/
|
||||
|
||||
static int
|
||||
coff_find_section(p, vp, fp, sh, s_type)
|
||||
struct proc *p;
|
||||
struct vnode *vp;
|
||||
struct coff_filehdr *fp;
|
||||
struct coff_scnhdr *sh;
|
||||
int s_type;
|
||||
coff_find_section(struct proc *p, struct vnode *vp, struct coff_filehdr *fp,
|
||||
struct coff_scnhdr *sh, int s_type)
|
||||
{
|
||||
int i, pos, resid, siz, error;
|
||||
|
||||
|
@ -268,8 +252,8 @@ coff_find_section(p, vp, fp, sh, s_type)
|
|||
siz -= resid;
|
||||
if (siz != sizeof(struct coff_scnhdr)) {
|
||||
DPRINTF(("incomplete read: hdr %d ask=%d, rem=%d got %d\n",
|
||||
s_type, sizeof(struct coff_scnhdr),
|
||||
resid, siz));
|
||||
s_type, sizeof(struct coff_scnhdr),
|
||||
resid, siz));
|
||||
return ENOEXEC;
|
||||
}
|
||||
DPRINTF(("found section: %lu\n", sh->s_flags));
|
||||
|
@ -290,11 +274,8 @@ coff_find_section(p, vp, fp, sh, s_type)
|
|||
*/
|
||||
|
||||
int
|
||||
exec_coff_prep_zmagic(p, epp, fp, ap)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
struct coff_filehdr *fp;
|
||||
struct coff_aouthdr *ap;
|
||||
exec_coff_prep_zmagic(struct proc *p, struct exec_package *epp,
|
||||
struct coff_filehdr *fp, struct coff_aouthdr *ap)
|
||||
{
|
||||
int error;
|
||||
u_long offset;
|
||||
|
@ -313,7 +294,7 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
return error;
|
||||
}
|
||||
DPRINTF(("COFF text addr %lu size %ld offset %ld\n", sh.s_vaddr,
|
||||
sh.s_size, sh.s_scnptr));
|
||||
sh.s_size, sh.s_scnptr));
|
||||
epp->ep_taddr = COFF_ALIGN(sh.s_vaddr);
|
||||
offset = sh.s_scnptr - (sh.s_vaddr - epp->ep_taddr);
|
||||
epp->ep_tsize = sh.s_size + (sh.s_vaddr - epp->ep_taddr);
|
||||
|
@ -334,16 +315,16 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
epp->ep_vp->v_flag |= VTEXT;
|
||||
|
||||
DPRINTF(("VMCMD: addr %lx size %lx offset %lx\n", epp->ep_taddr,
|
||||
epp->ep_tsize, offset));
|
||||
epp->ep_tsize, offset));
|
||||
if (!(offset & PAGE_MASK) && !(epp->ep_taddr & PAGE_MASK)) {
|
||||
epp->ep_tsize = round_page(epp->ep_tsize);
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, epp->ep_tsize,
|
||||
epp->ep_taddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
epp->ep_taddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
} else {
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, epp->ep_tsize,
|
||||
epp->ep_taddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
epp->ep_taddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
}
|
||||
|
||||
/* set up command for data segment */
|
||||
|
@ -353,7 +334,7 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
return error;
|
||||
}
|
||||
DPRINTF(("COFF data addr %lx size %ld offset %ld\n", sh.s_vaddr,
|
||||
sh.s_size, sh.s_scnptr));
|
||||
sh.s_size, sh.s_scnptr));
|
||||
epp->ep_daddr = COFF_ALIGN(sh.s_vaddr);
|
||||
offset = sh.s_scnptr - (sh.s_vaddr - epp->ep_daddr);
|
||||
dsize = sh.s_size + (sh.s_vaddr - epp->ep_daddr);
|
||||
|
@ -364,24 +345,24 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
#endif
|
||||
|
||||
DPRINTF(("VMCMD: addr %lx size %lx offset %lx\n", epp->ep_daddr,
|
||||
dsize, offset));
|
||||
dsize, offset));
|
||||
if (!(offset & PAGE_MASK) && !(epp->ep_daddr & PAGE_MASK)) {
|
||||
dsize = round_page(dsize);
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, dsize,
|
||||
epp->ep_daddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
epp->ep_daddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
} else {
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn,
|
||||
dsize, epp->ep_daddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
dsize, epp->ep_daddr, epp->ep_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
}
|
||||
|
||||
#ifdef __sh__
|
||||
if (ap->a_bsize > 0) {
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, ap->a_bsize,
|
||||
COFF_ROUND(ap->a_dstart + ap->a_dsize, COFF_LDPGSZ),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
COFF_ROUND(ap->a_dstart + ap->a_dsize, COFF_LDPGSZ),
|
||||
NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
}
|
||||
#else
|
||||
|
@ -390,10 +371,10 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
bsize = epp->ep_daddr + epp->ep_dsize - baddr;
|
||||
if (bsize > 0) {
|
||||
DPRINTF(("VMCMD: addr %x size %x offset %x\n",
|
||||
baddr, bsize, 0));
|
||||
baddr, bsize, 0));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
|
||||
bsize, baddr, NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
bsize, baddr, NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -407,12 +388,12 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
int len = sh.s_size, path_index, entry_len;
|
||||
|
||||
DPRINTF(("COFF shlib size %d offset %d\n",
|
||||
sh.s_size, sh.s_scnptr));
|
||||
sh.s_size, sh.s_scnptr));
|
||||
|
||||
error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t) buf,
|
||||
len, sh.s_scnptr,
|
||||
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
|
||||
&resid, p);
|
||||
len, sh.s_scnptr,
|
||||
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
|
||||
&resid, p);
|
||||
if (error) {
|
||||
DPRINTF(("shlib section read error %d\n", error));
|
||||
return ENOEXEC;
|
||||
|
@ -424,7 +405,7 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
entry_len = slhdr->entry_len * sizeof(long);
|
||||
|
||||
DPRINTF(("path_index: %d entry_len: %d name: %s\n",
|
||||
path_index, entry_len, slhdr->sl_name));
|
||||
path_index, entry_len, slhdr->sl_name));
|
||||
|
||||
error = coff_load_shlib(p, slhdr->sl_name, epp);
|
||||
if (error)
|
||||
|
@ -440,9 +421,9 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
|
||||
#if 1
|
||||
DPRINTF(("text addr: %lx size: %ld data addr: %lx size: %ld entry: %lx\n",
|
||||
epp->ep_taddr, epp->ep_tsize,
|
||||
epp->ep_daddr, epp->ep_dsize,
|
||||
epp->ep_entry));
|
||||
epp->ep_taddr, epp->ep_tsize,
|
||||
epp->ep_daddr, epp->ep_dsize,
|
||||
epp->ep_entry));
|
||||
#endif
|
||||
|
||||
return exec_coff_setup_stack(p, epp);
|
||||
|
@ -450,10 +431,7 @@ exec_coff_prep_zmagic(p, epp, fp, ap)
|
|||
|
||||
#if 0
|
||||
int
|
||||
coff_load_shlib(p, path, epp)
|
||||
struct proc *p;
|
||||
char *path;
|
||||
struct exec_package *epp;
|
||||
coff_load_shlib(struct proc *p, char *path, struct exec_package *epp)
|
||||
{
|
||||
int error, siz, resid;
|
||||
int taddr, tsize, daddr, dsize, offset;
|
||||
|
@ -481,44 +459,44 @@ coff_load_shlib(p, path, epp)
|
|||
error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t) fhp, siz, 0,
|
||||
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);
|
||||
if (error) {
|
||||
DPRINTF(("filehdr read error %d\n", error));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
DPRINTF(("filehdr read error %d\n", error));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
}
|
||||
siz -= resid;
|
||||
if (siz != sizeof(struct coff_filehdr)) {
|
||||
DPRINTF(("coff_load_shlib: incomplete read: ask=%d, rem=%d got %d\n",
|
||||
sizeof(struct coff_filehdr), resid, siz));
|
||||
vrele(nd.ni_vp);
|
||||
return ENOEXEC;
|
||||
DPRINTF(("coff_load_shlib: incomplete read: ask=%d, rem=%d got %d\n",
|
||||
sizeof(struct coff_filehdr), resid, siz));
|
||||
vrele(nd.ni_vp);
|
||||
return ENOEXEC;
|
||||
}
|
||||
|
||||
/* load text */
|
||||
error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_TEXT);
|
||||
if (error) {
|
||||
DPRINTF(("can't find shlib text section\n"));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
DPRINTF(("can't find shlib text section\n"));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
}
|
||||
DPRINTF(("COFF text addr %x size %d offset %d\n", sh.s_vaddr,
|
||||
sh.s_size, sh.s_scnptr));
|
||||
sh.s_size, sh.s_scnptr));
|
||||
taddr = COFF_ALIGN(shp->s_vaddr);
|
||||
offset = shp->s_scnptr - (shp->s_vaddr - taddr);
|
||||
tsize = shp->s_size + (shp->s_vaddr - taddr);
|
||||
DPRINTF(("VMCMD: addr %x size %x offset %x\n", taddr, tsize, offset));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn, tsize, taddr,
|
||||
nd.ni_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
nd.ni_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_EXECUTE);
|
||||
|
||||
/* load data */
|
||||
error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_DATA);
|
||||
if (error) {
|
||||
DPRINTF(("can't find shlib data section\n"));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
DPRINTF(("can't find shlib data section\n"));
|
||||
vrele(nd.ni_vp);
|
||||
return error;
|
||||
}
|
||||
DPRINTF(("COFF data addr %x size %d offset %d\n", shp->s_vaddr,
|
||||
shp->s_size, shp->s_scnptr));
|
||||
shp->s_size, shp->s_scnptr));
|
||||
daddr = COFF_ALIGN(shp->s_vaddr);
|
||||
offset = shp->s_scnptr - (shp->s_vaddr - daddr);
|
||||
dsize = shp->s_size + (shp->s_vaddr - daddr);
|
||||
|
@ -526,8 +504,8 @@ coff_load_shlib(p, path, epp)
|
|||
|
||||
DPRINTF(("VMCMD: addr %x size %x offset %x\n", daddr, dsize, offset));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn,
|
||||
dsize, daddr, nd.ni_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
dsize, daddr, nd.ni_vp, offset,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
/* load bss */
|
||||
error = coff_find_section(p, nd.ni_vp, fhp, shp, COFF_STYP_BSS);
|
||||
|
@ -536,11 +514,11 @@ coff_load_shlib(p, path, epp)
|
|||
int bsize = daddr + dsize + shp->s_size - baddr;
|
||||
if (bsize > 0) {
|
||||
DPRINTF(("VMCMD: addr %x size %x offset %x\n",
|
||||
baddr, bsize, 0));
|
||||
baddr, bsize, 0));
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
|
||||
bsize, baddr, NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
}
|
||||
bsize, baddr, NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
}
|
||||
}
|
||||
vrele(nd.ni_vp);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: compat_13_machdep.c,v 1.3 2001/05/16 12:42:38 msaitoh Exp $ */
|
||||
/* $NetBSD: compat_13_machdep.c,v 1.4 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -47,14 +47,11 @@
|
|||
#include <sys/syscallargs.h>
|
||||
|
||||
int
|
||||
compat_13_sys_sigreturn(p, v, retval)
|
||||
struct proc *p;
|
||||
void *v;
|
||||
register_t *retval;
|
||||
compat_13_sys_sigreturn(struct proc *p, void *v, register_t *retval)
|
||||
{
|
||||
struct compat_13_sys_sigreturn_args /* {
|
||||
syscallarg(struct sigcontext13 *) sigcntxp;
|
||||
} */ *uap = v;
|
||||
syscallarg(struct sigcontext13 *) sigcntxp;
|
||||
} */ *uap = v;
|
||||
struct sigcontext13 *scp, context;
|
||||
struct trapframe *tf;
|
||||
sigset_t mask;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_disasm.c,v 1.4 2000/09/04 23:02:43 tsubai Exp $ */
|
||||
/* $NetBSD: db_disasm.c,v 1.5 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
|
||||
|
@ -37,9 +37,7 @@
|
|||
void sh3_disasm(void *, char *, char *);
|
||||
|
||||
db_addr_t
|
||||
db_disasm(loc, altfmt)
|
||||
db_addr_t loc;
|
||||
boolean_t altfmt;
|
||||
db_disasm(db_addr_t loc, boolean_t altfmt)
|
||||
{
|
||||
char line[40], ascii[4];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_interface.c,v 1.6 2002/02/11 17:50:17 uch Exp $ */
|
||||
/* $NetBSD: db_interface.c,v 1.7 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 2002 UCHIYAMA Yasushi. All rights reserved.
|
||||
|
@ -64,10 +64,9 @@ const struct db_command db_machine_command_table[] = {
|
|||
int db_active;
|
||||
|
||||
void
|
||||
kdb_printtrap(type, code)
|
||||
u_int type;
|
||||
int code;
|
||||
kdb_printtrap(u_int type, int code)
|
||||
{
|
||||
|
||||
db_printf("kernel mode trap: ");
|
||||
if (type >= trap_types)
|
||||
db_printf("type %d", type);
|
||||
|
@ -77,9 +76,7 @@ kdb_printtrap(type, code)
|
|||
}
|
||||
|
||||
int
|
||||
kdb_trap(type, code, regs)
|
||||
int type, code;
|
||||
db_regs_t *regs;
|
||||
kdb_trap(int type, int code, db_regs_t *regs)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -120,6 +117,7 @@ kdb_trap(type, code, regs)
|
|||
void
|
||||
cpu_Debugger()
|
||||
{
|
||||
|
||||
breakpoint();
|
||||
}
|
||||
|
||||
|
@ -135,8 +133,7 @@ cpu_Debugger()
|
|||
#define I_RTE 0x002b
|
||||
|
||||
boolean_t
|
||||
inst_call(inst)
|
||||
int inst;
|
||||
inst_call(int inst)
|
||||
{
|
||||
#if _BYTE_ORDER == BIG_ENDIAN
|
||||
inst >>= 16;
|
||||
|
@ -146,8 +143,7 @@ inst_call(inst)
|
|||
}
|
||||
|
||||
boolean_t
|
||||
inst_return(inst)
|
||||
int inst;
|
||||
inst_return(int inst)
|
||||
{
|
||||
#if _BYTE_ORDER == BIG_ENDIAN
|
||||
inst >>= 16;
|
||||
|
@ -156,8 +152,7 @@ inst_return(inst)
|
|||
}
|
||||
|
||||
boolean_t
|
||||
inst_trap_return(inst)
|
||||
int inst;
|
||||
inst_trap_return(int inst)
|
||||
{
|
||||
#if _BYTE_ORDER == BIG_ENDIAN
|
||||
inst >>= 16;
|
||||
|
@ -166,9 +161,9 @@ inst_trap_return(inst)
|
|||
}
|
||||
|
||||
void
|
||||
db_set_single_step(regs)
|
||||
db_regs_t *regs;
|
||||
db_set_single_step(db_regs_t *regs)
|
||||
{
|
||||
|
||||
SHREG_BBRA = 0; /* disable break */
|
||||
SHREG_BARA = 0; /* break address */
|
||||
SHREG_BASRA = 0; /* break ASID */
|
||||
|
@ -179,9 +174,9 @@ db_set_single_step(regs)
|
|||
}
|
||||
|
||||
void
|
||||
db_clear_single_step(regs)
|
||||
db_regs_t *regs;
|
||||
db_clear_single_step(db_regs_t *regs)
|
||||
{
|
||||
|
||||
regs->tf_ubc = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_memrw.c,v 1.3 2000/09/04 23:11:42 tsubai Exp $ */
|
||||
/* $NetBSD: db_memrw.c,v 1.4 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
|
@ -47,12 +47,9 @@
|
|||
* Read bytes from kernel address space for debugger.
|
||||
*/
|
||||
void
|
||||
db_read_bytes(addr, size, data)
|
||||
vaddr_t addr;
|
||||
register size_t size;
|
||||
register char *data;
|
||||
db_read_bytes(vaddr_t addr, size_t size, char *data)
|
||||
{
|
||||
register char *src;
|
||||
char *src;
|
||||
|
||||
src = (char *)addr;
|
||||
while (size-- > 0)
|
||||
|
@ -63,12 +60,9 @@ db_read_bytes(addr, size, data)
|
|||
* Write bytes to kernel address space for debugger.
|
||||
*/
|
||||
void
|
||||
db_write_bytes(addr, size, data)
|
||||
vaddr_t addr;
|
||||
register size_t size;
|
||||
register char *data;
|
||||
db_write_bytes(vaddr_t addr, size_t size, char *data)
|
||||
{
|
||||
register char *dst;
|
||||
char *dst;
|
||||
|
||||
dst = (char *)addr;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_trace.c,v 1.6 2001/01/18 10:54:28 jdolecek Exp $ */
|
||||
/* $NetBSD: db_trace.c,v 1.7 2002/02/12 15:26:49 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
|
||||
|
@ -47,37 +47,35 @@ extern char _start[], etext[];
|
|||
void db_nextframe(db_addr_t, db_addr_t *, db_addr_t *);
|
||||
|
||||
const struct db_variable db_regs[] = {
|
||||
{ "r0", (long *)&ddb_regs.tf_r0, FCN_NULL },
|
||||
{ "r1", (long *)&ddb_regs.tf_r1, FCN_NULL },
|
||||
{ "r2", (long *)&ddb_regs.tf_r2, FCN_NULL },
|
||||
{ "r3", (long *)&ddb_regs.tf_r3, FCN_NULL },
|
||||
{ "r4", (long *)&ddb_regs.tf_r4, FCN_NULL },
|
||||
{ "r5", (long *)&ddb_regs.tf_r5, FCN_NULL },
|
||||
{ "r6", (long *)&ddb_regs.tf_r6, FCN_NULL },
|
||||
{ "r7", (long *)&ddb_regs.tf_r7, FCN_NULL },
|
||||
{ "r8", (long *)&ddb_regs.tf_r8, FCN_NULL },
|
||||
{ "r9", (long *)&ddb_regs.tf_r9, FCN_NULL },
|
||||
{ "r10", (long *)&ddb_regs.tf_r10, FCN_NULL },
|
||||
{ "r11", (long *)&ddb_regs.tf_r11, FCN_NULL },
|
||||
{ "r12", (long *)&ddb_regs.tf_r12, FCN_NULL },
|
||||
{ "r13", (long *)&ddb_regs.tf_r13, FCN_NULL },
|
||||
{ "r14", (long *)&ddb_regs.tf_r14, FCN_NULL },
|
||||
{ "r15", (long *)&ddb_regs.tf_r15, FCN_NULL },
|
||||
{ "pr", (long *)&ddb_regs.tf_pr, FCN_NULL },
|
||||
{ "spc", (long *)&ddb_regs.tf_spc, FCN_NULL },
|
||||
{ "ssr", (long *)&ddb_regs.tf_ssr, FCN_NULL },
|
||||
{ "mach", (long *)&ddb_regs.tf_mach, FCN_NULL },
|
||||
{ "macl", (long *)&ddb_regs.tf_macl, FCN_NULL },
|
||||
{ "r0", (long *)&ddb_regs.tf_r0, FCN_NULL },
|
||||
{ "r1", (long *)&ddb_regs.tf_r1, FCN_NULL },
|
||||
{ "r2", (long *)&ddb_regs.tf_r2, FCN_NULL },
|
||||
{ "r3", (long *)&ddb_regs.tf_r3, FCN_NULL },
|
||||
{ "r4", (long *)&ddb_regs.tf_r4, FCN_NULL },
|
||||
{ "r5", (long *)&ddb_regs.tf_r5, FCN_NULL },
|
||||
{ "r6", (long *)&ddb_regs.tf_r6, FCN_NULL },
|
||||
{ "r7", (long *)&ddb_regs.tf_r7, FCN_NULL },
|
||||
{ "r8", (long *)&ddb_regs.tf_r8, FCN_NULL },
|
||||
{ "r9", (long *)&ddb_regs.tf_r9, FCN_NULL },
|
||||
{ "r10", (long *)&ddb_regs.tf_r10, FCN_NULL },
|
||||
{ "r11", (long *)&ddb_regs.tf_r11, FCN_NULL },
|
||||
{ "r12", (long *)&ddb_regs.tf_r12, FCN_NULL },
|
||||
{ "r13", (long *)&ddb_regs.tf_r13, FCN_NULL },
|
||||
{ "r14", (long *)&ddb_regs.tf_r14, FCN_NULL },
|
||||
{ "r15", (long *)&ddb_regs.tf_r15, FCN_NULL },
|
||||
{ "pr", (long *)&ddb_regs.tf_pr, FCN_NULL },
|
||||
{ "spc", (long *)&ddb_regs.tf_spc, FCN_NULL },
|
||||
{ "ssr", (long *)&ddb_regs.tf_ssr, FCN_NULL },
|
||||
{ "mach", (long *)&ddb_regs.tf_mach, FCN_NULL },
|
||||
{ "macl", (long *)&ddb_regs.tf_macl, FCN_NULL },
|
||||
};
|
||||
|
||||
const struct db_variable * const db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
|
||||
const struct db_variable * const db_eregs =
|
||||
db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
|
||||
|
||||
void
|
||||
db_stack_trace_print(addr, have_addr, count, modif, print)
|
||||
db_expr_t addr, count;
|
||||
boolean_t have_addr;
|
||||
char *modif;
|
||||
void (*print)(const char *, ...);
|
||||
db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
|
||||
char *modif, void (*print)(const char *, ...))
|
||||
{
|
||||
db_addr_t callpc, frame, lastframe;
|
||||
|
||||
|
@ -116,10 +114,10 @@ db_stack_trace_print(addr, have_addr, count, modif, print)
|
|||
}
|
||||
|
||||
void
|
||||
db_nextframe(pc, fp, pr)
|
||||
db_addr_t pc; /* in: entry address of current function */
|
||||
db_addr_t *fp; /* in: current fp, out: parent fp */
|
||||
db_addr_t *pr; /* out: parent fp */
|
||||
db_nextframe(
|
||||
db_addr_t pc, /* in: entry address of current function */
|
||||
db_addr_t *fp, /* in: current fp, out: parent fp */
|
||||
db_addr_t *pr) /* out: parent fp */
|
||||
{
|
||||
int *frame = (void *)*fp;
|
||||
int i, inst;
|
||||
|
@ -186,7 +184,7 @@ db_nextframe(pc, fp, pr)
|
|||
db_disasm(pc - 2, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
if (fpdepth != -1)
|
||||
*fp = frame[depth - fpdepth - 1];
|
||||
else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disksubr.c,v 1.4 2000/11/20 08:24:21 chs Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.5 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
|
||||
|
@ -35,6 +35,8 @@
|
|||
* @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91
|
||||
*/
|
||||
|
||||
#include "opt_mbr.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/buf.h>
|
||||
|
@ -42,7 +44,6 @@
|
|||
#include <sys/syslog.h>
|
||||
|
||||
#include <machine/bswap.h>
|
||||
#include "opt_mbr.h"
|
||||
|
||||
int fat_types[] = { MBR_PTYPE_FAT12, MBR_PTYPE_FAT16S,
|
||||
MBR_PTYPE_FAT16B, MBR_PTYPE_FAT32,
|
||||
|
@ -51,14 +52,13 @@ int fat_types[] = { MBR_PTYPE_FAT12, MBR_PTYPE_FAT16S,
|
|||
|
||||
#define NO_MBR_SIGNATURE ((struct mbr_partition *) -1)
|
||||
|
||||
void ChangeEndianDiskLabel __P((struct disklabel *));
|
||||
u_int sh3_dkcksum __P((struct disklabel *));
|
||||
static struct mbr_partition *
|
||||
mbr_findslice __P((struct mbr_partition *, struct buf *));
|
||||
void change_endian_disk_label(struct disklabel *);
|
||||
u_int sh3_dkcksum(struct disklabel *);
|
||||
static struct mbr_partition *mbr_findslice(struct mbr_partition *,
|
||||
struct buf *);
|
||||
|
||||
void
|
||||
ChangeEndianDiskLabel(lp)
|
||||
struct disklabel *lp;
|
||||
change_endian_disk_label(struct disklabel *lp)
|
||||
{
|
||||
int i;
|
||||
u_int16_t d;
|
||||
|
@ -109,7 +109,7 @@ ChangeEndianDiskLabel(lp)
|
|||
SW32(d_magic2); /* the magic number (again) */
|
||||
SW16(d_checksum); /* xor of data incl. partitions */
|
||||
|
||||
/* filesystem and partition information: */
|
||||
/* filesystem and partition information: */
|
||||
SW16(d_npartitions); /* number of partitions in following */
|
||||
SW32(d_bbsize); /* size of boot area at sn0, bytes */
|
||||
SW32(d_sbsize); /* max size of fs superblock, bytes */
|
||||
|
@ -121,17 +121,17 @@ ChangeEndianDiskLabel(lp)
|
|||
#if 0
|
||||
t = lp->d_partitions[i].p_fstype;
|
||||
lp->d_partitions[i].p_fstype =
|
||||
lp->d_partitions[i].p_frag;
|
||||
lp->d_partitions[i].p_frag;
|
||||
lp->d_partitions[i].p_frag = t;
|
||||
#endif
|
||||
SW16(d_partitions[i].__partition_u1.cpg);
|
||||
#if 0
|
||||
printf("size,offset,fsize,fstype,frag=[%x,%x,%x,%x,%x]\n",
|
||||
lp->d_partitions[i].p_size,
|
||||
lp->d_partitions[i].p_offset,
|
||||
lp->d_partitions[i].p_fsize,
|
||||
lp->d_partitions[i].p_fstype,
|
||||
lp->d_partitions[i].p_frag);
|
||||
lp->d_partitions[i].p_size,
|
||||
lp->d_partitions[i].p_offset,
|
||||
lp->d_partitions[i].p_fsize,
|
||||
lp->d_partitions[i].p_fstype,
|
||||
lp->d_partitions[i].p_frag);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
@ -142,11 +142,8 @@ ChangeEndianDiskLabel(lp)
|
|||
* Otherwise, copy valid MBR partition-table into dp, and if a NetBSD
|
||||
* partition is found, return a pointer to it; else return NULL.
|
||||
*/
|
||||
static
|
||||
struct mbr_partition *
|
||||
mbr_findslice(dp, bp)
|
||||
struct mbr_partition *dp;
|
||||
struct buf *bp;
|
||||
static struct mbr_partition *
|
||||
mbr_findslice(struct mbr_partition *dp, struct buf *bp)
|
||||
{
|
||||
struct mbr_partition *ourdp = NULL;
|
||||
u_int16_t *mbrmagicp;
|
||||
|
@ -187,7 +184,7 @@ mbr_findslice(dp, bp)
|
|||
}
|
||||
#endif /* COMPAT_386BSD_MBRPART */
|
||||
|
||||
return (ourdp);
|
||||
return (ourdp);
|
||||
}
|
||||
|
||||
|
||||
|
@ -207,11 +204,8 @@ mbr_findslice(dp, bp)
|
|||
* Returns null on success and an error string on failure.
|
||||
*/
|
||||
char *
|
||||
readdisklabel(dev, strat, lp, osdep)
|
||||
dev_t dev;
|
||||
void (*strat) __P((struct buf *));
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *osdep;
|
||||
readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
struct mbr_partition *dp;
|
||||
struct partition *pp;
|
||||
|
@ -230,10 +224,10 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
#if 0
|
||||
if (lp->d_ncylinders == 16383) {
|
||||
printf("disklabel: Disk > 8G ... readjusting chs %d/%d/%d to ",
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders = lp->d_secperunit / lp->d_ntracks / lp->d_nsectors;
|
||||
printf("%d/%d/%d\n",
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
lp->d_ncylinders, lp->d_ntracks, lp->d_nsectors);
|
||||
}
|
||||
#endif
|
||||
lp->d_npartitions = RAW_PART + 1;
|
||||
|
@ -295,15 +289,15 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
|
||||
/* update disklabel with details */
|
||||
lp->d_partitions[2].p_size =
|
||||
dp->mbrp_size;
|
||||
dp->mbrp_size;
|
||||
lp->d_partitions[2].p_offset =
|
||||
dp->mbrp_start;
|
||||
dp->mbrp_start;
|
||||
#if 0
|
||||
if (lp->d_ntracks != dp->mbrp_ehd + 1 ||
|
||||
lp->d_nsectors != MBR_PSECT(dp->mbrp_esect)) {
|
||||
printf("disklabel: BIOS sees chs %d/%d/%d as ",
|
||||
lp->d_ncylinders, lp->d_ntracks,
|
||||
lp->d_nsectors);
|
||||
lp->d_ncylinders, lp->d_ntracks,
|
||||
lp->d_nsectors);
|
||||
lp->d_ntracks = dp->mbrp_ehd + 1;
|
||||
lp->d_nsectors = MBR_PSECT(dp->mbrp_esect);
|
||||
lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
|
||||
|
@ -311,9 +305,9 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
if (! lp->d_ncylinders)
|
||||
lp->d_ncylinders = 1;
|
||||
printf("%d/%d/%d\n",
|
||||
lp->d_ncylinders, lp->d_ntracks,
|
||||
lp->d_nsectors);
|
||||
}
|
||||
lp->d_ncylinders, lp->d_ntracks,
|
||||
lp->d_nsectors);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -339,12 +333,12 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
dls = *dlp;
|
||||
|
||||
ChangeEndianDiskLabel(&dls);
|
||||
change_endian_disk_label(&dls);
|
||||
if (dls.d_magic != DISKMAGIC || dls.d_magic2 != DISKMAGIC) {
|
||||
if (msg == NULL)
|
||||
msg = "no disk label";
|
||||
} else if (dls.d_npartitions > MAXPARTITIONS ||
|
||||
sh3_dkcksum(&dls) != 0)
|
||||
sh3_dkcksum(&dls) != 0)
|
||||
msg = "disk label corrupted";
|
||||
else {
|
||||
*lp = dls;
|
||||
|
@ -382,7 +376,7 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
db = (struct dkbad *)(bp->b_data);
|
||||
#define DKBAD_MAGIC 0x4321
|
||||
if (db->bt_mbz == 0
|
||||
&& db->bt_flag == DKBAD_MAGIC) {
|
||||
&& db->bt_flag == DKBAD_MAGIC) {
|
||||
msg = NULL;
|
||||
*bdp = *db;
|
||||
break;
|
||||
|
@ -390,39 +384,38 @@ readdisklabel(dev, strat, lp, osdep)
|
|||
msg = "bad sector table corrupted";
|
||||
}
|
||||
} while ((bp->b_flags & B_ERROR) && (i += 2) < 10 &&
|
||||
i < lp->d_nsectors);
|
||||
i < lp->d_nsectors);
|
||||
}
|
||||
|
||||
done:
|
||||
done:
|
||||
brelse(bp);
|
||||
return (msg);
|
||||
}
|
||||
|
||||
u_int
|
||||
sh3_dkcksum(lp)
|
||||
struct disklabel *lp;
|
||||
sh3_dkcksum(struct disklabel *lp)
|
||||
{
|
||||
struct disklabel tdl;
|
||||
u_short *start, *end;
|
||||
int offset;
|
||||
u_short sum = 0;
|
||||
u_short w;
|
||||
struct disklabel tdl;
|
||||
u_short *start, *end;
|
||||
int offset;
|
||||
u_short sum = 0;
|
||||
u_short w;
|
||||
|
||||
tdl = *lp;
|
||||
tdl = *lp;
|
||||
|
||||
ChangeEndianDiskLabel(&tdl);
|
||||
start = (u_short *)lp;
|
||||
end = (u_short *)&lp->d_partitions[lp->d_npartitions];
|
||||
offset = end - start;
|
||||
change_endian_disk_label(&tdl);
|
||||
start = (u_short *)lp;
|
||||
end = (u_short *)&lp->d_partitions[lp->d_npartitions];
|
||||
offset = end - start;
|
||||
|
||||
start = (u_short *)&tdl;
|
||||
end = start + offset;
|
||||
while (start < end) {
|
||||
w = *start++;
|
||||
sum ^= bswap16(w);
|
||||
}
|
||||
start = (u_short *)&tdl;
|
||||
end = start + offset;
|
||||
while (start < end) {
|
||||
w = *start++;
|
||||
sum ^= bswap16(w);
|
||||
}
|
||||
|
||||
return (sum);
|
||||
return (sum);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -430,18 +423,16 @@ sh3_dkcksum(lp)
|
|||
* before setting it.
|
||||
*/
|
||||
int
|
||||
setdisklabel(olp, nlp, openmask, osdep)
|
||||
struct disklabel *olp, *nlp;
|
||||
u_long openmask;
|
||||
struct cpu_disklabel *osdep;
|
||||
setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
int i;
|
||||
struct partition *opp, *npp;
|
||||
|
||||
/* sanity clause */
|
||||
if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0
|
||||
|| (nlp->d_secsize % DEV_BSIZE) != 0)
|
||||
return(EINVAL);
|
||||
|| (nlp->d_secsize % DEV_BSIZE) != 0)
|
||||
return(EINVAL);
|
||||
|
||||
/* special case to allow disklabel to be invalidated */
|
||||
if (nlp->d_magic == 0xffffffff) {
|
||||
|
@ -486,11 +477,8 @@ setdisklabel(olp, nlp, openmask, osdep)
|
|||
* Write disk label back to device after modification.
|
||||
*/
|
||||
int
|
||||
writedisklabel(dev, strat, lp, osdep)
|
||||
dev_t dev;
|
||||
void (*strat) __P((struct buf *));
|
||||
struct disklabel *lp;
|
||||
struct cpu_disklabel *osdep;
|
||||
writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
|
||||
struct cpu_disklabel *osdep)
|
||||
{
|
||||
struct mbr_partition *dp;
|
||||
struct buf *bp;
|
||||
|
@ -525,7 +513,7 @@ writedisklabel(dev, strat, lp, osdep)
|
|||
|
||||
if (ourdp) {
|
||||
/* need sector address for SCSI/IDE,
|
||||
cylinder for ESDI/ST506/RLL */
|
||||
cylinder for ESDI/ST506/RLL */
|
||||
dospartoff = ourdp->mbrp_start;
|
||||
cyl = MBR_PCYL(ourdp->mbrp_scyl, ourdp->mbrp_ssect);
|
||||
}
|
||||
|
@ -535,7 +523,7 @@ writedisklabel(dev, strat, lp, osdep)
|
|||
#ifdef maybe
|
||||
/* disklabel in appropriate location? */
|
||||
if (lp->d_partitions[2].p_offset != 0
|
||||
&& lp->d_partitions[2].p_offset != dospartoff) {
|
||||
&& lp->d_partitions[2].p_offset != dospartoff) {
|
||||
error = EXDEV;
|
||||
goto done;
|
||||
}
|
||||
|
@ -557,11 +545,11 @@ writedisklabel(dev, strat, lp, osdep)
|
|||
dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
|
||||
dls = *dlp;
|
||||
|
||||
ChangeEndianDiskLabel(&dls);
|
||||
change_endian_disk_label(&dls);
|
||||
if (dls.d_magic == DISKMAGIC && dls.d_magic2 == DISKMAGIC &&
|
||||
sh3_dkcksum(&dls) == 0) {
|
||||
dls = *lp;
|
||||
ChangeEndianDiskLabel(&dls);
|
||||
change_endian_disk_label(&dls);
|
||||
*dlp = dls;
|
||||
bp->b_flags &= ~(B_READ|B_DONE);
|
||||
bp->b_flags |= B_WRITE;
|
||||
|
@ -572,7 +560,7 @@ writedisklabel(dev, strat, lp, osdep)
|
|||
}
|
||||
error = ESRCH;
|
||||
|
||||
done:
|
||||
done:
|
||||
brelse(bp);
|
||||
return (error);
|
||||
}
|
||||
|
@ -583,10 +571,7 @@ done:
|
|||
* if needed, and signal errors or early completion.
|
||||
*/
|
||||
int
|
||||
bounds_check_with_label(bp, lp, wlabel)
|
||||
struct buf *bp;
|
||||
struct disklabel *lp;
|
||||
int wlabel;
|
||||
bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
|
||||
{
|
||||
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
|
||||
int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
|
||||
|
@ -625,8 +610,8 @@ bounds_check_with_label(bp, lp, wlabel)
|
|||
(lp->d_secsize / DEV_BSIZE) / lp->d_secpercyl;
|
||||
return (1);
|
||||
|
||||
bad:
|
||||
bad:
|
||||
bp->b_flags |= B_ERROR;
|
||||
done:
|
||||
done:
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dkbad.c,v 1.1 1999/09/13 10:31:29 itojun Exp $ */
|
||||
/* $NetBSD: dkbad.c,v 1.2 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -50,15 +50,15 @@
|
|||
* Return -1 if not found.
|
||||
*/
|
||||
|
||||
isbad(bt, cyl, trk, sec)
|
||||
register struct dkbad *bt;
|
||||
isbad(struct dkbad *bt)
|
||||
{
|
||||
register int i;
|
||||
register long blk, bblk;
|
||||
int i;
|
||||
long blk, bblk;
|
||||
|
||||
blk = ((long)cyl << 16) + (trk << 8) + sec;
|
||||
for (i = 0; i < 126; i++) {
|
||||
bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec;
|
||||
bblk = ((long)bt->bt_bad[i].bt_cyl << 16) +
|
||||
bt->bt_bad[i].bt_trksec;
|
||||
if (blk == bblk)
|
||||
return (i);
|
||||
if (blk < bblk || bblk < 0)
|
||||
|
@ -66,4 +66,4 @@ isbad(bt, cyl, trk, sec)
|
|||
}
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
#endif /* !NOBADSECT */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kgdb_machdep.c,v 1.3 2001/11/20 08:43:34 lukem Exp $ */
|
||||
/* $NetBSD: kgdb_machdep.c,v 1.4 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -91,15 +91,13 @@
|
|||
#include <machine/trap.h>
|
||||
|
||||
/* XXX Should be in <machine/pmap.h> */
|
||||
pt_entry_t *pmap_pte __P((pmap_t, vaddr_t));
|
||||
pt_entry_t *pmap_pte(pmap_t, vaddr_t);
|
||||
|
||||
/*
|
||||
* Determine if the memory at va..(va+len) is valid.
|
||||
*/
|
||||
int
|
||||
kgdb_acc(va, len)
|
||||
vaddr_t va;
|
||||
size_t len;
|
||||
kgdb_acc(vaddr_t va, size_t len)
|
||||
{
|
||||
vaddr_t last_va;
|
||||
pt_entry_t pte;
|
||||
|
@ -123,8 +121,7 @@ kgdb_acc(va, len)
|
|||
* (gdb only understands unix signal numbers).
|
||||
*/
|
||||
int
|
||||
kgdb_signal(type)
|
||||
int type;
|
||||
kgdb_signal(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case T_NMI:
|
||||
|
@ -169,9 +166,7 @@ kgdb_signal(type)
|
|||
* understood by gdb.
|
||||
*/
|
||||
void
|
||||
kgdb_getregs(regs, gdb_regs)
|
||||
db_regs_t *regs;
|
||||
kgdb_reg_t *gdb_regs;
|
||||
kgdb_getregs(db_regs_t *regs, kgdb_reg_t *gdb_regs)
|
||||
{
|
||||
|
||||
gdb_regs[ 0] = regs->tf_eax;
|
||||
|
@ -201,9 +196,7 @@ kgdb_getregs(regs, gdb_regs)
|
|||
* Reverse the above.
|
||||
*/
|
||||
void
|
||||
kgdb_setregs(regs, gdb_regs)
|
||||
db_regs_t *regs;
|
||||
kgdb_reg_t *gdb_regs;
|
||||
kgdb_setregs(db_regs_t *regs, kgdb_reg_t *gdb_regs)
|
||||
{
|
||||
|
||||
regs->tf_eax = gdb_regs[ 0];
|
||||
|
@ -233,8 +226,7 @@ kgdb_setregs(regs, gdb_regs)
|
|||
* noting on the console why nothing else is going on.
|
||||
*/
|
||||
void
|
||||
kgdb_connect(verbose)
|
||||
int verbose;
|
||||
kgdb_connect(int verbose)
|
||||
{
|
||||
|
||||
if (kgdb_dev < 0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mem.c,v 1.7 2001/09/10 21:19:23 chris Exp $ */
|
||||
/* $NetBSD: mem.c,v 1.8 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -65,10 +65,7 @@ caddr_t zeropage;
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mmopen(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
mmopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
|
||||
switch (minor(dev)) {
|
||||
|
@ -81,10 +78,7 @@ mmopen(dev, flag, mode, p)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mmclose(dev, flag, mode, p)
|
||||
dev_t dev;
|
||||
int flag, mode;
|
||||
struct proc *p;
|
||||
mmclose(dev_t dev, int flag, int mode, struct proc *p)
|
||||
{
|
||||
|
||||
return (0);
|
||||
|
@ -92,10 +86,7 @@ mmclose(dev, flag, mode, p)
|
|||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
mmrw(dev, uio, flags)
|
||||
dev_t dev;
|
||||
struct uio *uio;
|
||||
int flags;
|
||||
mmrw(dev_t dev, struct uio *uio, int flags)
|
||||
{
|
||||
register vaddr_t o, v;
|
||||
register int c;
|
||||
|
@ -189,10 +180,7 @@ mmrw(dev, uio, flags)
|
|||
}
|
||||
|
||||
paddr_t
|
||||
mmmmap(dev, off, prot)
|
||||
dev_t dev;
|
||||
off_t off;
|
||||
int prot;
|
||||
mmmmap(dev_t dev, off_t off, int prot)
|
||||
{
|
||||
struct proc *p = curproc; /* XXX */
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: process_machdep.c,v 1.2 2000/04/13 15:51:26 msaitoh Exp $ */
|
||||
/* $NetBSD: process_machdep.c,v 1.3 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 1996, 1997
|
||||
|
@ -77,20 +77,17 @@
|
|||
#include <machine/reg.h>
|
||||
#include <machine/segments.h>
|
||||
|
||||
static __inline struct trapframe *process_frame __P((struct proc *));
|
||||
static __inline struct trapframe *process_frame(struct proc *);
|
||||
|
||||
static __inline struct trapframe *
|
||||
process_frame(p)
|
||||
struct proc *p;
|
||||
process_frame(struct proc *p)
|
||||
{
|
||||
|
||||
return (p->p_md.md_regs);
|
||||
}
|
||||
|
||||
int
|
||||
process_read_regs(p, regs)
|
||||
struct proc *p;
|
||||
struct reg *regs;
|
||||
process_read_regs(struct proc *p, struct reg *regs)
|
||||
{
|
||||
struct trapframe *tf = process_frame(p);
|
||||
#if 0
|
||||
|
@ -126,9 +123,7 @@ process_read_regs(p, regs)
|
|||
}
|
||||
|
||||
int
|
||||
process_write_regs(p, regs)
|
||||
struct proc *p;
|
||||
struct reg *regs;
|
||||
process_write_regs(struct proc *p, struct reg *regs)
|
||||
{
|
||||
struct trapframe *tf = process_frame(p);
|
||||
|
||||
|
@ -186,9 +181,7 @@ process_sstep(p, sstep)
|
|||
}
|
||||
|
||||
int
|
||||
process_set_pc(p, addr)
|
||||
struct proc *p;
|
||||
caddr_t addr;
|
||||
process_set_pc(struct proc *p, caddr_t addr)
|
||||
{
|
||||
struct trapframe *tf = process_frame(p);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sh3_machdep.c,v 1.22 2002/02/11 18:03:06 uch Exp $ */
|
||||
/* $NetBSD: sh3_machdep.c,v 1.23 2002/02/12 15:26:50 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -237,11 +237,7 @@ sh3_startup()
|
|||
* specified pc, psl.
|
||||
*/
|
||||
void
|
||||
sendsig(catcher, sig, mask, code)
|
||||
sig_t catcher;
|
||||
int sig;
|
||||
sigset_t *mask;
|
||||
u_long code;
|
||||
sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
|
||||
{
|
||||
struct proc *p = curproc;
|
||||
struct trapframe *tf;
|
||||
|
@ -344,10 +340,7 @@ sendsig(catcher, sig, mask, code)
|
|||
* a machine fault.
|
||||
*/
|
||||
int
|
||||
sys___sigreturn14(p, v, retval)
|
||||
struct proc *p;
|
||||
void *v;
|
||||
register_t *retval;
|
||||
sys___sigreturn14(struct proc *p, void *v, register_t *retval)
|
||||
{
|
||||
struct sys___sigreturn14_args /* {
|
||||
syscallarg(struct sigcontext *) sigcntxp;
|
||||
|
@ -407,10 +400,7 @@ sys___sigreturn14(p, v, retval)
|
|||
* Clear registers on exec
|
||||
*/
|
||||
void
|
||||
setregs(p, pack, stack)
|
||||
struct proc *p;
|
||||
struct exec_package *pack;
|
||||
u_long stack;
|
||||
setregs(struct proc *p, struct exec_package *pack, u_long stack)
|
||||
{
|
||||
register struct pcb *pcb = &p->p_addr->u_pcb;
|
||||
register struct trapframe *tf;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sys_machdep.c,v 1.4 2000/06/29 07:44:06 mrg Exp $ */
|
||||
/* $NetBSD: sys_machdep.c,v 1.5 2002/02/12 15:26:51 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1997
|
||||
|
@ -63,10 +63,7 @@
|
|||
#include <machine/reg.h>
|
||||
|
||||
int
|
||||
sys_sysarch(p, v, retval)
|
||||
struct proc *p;
|
||||
void *v;
|
||||
register_t *retval;
|
||||
sys_sysarch(struct proc *p, void *v, register_t *retval)
|
||||
{
|
||||
#if 0 /* unused */
|
||||
struct sys_sysarch_args /* {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vm_machdep.c,v 1.22 2001/09/16 16:40:45 wiz Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.23 2002/02/12 15:26:51 uch Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
|
||||
|
@ -61,7 +61,7 @@
|
|||
#include <machine/cpu.h>
|
||||
#include <machine/reg.h>
|
||||
|
||||
void setredzone __P((u_short *, caddr_t));
|
||||
void setredzone(u_short *, caddr_t);
|
||||
|
||||
/*
|
||||
* Finish a fork operation, with process p2 nearly set up.
|
||||
|
@ -82,16 +82,12 @@ void setredzone __P((u_short *, caddr_t));
|
|||
* accordingly.
|
||||
*/
|
||||
void
|
||||
cpu_fork(p1, p2, stack, stacksize, func, arg)
|
||||
register struct proc *p1, *p2;
|
||||
void *stack;
|
||||
size_t stacksize;
|
||||
void (*func) __P((void *));
|
||||
void *arg;
|
||||
cpu_fork(struct proc *p1, struct proc *p2, void *stack,
|
||||
size_t stacksize, void (*func)(void *), void *arg)
|
||||
{
|
||||
register struct pcb *pcb = &p2->p_addr->u_pcb;
|
||||
register struct trapframe *tf;
|
||||
register struct switchframe *sf;
|
||||
struct pcb *pcb = &p2->p_addr->u_pcb;
|
||||
struct trapframe *tf;
|
||||
struct switchframe *sf;
|
||||
|
||||
#ifdef sh3_debug
|
||||
printf("cpu_fork:p1(%p),p2(%p)\n", p1, p2);
|
||||
|
@ -143,8 +139,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg)
|
|||
}
|
||||
|
||||
void
|
||||
cpu_swapout(p)
|
||||
struct proc *p;
|
||||
cpu_swapout(struct proc *p)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -157,8 +152,7 @@ cpu_swapout(p)
|
|||
* jumps into switch() to wait for another process to wake up.
|
||||
*/
|
||||
void
|
||||
cpu_exit(p)
|
||||
register struct proc *p;
|
||||
cpu_exit(struct proc *p)
|
||||
{
|
||||
uvmexp.swtch++;
|
||||
switch_exit(p);
|
||||
|
@ -172,11 +166,8 @@ struct md_core {
|
|||
};
|
||||
|
||||
int
|
||||
cpu_coredump(p, vp, cred, chdr)
|
||||
struct proc *p;
|
||||
struct vnode *vp;
|
||||
struct ucred *cred;
|
||||
struct core *chdr;
|
||||
cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
|
||||
struct core *chdr)
|
||||
{
|
||||
struct md_core md_core;
|
||||
struct coreseg cseg;
|
||||
|
@ -218,9 +209,7 @@ cpu_coredump(p, vp, cred, chdr)
|
|||
* Set a red zone in the kernel stack after the u. area.
|
||||
*/
|
||||
void
|
||||
setredzone(pte, vaddr)
|
||||
u_short *pte;
|
||||
caddr_t vaddr;
|
||||
setredzone(u_short *pte, caddr_t vaddr)
|
||||
{
|
||||
/* eventually do this by setting up an expand-down stack segment
|
||||
for ss0: selector, allowing stack access down to top of u.
|
||||
|
@ -238,11 +227,9 @@ setredzone(pte, vaddr)
|
|||
* Both addresses are assumed to reside in the Sysmap.
|
||||
*/
|
||||
void
|
||||
pagemove(from, to, size)
|
||||
register caddr_t from, to;
|
||||
size_t size;
|
||||
pagemove(caddr_t from, caddr_t to, size_t size)
|
||||
{
|
||||
register pt_entry_t *fpte, *tpte;
|
||||
pt_entry_t *fpte, *tpte;
|
||||
|
||||
if (size % NBPG)
|
||||
panic("pagemove");
|
||||
|
@ -280,9 +267,7 @@ extern struct vm_map *phys_map;
|
|||
*/
|
||||
|
||||
void
|
||||
vmapbuf(bp, len)
|
||||
struct buf *bp;
|
||||
vsize_t len;
|
||||
vmapbuf(struct buf *bp, vsize_t len)
|
||||
{
|
||||
vaddr_t faddr, taddr, off;
|
||||
paddr_t fpa;
|
||||
|
@ -323,9 +308,7 @@ vmapbuf(bp, len)
|
|||
* We also invalidate the TLB entries and restore the original b_addr.
|
||||
*/
|
||||
void
|
||||
vunmapbuf(bp, len)
|
||||
struct buf *bp;
|
||||
vsize_t len;
|
||||
vunmapbuf(struct buf *bp, vsize_t len)
|
||||
{
|
||||
vaddr_t addr, off;
|
||||
|
||||
|
|
Loading…
Reference in New Issue