Tue Nov 3 15:52:57 2020 UTC ()
Avoid a use of __UNVOLATILE(3).  Tested on XM6i.


(tsutsui)
diff -r1.5 -r1.6 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h
diff -r1.5 -r1.6 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c
diff -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h

cvs diff -r1.5 -r1.6 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h 2020/07/22 21:24:20 1.5
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68k.h 2020/11/03 15:52:57 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: x68k.h,v 1.5 2020/07/22 21:24:20 tsutsui Exp $ */ 1/* $NetBSD: x68k.h,v 1.6 2020/11/03 15:52:57 tsutsui Exp $ */
2/*------------------------------------------------------------------------- 2/*-------------------------------------------------------------------------
3 * Copyright (c) 1996 Yasushi Yamasaki 3 * Copyright (c) 1996 Yasushi Yamasaki
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -69,27 +69,27 @@ @@ -69,27 +69,27 @@
69 * X68k dependent screen record 69 * X68k dependent screen record
70 */ 70 */
71typedef struct _X68kScreenRec { 71typedef struct _X68kScreenRec {
72 int type; /* frame buffer type */ 72 int type; /* frame buffer type */
73 int class; /* visual class */ 73 int class; /* visual class */
74 int fd; /* file descriptor */ 74 int fd; /* file descriptor */
75 int depth; /* depth */ 75 int depth; /* depth */
76 int fb_width; /* frame buffer width */ 76 int fb_width; /* frame buffer width */
77 int fb_height; /* frame buffer height */ 77 int fb_height; /* frame buffer height */
78 int scr_width; /* screen width */ 78 int scr_width; /* screen width */
79 int scr_height; /* screen height */ 79 int scr_height; /* screen height */
80 int dpi; /* dots per inch */ 80 int dpi; /* dots per inch */
81 uint8_t *fb; /* frame buffer VA */ 81 uint8_t *fb; /* frame buffer VA */
82 volatile FbReg *reg; /* control register VA */ 82 FbReg *reg; /* control register VA */
83 X68kFbReg x68kreg; /* control register */ 83 X68kFbReg x68kreg; /* control register */
84 int mapsize; /* size of mapped memory */ 84 int mapsize; /* size of mapped memory */
85 ColormapPtr installedMap; /* installed colormap */ 85 ColormapPtr installedMap; /* installed colormap */
86} X68kScreenRec; 86} X68kScreenRec;
87 87
88/* 88/*
89 * frame buffer procedures 89 * frame buffer procedures
90 */ 90 */
91typedef struct _X68kFbProcRec { 91typedef struct _X68kFbProcRec {
92 Bool (*open)(X68kScreenRec *); /* open procedure */ 92 Bool (*open)(X68kScreenRec *); /* open procedure */
93 Bool (*init)(ScreenPtr, int, char *[]); /* initialize procedure */ 93 Bool (*init)(ScreenPtr, int, char *[]); /* initialize procedure */
94 void (*close)(X68kScreenRec *); /* close procedure */ 94 void (*close)(X68kScreenRec *); /* close procedure */
95} X68kFbProcRec; 95} X68kFbProcRec;

cvs diff -r1.5 -r1.6 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c 2020/11/03 15:25:21 1.5
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kFb.c 2020/11/03 15:52:57 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: x68kFb.c,v 1.5 2020/11/03 15:25:21 tsutsui Exp $ */ 1/* $NetBSD: x68kFb.c,v 1.6 2020/11/03 15:52:57 tsutsui Exp $ */
2/*------------------------------------------------------------------------- 2/*-------------------------------------------------------------------------
3 * Copyright (c) 1996 Yasushi Yamasaki 3 * Copyright (c) 1996 Yasushi Yamasaki
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -103,27 +103,27 @@ x68kFbCommonClose(X68kScreenRec *pPriv) @@ -103,27 +103,27 @@ x68kFbCommonClose(X68kScreenRec *pPriv)
103 524, 1, 33, 513, 103 524, 1, 33, 513,
104 27, 0, 0, 0, 104 27, 0, 0, 0,
105 0, 0, 0, 0, 105 0, 0, 0, 0,
106 0, 0, 0, 0, 106 0, 0, 0, 0,
107 0x0417, 0, 0, 0, 0 }, 107 0x0417, 0, 0, 0, 0 },
108 { 0x0004, 0x21e4, 0x0020 }, 108 { 0x0004, 0x21e4, 0x0020 },
109 0 109 0
110 }; 110 };
111 /* change video mode */ 111 /* change video mode */
112 pPriv->x68kreg = (cons_dwidth == 640) ? graphNone_mode19 : graphNone_mode16; 112 pPriv->x68kreg = (cons_dwidth == 640) ? graphNone_mode19 : graphNone_mode16;
113 x68kRegSetup(pPriv); 113 x68kRegSetup(pPriv);
114 114
115 /* unmap and close frame buffer */ 115 /* unmap and close frame buffer */
116 if ( munmap(__UNVOLATILE(pPriv->reg), pPriv->mapsize) == -1 ) 116 if ( munmap(pPriv->reg, pPriv->mapsize) == -1 )
117 ErrorF("Can't unmap frame buffer"); 117 ErrorF("Can't unmap frame buffer");
118 close(pPriv->fd); 118 close(pPriv->fd);
119} 119}
120 120
121/*------------------------------------------------------------------------- 121/*-------------------------------------------------------------------------
122 * function "x68kRegSetup" 122 * function "x68kRegSetup"
123 * 123 *
124 * purpose: set up CRT controller and Video controller 124 * purpose: set up CRT controller and Video controller
125 * with register values in pPriv->x68kreg 125 * with register values in pPriv->x68kreg
126 * argument: (X68kScreenRec *)pPriv : X68k private screen record 126 * argument: (X68kScreenRec *)pPriv : X68k private screen record
127 * returns: nothing 127 * returns: nothing
128 *-----------------------------------------------------------------------*/ 128 *-----------------------------------------------------------------------*/
129#define CRTCSET(r) pPriv->reg->crtc.r = pPriv->x68kreg.crtc.r 129#define CRTCSET(r) pPriv->reg->crtc.r = pPriv->x68kreg.crtc.r

