Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp300/stand/common All framebuffer drivers use comm...



details:   https://anonhg.NetBSD.org/src/rev/c8553cf1e67e
branches:  trunk
changeset: 761886:c8553cf1e67e
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Feb 10 10:44:22 2011 +0000

description:
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).

diffstat:

 sys/arch/hp300/stand/common/ite.c      |  18 +++++++++---------
 sys/arch/hp300/stand/common/ite_subr.c |  18 +++++-------------
 sys/arch/hp300/stand/common/itevar.h   |  11 ++---------
 3 files changed, 16 insertions(+), 31 deletions(-)

diffs (138 lines):

diff -r 1c9c2ea99929 -r c8553cf1e67e sys/arch/hp300/stand/common/ite.c
--- a/sys/arch/hp300/stand/common/ite.c Thu Feb 10 10:23:20 2011 +0000
+++ b/sys/arch/hp300/stand/common/ite.c Thu Feb 10 10:44:22 2011 +0000
@@ -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]);
 
diff -r 1c9c2ea99929 -r c8553cf1e67e sys/arch/hp300/stand/common/ite_subr.c
--- a/sys/arch/hp300/stand/common/ite_subr.c    Thu Feb 10 10:23:20 2011 +0000
+++ b/sys/arch/hp300/stand/common/ite_subr.c    Thu Feb 10 10:44:22 2011 +0000
@@ -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;
diff -r 1c9c2ea99929 -r c8553cf1e67e sys/arch/hp300/stand/common/itevar.h
--- a/sys/arch/hp300/stand/common/itevar.h      Thu Feb 10 10:23:20 2011 +0000
+++ b/sys/arch/hp300/stand/common/itevar.h      Thu Feb 10 10:44:22 2011 +0000
@@ -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 *);
 



Home | Main Index | Thread Index | Old Index