Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax/ibus Use MI <dev/ic/dc503reg.h> (added for vax...



details:   https://anonhg.NetBSD.org/src/rev/60c5cd3d0203
branches:  trunk
changeset: 373463:60c5cd3d0203
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Feb 11 18:30:45 2023 +0000

description:
Use MI <dev/ic/dc503reg.h> (added for vax smg(4)) for pmax pm(4) too.

diffstat:

 sys/arch/pmax/ibus/pm.c    |  32 +++++++++++++++-------------
 sys/arch/pmax/ibus/pmreg.h |  51 +---------------------------------------------
 2 files changed, 18 insertions(+), 65 deletions(-)

diffs (192 lines):

diff -r 0db3aaf1d84e -r 60c5cd3d0203 sys/arch/pmax/ibus/pm.c
--- a/sys/arch/pmax/ibus/pm.c   Sat Feb 11 18:09:55 2023 +0000
+++ b/sys/arch/pmax/ibus/pm.c   Sat Feb 11 18:30:45 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm.c,v 1.18 2021/08/07 16:19:02 thorpej Exp $  */
+/*     $NetBSD: pm.c,v 1.19 2023/02/11 18:30:45 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.18 2021/08/07 16:19:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.19 2023/02/11 18:30:45 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -46,6 +46,8 @@
 #include <dev/rasops/rasops.h>
 #include <dev/wsfont/wsfont.h>
 
+#include <dev/ic/dc503reg.h>
+
 #include <pmax/pmax/kn01.h>
 
 #include <pmax/ibus/ibusvar.h>
@@ -259,7 +261,7 @@
 {
        struct rasops_info *ri;
        int cookie, bior, i;
-       PCCRegs *pcc;
+       struct dc503reg *pcc;
        VDACRegs *vdac;
        uint16_t kn01csr;
 
@@ -370,7 +372,7 @@
        /*
         * Turn off the hardware cursor sprite for text mode.
         */
-       pcc->cmdr = PCC_FOPB | PCC_VBHI;
+       pcc->cmdr = PCCCMD_FOPB | PCCCMD_VBHI;
        wbflush();
        pm_creg = 0;
        pm_cursor_off();
@@ -379,21 +381,21 @@
 void
 pm_cursor_off(void)
 {
-       PCCRegs *pcc;
+       struct dc503reg *pcc;
 
        pcc = (void *)MIPS_PHYS_TO_KSEG1(KN01_SYS_PCC);
-       pcc->cmdr = (pm_creg &= ~(PCC_ENPA | PCC_ENPB));
+       pcc->cmdr = (pm_creg &= ~(PCCCMD_ENPA | PCCCMD_ENPB));
        wbflush();
 }
 
 void
 pm_cursor_on(struct pm_softc *sc)
 {
-       PCCRegs *pcc;
+       struct dc503reg *pcc;
 
        if (sc->sc_curenb) {
                pcc = (void *)MIPS_PHYS_TO_KSEG1(KN01_SYS_PCC);
-               pcc->cmdr = (pm_creg |= (PCC_ENPA | PCC_ENPB));
+               pcc->cmdr = (pm_creg |= (PCCCMD_ENPA | PCCCMD_ENPB));
                wbflush();
        }
 }
@@ -404,7 +406,7 @@
        struct pm_softc *sc;
        struct rasops_info *ri;
        int turnoff, rv, i;
-       PCCRegs *pcc;
+       struct dc503reg *pcc;
        VDACRegs *vdac;
 
        sc = v;
@@ -451,14 +453,14 @@
                        sc->sc_blanked = turnoff;
                        if (turnoff == 0) {
                                pcc->cmdr =
-                                   (pm_creg &= ~(PCC_FOPA | PCC_FOPB));
+                                   (pm_creg &= ~(PCCCMD_FOPA | PCCCMD_FOPB));
                                wbflush();
                                pm_cursor_on(sc);
                                sc->sc_changed |= WSDISPLAY_CURSOR_DOCMAP;
                        } else {
                                pm_cursor_off();
                                pcc->cmdr =
-                                   (pm_creg |= (PCC_FOPA | PCC_FOPB));
+                                   (pm_creg |= (PCCCMD_FOPA | PCCCMD_FOPB));
                                wbflush();
                                vdac->overWA = 0x0c;
                                wbflush();
@@ -575,7 +577,7 @@
 pm_flush(struct pm_softc *sc)
 {
        VDACRegs *vdac;
-       PCCRegs *pcc;
+       struct dc503reg *pcc;
        uint8_t *cp;
        int v, i, x, y;
        u_short *p, *pe;
@@ -629,17 +631,17 @@
                }
        }
        if ((v & WSDISPLAY_CURSOR_DOSHAPE) != 0) {
-               pcc->cmdr = (pm_creg | PCC_LODSA);
+               pcc->cmdr = (pm_creg | PCCCMD_LODSA);
                wbflush();
 
                p = sc->sc_cursor.cc_image;
                x = 0xffff >> (16 - sc->sc_cursor.cc_size.x);
                for (pe = p + 64; p < pe; p += 2) {
-                       pcc->memory = *p & x;
+                       pcc->load = *p & x;
                        wbflush();
                }
 
-               pcc->cmdr = (pm_creg &= ~PCC_LODSA);
+               pcc->cmdr = (pm_creg &= ~PCCCMD_LODSA);
                wbflush();
        }
 
diff -r 0db3aaf1d84e -r 60c5cd3d0203 sys/arch/pmax/ibus/pmreg.h
--- a/sys/arch/pmax/ibus/pmreg.h        Sat Feb 11 18:09:55 2023 +0000
+++ b/sys/arch/pmax/ibus/pmreg.h        Sat Feb 11 18:30:45 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmreg.h,v 1.3 2005/12/11 12:18:36 christos Exp $       */
+/*     $NetBSD: pmreg.h,v 1.4 2023/02/11 18:30:45 tsutsui Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -38,55 +38,6 @@
 #define        _PMREG_H_
 
 /*
- * Structure to describe the programmable cursor chip (DC503) from DEC.
- */
-typedef volatile struct PCCRegs {
-       u_short cmdr;   /* cursor command register */
-       short   pad1;
-       u_short xpos;   /* cursor X position */
-       short   pad2;
-       u_short ypos;   /* cursor Y position */
-       short   pad3;
-       u_short xmin1;  /* region 1 left edge */
-       short   pad4;
-       u_short xmax1;  /* region 1 right edge */
-       short   pad5;
-       u_short ymin1;  /* region 1 top edge */
-       short   pad6;
-       u_short ymax1;  /* region 1 bottom edge */
-       short   pad7[9];
-       u_short xmin2;  /* region 2 left edge */
-       short   pad8;
-       u_short xmax2;  /* region 2 right edge */
-       short   pad9;
-       u_short ymin2;  /* region 2 top edge */
-       short   pad10;
-       u_short ymax2;  /* region 2 bottom edge */
-       short   pad11;
-       u_short memory; /* cursor sprite pattern load */
-} PCCRegs;
-
-/*
- * Bits in pcc_cmdr.
- */
-#define PCC_TEST       0x8000
-#define PCC_HSHI       0x4000
-#define PCC_VBHI       0x2000
-#define PCC_LODSA      0x1000
-#define PCC_FORG2      0x0800
-#define PCC_ENRG2      0x0400
-#define PCC_FORG1      0x0200
-#define PCC_ENRG1      0x0100
-#define PCC_XHWID      0x0080
-#define PCC_XHCL1      0x0040
-#define PCC_XHCLP      0x0020
-#define PCC_XHAIR      0x0010
-#define PCC_FOPB       0x0008
-#define PCC_ENPB       0x0004
-#define PCC_FOPA       0x0002
-#define PCC_ENPA       0x0001
-
-/*
  * Magic offset for cursor X & Y locations.
  */
 #define PCC_X_OFFSET   212



Home | Main Index | Thread Index | Old Index