summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-11 21:23:54 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-11 21:23:54 +0000
commitfb39ebfc2cba5ba1dec32938c2888642906d067d (patch)
tree3f5eb0d8010569c9d47e3c0461b3ef8ce91fa9d3 /sys
parent006e509b3eb298e8adccfdf6858339ee8ddad120 (diff)
fix a few types and alignment problems
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/sti.c30
-rw-r--r--sys/dev/ic/stireg.h10
2 files changed, 25 insertions, 15 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index b76ac8e3f29..38e75b880a2 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.2 2000/09/03 22:50:01 mickey Exp $ */
+/* $OpenBSD: sti.c,v 1.3 2001/01/11 21:23:53 mickey Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -106,6 +106,7 @@ sti_attach_common(sc)
struct sti_softc *sc;
{
struct sti_inqconfout cfg;
+ bus_space_handle_t fbh;
struct wsscreen_descr **sl;
struct wsemuldisplaydev_attach_args waa;
struct sti_dd *dd;
@@ -238,22 +239,22 @@ sti_attach_common(sc)
bzero(cc, sizeof (*cc));
{
register int i = dd->dd_reglst;
- register u_int *p;
+ register u_int32_t *p;
struct sti_region r;
#ifdef STIDEBUG
printf ("stiregions @%p:\n", i);
#endif
r.last = 0;
- for (p = (u_int *)cc->regions; !r.last &&
- p < (u_int *)&cc->regions[STI_REGION_MAX]; p++) {
+ for (p = cc->regions; !r.last &&
+ p < &cc->regions[STI_REGION_MAX]; p++) {
if (sc->sc_devtype == STI_DEVTYPE1)
*(u_int *)&r = parseword(i), i+= 16;
else
*(u_int *)&r = bus_space_read_4(sc->memt, sc->romh, i), i += 4;
- *p = (p == (u_int *)cc->regions? sc->romh : sc->ioh) +
+ *p = (p == cc->regions? sc->romh : sc->ioh) +
(r.offset << PGSHIFT);
#ifdef STIDEBUG
printf("%x @ 0x%x %s%s%s%s\n",
@@ -263,14 +264,15 @@ sti_attach_common(sc)
#endif
/* rom was already mapped */
- if (p != (u_int *)cc->regions) {
+ if (p != cc->regions) {
if (bus_space_map(sc->memt, *p,
- r.length << PGSHIFT, 0, &sc->fbh)) {
+ r.length << PGSHIFT, 0, &fbh)) {
#ifdef STIDEBUG
printf("cannot map region\n");
#endif
/* who cares: return; */
- }
+ } else if (p - cc->regions == 1)
+ sc->fbh = fbh;
}
}
}
@@ -364,7 +366,11 @@ sti_init(sc, mode)
(mode & STI_TEXTMODE? STI_INITF_TEXT | STI_INITF_PBET |
STI_INITF_PBETI | STI_INITF_ICMT : 0);
a.in.text_planes = 1;
- sc->init(&a.flags, &a.in, &a.out, &sc->sc_cfg);
+#ifdef STIDEBUG
+ printf("%s: init,%p(%x, %p, %p, %p)\n", sc->sc_dev.dv_xname,
+ sc->init, a.flags.flags, &a.in, &a.out, &sc->sc_cfg);
+#endif
+ (*sc->init)(&a.flags, &a.in, &a.out, &sc->sc_cfg);
return (a.out.text_planes != a.in.text_planes || a.out.errno);
}
@@ -382,7 +388,7 @@ sti_inqcfg(sc, out)
bzero(out, sizeof(*out));
a.flags.flags = STI_INQCONFF_WAIT;
- sc->inqconf(&a.flags, &a.in, out, &sc->sc_cfg);
+ (*sc->inqconf)(&a.flags, &a.in, out, &sc->sc_cfg);
return out->errno;
}
@@ -424,7 +430,7 @@ sti_bmove(sc, x1, y1, x2, y2, h, w, f)
a.in.height = h;
a.in.width = w;
- sc->blkmv(&a.flags, &a.in, &a.out, &sc->sc_cfg);
+ (*sc->blkmv)(&a.flags, &a.in, &a.out, &sc->sc_cfg);
#ifdef STIDEBUG
if (a.out.errno)
printf ("%s: blkmv returned %d\n",
@@ -541,7 +547,7 @@ sti_putchar(v, row, col, uc, attr)
a.in.y = row * sc->sc_fontcfg.height;
a.in.font_addr = 0/*STI_FONTAD(sc->sc_devtype, sc->sc_rom)*/;
a.in.index = uc;
- sc->unpmv(&a.flags, &a.in, &a.out, &sc->sc_cfg);
+ (*sc->unpmv)(&a.flags, &a.in, &a.out, &sc->sc_cfg);
}
void
diff --git a/sys/dev/ic/stireg.h b/sys/dev/ic/stireg.h
index 2e123a56e26..89b836545b9 100644
--- a/sys/dev/ic/stireg.h
+++ b/sys/dev/ic/stireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stireg.h,v 1.1 2000/05/30 19:39:38 mickey Exp $ */
+/* $OpenBSD: stireg.h,v 1.2 2001/01/11 21:23:53 mickey Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -108,6 +108,8 @@
#define STI_COLOUR_BLUE 6
#define STI_COLOUR_MAGENTA 7
+#pragma pack(1)
+
/* LSB high */
struct sti_dd {
u_int32_t dd_type; /* 0x00 device type */
@@ -129,7 +131,7 @@ struct sti_dd {
u_int32_t dd_udaddr; /* 0x28 user data address */
u_int32_t dd_stimemreq; /* 0x2c sti memory request */
u_int32_t dd_udsize; /* 0x30 user data size */
- u_int32_t dd_pwruse; /* 0x34 power usage */
+ u_int16_t dd_pwruse; /* 0x34 power usage */
u_int8_t dd_bussup; /* 0x36 bus support */
#define STI_BUSSUPPORT_GSCINTL 0x01 /* supports pulling INTL for int */
#define STI_BUSSUPPORT_GSC15X 0x02 /* supports GSC 1.5X */
@@ -206,7 +208,7 @@ typedef struct sti_cfg {
u_int16_t oscr_height;
u_int16_t fb_width;
u_int16_t fb_height;
- u_int32_t *regions[STI_REGION_MAX];
+ u_int32_t regions[STI_REGION_MAX];
u_int32_t reent_level;
u_int32_t *save_addr;
sti_ecfg_t ext_cfg;
@@ -580,4 +582,6 @@ typedef struct sti_utilout {
STI_DEP(util);
+#pragma pack()
+
#endif /* _STI_H_ */