summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/rcons/raster.h4
-rw-r--r--sys/dev/rcons/raster_op.c133
-rw-r--r--sys/dev/rcons/raster_text.c11
-rw-r--r--sys/dev/rcons/rcons_kern.c4
4 files changed, 81 insertions, 71 deletions
diff --git a/sys/dev/rcons/raster.h b/sys/dev/rcons/raster.h
index 77c7e262b24..e8868ca27c5 100644
--- a/sys/dev/rcons/raster.h
+++ b/sys/dev/rcons/raster.h
@@ -1,4 +1,4 @@
-/* $NetBSD: raster.h,v 1.2 1995/10/04 23:57:19 pk Exp $ */
+/* $NetBSD: raster.h,v 1.3 1995/11/24 23:50:51 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -87,7 +87,7 @@ struct raster {
int width, height; /* size in pixels */
int depth; /* bits per pixel - 1 or 8 */
int linelongs; /* longs from one line to the next - for padding */
- u_long* pixels; /* pointer to the actual bits */
+ u_int32_t *pixels; /* pointer to the actual bits */
caddr_t data; /* special pointer for frame buffers and subregions */
};
diff --git a/sys/dev/rcons/raster_op.c b/sys/dev/rcons/raster_op.c
index 4aa418478a0..80641925e23 100644
--- a/sys/dev/rcons/raster_op.c
+++ b/sys/dev/rcons/raster_op.c
@@ -1,4 +1,4 @@
-/* $NetBSD: raster_op.c,v 1.1 1995/09/17 19:56:33 pk Exp $ */
+/* $NetBSD: raster_op.c,v 1.3 1995/11/29 22:12:58 pk Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -57,7 +57,11 @@
*/
#include <sys/types.h>
+#ifdef _KERNEL
#include <dev/rcons/raster.h>
+#else
+#include "raster.h"
+#endif
/* CONFIGURE: To save on executable size, you can configure out the seldom-used
** logical operations. With this variable set, the only operations implemented
@@ -413,7 +417,7 @@ static int needsrc[16] = { 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0 };
#ifdef MSBIT_FIRST
-u_long raster_bitmask[32] = {
+u_int32_t raster_bitmask[32] = {
0x80000000, 0x40000000, 0x20000000, 0x10000000,
0x08000000, 0x04000000, 0x02000000, 0x01000000,
0x00800000, 0x00400000, 0x00200000, 0x00100000,
@@ -424,7 +428,7 @@ u_long raster_bitmask[32] = {
0x00000008, 0x00000004, 0x00000002, 0x00000001 };
#ifdef MSBYTE_FIRST
-static u_long leftmask[32] = {
+static u_int32_t leftmask[32] = {
0x00000000, 0x80000000, 0xc0000000, 0xe0000000,
0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000,
0xff000000, 0xff800000, 0xffc00000, 0xffe00000,
@@ -433,7 +437,7 @@ static u_long leftmask[32] = {
0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00,
0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0,
0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe };
-static u_long rightmask[32] = {
+static u_int32_t rightmask[32] = {
0x00000000, 0x00000001, 0x00000003, 0x00000007,
0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f,
0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff,
@@ -442,11 +446,14 @@ static u_long rightmask[32] = {
0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff,
0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff,
0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff };
+
+#define LSOP <<
+#define RSOP >>
#endif /*MSBYTE_FIRST*/
#else /*MSBIT_FIRST*/
-u_long raster_bitmask[32] = {
+u_int32_t raster_bitmask[32] = {
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080,
0x00000100, 0x00000200, 0x00000400, 0x00000800,
@@ -457,7 +464,7 @@ u_long raster_bitmask[32] = {
0x10000000, 0x20000000, 0x40000000, 0x80000000 };
#ifndef MSBYTE_FIRST
-static u_long leftmask[32] = {
+static u_int32_t leftmask[32] = {
0x00000000, 0x00000001, 0x00000003, 0x00000007,
0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f,
0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff,
@@ -466,7 +473,7 @@ static u_long leftmask[32] = {
0x000fffff, 0x001fffff, 0x003fffff, 0x007fffff,
0x00ffffff, 0x01ffffff, 0x03ffffff, 0x07ffffff,
0x0fffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff };
-static u_long rightmask[32] = {
+static u_int32_t rightmask[32] = {
0x00000000, 0x80000000, 0xc0000000, 0xe0000000,
0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000,
0xff000000, 0xff800000, 0xffc00000, 0xffe00000,
@@ -475,6 +482,8 @@ static u_long rightmask[32] = {
0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00,
0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0,
0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe };
+#define LSOP >>
+#define RSOP <<
#endif /*not MSBYTE_FIRST*/
#endif /*MSBIT_FIRST*/
@@ -482,9 +491,9 @@ static u_long rightmask[32] = {
/* (The odd combinations MSBIT+~MSBYTE and ~MSBIT+MSBYTE could be added.) */
#ifdef MSBYTE_FIRST
-static u_long bytemask[4] = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff };
+static u_int32_t bytemask[4] = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff };
#else /*MSBYTE_FIRST*/
-static u_long bytemask[4] = { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 };
+static u_int32_t bytemask[4] = { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 };
#endif /*MSBYTE_FIRST*/
@@ -598,8 +607,8 @@ raster_op_noclip( dst, dx, dy, w, h, rop, src, sx, sy )
if ( dst->depth == 1 )
{
/* One to one blit. */
- u_long* srclin1;
- u_long* dstlin1;
+ u_int32_t* srclin1;
+ u_int32_t* dstlin1;
int srcleftignore, srcrightignore, srclongs;
int dstleftignore, dstrightignore, dstlongs;
@@ -613,7 +622,7 @@ raster_op_noclip( dst, dx, dy, w, h, rop, src, sx, sy )
{
bcopy(
(char*) srclin1, (char*) dstlin1,
- h * src->linelongs * sizeof(u_long) );
+ h * src->linelongs * sizeof(u_int32_t) );
return 0;
}
#endif /*BCOPY_FASTER*/
@@ -637,14 +646,14 @@ raster_op_noclip( dst, dx, dy, w, h, rop, src, sx, sy )
** as a group, indexing into a 16-element runtime-constructed
** table of longwords.
*/
- u_long* srclin1;
- u_long* dstlin1;
- u_long* srclin2;
- u_long* srclin;
- u_long* dstlin;
- register u_long* srclong;
- register u_long* dstlong;
- register u_long color, dl;
+ u_int32_t* srclin1;
+ u_int32_t* dstlin1;
+ u_int32_t* srclin2;
+ u_int32_t* srclin;
+ u_int32_t* dstlin;
+ register u_int32_t* srclong;
+ register u_int32_t* dstlong;
+ register u_int32_t color, dl;
register int srcbit, dstbyte, i;
color = RAS_GETCOLOR( rop );
@@ -705,8 +714,8 @@ raster_op_noclip( dst, dx, dy, w, h, rop, src, sx, sy )
else
{
/* Eight to eight blit. */
- u_long* srclin1;
- u_long* dstlin1;
+ u_int32_t* srclin1;
+ u_int32_t* dstlin1;
int srcleftignore, srcrightignore, srclongs;
int dstleftignore, dstrightignore, dstlongs;
@@ -722,7 +731,7 @@ raster_op_noclip( dst, dx, dy, w, h, rop, src, sx, sy )
src->linelongs == dst->linelongs && src->linelongs == w >> 2 )
{
bcopy( (char*) srclin1, (char*) dstlin1,
- h * src->linelongs * sizeof(u_long) );
+ h * src->linelongs * sizeof(u_int32_t) );
return 0;
}
#endif /*BCOPY_FASTER*/
@@ -757,13 +766,13 @@ raster_op_nosrc_noclip( dst, dx, dy, w, h, rop )
if ( dst->depth == 1 )
{
/* One-bit no-src blit. */
- u_long* dstlin1;
- u_long* dstlin2;
- u_long* dstlin;
+ u_int32_t* dstlin1;
+ u_int32_t* dstlin2;
+ u_int32_t* dstlin;
int dstleftignore, dstrightignore, dstlongs;
- u_long dl, lm, nlm, rm, nrm;
- register u_long* dstlong2;
- register u_long* dstlong;
+ u_int32_t dl, lm, nlm, rm, nrm;
+ register u_int32_t* dstlong2;
+ register u_int32_t* dstlong;
dstlin1 = RAS_ADDR( dst, dx, dy );
@@ -771,7 +780,7 @@ raster_op_nosrc_noclip( dst, dx, dy, w, h, rop )
/* Special-case full-width clears. */
if ( op == RAS_CLEAR && dst->width == w && dst->linelongs == w >> 5 )
{
- bzero( (char*) dstlin1, h * dst->linelongs * sizeof(u_long) );
+ bzero( (char*) dstlin1, h * dst->linelongs * sizeof(u_int32_t) );
return 0;
}
#endif /*BCOPY_FASTER*/
@@ -851,14 +860,14 @@ raster_op_nosrc_noclip( dst, dx, dy, w, h, rop )
else
{
/* Eight-bit no-src blit. */
- register u_long color;
- u_long* dstlin1;
- u_long* dstlin2;
- u_long* dstlin;
+ register u_int32_t color;
+ u_int32_t* dstlin1;
+ u_int32_t* dstlin2;
+ u_int32_t* dstlin;
int dstleftignore, dstrightignore, dstlongs;
- u_long dl, lm, nlm, rm, nrm;
- register u_long* dstlong2;
- register u_long* dstlong;
+ u_int32_t dl, lm, nlm, rm, nrm;
+ register u_int32_t* dstlong2;
+ register u_int32_t* dstlong;
dstlin1 = RAS_ADDR( dst, dx, dy );
@@ -866,7 +875,7 @@ raster_op_nosrc_noclip( dst, dx, dy, w, h, rop )
/* Special-case full-width clears. */
if ( op == RAS_CLEAR && dst->width == w && dst->linelongs == w >> 2 )
{
- bzero( (char*) dstlin1, h * dst->linelongs * sizeof(u_long) );
+ bzero( (char*) dstlin1, h * dst->linelongs * sizeof(u_int32_t) );
return 0;
}
#endif /*BCOPY_FASTER*/
@@ -962,24 +971,24 @@ raster_op_nosrc_noclip( dst, dx, dy, w, h, rop )
static int
raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1, dstleftignore, dstrightignore, dstlongs, h, op )
struct raster* src;
- u_long* srclin1;
+ u_int32_t* srclin1;
int srcleftignore, srcrightignore, srclongs;
struct raster* dst;
- u_long* dstlin1;
+ u_int32_t* dstlin1;
int dstleftignore, dstrightignore, dstlongs;
int h, op;
{
- u_long* srclin2;
- u_long* dstlin2;
+ u_int32_t* srclin2;
+ u_int32_t* dstlin2;
int srclininc, dstlininc;
- u_long* srclin;
- u_long* dstlin;
+ u_int32_t* srclin;
+ u_int32_t* dstlin;
register int prevleftshift, currrightshift;
int longinc;
- register u_long* srclong;
- register u_long* dstlong;
- register u_long* dstlong2;
- register u_long dl, lm, nlm, rm, nrm;
+ register u_int32_t* srclong;
+ register u_int32_t* dstlong;
+ register u_int32_t* dstlong2;
+ register u_int32_t dl, lm, nlm, rm, nrm;
prevleftshift = ( srcleftignore - dstleftignore ) & 31;
@@ -1152,7 +1161,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
else
{
/* General case, with shifting and everything. */
- register u_long sl, prevsl;
+ register u_int32_t sl, prevsl;
currrightshift = 32 - prevleftshift;
if ( srclongs == 1 && dstlongs == 1 )
@@ -1167,7 +1176,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
ROP_SRCDST(
/*op*/ op,
/*pre*/ dl = *dstlin;,
- /*s*/ *srclin << prevleftshift,
+ /*s*/ *srclin LSOP prevleftshift,
/*d*/ dl,
/*pst*/ *dstlin = ( *dstlin & lm ) | ( dl & nlm ); )
@@ -1182,7 +1191,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
ROP_SRCDST(
/*op*/ op,
/*pre*/ dl = *dstlin;,
- /*s*/ *srclin >> currrightshift,
+ /*s*/ *srclin RSOP currrightshift,
/*d*/ dl,
/*pst*/ *dstlin = ( *dstlin & lm ) | ( dl & nlm ); )
@@ -1207,7 +1216,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
dstlong = dstlin;
dstlong2 = dstlong + dstlongs;
if ( srcleftignore > dstleftignore )
- prevsl = *srclong++ << prevleftshift;
+ prevsl = *srclong++ LSOP prevleftshift;
else
prevsl = 0;
if ( dstrightignore != 0 )
@@ -1220,7 +1229,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
/*op*/ op,
/*pre*/ sl = *srclong;
dl = *dstlong;,
- /*s*/ prevsl | ( sl >> currrightshift ),
+ /*s*/ prevsl | ( sl RSOP currrightshift ),
/*d*/ dl,
/*pst*/ *dstlong = ( *dstlong & lm ) | ( dl & nlm ); )
prevsl = sl << prevleftshift;
@@ -1234,9 +1243,9 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
/*pre*/ while ( dstlong != dstlong2 )
{
sl = *srclong;,
- /*s*/ prevsl | ( sl >> currrightshift ),
+ /*s*/ prevsl | ( sl RSOP currrightshift ),
/*d*/ *dstlong,
- /*pst*/ prevsl = sl << prevleftshift;
+ /*pst*/ prevsl = sl LSOP prevleftshift;
++srclong;
++dstlong;
} )
@@ -1247,7 +1256,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
ROP_SRCDST(
/*op*/ op,
/*pre*/ dl = *dstlong;,
- /*s*/ prevsl | ( *srclong >> currrightshift ),
+ /*s*/ prevsl | ( *srclong RSOP currrightshift ),
/*d*/ dl,
/*pst*/ *dstlong = ( dl & nrm ) | ( *dstlong & rm ); )
}
@@ -1265,7 +1274,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
dstlong = dstlin;
dstlong2 = dstlong - dstlongs;
if ( srcrightignore > dstrightignore )
- prevsl = *srclong-- >> currrightshift;
+ prevsl = *srclong-- RSOP currrightshift;
else
prevsl = 0;
if ( dstleftignore != 0 )
@@ -1278,10 +1287,10 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
/*op*/ op,
/*pre*/ sl = *srclong;
dl = *dstlong;,
- /*s*/ prevsl | ( sl << prevleftshift ),
+ /*s*/ prevsl | ( sl LSOP prevleftshift ),
/*d*/ dl,
/*pst*/ *dstlong = ( dl & nrm ) | ( *dstlong & rm ); )
- prevsl = sl >> currrightshift;
+ prevsl = sl RSOP currrightshift;
--srclong;
--dstlong;
}
@@ -1292,9 +1301,9 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
/*pre*/ while ( dstlong != dstlong2 )
{
sl = *srclong;,
- /*s*/ prevsl | ( sl << prevleftshift ),
+ /*s*/ prevsl | ( sl LSOP prevleftshift ),
/*d*/ *dstlong,
- /*pst*/ prevsl = sl >> currrightshift;
+ /*pst*/ prevsl = sl RSOP currrightshift;
--srclong;
--dstlong;
} )
@@ -1305,7 +1314,7 @@ raster_blit( src, srclin1, srcleftignore, srcrightignore, srclongs, dst, dstlin1
ROP_SRCDST(
/*op*/ op,
/*pre*/ dl = *dstlong;,
- /*s*/ prevsl | ( *srclong << prevleftshift ),
+ /*s*/ prevsl | ( *srclong LSOP prevleftshift ),
/*d*/ dl,
/*pst*/ *dstlong = ( *dstlong & lm ) | ( dl & nlm ); )
}
diff --git a/sys/dev/rcons/raster_text.c b/sys/dev/rcons/raster_text.c
index d77b1f69a1a..ec0e140728d 100644
--- a/sys/dev/rcons/raster_text.c
+++ b/sys/dev/rcons/raster_text.c
@@ -1,4 +1,4 @@
-/* $NetBSD: raster_text.c,v 1.2 1995/10/04 23:57:22 pk Exp $ */
+/* $NetBSD: raster_text.c,v 1.3 1995/11/24 23:50:56 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -45,6 +45,7 @@
#ifdef _KERNEL
#include <sys/param.h>
+#include <sys/systm.h>
#include <dev/rcons/raster.h>
#ifdef COLORFONT_CACHE
#include <sys/malloc.h>
@@ -52,14 +53,14 @@
#endif
#else
#include <sys/types.h>
-#include <dev/rcons/raster.h>
+#include <string.h>
+#include "raster.h"
#ifdef COLORFONT_CACHE
#include <malloc.h>
#define NEW(size) malloc(size)
#endif
#endif
-
/* Draws text. Returns 0 on success, -1 on failure. */
int
raster_text( r, x, y, rop, rf, text )
@@ -234,7 +235,7 @@ raster_alloc( width, height, depth )
return (struct raster*) 0;
linelongs = ( ( width * depth + 31 ) >> 5 );
r = (struct raster*)
- NEW( sizeof(struct raster) + height * linelongs * sizeof(u_long));
+ NEW( sizeof(struct raster) + height * linelongs * sizeof(u_int32_t));
if ( r == (struct raster*) 0 )
return (struct raster*) 0;
@@ -242,7 +243,7 @@ raster_alloc( width, height, depth )
r->height = height;
r->depth = depth;
r->linelongs = linelongs;
- r->pixels = (u_long*) (r + 1);
+ r->pixels = (u_int32_t*) (r + 1);
r->data = (caddr_t) 0;
return r;
}
diff --git a/sys/dev/rcons/rcons_kern.c b/sys/dev/rcons/rcons_kern.c
index a2f5fe0ea87..49768997c67 100644
--- a/sys/dev/rcons/rcons_kern.c
+++ b/sys/dev/rcons/rcons_kern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rcons_kern.c,v 1.2 1995/10/04 23:57:25 pk Exp $ */
+/* $NetBSD: rcons_kern.c,v 1.3 1995/11/29 22:09:23 pk Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -185,7 +185,7 @@ rcons_init(rc)
return;
}
rp->linelongs = rc->rc_linebytes >> 2;
- rp->pixels = (u_long *)rc->rc_pixels;
+ rp->pixels = (u_int32_t *)rc->rc_pixels;
rc->rc_ras_blank = RAS_CLEAR;