ANSI KNF.

This commit is contained in:
uch 2001-06-04 18:59:31 +00:00
parent 842b6023c3
commit 859a6a49b2
17 changed files with 343 additions and 513 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bivideovar.h,v 1.1 2001/02/22 18:37:54 uch Exp $ */
/* $NetBSD: bivideovar.h,v 1.2 2001/06/04 18:59:31 uch Exp $ */
/*
* Copyright (c) 2000 Takemura Shin
@ -28,4 +28,4 @@
*/
extern int bivideo_dont_attach;
int bivideo_getcnfb __P((struct hpcfb_fbconf* fb));
int bivideo_getcnfb(struct hpcfb_fbconf *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: btnmgr.c,v 1.1 2001/02/22 18:37:54 uch Exp $ */
/* $NetBSD: btnmgr.c,v 1.2 2001/06/04 18:59:31 uch Exp $ */
/*-
* Copyright (c) 1999
@ -79,18 +79,10 @@ struct btnmgr_softc {
#endif
};
/*
static struct btnmgr_softc *the_btnmgr_sc;
*/
/*
void btnmgrattach __P((int));
*/
int btnmgrmatch __P((struct device *, struct cfdata *, void *));
void btnmgrattach __P((struct device *, struct device *, void *));
char* btnmgr_name __P((long));
static int btnmgr_hook __P((void *, int, long, void *));
int btnmgrmatch(struct device *, struct cfdata *, void *);
void btnmgrattach(struct device *, struct device *, void *);
char *btnmgr_name(long);
static int btnmgr_hook(void *, int, long, void *);
/*
* global/static data
@ -100,9 +92,9 @@ struct cfattach btnmgr_ca = {
};
/* wskbd accessopts */
int btnmgr_wskbd_enable __P((void *, int));
void btnmgr_wskbd_set_leds __P((void *, int));
int btnmgr_wskbd_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
int btnmgr_wskbd_enable(void *, int);
void btnmgr_wskbd_set_leds(void *, int);
int btnmgr_wskbd_ioctl(void *, u_long, caddr_t, int, struct proc *);
const struct wskbd_accessops btnmgr_wskbd_accessops = {
btnmgr_wskbd_enable,
@ -165,10 +157,7 @@ struct wskbd_mapdata btnmgr_keymapdata = {
* function bodies
*/
int
btnmgrmatch(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
btnmgrmatch(struct device *parent, struct cfdata *match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@ -179,9 +168,7 @@ btnmgrmatch(parent, match, aux)
}
void
btnmgrattach(parent, self, aux)
struct device *parent, *self;
void *aux;
btnmgrattach(struct device *parent, struct device *self, void *aux)
{
int id;
struct btnmgr_softc *sc = (struct btnmgr_softc *)self;
@ -210,11 +197,7 @@ btnmgrattach(parent, self, aux)
}
static int
btnmgr_hook(ctx, type, id, msg)
void *ctx;
int type;
long id;
void *msg;
btnmgr_hook(void *ctx, int type, long id, void *msg)
{
struct btnmgr_softc *sc = ctx;
@ -245,18 +228,15 @@ btnmgr_hook(ctx, type, id, msg)
}
char*
btnmgr_name(id)
long id;
btnmgr_name(long id)
{
if (id < n_button_config)
return button_config[id].name;
return (button_config[id].name);
return ("unknown");
}
int
btnmgr_wskbd_enable(scx, on)
void *scx;
int on;
btnmgr_wskbd_enable(void *scx, int on)
{
struct btnmgr_softc *sc = scx;
@ -272,9 +252,7 @@ btnmgr_wskbd_enable(scx, on)
}
void
btnmgr_wskbd_set_leds(scx, leds)
void *scx;
int leds;
btnmgr_wskbd_set_leds(void *scx, int leds)
{
/*
* We have nothing to do.
@ -282,12 +260,8 @@ btnmgr_wskbd_set_leds(scx, leds)
}
int
btnmgr_wskbd_ioctl(scx, cmd, data, flag, p)
void *scx;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
btnmgr_wskbd_ioctl(void *scx, u_long cmd, caddr_t data, int flag,
struct proc *p)
{
#ifdef WSDISPLAY_COMPAT_RAWKBD
struct btnmgr_softc *sc = scx;
@ -295,10 +269,10 @@ btnmgr_wskbd_ioctl(scx, cmd, data, flag, p)
switch (cmd) {
case WSKBDIO_GTYPE:
*(int *)data = WSKBD_TYPE_HPC_BTN;
return 0;
return (0);
case WSKBDIO_SETLEDS:
DPRINTF(("%s(%d): no LED\n", __FILE__, __LINE__));
return 0;
return (0);
case WSKBDIO_GETLEDS:
DPRINTF(("%s(%d): no LED\n", __FILE__, __LINE__));
*(int *)data = 0;
@ -316,48 +290,31 @@ btnmgr_wskbd_ioctl(scx, cmd, data, flag, p)
#ifdef notyet
int
btnmgropen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
btnmgropen(dev_t dev, int flag, int mode, struct proc *p)
{
return (EINVAL);
}
int
btnmgrclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
struct proc *p;
btnmgrclose(dev_t dev, int flag, int mode, struct proc *p)
{
return (EINVAL);
}
int
btnmgrread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
btnmgrread(dev_t dev, struct uio *uio, int flag)
{
return (EINVAL);
}
int
btnmgrwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
btnmgrwrite(dev_t dev, struct uio *uio, int flag)
{
return (EINVAL);
}
int
btnmgrioctl(dev, cmd, data, flag, p)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
btnmgrioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
return (EINVAL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: button.c,v 1.3 2001/05/01 00:25:16 takemura Exp $ */
/* $NetBSD: button.c,v 1.4 2001/06/04 18:59:31 uch Exp $ */
/*-
* Copyright (c) 1999-2001
@ -59,40 +59,31 @@ struct button_softc {
config_hook_tag sc_ghook_tag;
};
static int button_match __P((struct device *, struct cfdata *,
void *));
static void button_attach __P((struct device *, struct device *,
void *));
static int button_intr __P((void*));
static int button_state __P((void *ctx, int type, long id,
void *msg));
static int button_match(struct device *, struct cfdata *, void *);
static void button_attach(struct device *, struct device *, void *);
static int button_intr(void *);
static int button_state(void *, int, long, void *);
struct cfattach button_ca = {
sizeof(struct button_softc), button_match, button_attach
};
int
button_match(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
button_match(struct device *parent, struct cfdata *match, void *aux)
{
struct hpcio_attach_args *haa = aux;
platid_mask_t mask;
if (strcmp(haa->haa_busname, HPCIO_BUSNAME))
return 0;
return (0);
if (match->cf_loc[HPCIOIFCF_PLATFORM] == 0)
return 0;
return (0);
mask = PLATID_DEREF(match->cf_loc[HPCIOIFCF_PLATFORM]);
return platid_match(&platid, &mask);
return (platid_match(&platid, &mask));
}
void
button_attach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
button_attach(struct device *parent, struct device *self, void *aux)
{
struct hpcio_attach_args *haa = aux;
int *loc;
@ -152,36 +143,28 @@ button_attach(parent, self, aux)
sc->sc_intr_handle =
hpcio_intr_establish(sc->sc_hc, sc->sc_port,
mode, button_intr, sc);
sc->sc_ghook_tag = config_hook(CONFIG_HOOK_GET,
sc->sc_id,
CONFIG_HOOK_SHARE,
button_state,
sc);
sc->sc_ghook_tag = config_hook(CONFIG_HOOK_GET, sc->sc_id,
CONFIG_HOOK_SHARE, button_state, sc);
printf("\n");
}
int
button_state(ctx, type, id, msg)
void *ctx;
int type;
long id;
void *msg;
button_state(void *ctx, int type, long id, void *msg)
{
struct button_softc *sc = ctx;
if (type != CONFIG_HOOK_GET || id != sc->sc_id)
return 1;
return (1);
if (CONFIG_HOOK_VALUEP(msg))
return 1;
return (1);
*(int*)msg = (hpcio_portread(sc->sc_hc, sc->sc_port) == sc->sc_active);
return 0;
return (0);
}
int
button_intr(ctx)
void *ctx;
button_intr(void *ctx)
{
struct button_softc *sc = ctx;
int on;
@ -193,5 +176,5 @@ button_intr(ctx)
config_hook_call(CONFIG_HOOK_BUTTONEVENT, sc->sc_id, (void*)on);
return 0;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fontconv.c,v 1.1 2001/02/22 18:37:55 uch Exp $ */
/* $NetBSD: fontconv.c,v 1.2 2001/06/04 18:59:31 uch Exp $ */
#include <stdio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpccmap_gen.c,v 1.2 2001/05/08 14:46:06 uch Exp $ */
/* $NetBSD: hpccmap_gen.c,v 1.3 2001/06/04 18:59:31 uch Exp $ */
/*-
* Copyright (c) 1999
@ -45,9 +45,7 @@ unsigned char compo6[6] = { 0, 51, 102, 153, 204, 255 };
unsigned char compo7[7] = { 0, 42, 85, 127, 170, 212, 255 };
void
main(ac, av)
int ac;
char *av[];
main(int ac, char *av[])
{
int i;
char *rgb = "rgb";
@ -65,10 +63,8 @@ main(ac, av)
}
void
rgb_separate_out(ctxx, idx, r, g, b)
void* ctxx;
int idx;
unsigned char r, g, b;
rgb_separate_out(void *ctxx, int idx, unsigned char r, unsigned char g,
unsigned char b)
{
int rgb = (int)ctxx;
@ -90,9 +86,7 @@ rgb_separate_out(ctxx, idx, r, g, b)
}
void
cmap_gen(func, ctx)
output_func func;
void *ctx;
cmap_gen(output_func func, void *ctx)
{
int i, r, g, b;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcfb.c,v 1.3 2001/05/08 14:46:06 uch Exp $ */
/* $NetBSD: hpcfb.c,v 1.4 2001/06/04 18:59:31 uch Exp $ */
/*-
* Copyright (c) 1999
@ -46,7 +46,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$NetBSD: hpcfb.c,v 1.3 2001/05/08 14:46:06 uch Exp $";
"$NetBSD: hpcfb.c,v 1.4 2001/06/04 18:59:31 uch Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@ -165,7 +165,7 @@ struct hpcfb_softc {
struct proc *sc_thread;
struct lock sc_lock;
void *sc_wantedscreen;
void (*sc_switchcb) __P((void *, int, int));
void (*sc_switchcb)(void *, int, int);
void *sc_switchcbarg;
struct callout sc_switch_callout;
};
@ -173,52 +173,49 @@ struct hpcfb_softc {
/*
* function prototypes
*/
int hpcfbmatch __P((struct device *, struct cfdata *, void *));
void hpcfbattach __P((struct device *, struct device *, void *));
int hpcfbprint __P((void *aux, const char *pnp));
int hpcfbmatch(struct device *, struct cfdata *, void *);
void hpcfbattach(struct device *, struct device *, void *);
int hpcfbprint(void *, const char *);
int hpcfb_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
paddr_t hpcfb_mmap __P((void *, off_t, int));
int hpcfb_ioctl(void *, u_long, caddr_t, int, struct proc *);
paddr_t hpcfb_mmap(void *, off_t, int);
void hpcfb_refresh_screen __P((struct hpcfb_softc *sc));
void hpcfb_doswitch __P((struct hpcfb_softc *sc));
void hpcfb_refresh_screen(struct hpcfb_softc *);
void hpcfb_doswitch(struct hpcfb_softc *);
#ifdef HPCFB_JUMP
static void hpcfb_create_thread __P((void *));
static void hpcfb_thread __P((void *));
static void hpcfb_create_thread(void *);
static void hpcfb_thread(void *);
#endif /* HPCFB_JUMP */
static int hpcfb_init __P((struct hpcfb_fbconf *fbconf,
struct hpcfb_devconfig *dc));
static int hpcfb_alloc_screen __P((void *, const struct wsscreen_descr *,
void **, int *, int *, long *));
static void hpcfb_free_screen __P((void *, void *));
static int hpcfb_show_screen __P((void *, void *, int,
void (*) (void *, int, int), void *));
static void hpcfb_pollc __P((void *, int));
static void hpcfb_power __P((int, void *));
static void hpcfb_cmap_reorder __P((struct hpcfb_fbconf *,
struct hpcfb_devconfig *));
static int hpcfb_init(struct hpcfb_fbconf *, struct hpcfb_devconfig *);
static int hpcfb_alloc_screen(void *, const struct wsscreen_descr *,
void **, int *, int *, long *);
static void hpcfb_free_screen(void *, void *);
static int hpcfb_show_screen(void *, void *, int,
void (*) (void *, int, int), void *);
static void hpcfb_pollc(void *, int);
static void hpcfb_power(int, void *);
static void hpcfb_cmap_reorder(struct hpcfb_fbconf *,
struct hpcfb_devconfig *);
static int pow __P((int, int));
static int pow(int, int);
void hpcfb_cursor __P((void *c, int on, int row, int col));
int hpcfb_mapchar __P((void *, int, unsigned int *));
void hpcfb_putchar __P((void *c, int row, int col, u_int uc, long attr));
void hpcfb_copycols __P((void *c, int row, int srccol,
int dstcol, int ncols));
void hpcfb_erasecols __P((void *c, int row, int startcol,
int ncols, long attr));
void hpcfb_redraw __P((void *c, int row, int nrows, int all));
void hpcfb_copyrows __P((void *c, int srcrow, int dstrow, int nrows));
void hpcfb_eraserows __P((void *c, int row, int nrows, long attr));
int hpcfb_alloc_attr __P((void *c, int fg, int bg, int flags, long *attr));
void hpcfb_cursor_raw __P((void *c, int on, int row, int col));
void hpcfb_cursor(void *, int, int, int);
int hpcfb_mapchar(void *, int, unsigned int *);
void hpcfb_putchar(void *, int, int, u_int, long);
void hpcfb_copycols(void *, int, int, int, int);
void hpcfb_erasecols(void *, int, int, int, long);
void hpcfb_redraw(void *, int, int, int);
void hpcfb_copyrows(void *, int, int, int);
void hpcfb_eraserows(void *, int, int, long);
int hpcfb_alloc_attr(void *, int, int, int, long *);
void hpcfb_cursor_raw(void *, int, int, int);
#ifdef HPCFB_JUMP
void hpcfb_update __P((void *));
void hpcfb_do_scroll __P((void *));
void hpcfb_check_update __P((void *));
void hpcfb_update(void *);
void hpcfb_do_scroll(void *);
void hpcfb_check_update(void *);
#endif /* HPCFB_JUMP */
struct wsdisplay_emulops hpcfb_emulops = {
@ -267,11 +264,11 @@ struct wsdisplay_accessops hpcfb_accessops = {
hpcfb_pollc
};
void hpcfb_tv_putchar __P((struct hpcfb_devconfig *, int, int, u_int, long));
void hpcfb_tv_copycols __P((struct hpcfb_devconfig *, int, int, int, int));
void hpcfb_tv_erasecols __P((struct hpcfb_devconfig *, int, int, int, long));
void hpcfb_tv_copyrows __P((struct hpcfb_devconfig *, int, int, int));
void hpcfb_tv_eraserows __P((struct hpcfb_devconfig *, int, int, long));
void hpcfb_tv_putchar(struct hpcfb_devconfig *, int, int, u_int, long);
void hpcfb_tv_copycols(struct hpcfb_devconfig *, int, int, int, int);
void hpcfb_tv_erasecols(struct hpcfb_devconfig *, int, int, int, long);
void hpcfb_tv_copyrows(struct hpcfb_devconfig *, int, int, int);
void hpcfb_tv_eraserows(struct hpcfb_devconfig *, int, int, long);
struct wsdisplay_emulops rasops_emul;
@ -294,18 +291,13 @@ pow(int x, int n)
}
int
hpcfbmatch(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
hpcfbmatch(struct device *parent, struct cfdata *match, void *aux)
{
return (1);
}
void
hpcfbattach(parent, self, aux)
struct device *parent, *self;
void *aux;
hpcfbattach(struct device *parent, struct device *self, void *aux)
{
struct hpcfb_softc *sc = (struct hpcfb_softc *)self;
struct hpcfb_attach_args *ha = aux;
@ -381,8 +373,7 @@ hpcfbattach(parent, self, aux)
#ifdef HPCFB_JUMP
void
hpcfb_create_thread(arg)
void *arg;
hpcfb_create_thread(void *arg)
{
struct hpcfb_softc *sc = arg;
@ -399,8 +390,7 @@ hpcfb_create_thread(arg)
}
void
hpcfb_thread(arg)
void *arg;
hpcfb_thread(void *arg)
{
struct hpcfb_softc *sc = arg;
@ -421,9 +411,7 @@ hpcfb_thread(arg)
/* Print function (for parent devices). */
int
hpcfbprint(aux, pnp)
void *aux;
const char *pnp;
hpcfbprint(void *aux, const char *pnp)
{
if (pnp)
printf("hpcfb at %s", pnp);
@ -432,8 +420,7 @@ hpcfbprint(aux, pnp)
}
int
hpcfb_cnattach(fbconf)
struct hpcfb_fbconf *fbconf;
hpcfb_cnattach(struct hpcfb_fbconf *fbconf)
{
struct hpcfb_fbconf __fbconf __attribute__((__unused__));
long defattr;
@ -466,9 +453,7 @@ hpcfb_cnattach(fbconf)
}
int
hpcfb_init(fbconf, dc)
struct hpcfb_fbconf *fbconf;
struct hpcfb_devconfig *dc;
hpcfb_init(struct hpcfb_fbconf *fbconf, struct hpcfb_devconfig *dc)
{
struct rasops_info *ri;
vaddr_t fbaddr;
@ -517,9 +502,7 @@ hpcfb_init(fbconf, dc)
}
static void
hpcfb_cmap_reorder(fbconf, dc)
struct hpcfb_fbconf *fbconf;
struct hpcfb_devconfig *dc;
hpcfb_cmap_reorder(struct hpcfb_fbconf *fbconf, struct hpcfb_devconfig *dc)
{
struct rasops_info *ri = &dc->dc_rinfo;
int reverse = fbconf->hf_access_flags & HPCFB_ACCESS_REVERSE;
@ -574,12 +557,7 @@ hpcfb_cmap_reorder(fbconf, dc)
}
int
hpcfb_ioctl(v, cmd, data, flag, p)
void *v;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
hpcfb_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
struct hpcfb_softc *sc = v;
struct hpcfb_devconfig *dc = sc->sc_dc;
@ -592,7 +570,7 @@ hpcfb_ioctl(v, cmd, data, flag, p)
case WSDISPLAYIO_GTYPE:
*(u_int *)data = WSDISPLAY_TYPE_HPCFB;
return 0;
return (0);
case WSDISPLAYIO_GINFO:
wdf = (void *)data;
@ -600,7 +578,7 @@ hpcfb_ioctl(v, cmd, data, flag, p)
wdf->width = dc->dc_rinfo.ri_width;
wdf->depth = dc->dc_rinfo.ri_depth;
wdf->cmsize = 256; /* XXXX */
return 0;
return (0);
case WSDISPLAYIO_SMODE:
if (*(int *)data == WSDISPLAYIO_MODE_EMUL){
@ -623,7 +601,7 @@ hpcfb_ioctl(v, cmd, data, flag, p)
}
if (sc && sc->sc_accessops->iodone)
(*sc->sc_accessops->iodone)(sc->sc_accessctx);
return 0;
return (0);
case WSDISPLAYIO_GETCMAP:
case WSDISPLAYIO_PUTCMAP:
@ -635,8 +613,8 @@ hpcfb_ioctl(v, cmd, data, flag, p)
case HPCFBIO_SDSPCONF:
case HPCFBIO_GOP:
case HPCFBIO_SOP:
return (*sc->sc_accessops->ioctl)(sc->sc_accessctx,
cmd, data, flag, p);
return ((*sc->sc_accessops->ioctl)(sc->sc_accessctx,
cmd, data, flag, p));
default:
if (IOCGROUP(cmd) != 't')
@ -650,20 +628,15 @@ hpcfb_ioctl(v, cmd, data, flag, p)
}
paddr_t
hpcfb_mmap(v, offset, prot)
void *v;
off_t offset;
int prot;
hpcfb_mmap(void *v, off_t offset, int prot)
{
struct hpcfb_softc *sc = v;
return (*sc->sc_accessops->mmap)(sc->sc_accessctx, offset, prot);
return ((*sc->sc_accessops->mmap)(sc->sc_accessctx, offset, prot));
}
static void
hpcfb_power(why, arg)
int why;
void *arg;
hpcfb_power(int why, void *arg)
{
struct hpcfb_softc *sc = arg;
@ -695,8 +668,7 @@ hpcfb_power(why, arg)
}
void
hpcfb_refresh_screen(sc)
struct hpcfb_softc *sc;
hpcfb_refresh_screen(struct hpcfb_softc *sc)
{
struct hpcfb_devconfig *dc = sc->sc_dc;
int x, y;
@ -726,12 +698,8 @@ hpcfb_refresh_screen(sc)
}
static int
hpcfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
void *v;
const struct wsscreen_descr *type;
void **cookiep;
int *curxp, *curyp;
long *attrp;
hpcfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
int *curxp, int *curyp, long *attrp)
{
struct hpcfb_softc *sc = v;
struct hpcfb_devconfig *dc;
@ -739,7 +707,7 @@ hpcfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
DPRINTF(("%s(%d): hpcfb_alloc_screen()\n", __FILE__, __LINE__));
if (!hpcfbconsole && sc->nscreens > 0) /* XXXXX */
return ENOMEM;
return (ENOMEM);
if (sc->nscreens > HPCFB_MAX_SCREEN)
return (ENOMEM);
@ -748,7 +716,7 @@ hpcfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
sc->screens[sc->nscreens] =
malloc(sizeof(struct hpcfb_devconfig), M_DEVBUF, M_WAITOK);
if (sc->screens[sc->nscreens] == NULL)
return ENOMEM;
return (ENOMEM);
bzero(sc->screens[sc->nscreens], sizeof(struct hpcfb_devconfig));
}
dc = sc->screens[sc->nscreens];
@ -776,7 +744,7 @@ hpcfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
if (dc->dc_tvram == NULL){
free(sc->screens[sc->nscreens], M_DEVBUF);
sc->screens[sc->nscreens] = NULL;
return ENOMEM;
return (ENOMEM);
}
bzero(dc->dc_tvram,
sizeof(struct hpcfb_tvrow)*dc->dc_rows);
@ -791,9 +759,7 @@ hpcfb_alloc_screen(v, type, cookiep, curxp, curyp, attrp)
}
static void
hpcfb_free_screen(v, cookie)
void *v;
void *cookie;
hpcfb_free_screen(void *v, void *cookie)
{
struct hpcfb_softc *sc = v;
@ -803,12 +769,8 @@ hpcfb_free_screen(v, cookie)
}
static int
hpcfb_show_screen(v, cookie, waitok, cb, cbarg)
void *v;
void *cookie;
int waitok;
void (*cb) __P((void *, int, int));
void *cbarg;
hpcfb_show_screen(void *v, void *cookie, int waitok,
void (*cb)(void *, int, int), void *cbarg)
{
struct hpcfb_softc *sc = v;
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
@ -820,7 +782,7 @@ hpcfb_show_screen(v, cookie, waitok, cb, cbarg)
if (dc == NULL || odc == dc) {
hpcfb_refresh_screen(sc);
return 0;
return (0);
}
sc->sc_wantedscreen = cookie;
@ -829,16 +791,15 @@ hpcfb_show_screen(v, cookie, waitok, cb, cbarg)
if (cb) {
callout_reset(&sc->sc_switch_callout, 0,
(void(*)(void *))hpcfb_doswitch, sc);
return EAGAIN;
return (EAGAIN);
}
hpcfb_doswitch(sc);
return 0;
return (0);
}
void
hpcfb_doswitch(sc)
struct hpcfb_softc *sc;
hpcfb_doswitch(struct hpcfb_softc *sc)
{
struct hpcfb_devconfig *dc;
struct hpcfb_devconfig *odc;
@ -882,9 +843,7 @@ hpcfb_doswitch(sc)
}
static void
hpcfb_pollc(v, on)
void *v;
int on;
hpcfb_pollc(void *v, int on)
{
struct hpcfb_softc *sc = v;
@ -906,9 +865,7 @@ hpcfb_pollc(v, on)
* cursor
*/
void
hpcfb_cursor(cookie, on, row, col)
void *cookie;
int on, row, col;
hpcfb_cursor(void *cookie, int on, int row, int col)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
@ -963,26 +920,20 @@ hpcfb_cursor_raw(cookie, on, row, col)
* mapchar
*/
int
hpcfb_mapchar(cookie, c, cp)
void *cookie;
int c;
unsigned int *cp;
hpcfb_mapchar(void *cookie, int c, unsigned int *cp)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct rasops_info *ri = &dc->dc_rinfo;
return rasops_emul.mapchar(ri, c, cp);
return (rasops_emul.mapchar(ri, c, cp));
}
/*
* putchar
*/
void
hpcfb_tv_putchar(dc, row, col, uc, attr)
struct hpcfb_devconfig *dc;
int row, col;
u_int uc;
long attr;
hpcfb_tv_putchar(struct hpcfb_devconfig *dc, int row, int col, u_int uc,
long attr)
{
struct hpcfb_tvrow *vscn = dc->dc_tvram;
struct hpcfb_vchar *vc = &vscn[row].col[col];
@ -1015,11 +966,7 @@ hpcfb_tv_putchar(dc, row, col, uc, attr)
}
void
hpcfb_putchar(cookie, row, col, uc, attr)
void *cookie;
int row, col;
u_int uc;
long attr;
hpcfb_putchar(void *cookie, int row, int col, u_int uc, long attr)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct hpcfb_softc *sc = dc->dc_sc;
@ -1065,9 +1012,8 @@ hpcfb_putchar(cookie, row, col, uc, attr)
* copycols
*/
void
hpcfb_tv_copycols(dc, row, srccol, dstcol, ncols)
struct hpcfb_devconfig *dc;
int row, srccol, dstcol, ncols;
hpcfb_tv_copycols(struct hpcfb_devconfig *dc, int row, int srccol, int dstcol,
int ncols)
{
struct hpcfb_tvrow *vscn = dc->dc_tvram;
struct hpcfb_vchar *svc = &vscn[row].col[srccol];
@ -1096,9 +1042,7 @@ hpcfb_tv_copycols(dc, row, srccol, dstcol, ncols)
}
void
hpcfb_copycols(cookie, row, srccol, dstcol, ncols)
void *cookie;
int row, srccol, dstcol, ncols;
hpcfb_copycols(void *cookie, int row, int srccol, int dstcol, int ncols)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct hpcfb_softc *sc = dc->dc_sc;
@ -1143,10 +1087,8 @@ hpcfb_copycols(cookie, row, srccol, dstcol, ncols)
* erasecols
*/
void
hpcfb_tv_erasecols(dc, row, startcol, ncols, attr)
struct hpcfb_devconfig *dc;
int row, startcol, ncols;
long attr;
hpcfb_tv_erasecols(struct hpcfb_devconfig *dc, int row, int startcol,
int ncols, long attr)
{
struct hpcfb_tvrow *vscn = dc->dc_tvram;
@ -1171,10 +1113,7 @@ hpcfb_tv_erasecols(dc, row, startcol, ncols, attr)
}
void
hpcfb_erasecols(cookie, row, startcol, ncols, attr)
void *cookie;
int row, startcol, ncols;
long attr;
hpcfb_erasecols(void *cookie, int row, int startcol, int ncols, long attr)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct hpcfb_softc *sc = dc->dc_sc;
@ -1215,9 +1154,7 @@ hpcfb_erasecols(cookie, row, startcol, ncols, attr)
* Copy rows.
*/
void
hpcfb_tv_copyrows(dc, src, dst, num)
struct hpcfb_devconfig *dc;
int src, dst, num;
hpcfb_tv_copyrows(struct hpcfb_devconfig *dc, int src, int dst, int num)
{
struct hpcfb_tvrow *vscn = dc->dc_tvram;
struct hpcfb_tvrow *svc = &vscn[src];
@ -1332,8 +1269,7 @@ hpcfb_redraw(cookie, row, num, all)
#ifdef HPCFB_JUMP
void
hpcfb_update(v)
void *v;
hpcfb_update(void *v)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)v;
@ -1356,8 +1292,7 @@ hpcfb_update(v)
}
void
hpcfb_do_scroll(v)
void *v;
hpcfb_do_scroll(void *v)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)v;
@ -1374,8 +1309,7 @@ hpcfb_do_scroll(v)
}
void
hpcfb_check_update(v)
void *v;
hpcfb_check_update(void *v)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)v;
@ -1397,9 +1331,7 @@ hpcfb_check_update(v)
#endif /* HPCFB_JUMP */
void
hpcfb_copyrows(cookie, src, dst, num)
void *cookie;
int src, dst, num;
hpcfb_copyrows(void *cookie, int src, int dst, int num)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct rasops_info *ri = &dc->dc_rinfo;
@ -1466,10 +1398,7 @@ hpcfb_copyrows(cookie, src, dst, num)
* eraserows
*/
void
hpcfb_tv_eraserows(dc, row, nrow, attr)
struct hpcfb_devconfig *dc;
int row, nrow;
long attr;
hpcfb_tv_eraserows(struct hpcfb_devconfig *dc, int row, int nrow, long attr)
{
struct hpcfb_tvrow *vscn = dc->dc_tvram;
int cols;
@ -1499,10 +1428,7 @@ hpcfb_tv_eraserows(dc, row, nrow, attr)
}
void
hpcfb_eraserows(cookie, row, nrow, attr)
void *cookie;
int row, nrow;
long attr;
hpcfb_eraserows(void *cookie, int row, int nrow, long attr)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct hpcfb_softc *sc = dc->dc_sc;
@ -1543,13 +1469,10 @@ hpcfb_eraserows(cookie, row, nrow, attr)
* alloc_attr
*/
int
hpcfb_alloc_attr(cookie, fg, bg, flags, attrp)
void *cookie;
int fg, bg, flags;
long *attrp;
hpcfb_alloc_attr(void *cookie, int fg, int bg, int flags, long *attrp)
{
struct hpcfb_devconfig *dc = (struct hpcfb_devconfig *)cookie;
struct rasops_info *ri = &dc->dc_rinfo;
return rasops_emul.alloc_attr(ri, fg, bg, flags, attrp);
return (rasops_emul.alloc_attr(ri, fg, bg, flags, attrp));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcfbvar.h,v 1.1 2001/02/22 18:37:55 uch Exp $ */
/* $NetBSD: hpcfbvar.h,v 1.2 2001/06/04 18:59:31 uch Exp $ */
/*-
* Copyright (c) 1999
@ -40,16 +40,16 @@
* video access functions (must be provided by all video).
*/
struct hpcfb_accessops {
int (*ioctl) __P((void *, u_long, caddr_t, int, struct proc *));
paddr_t (*mmap) __P((void *, off_t, int));
void (*cursor) __P((void *, int, int, int, int, int));
void (*bitblit) __P((void *, int, int, int, int, int, int));
void (*erase) __P((void *, int, int, int, int, int));
void (*putchar) __P((void *, int, int, struct wsdisplay_font *,
int, int, u_int, int));
void (*setclut) __P((void *, struct rasops_info *));
void (*font) __P((void *, struct wsdisplay_font *)); /* load fonts */
void (*iodone) __P((void *)); /* wait i/o done */
int (*ioctl)(void *, u_long, caddr_t, int, struct proc *);
paddr_t (*mmap)(void *, off_t, int);
void (*cursor)(void *, int, int, int, int, int);
void (*bitblit)(void *, int, int, int, int, int, int);
void (*erase)(void *, int, int, int, int, int);
void (*putchar)(void *, int, int, struct wsdisplay_font *,
int, int, u_int, int);
void (*setclut)(void *, struct rasops_info *);
void (*font)(void *, struct wsdisplay_font *); /* load fonts */
void (*iodone)(void *); /* wait i/o done */
};
/*
@ -68,5 +68,5 @@ struct hpcfb_attach_args {
struct hpcfb_dspconf *ha_dspconflist;
};
int hpcfb_cnattach __P((struct hpcfb_fbconf *));
int hpcfbprint __P((void *aux, const char *pnp));
int hpcfb_cnattach(struct hpcfb_fbconf *);
int hpcfbprint(void *aux, const char *pnp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcin.c,v 1.1 2001/04/30 11:42:17 takemura Exp $ */
/* $NetBSD: hpcin.c,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@ struct cfattach hpcin_ca = {
int
hpcin_match(struct device *parent, struct cfdata *cf, void *aux)
{
return 1;
return (1);
}
void
@ -93,8 +93,7 @@ hpcin_attach(struct device *parent, struct device *self, void *aux)
/* install interrupt handler */
sc->sc_ih = hpcio_intr_establish(sc->sc_hc, sc->sc_port,
sc->sc_intr_mode,
hpcin_intr, sc);
sc->sc_intr_mode, hpcin_intr, sc);
if (sc->sc_ih == NULL)
printf("hpcin: can't install interrupt handler\n");
}
@ -110,5 +109,5 @@ hpcin_intr(void *arg)
config_hook_call(sc->sc_type, sc->sc_id, (void *)on);
printf("done.\n");
return 0;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcioman.c,v 1.2 2001/05/01 00:25:17 takemura Exp $ */
/* $NetBSD: hpcioman.c,v 1.3 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@ -69,11 +69,11 @@ hpcioman_match(struct device *parent, struct cfdata *cf, void *aux)
platid_mask_t mask;
if (strcmp(haa->haa_busname, HPCIO_BUSNAME))
return 0;
return (0);
/* select platform */
mask = PLATID_DEREF(cf->cf_loc[HPCIOIFCF_PLATFORM]);
return platid_match(&platid, &mask);
return (platid_match(&platid, &mask));
}
void
@ -162,11 +162,14 @@ hpcioman_print(void *aux, const char *pnp)
type == CONFIG_HOOK_EVENT) {
if (hma->hma_intr_mode & HPCIO_INTR_EDGE)
printf (", interrupt edge [%s%s]",
(hma->hma_intr_mode&HPCIO_INTR_POSEDGE) ? "p" : "",
(hma->hma_intr_mode&HPCIO_INTR_NEGEDGE) ? "n" : "");
(hma->hma_intr_mode&HPCIO_INTR_POSEDGE)
? "p" : "",
(hma->hma_intr_mode&HPCIO_INTR_NEGEDGE)
? "n" : "");
else
printf (", interrupt level %s",
(hma->hma_intr_mode&HPCIO_INTR_HIGH) ? "high" : "low");
(hma->hma_intr_mode&HPCIO_INTR_HIGH) ?
"high" : "low");
}
if (hma->hma_initvalue != -1)
printf(", initial value %d", hma->hma_initvalue);
@ -174,5 +177,5 @@ hpcioman_print(void *aux, const char *pnp)
printf(", active low");
}
return QUIET;
return (QUIET);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpciovar.h,v 1.3 2001/05/06 14:25:15 takemura Exp $ */
/* $NetBSD: hpciovar.h,v 1.4 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 2001 TAKEMURA Shin.
@ -42,7 +42,8 @@ struct hpcio_chip {
void *hc_sc;
int (*hc_portread)(hpcio_chip_t, int);
void (*hc_portwrite)(hpcio_chip_t, int, int);
hpcio_intr_handle_t(*hc_intr_establish)(hpcio_chip_t, int, int, int (*)(void *), void*);
hpcio_intr_handle_t(*hc_intr_establish)(hpcio_chip_t, int, int,
int (*)(void *), void *);
void (*hc_intr_disestablish)(hpcio_chip_t, hpcio_intr_handle_t);
void (*hc_intr_clear)(hpcio_chip_t, hpcio_intr_handle_t);
void (*hc_register_iochip)(hpcio_chip_t, hpcio_chip_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpckbd.c,v 1.4 2001/05/08 17:23:09 uch Exp $ */
/* $NetBSD: hpckbd.c,v 1.5 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcout.c,v 1.1 2001/04/30 11:42:17 takemura Exp $ */
/* $NetBSD: hpcout.c,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@ struct cfattach hpcout_ca = {
int
hpcout_match(struct device *parent, struct cfdata *cf, void *aux)
{
return 1;
return (1);
}
void
@ -105,5 +105,5 @@ hpcout_hook(void *arg, int type, long id, void *msg)
hpcio_portwrite(sc->sc_hc, sc->sc_port,
(int)msg ? sc->sc_on : sc->sc_off);
return 0;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mra.c,v 1.1 2001/02/22 18:37:56 uch Exp $ */
/* $NetBSD: mra.c,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*
* Copyright (c) 1999 Shin Takemura All rights reserved.
@ -30,16 +30,16 @@
#include <sys/param.h>
#include <sys/systm.h>
int mra_Y_AX1_BX2_C __P((int *y, int ys, int *x1, int x1s, int *x2, int x2s,
int n, int scale, int *a, int *b, int *c));
int mra_Y_AX1_BX2_C(int *, int, int *, int, int *, int, int, int, int *,
int *, int *);
/*
* multiple regression analysis
* Y = AX1 + BX2 + C
*/
int
mra_Y_AX1_BX2_C(y, ys, x1, x1s, x2, x2s, n, scale, a, b, c)
int *y, ys, *x1, x1s, *x2, x2s, n, scale, *a, *b, *c;
mra_Y_AX1_BX2_C(int *y, int ys, int *x1, int x1s, int *x2, int x2s, int n,
int scale, int *a, int *b, int *c)
{
int i;
int64_t X1a, X2a, Ya;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pwctl.c,v 1.4 2001/05/06 14:25:15 takemura Exp $ */
/* $NetBSD: pwctl.c,v 1.5 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 1999-2001
@ -51,7 +51,7 @@
#define PWCTLVRGIUDEBUG
#ifdef PWCTLVRGIUDEBUG
int pwctl_debug = 0;
int pwctl_debug = 1;
#define DPRINTF(arg) if (pwctl_debug) printf arg;
#else
#define DPRINTF(arg)
@ -70,44 +70,34 @@ struct pwctl_softc {
int sc_initvalue;
};
static int pwctl_match __P((struct device *, struct cfdata *,
void *));
static void pwctl_attach __P((struct device *, struct device *,
void *));
static int pwctl_hook __P((void *ctx, int type, long id,
void *msg));
static int pwctl_ghook __P((void *ctx, int type, long id,
void *msg));
int pwctl_hardpower __P((void *, int, long, void *));
static int pwctl_match(struct device *, struct cfdata *, void *);
static void pwctl_attach(struct device *, struct device *, void *);
static int pwctl_hook(void *, int, long, void *);
static int pwctl_ghook(void *, int, long, void *);
int pwctl_hardpower(void *, int, long, void *);
struct cfattach pwctl_ca = {
sizeof(struct pwctl_softc), pwctl_match, pwctl_attach
};
int
pwctl_match(parent, match, aux)
struct device *parent;
struct cfdata *match;
void *aux;
pwctl_match(struct device *parent, struct cfdata *match, void *aux)
{
struct hpcio_attach_args *haa = aux;
platid_mask_t mask;
if (strcmp(haa->haa_busname, HPCIO_BUSNAME))
return 0;
return (0);
if (match->cf_loc[HPCIOIFCF_PLATFORM] == 0)
return 0;
return (0);
mask = PLATID_DEREF(match->cf_loc[HPCIOIFCF_PLATFORM]);
if (!platid_match(&platid, &mask))
return 0;
return 1;
return (0);
return (1);
}
void
pwctl_attach(parent, self, aux)
struct device *parent;
struct device *self;
void *aux;
pwctl_attach(struct device *parent, struct device *self, void *aux)
{
struct hpcio_attach_args *haa = aux;
int *loc;
@ -120,6 +110,7 @@ pwctl_attach(parent, self, aux)
sc->sc_on = loc[HPCIOIFCF_ACTIVE] ? 1 : 0;
sc->sc_off = loc[HPCIOIFCF_ACTIVE] ? 0 : 1;
sc->sc_initvalue = loc[HPCIOIFCF_INITVALUE];
printf(" port=%d id=%ld on=%d%s",
sc->sc_port, sc->sc_id, sc->sc_on,
sc->sc_initvalue == -1 ? "" :
@ -130,17 +121,14 @@ pwctl_attach(parent, self, aux)
printf(" (ignored)");
} else {
sc->sc_hook_tag = config_hook(CONFIG_HOOK_POWERCONTROL,
sc->sc_id, CONFIG_HOOK_SHARE,
pwctl_hook, sc);
sc->sc_id, CONFIG_HOOK_SHARE, pwctl_hook, sc);
sc->sc_ghook_tag = config_hook(CONFIG_HOOK_GET,
sc->sc_id, CONFIG_HOOK_SHARE,
pwctl_ghook, sc);
sc->sc_id, CONFIG_HOOK_SHARE, pwctl_ghook, sc);
sc->sc_hook_hardpower = config_hook(CONFIG_HOOK_PMEVENT,
CONFIG_HOOK_PMEVENT_HARDPOWER,
CONFIG_HOOK_SHARE,
CONFIG_HOOK_PMEVENT_HARDPOWER, CONFIG_HOOK_SHARE,
pwctl_hardpower, sc);
}
if (sc->sc_initvalue != -1)
hpcio_portwrite(sc->sc_hc, sc->sc_port,
sc->sc_initvalue ? sc->sc_on : sc->sc_off);
@ -148,11 +136,7 @@ pwctl_attach(parent, self, aux)
}
int
pwctl_hook(ctx, type, id, msg)
void *ctx;
int type;
long id;
void *msg;
pwctl_hook(void *ctx, int type, long id, void *msg)
{
struct pwctl_softc *sc = ctx;
@ -160,38 +144,32 @@ pwctl_hook(ctx, type, id, msg)
msg ? "ON" : "OFF", msg ? sc->sc_on : sc->sc_off));
hpcio_portwrite(sc->sc_hc, sc->sc_port,
msg ? sc->sc_on : sc->sc_off);
return (0);
}
int
pwctl_ghook(ctx, type, id, msg)
void *ctx;
int type;
long id;
void *msg;
pwctl_ghook(void *ctx, int type, long id, void *msg)
{
struct pwctl_softc *sc = ctx;
if (CONFIG_HOOK_VALUEP(msg))
return 1;
return (1);
*(int*)msg = hpcio_portread(sc->sc_hc, sc->sc_port) == sc->sc_on;
DPRINTF(("pwctl ghook: port %d %s(%d)", sc->sc_port,
*(int*)msg? "ON" : "OFF", *(int*)msg ? sc->sc_on : sc->sc_off));
return 0;
return (0);
}
int
pwctl_hardpower(ctx, type, id, msg)
void *ctx;
int type;
long id;
void *msg;
pwctl_hardpower(void *ctx, int type, long id, void *msg)
{
struct pwctl_softc *sc = ctx;
int why =(int)msg;
#if 0
#if 1
/* XXX debug print cause hang system... Huum...*/
DPRINTF(("pwctl hardpower: port %d %s: %s(%d)\n", sc->sc_port,
why == PWR_RESUME? "resume"
@ -209,5 +187,6 @@ pwctl_hardpower(ctx, type, id, msg)
hpcio_portwrite(sc->sc_hc, sc->sc_port, sc->sc_save);
break;
}
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tpcalib.c,v 1.1 2001/02/22 18:37:56 uch Exp $ */
/* $NetBSD: tpcalib.c,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*
* Copyright (c) 1999 Shin Takemura All rights reserved.
@ -43,32 +43,27 @@ int tpcalib_debug = 0;
#endif
/* mra is defined in mra.c */
int mra_Y_AX1_BX2_C __P((int *y, int ys, int *x1, int x1s, int *x2, int x2s,
int n, int scale, int *a, int *b, int *c));
extern int mra_Y_AX1_BX2_C(int *, int, int *, int, int *, int, int, int, int *,
int *, int *);
#define SCALE (1024*1024)
int
tpcalib_init(sc)
struct tpcalib_softc *sc;
tpcalib_init(struct tpcalib_softc *sc)
{
tpcalib_reset(sc);
return (0);
}
void
tpcalib_reset(sc)
struct tpcalib_softc *sc;
tpcalib_reset(struct tpcalib_softc *sc)
{
/* This indicate 'raw mode'. No translation will be done. */
sc->sc_saved.samplelen = WSMOUSE_CALIBCOORDS_RESET;
}
void
tpcalib_trans(sc, rawx, rawy, x, y)
struct tpcalib_softc *sc;
int rawx, rawy;
int *x, *y;
tpcalib_trans(struct tpcalib_softc *sc, int rawx, int rawy, int *x, int *y)
{
if (sc->sc_saved.samplelen == WSMOUSE_CALIBCOORDS_RESET) {
/* This indicate 'raw mode'. No translation will be done. */
@ -87,12 +82,8 @@ tpcalib_trans(sc, rawx, rawy, x, y)
}
int
tpcalib_ioctl(sc, cmd, data, flag, p)
struct tpcalib_softc *sc;
u_long cmd;
caddr_t data;
int flag;
struct proc *p;
tpcalib_ioctl(struct tpcalib_softc *sc, u_long cmd, caddr_t data, int flag,
struct proc *p)
{
struct wsmouse_calibcoords *d;
int s = sizeof(struct wsmouse_calibcoord);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tpcalibvar.h,v 1.1 2001/02/22 18:37:56 uch Exp $ */
/* $NetBSD: tpcalibvar.h,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*
* Copyright (c) 1999 Shin Takemura All rights reserved.
@ -36,8 +36,8 @@ struct tpcalib_softc {
struct wsmouse_calibcoords sc_saved;
};
int tpcalib_init __P((struct tpcalib_softc *sc));
void tpcalib_reset __P((struct tpcalib_softc *sc));
void tpcalib_trans __P((struct tpcalib_softc*, int, int, int*, int*));
int tpcalib_ioctl __P((struct tpcalib_softc *, u_long, caddr_t,
int, struct proc*));
int tpcalib_init(struct tpcalib_softc *);
void tpcalib_reset(struct tpcalib_softc *);
void tpcalib_trans(struct tpcalib_softc*, int, int, int*, int*);
int tpcalib_ioctl(struct tpcalib_softc *, u_long, caddr_t, int,
struct proc *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: video_subr.c,v 1.1 2001/02/22 18:37:56 uch Exp $ */
/* $NetBSD: video_subr.c,v 1.2 2001/06/04 18:59:32 uch Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.