summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenji Aoyama <aoyama@cvs.openbsd.org>2013-04-28 23:33:13 +0000
committerKenji Aoyama <aoyama@cvs.openbsd.org>2013-04-28 23:33:13 +0000
commite4a21bf54da7aca258354ff121de42812a950613 (patch)
tree97b065c9d726da3aeb80f6699acec28d7a2a4217
parent47fde6aa2e47444f9c20428fe9db5e3b83dbb82e (diff)
Preliminary modifications for Xorg 1bpp server, based on OpenBSD/hp300
and NetBSD/luna68k. Need more work in Xorg. luna88k/conf/GENERIC: - enable wsmux on GENERIC kernel luna88k/dev/luanfb.c: - make hardware access volatile'd - add extra ioctl(2) used in Xorg wsfb driver - add some workaround luna88k/dev/lunaws.c: - add WSDISPLAY_COMPAT_RAWKBD stuff for Xorg keyboard input luna88k/dev/omrasops.c: - change 'caddr_t' to 'u_int8_t *' "go for it!" miod@
-rw-r--r--sys/arch/luna88k/conf/GENERIC11
-rw-r--r--sys/arch/luna88k/dev/lunafb.c86
-rw-r--r--sys/arch/luna88k/dev/lunaws.c184
-rw-r--r--sys/arch/luna88k/dev/omrasops.c38
4 files changed, 259 insertions, 60 deletions
diff --git a/sys/arch/luna88k/conf/GENERIC b/sys/arch/luna88k/conf/GENERIC
index 280a99477af..9d6da0619e8 100644
--- a/sys/arch/luna88k/conf/GENERIC
+++ b/sys/arch/luna88k/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.15 2011/06/29 20:52:09 matthew Exp $
+# $OpenBSD: GENERIC,v 1.16 2013/04/28 23:33:12 aoyama Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -22,6 +22,8 @@ option MAX_CPUS=4 # may have up to 4 processors
# Define this if your processor has the xxx.usr bug (mask C82N)
option ERRATA__XXX_USR
+# Options for luna88k hardware
+option WSDISPLAY_COMPAT_RAWKBD # Provide raw scancodes; needed for X11
config bsd swap generic
@@ -42,8 +44,8 @@ spc1 at mainbus0
# Workstation Console attachments
wsdisplay* at fb?
-wskbd* at ws?
-wsmouse* at ws?
+wskbd* at ws? mux 1
+wsmouse* at ws? mux 0
# SCSI bus support
@@ -56,3 +58,6 @@ ch* at scsibus?
safte* at scsibus?
ses* at scsibus?
uk* at scsibus?
+
+# Pseudo-device
+pseudo-device wsmux 2
diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c
index f1817832d70..1c430f524f8 100644
--- a/sys/arch/luna88k/dev/lunafb.c
+++ b/sys/arch/luna88k/dev/lunafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunafb.c,v 1.12 2012/01/08 00:31:35 aoyama Exp $ */
+/* $OpenBSD: lunafb.c,v 1.13 2013/04/28 23:33:12 aoyama Exp $ */
/* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
/*-
@@ -52,18 +52,18 @@
#include <machine/autoconf.h>
struct bt454 {
- u_int8_t bt_addr; /* map address register */
- u_int8_t bt_cmap; /* colormap data register */
+ volatile u_int8_t bt_addr; /* map address register */
+ volatile u_int8_t bt_cmap; /* colormap data register */
};
struct bt458 {
- u_int8_t bt_addr; /* map address register */
+ volatile u_int8_t bt_addr; /* map address register */
unsigned :24;
- u_int8_t bt_cmap; /* colormap data register */
+ volatile u_int8_t bt_cmap; /* colormap data register */
unsigned :24;
- u_int8_t bt_ctrl; /* control register */
+ volatile u_int8_t bt_ctrl; /* control register */
unsigned :24;
- u_int8_t bt_omap; /* overlay (cursor) map register */
+ volatile u_int8_t bt_omap; /* overlay (cursor) map register */
unsigned :24;
};
@@ -73,7 +73,7 @@ struct bt458 {
#define OMFB_FB_RADDR 0xB10C0008 /* plane #0 */
#define OMFB_ROPFUNC 0xB12C0000 /* ROP function code */
#define OMFB_RAMDAC 0xC1100000 /* Bt454/Bt458 RAMDAC */
-#define OMFB_SIZE (0xB1300000 - 0xB1080000 + NBPG)
+#define OMFB_SIZE (0xB1300000 - 0xB1080000 + PAGE_SIZE)
struct om_hwdevconfig {
int dc_wid; /* width of frame buffer */
@@ -191,8 +191,7 @@ omfbattach(parent, self, args)
if (omfb_console) {
sc->sc_dc = &omfb_console_dc;
sc->nscreens = 1;
- }
- else {
+ } else {
sc->sc_dc = (struct om_hwdevconfig *)
malloc(sizeof(struct om_hwdevconfig), M_DEVBUF,
M_WAITOK | M_ZERO);
@@ -201,11 +200,10 @@ omfbattach(parent, self, args)
printf(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
sc->sc_dc->dc_depth);
-#if 0 /* WHITE on BLACK */
- cm = &sc->sc_cmap;
- memset(cm, 255, sizeof(struct hwcmap));
- cm->r[0] = cm->g[0] = cm->b[0] = 0;
-#endif
+ /* WHITE on BLACK */
+ memset(&sc->sc_cmap, 255, sizeof(struct hwcmap));
+ sc->sc_cmap.r[0] = sc->sc_cmap.g[0] = sc->sc_cmap.b[0] = 0;
+
waa.console = omfb_console;
waa.scrdata = &omfb_screenlist;
waa.accessops = &omfb_accessops;
@@ -251,7 +249,11 @@ omfbioctl(v, cmd, data, flag, p)
wsd_fbip->width = dc->dc_wid;
wsd_fbip->depth = dc->dc_depth;
wsd_fbip->cmsize = dc->dc_cmsize;
-#undef fbt
+#undef wsd_fbip
+ break;
+
+ case WSDISPLAYIO_LINEBYTES:
+ *(u_int *)data = dc->dc_rowbytes;
break;
case WSDISPLAYIO_GETCMAP:
@@ -260,6 +262,10 @@ omfbioctl(v, cmd, data, flag, p)
case WSDISPLAYIO_PUTCMAP:
return omsetcmap(sc, (struct wsdisplay_cmap *)data);
+ case WSDISPLAYIO_GETSUPPORTEDDEPTH:
+ *(u_int *)data = WSDISPLAYIO_DEPTH_1;
+ break;
+
case WSDISPLAYIO_SVIDEO:
case WSDISPLAYIO_GVIDEO:
break;
@@ -288,13 +294,20 @@ omfbmmap(v, offset, prot)
int prot;
{
struct omfb_softc *sc = v;
+ struct om_hwdevconfig *dc = sc->sc_dc;
+ paddr_t cookie = -1;
- if (offset & PGOFSET)
- return (-1);
- if (offset >= OMFB_SIZE || offset < 0)
+ if ((offset & PAGE_MASK) != 0)
return (-1);
- return (trunc_page(sc->sc_dc->dc_videobase) + offset);
+#if 0 /* Workaround for making Xorg 1bpp server work */
+ if (offset >= 0 && offset < OMFB_SIZE)
+ cookie = (paddr_t)(trunc_page(dc->dc_videobase) + offset);
+#else
+ if (offset >= 0 && offset < dc->dc_rowbytes * dc->dc_ht)
+ cookie = (paddr_t)(trunc_page(OMFB_FB_RADDR) + offset);
+#endif
+ return cookie;
}
int
@@ -348,8 +361,8 @@ omsetcmap(sc, p)
if (hwplanebits == 4) {
struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC;
- odac->bt_addr = index;
- for (i = index; i < count; i++) {
+ odac->bt_addr = (u_int8_t)index;
+ for (i = index; i < index + count; i++) {
odac->bt_cmap = sc->sc_cmap.r[i];
odac->bt_cmap = sc->sc_cmap.g[i];
odac->bt_cmap = sc->sc_cmap.b[i];
@@ -357,8 +370,8 @@ omsetcmap(sc, p)
}
else if (hwplanebits == 8) {
struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC;
- ndac->bt_addr = index;
- for (i = index; i < count; i++) {
+ ndac->bt_addr = (u_int8_t)index;
+ for (i = index; i < index + count; i++) {
ndac->bt_cmap = sc->sc_cmap.r[i];
ndac->bt_cmap = sc->sc_cmap.g[i];
ndac->bt_cmap = sc->sc_cmap.b[i];
@@ -379,6 +392,7 @@ omfb_getdevconfig(paddr, dc)
u_int32_t u;
} rfcnt;
+#if 0 /* Workaround for making Xorg 1bpp server work */
switch (hwplanebits) {
case 8:
bpp = 8; /* XXX check monochrome bit in DIPSW */
@@ -391,6 +405,9 @@ omfb_getdevconfig(paddr, dc)
bpp = 1;
break;
}
+#else
+ bpp = 1;
+#endif
dc->dc_wid = 1280;
dc->dc_ht = 1024;
dc->dc_depth = bpp;
@@ -398,9 +415,9 @@ omfb_getdevconfig(paddr, dc)
dc->dc_cmsize = (bpp == 1) ? 0 : 1 << bpp;
dc->dc_videobase = paddr;
-#if 0 /* WHITE on BLACK XXX experiment resulted in WHITE on SKYBLUE... */
+ /* WHITE on BLACK */
if (hwplanebits == 4) {
- /* XXX Need Bt454 initialization */
+ /* XXX Need Bt454 more initialization */
struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC;
odac->bt_addr = 0;
odac->bt_cmap = 0;
@@ -411,15 +428,16 @@ omfb_getdevconfig(paddr, dc)
odac->bt_cmap = 255;
odac->bt_cmap = 255;
}
- }
- else if (hwplanebits == 8) {
+ } else if (hwplanebits == 8) {
struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC;
+#if 0 /* This doesn't work. Don't touch ROM setting for now. */
ndac->bt_addr = 0x04;
ndac->bt_ctrl = 0xff; /* all planes will be read */
ndac->bt_ctrl = 0x00; /* all planes have non-blink */
ndac->bt_ctrl = 0x43; /* pallete enabled, ovly plane */
ndac->bt_ctrl = 0x00; /* no test mode */
+#endif
ndac->bt_addr = 0;
ndac->bt_cmap = 0;
ndac->bt_cmap = 0;
@@ -430,19 +448,19 @@ omfb_getdevconfig(paddr, dc)
ndac->bt_cmap = 255;
}
}
-#endif
/* adjust h/v origin on screen */
rfcnt.p.h = 7;
rfcnt.p.v = -27;
- *(u_int32_t *)OMFB_RFCNT = rfcnt.u; /* single write of 0x007ffe6 */
+ /* single write of 0x007ffe6 */
+ *(volatile u_int32_t *)OMFB_RFCNT = rfcnt.u;
/* clear the screen */
- *(u_int32_t *)OMFB_PLANEMASK = 0xff;
- ((u_int32_t *)OMFB_ROPFUNC)[5] = ~0; /* ROP copy */
+ *(volatile u_int32_t *)OMFB_PLANEMASK = 0xff;
+ ((volatile u_int32_t *)OMFB_ROPFUNC)[5] = ~0; /* ROP copy */
for (i = 0; i < dc->dc_ht * dc->dc_rowbytes / sizeof(u_int32_t); i++)
- *((u_int32_t *)dc->dc_videobase + i) = 0;
- *(u_int32_t *)OMFB_PLANEMASK = 0x01;
+ *((volatile u_int32_t *)dc->dc_videobase + i) = 0;
+ *(volatile u_int32_t *)OMFB_PLANEMASK = 0x01;
/* initialize the raster */
ri = &dc->dc_ri;
diff --git a/sys/arch/luna88k/dev/lunaws.c b/sys/arch/luna88k/dev/lunaws.c
index f1a73803c20..67fd0f51b80 100644
--- a/sys/arch/luna88k/dev/lunaws.c
+++ b/sys/arch/luna88k/dev/lunaws.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunaws.c,v 1.7 2008/09/11 11:30:14 jsg Exp $ */
+/* $OpenBSD: lunaws.c,v 1.8 2013/04/28 23:33:12 aoyama Exp $ */
/* $NetBSD: lunaws.c,v 1.6 2002/03/17 19:40:42 atatat Exp $ */
/*-
@@ -41,6 +41,9 @@
#include <dev/wscons/wskbdvar.h>
#include <dev/wscons/wsksymdef.h>
#include <dev/wscons/wsksymvar.h>
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+#include <dev/wscons/wskbdraw.h>
+#endif
#include <dev/wscons/wsmousevar.h>
#include <luna88k/dev/sioreg.h>
@@ -65,6 +68,10 @@ struct ws_softc {
int sc_msreport;
int buttons, dx, dy;
#endif
+
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ int sc_rawkbd;
+#endif
};
void omkbd_input(void *, int);
@@ -278,6 +285,8 @@ wsintr(chan)
/* not capable of transmit, yet */
}
+static const u_int8_t omkbd_raw[];
+
void
omkbd_input(v, data)
void *v;
@@ -288,8 +297,30 @@ omkbd_input(v, data)
int key;
omkbd_decode(v, data, &type, &key);
- if (sc->sc_wskbddev != NULL)
- wskbd_input(sc->sc_wskbddev, type, key);
+
+#if WSDISPLAY_COMPAT_RAWKBD
+ if (sc->sc_rawkbd) {
+ u_char cbuf[2];
+ int c, j = 0;
+
+ c = omkbd_raw[key];
+ if (c != RAWKEY_Null) {
+ /* fake extended scancode if necessary */
+ if (c & 0x80)
+ cbuf[j++] = 0xe0;
+ cbuf[j] = c & 0x7f;
+ if (type == WSCONS_EVENT_KEY_UP)
+ cbuf[j] |= 0x80;
+ j++;
+
+ wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
+ }
+ } else
+#endif
+ {
+ if (sc->sc_wskbddev != NULL)
+ wskbd_input(sc->sc_wskbddev, type, key);
+ }
}
void
@@ -303,6 +334,143 @@ omkbd_decode(v, datain, type, dataout)
*dataout = datain & 0x7f;
}
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+/*
+ * Translate LUNA keycodes to US keyboard XT scancodes, for proper
+ * X11-over-wsmux operation.
+ */
+static const u_int8_t omkbd_raw[0x80] = {
+ RAWKEY_Null, /* 0x00 */
+ RAWKEY_Null, /* 0x01 */
+ RAWKEY_Null, /* 0x02 */
+ RAWKEY_Null, /* 0x03 */
+ RAWKEY_Null, /* 0x04 */
+ RAWKEY_Null, /* 0x05 */
+ RAWKEY_Null, /* 0x06 */
+ RAWKEY_Null, /* 0x07 */
+ RAWKEY_Null, /* 0x08 */
+ RAWKEY_Tab, /* 0x09 */
+ RAWKEY_Control_L, /* 0x0a */
+ RAWKEY_Null, /* 0x0b: Kana */
+ RAWKEY_Shift_R, /* 0x0c */
+ RAWKEY_Shift_L, /* 0x0d */
+ RAWKEY_Caps_Lock, /* 0x0e */
+ RAWKEY_Meta_L, /* 0x0f: Zenmen */
+ RAWKEY_Escape, /* 0x10 */
+ RAWKEY_BackSpace, /* 0x11 */
+ RAWKEY_Return, /* 0x12 */
+ RAWKEY_Null, /* 0x13 */
+ RAWKEY_space, /* 0x14 */
+ RAWKEY_Delete, /* 0x15 */
+ RAWKEY_Alt_L, /* 0x16: Henkan */
+ RAWKEY_Alt_R, /* 0x17: Kakutei */
+ RAWKEY_f11, /* 0x18: Shokyo */
+ RAWKEY_f12, /* 0x19: Yobidashi */
+ RAWKEY_Null, /* 0x1a: Bunsetsu L / f13 */
+ RAWKEY_Null, /* 0x1b: Bunsetsu R / f14 */
+ RAWKEY_KP_Up, /* 0x1c */
+ RAWKEY_KP_Left, /* 0x1d */
+ RAWKEY_KP_Right, /* 0x1e */
+ RAWKEY_KP_Down, /* 0x1f */
+ RAWKEY_f11, /* 0x20 */
+ RAWKEY_f12, /* 0x21 */
+ RAWKEY_1, /* 0x22: exclam */
+ RAWKEY_2, /* 0x23: quotedbl */
+ RAWKEY_3, /* 0x24: numbersign */
+ RAWKEY_4, /* 0x25: dollar */
+ RAWKEY_5, /* 0x26: percent */
+ RAWKEY_6, /* 0x27: ampersand */
+ RAWKEY_7, /* 0x28: apostrophe */
+ RAWKEY_8, /* 0x29: parenleft */
+ RAWKEY_9, /* 0x2a: parenright */
+ RAWKEY_0, /* 0x2b */
+ RAWKEY_minus, /* 0x2c: equal */
+ RAWKEY_equal, /* 0x2d: asciitilde */
+ RAWKEY_backslash, /* 0x2e: bar */
+ RAWKEY_Null, /* 0x2f */
+ RAWKEY_Null, /* 0x30: f13 */
+ RAWKEY_Null, /* 0x31: f14 */
+ RAWKEY_q, /* 0x32 */
+ RAWKEY_w, /* 0x33 */
+ RAWKEY_e, /* 0x34 */
+ RAWKEY_r, /* 0x35 */
+ RAWKEY_t, /* 0x36 */
+ RAWKEY_y, /* 0x37 */
+ RAWKEY_u, /* 0x38 */
+ RAWKEY_i, /* 0x39 */
+ RAWKEY_o, /* 0x3a */
+ RAWKEY_p, /* 0x3b */
+ RAWKEY_bracketleft, /* 0x3c: grave */
+ RAWKEY_bracketright, /* 0x3d: braceleft */
+ RAWKEY_Null, /* 0x3e */
+ RAWKEY_Null, /* 0x3f */
+ RAWKEY_Null, /* 0x40 */
+ RAWKEY_Null, /* 0x41 */
+ RAWKEY_a, /* 0x42 */
+ RAWKEY_s, /* 0x43 */
+ RAWKEY_d, /* 0x44 */
+ RAWKEY_f, /* 0x45 */
+ RAWKEY_g, /* 0x46 */
+ RAWKEY_h, /* 0x47 */
+ RAWKEY_j, /* 0x48 */
+ RAWKEY_k, /* 0x49 */
+ RAWKEY_l, /* 0x4a */
+ RAWKEY_semicolon, /* 0x4b: plus */
+ RAWKEY_apostrophe, /* 0x4c: asterisk */
+ RAWKEY_Null, /* 0x4d: braceright */
+ RAWKEY_Null, /* 0x4e */
+ RAWKEY_Null, /* 0x4f */
+ RAWKEY_Null, /* 0x50 */
+ RAWKEY_Null, /* 0x51 */
+ RAWKEY_z, /* 0x52 */
+ RAWKEY_x, /* 0x53 */
+ RAWKEY_c, /* 0x54 */
+ RAWKEY_v, /* 0x55 */
+ RAWKEY_b, /* 0x56 */
+ RAWKEY_n, /* 0x57 */
+ RAWKEY_m, /* 0x58 */
+ RAWKEY_comma, /* 0x59: less */
+ RAWKEY_period, /* 0x5a: greater */
+ RAWKEY_slash, /* 0x5b: question */
+ RAWKEY_Null, /* 0x5c: underscore */
+ RAWKEY_Null, /* 0x5d */
+ RAWKEY_Null, /* 0x5e */
+ RAWKEY_Null, /* 0x5f */
+ RAWKEY_KP_Delete, /* 0x60 */
+ RAWKEY_KP_Add, /* 0x61 */
+ RAWKEY_KP_Subtract, /* 0x62 */
+ RAWKEY_KP_Home, /* 0x63: KP 7 */
+ RAWKEY_KP_Up, /* 0x64: KP 8 */
+ RAWKEY_KP_Prior, /* 0x65: KP 9 */
+ RAWKEY_KP_Left, /* 0x66: KP 4 */
+ RAWKEY_KP_Begin, /* 0x67: KP 5 */
+ RAWKEY_KP_Right, /* 0x68: KP 6 */
+ RAWKEY_KP_End, /* 0x69: KP 1 */
+ RAWKEY_KP_Down, /* 0x6a: KP 2 */
+ RAWKEY_KP_Next, /* 0x6b: KP 3 */
+ RAWKEY_KP_Insert, /* 0x6c: KP 0 */
+ RAWKEY_KP_Delete, /* 0x6d: KP Decimal */
+ RAWKEY_KP_Enter, /* 0x6e */
+ RAWKEY_Null, /* 0x6f */
+ RAWKEY_Null, /* 0x70 */
+ RAWKEY_Null, /* 0x71 */
+ RAWKEY_f1, /* 0x72 */
+ RAWKEY_f2, /* 0x73 */
+ RAWKEY_f3, /* 0x74 */
+ RAWKEY_f4, /* 0x75 */
+ RAWKEY_f5, /* 0x76 */
+ RAWKEY_f6, /* 0x77 */
+ RAWKEY_f7, /* 0x78 */
+ RAWKEY_f8, /* 0x79 */
+ RAWKEY_f9, /* 0x7a */
+ RAWKEY_f10, /* 0x7b */
+ RAWKEY_KP_Multiply, /* 0x7c */
+ RAWKEY_KP_Divide, /* 0x7d */
+ RAWKEY_KP_Equal, /* 0x7E */
+ RAWKEY_Null, /* 0x7f: KP Separator */
+};
+#endif
+
#define KC(n) KS_KEYCODE(n)
static const keysym_t omkbd_keydesc_1[] = {
@@ -477,7 +645,7 @@ omkbd_ioctl(v, cmd, data, flag, p)
int flag;
struct proc *p;
{
-#if 0
+#if WSDISPLAY_COMPAT_RAWKBD
struct ws_softc *sc = v;
#endif
@@ -489,6 +657,14 @@ omkbd_ioctl(v, cmd, data, flag, p)
case WSKBDIO_GETLEDS:
case WSKBDIO_COMPLEXBELL: /* XXX capable of complex bell */
return -1;
+#if WSDISPLAY_COMPAT_RAWKBD
+ case WSKBDIO_SETMODE:
+ sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
+ return 0;
+ case WSKBDIO_GETMODE:
+ *(int *)data = sc->sc_rawkbd;
+ return 0;
+#endif
}
return -1;
}
diff --git a/sys/arch/luna88k/dev/omrasops.c b/sys/arch/luna88k/dev/omrasops.c
index b62a36846be..539722b8695 100644
--- a/sys/arch/luna88k/dev/omrasops.c
+++ b/sys/arch/luna88k/dev/omrasops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omrasops.c,v 1.6 2009/09/05 14:09:35 miod Exp $ */
+/* $OpenBSD: omrasops.c,v 1.7 2013/04/28 23:33:12 aoyama Exp $ */
/* $NetBSD: omrasops.c,v 1.1 2000/01/05 08:48:56 nisimura Exp $ */
/*-
@@ -62,7 +62,7 @@ int om_eraserows(void *, int, int, long);
#define BYTESDONE (4)
#define W(p) (*(u_int32_t *)(p))
-#define R(p) (*(u_int32_t *)((caddr_t)(p) + 0x40000))
+#define R(p) (*(u_int32_t *)((u_int8_t *)(p) + 0x40000))
/*
* Blit a character at the specified co-ordinates.
@@ -75,7 +75,7 @@ om_putchar(cookie, row, startcol, uc, attr)
long attr;
{
struct rasops_info *ri = cookie;
- caddr_t p;
+ u_int8_t *p;
int scanspan, startx, height, width, align, y;
u_int32_t lmask, rmask, glyph, inverse;
int i, fg, bg;
@@ -90,7 +90,7 @@ om_putchar(cookie, row, startcol, uc, attr)
ri->ri_ops.unpack_attr(cookie, attr, &fg, &bg, NULL);
inverse = (bg != 0) ? ALL1BITS : ALL0BITS;
- p = (caddr_t)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
+ p = (u_int8_t *)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
align = startx & ALIGNMASK;
width = ri->ri_font->fontwidth + align;
lmask = ALL1BITS >> align;
@@ -109,7 +109,7 @@ om_putchar(cookie, row, startcol, uc, attr)
}
}
else {
- caddr_t q = p;
+ u_int8_t *q = p;
u_int32_t lhalf, rhalf;
while (height > 0) {
@@ -138,7 +138,7 @@ om_erasecols(cookie, row, startcol, ncols, attr)
long attr;
{
struct rasops_info *ri = cookie;
- caddr_t p;
+ u_int8_t *p;
int scanspan, startx, height, width, align, w, y;
u_int32_t lmask, rmask, fill;
@@ -149,7 +149,7 @@ om_erasecols(cookie, row, startcol, ncols, attr)
w = ri->ri_font->fontwidth * ncols;
fill = (attr != 0) ? ALL1BITS : ALL0BITS;
- p = (caddr_t)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
+ p = (u_int8_t *)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
align = startx & ALIGNMASK;
width = w + align;
lmask = ALL1BITS >> align;
@@ -164,7 +164,7 @@ om_erasecols(cookie, row, startcol, ncols, attr)
}
}
else {
- caddr_t q = p;
+ u_int8_t *q = p;
while (height > 0) {
W(p) = (R(p) & ~lmask) | (fill & lmask);
width -= 2 * BLITWIDTH;
@@ -192,7 +192,7 @@ om_eraserows(cookie, startrow, nrows, attr)
long attr;
{
struct rasops_info *ri = cookie;
- caddr_t p, q;
+ u_int8_t *p, *q;
int scanspan, starty, height, width, w;
u_int32_t rmask, fill;
@@ -202,7 +202,7 @@ om_eraserows(cookie, startrow, nrows, attr)
w = ri->ri_emuwidth;
fill = (attr == 1) ? ALL1BITS : ALL0BITS;
- p = (caddr_t)ri->ri_bits + starty * scanspan;
+ p = (u_int8_t *)ri->ri_bits + starty * scanspan;
width = w;
rmask = ALL1BITS << (-width & ALIGNMASK);
q = p;
@@ -230,7 +230,7 @@ om_copyrows(cookie, srcrow, dstrow, nrows)
int srcrow, dstrow, nrows;
{
struct rasops_info *ri = cookie;
- caddr_t p, q;
+ u_int8_t *p, *q;
int scanspan, offset, srcy, height, width, w;
u_int32_t rmask;
@@ -243,7 +243,7 @@ om_copyrows(cookie, srcrow, dstrow, nrows)
srcy += height;
}
- p = (caddr_t)ri->ri_bits + srcy * ri->ri_stride;
+ p = (u_int8_t *)ri->ri_bits + srcy * ri->ri_stride;
w = ri->ri_emuwidth;
width = w;
rmask = ALL1BITS << (-width & ALIGNMASK);
@@ -273,7 +273,7 @@ om_copycols(cookie, startrow, srccol, dstcol, ncols)
int startrow, srccol, dstcol, ncols;
{
struct rasops_info *ri = cookie;
- caddr_t sp, dp, basep;
+ u_int8_t *sp, *dp, *basep;
int scanspan, height, width, align, shift, w, y, srcx, dstx;
u_int32_t lmask, rmask;
@@ -283,7 +283,7 @@ om_copycols(cookie, startrow, srccol, dstcol, ncols)
dstx = ri->ri_font->fontwidth * dstcol;
height = ri->ri_font->fontheight;
w = ri->ri_font->fontwidth * ncols;
- basep = (caddr_t)ri->ri_bits + y * scanspan;
+ basep = (u_int8_t *)ri->ri_bits + y * scanspan;
align = shift = srcx & ALIGNMASK;
width = w + align;
@@ -309,7 +309,7 @@ om_copycols(cookie, startrow, srccol, dstcol, ncols)
}
/* copy forward (left-to-right) */
else if (dstcol < srccol || srccol + ncols < dstcol) {
- caddr_t sq = sp, dq = dp;
+ u_int8_t *sq = sp, *dq = dp;
w = width;
while (height > 0) {
@@ -332,7 +332,7 @@ om_copycols(cookie, startrow, srccol, dstcol, ncols)
}
/* copy backward (right-to-left) */
else {
- caddr_t sq, dq;
+ u_int8_t *sq, *dq;
sq = (sp += width / 32 * 4);
dq = (dp += width / 32 * 4);
@@ -373,7 +373,7 @@ om_cursor(cookie, on, row, col)
int on, row, col;
{
struct rasops_info *ri = cookie;
- caddr_t p;
+ u_int8_t *p;
int scanspan, startx, height, width, align, y;
u_int32_t lmask, rmask, image;
@@ -395,7 +395,7 @@ om_cursor(cookie, on, row, col)
startx = ri->ri_font->fontwidth * col;
height = ri->ri_font->fontheight;
- p = (caddr_t)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
+ p = (u_int8_t *)ri->ri_bits + y * scanspan + ((startx / 32) * 4);
align = startx & ALIGNMASK;
width = ri->ri_font->fontwidth + align;
lmask = ALL1BITS >> align;
@@ -410,7 +410,7 @@ om_cursor(cookie, on, row, col)
}
}
else {
- caddr_t q = p;
+ u_int8_t *q = p;
while (height > 0) {
image = R(p);