Module Name:    src
Committed By:   tsutsui
Date:           Thu Feb 10 10:44:23 UTC 2011

Modified Files:
        src/sys/arch/hp300/stand/common: ite.c ite_subr.c itevar.h

Log Message:
All framebuffer drivers use common readbyte and writeglyph functions
so no need to put them into per driver function pointers. From OpenBSD.

Tested on HP382 (serial) and HP425t (topcat).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/stand/common/ite_subr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/stand/common/itevar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.11 src/sys/arch/hp300/stand/common/ite.c:1.12
--- src/sys/arch/hp300/stand/common/ite.c:1.11	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite.c	Thu Feb 10 10:44:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.11 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite.c,v 1.12 2011/02/10 10:44:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -64,35 +64,35 @@
 struct itesw itesw[] = {
 	{ GID_TOPCAT,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_GATORBOX,
 	gbox_init,	ite_deinit_noop, gbox_clear,	gbox_putc,
-	gbox_cursor,	gbox_scroll,	ite_readbyte,	ite_writeglyph },
+	gbox_cursor,	gbox_scroll },
 
 	{ GID_RENAISSANCE,
 	rbox_init,	ite_deinit_noop, rbox_clear,	rbox_putc,
-	rbox_cursor,	rbox_scroll,	ite_readbyte,	ite_writeglyph },
+	rbox_cursor,	rbox_scroll },
 
 	{ GID_LRCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRCCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRMCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_DAVINCI,
       	dvbox_init,	ite_deinit_noop, dvbox_clear,	dvbox_putc,
-	dvbox_cursor,	dvbox_scroll,	ite_readbyte,	ite_writeglyph },
+	dvbox_cursor,	dvbox_scroll },
 
 	{ GID_HYPERION,
 	hyper_init,	ite_deinit_noop, hyper_clear,	hyper_putc,
-	hyper_cursor,	hyper_scroll,	ite_readbyte,	ite_writeglyph },
+	hyper_cursor,	hyper_scroll },
 };
 int	nitesw = sizeof(itesw) / sizeof(itesw[0]);
 

Index: src/sys/arch/hp300/stand/common/ite_subr.c
diff -u src/sys/arch/hp300/stand/common/ite_subr.c:1.7 src/sys/arch/hp300/stand/common/ite_subr.c:1.8
--- src/sys/arch/hp300/stand/common/ite_subr.c:1.7	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_subr.c	Thu Feb 10 10:44:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_subr.c,v 1.7 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_subr.c,v 1.8 2011/02/10 10:44:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,6 +47,8 @@
 #include <hp300/stand/common/samachdep.h>
 #include <hp300/stand/common/itevar.h>
 
+static void ite_writeglyph(struct ite_data *, u_char *, u_char *);
+
 void
 ite_fontinfo(struct ite_data *ip)
 {
@@ -99,21 +101,11 @@
 			*dp++ = getbyte(ip, romp);
 			romp += 2;
 		}
-		writeglyph(ip, fbmem, fontbuf);
+		ite_writeglyph(ip, fbmem, fontbuf);
 	}
 }
 
-/*
- * Display independent versions of the readbyte and writeglyph routines.
- */
-u_char
-ite_readbyte(struct ite_data *ip, int disp)
-{
-
-	return (u_char)*(((u_char *)ip->regbase) + disp);
-}
-
-void
+static void
 ite_writeglyph(struct ite_data *ip, u_char *fbmem, u_char *glyphp)
 {
 	int bn;

Index: src/sys/arch/hp300/stand/common/itevar.h
diff -u src/sys/arch/hp300/stand/common/itevar.h:1.8 src/sys/arch/hp300/stand/common/itevar.h:1.9
--- src/sys/arch/hp300/stand/common/itevar.h:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/itevar.h	Thu Feb 10 10:44:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: itevar.h,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: itevar.h,v 1.9 2011/02/10 10:44:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -45,14 +45,11 @@
 #define ITEUNIT(dev)       minor(dev)
 
 #define getbyte(ip, offset) \
-	((*(ip)->isw->ite_readbyte)(ip, offset))
+	*(((u_char *)(ip)->regbase) + (offset))
 
 #define getword(ip, offset) \
 	((getbyte(ip, offset) << 8) | getbyte(ip, (offset) + 2))
 
-#define writeglyph(ip, offset, fontbuf) \
-	((*(ip)->isw->ite_writeglyph)((ip), (offset), (fontbuf)))
-
 struct ite_data {
 	int	flags;
 	struct	tty *tty;
@@ -84,8 +81,6 @@
 	void	(*ite_putc)(struct ite_data *, int, int, int, int);
 	void	(*ite_cursor)(struct ite_data *, int);
 	void	(*ite_scroll)(struct ite_data *, int, int, int, int);
-	u_char	(*ite_readbyte)(struct ite_data *, int);
-	void	(*ite_writeglyph)(struct ite_data *, u_char *, u_char *);
 };
 
 /* Flags */
@@ -190,8 +185,6 @@
 /*
  * Prototypes.
  */
-u_char ite_readbyte(struct ite_data *, int);
-void ite_writeglyph(struct ite_data *, u_char *, u_char *);
 void ite_fontinfo(struct ite_data *);
 void ite_fontinit(struct ite_data *);
 

Reply via email to