Module Name: src Committed By: tsutsui Date: Sat Feb 11 18:30:45 UTC 2023
Modified Files: src/sys/arch/pmax/ibus: pm.c pmreg.h Log Message: Use MI <dev/ic/dc503reg.h> (added for vax smg(4)) for pmax pm(4) too. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/pmax/ibus/pm.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/pmax/ibus/pmreg.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/pmax/ibus/pm.c diff -u src/sys/arch/pmax/ibus/pm.c:1.18 src/sys/arch/pmax/ibus/pm.c:1.19 --- src/sys/arch/pmax/ibus/pm.c:1.18 Sat Aug 7 16:19:02 2021 +++ src/sys/arch/pmax/ibus/pm.c Sat Feb 11 18:30:45 2023 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.18 #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 @@ pm_common_init(void) { struct rasops_info *ri; int cookie, bior, i; - PCCRegs *pcc; + struct dc503reg *pcc; VDACRegs *vdac; uint16_t kn01csr; @@ -370,7 +372,7 @@ pm_common_init(void) /* * 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 @@ pm_common_init(void) 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 @@ pm_ioctl(void *v, void *vs, u_long cmd, 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 @@ pm_ioctl(void *v, void *vs, u_long cmd, 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 @@ int 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 @@ pm_flush(struct pm_softc *sc) } } 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(); } Index: src/sys/arch/pmax/ibus/pmreg.h diff -u src/sys/arch/pmax/ibus/pmreg.h:1.3 src/sys/arch/pmax/ibus/pmreg.h:1.4 --- src/sys/arch/pmax/ibus/pmreg.h:1.3 Sun Dec 11 12:18:36 2005 +++ src/sys/arch/pmax/ibus/pmreg.h Sat Feb 11 18:30:45 2023 @@ -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