cvs diff -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h 2020/08/01 20:09:03 1.3
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kReg.h 2020/11/03 15:52:57 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: x68kReg.h,v 1.3 2020/08/01 20:09:03 tsutsui Exp $ */ 1/* $NetBSD: x68kReg.h,v 1.4 2020/11/03 15:52:57 tsutsui Exp $ */
2/*------------------------------------------------------------------------- 2/*-------------------------------------------------------------------------
3 * Copyright (c) 1996 Yasushi Yamasaki 3 * Copyright (c) 1996 Yasushi Yamasaki
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -18,73 +18,73 @@ @@ -18,73 +18,73 @@
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *-----------------------------------------------------------------------*/ 25 *-----------------------------------------------------------------------*/
26 26
27/* 27/*
28 * CRT controller 28 * CRT controller
29 */ 29 */
30typedef struct { 30typedef struct {
31 u_short r00, r01, r02, r03, r04, r05, r06, r07; 31 volatile u_short r00, r01, r02, r03, r04, r05, r06, r07;
32 u_short r08, r09, r10, r11, r12, r13, r14, r15; 32 volatile u_short r08, r09, r10, r11, r12, r13, r14, r15;
33 u_short r16, r17, r18, r19, r20, r21, r22, r23; 33 volatile u_short r16, r17, r18, r19, r20, r21, r22, r23;
34 char pad0[0x450]; 34 char pad0[0x450];
35 u_short ctrl; 35 volatile u_short ctrl;
36 char pad1[0x1b7e]; 36 char pad1[0x1b7e];
37} Crtc; 37} Crtc;
38 38
39typedef struct { 39typedef struct {
40 u_short r00, r01, r02, r03, r04, r05, r06, r07; 40 u_short r00, r01, r02, r03, r04, r05, r06, r07;
41 u_short r08, r09, r10, r11, r12, r13, r14, r15; 41 u_short r08, r09, r10, r11, r12, r13, r14, r15;
42 u_short r16, r17, r18, r19, r20, r21, r22, r23; 42 u_short r16, r17, r18, r19, r20, r21, r22, r23;
43 u_short ctrl; 43 u_short ctrl;
44} X68kCrtc; 44} X68kCrtc;
45 45
46/* 46/*
47 * video controller 47 * video controller
48 */ 48 */
49typedef struct { 49typedef struct {
50 u_short r0; 50 volatile u_short r0;
51 char pad0[0xfe]; 51 char pad0[0xfe];
52 u_short r1; 52 volatile u_short r1;
53 char pad1[0xfe]; 53 char pad1[0xfe];
54 u_short r2; 54 volatile u_short r2;
55 char pad2[0x19fe]; 55 char pad2[0x19fe];
56} Videoc; 56} Videoc;
57 57
58typedef struct { 58typedef struct {
59 u_short r0; 59 u_short r0;
60 u_short r1; 60 u_short r1;
61 u_short r2; 61 u_short r2;
62} X68kVideoc; 62} X68kVideoc;
63 63
64/* system port */ 64/* system port */
65typedef struct { 65typedef struct {
66 u_short r1, r2, r3, r4; 66 volatile u_short r1, r2, r3, r4;
67 u_short pad0[2]; 67 u_short pad0[2];
68 u_short r5, r6; 68 volatile u_short r5, r6;
69 u_short pad[0x1ff0]; 69 u_short pad[0x1ff0];
70} Sysport; 70} Sysport;
71 71
72/* 72/*
73 * control registers 73 * control registers
74 */ 74 */
75typedef struct { 75typedef struct {
76 Crtc crtc; 76 Crtc crtc;
77 u_short gpal[256]; /* graphic palette */ 77 volatile u_short gpal[256]; /* graphic palette */
78 u_short tpal[256]; /* text palette */ 78 volatile u_short tpal[256]; /* text palette */
79 Videoc videoc; 79 Videoc videoc;
80 u_short pad0[0xa000]; 80 u_short pad0[0xa000];
81 Sysport sysport; 81 Sysport sysport;
82} FbReg; 82} FbReg;
83 83
84typedef struct { 84typedef struct {
85 X68kCrtc crtc; 85 X68kCrtc crtc;
86 X68kVideoc videoc; 86 X68kVideoc videoc;
87 char dotClock; 87 char dotClock;
88} X68kFbReg; 88} X68kFbReg;
89 89
90/* EOF x68kReg.h */ 90/* EOF x68kReg.h */