Update for removal of AddEnabledDevice and RemoveEnabledDevice. Use the NotifyFd API instead as per upstream commits: https://cgit.freedesktop.org/xorg/xserver/commit/?id=55c2e1a3aa587c58a74066724e11e30b3df267b8 https://cgit.freedesktop.org/xorg/xserver/commit/?id=be5a513fee6cbf29ef7570e57eb0436d70fbd88c https://cgit.freedesktop.org/xorg/xserver/commit/?id=60a91031d13e4d29c383087120e318f6b528b6e5 https://cgit.freedesktop.org/xorg/xserver/commit/?id=7def2fea30060d47780dc1eedc91fada5ae1934fdiff -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c
(tsutsui)
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c 2020/04/10 16:49:36 1.4
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kKbd.c 2020/07/18 15:37:02 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: x68kKbd.c,v 1.4 2020/04/10 16:49:36 tsutsui Exp $ */ | 1 | /* $NetBSD: x68kKbd.c,v 1.5 2020/07/18 15:37:02 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 | * | |
@@ -77,33 +77,39 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | @@ -77,33 +77,39 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
77 | #include "misc.h" | 77 | #include "misc.h" | |
78 | #include "scrnintstr.h" | 78 | #include "scrnintstr.h" | |
79 | #include "servermd.h" | 79 | #include "servermd.h" | |
80 | 80 | |||
81 | #include <X11/extensions/XKB.h> | 81 | #include <X11/extensions/XKB.h> | |
82 | #include "xkbsrv.h" | 82 | #include "xkbsrv.h" | |
83 | 83 | |||
84 | #define MIN_KEYCODE 7 /* necessary to avoid the mouse buttons */ | 84 | #define MIN_KEYCODE 7 /* necessary to avoid the mouse buttons */ | |
85 | #define MAX_KEYCODE 255 /* limited by the protocol */ | 85 | #define MAX_KEYCODE 255 /* limited by the protocol */ | |
86 | 86 | |||
87 | X68kKbdPriv x68kKbdPriv; | 87 | X68kKbdPriv x68kKbdPriv; | |
88 | DeviceIntPtr x68kKeyboardDevice = NULL; | 88 | DeviceIntPtr x68kKeyboardDevice = NULL; | |
89 | 89 | |||
90 | static void x68kKbdHandlerNotify(int, int, void *); | |||
90 | static void x68kInitModMap(KeySymsRec *, CARD8 *); | 91 | static void x68kInitModMap(KeySymsRec *, CARD8 *); | |
91 | static void x68kInitKbdNames(XkbRMLVOSet *, X68kKbdPrivPtr); | 92 | static void x68kInitKbdNames(XkbRMLVOSet *, X68kKbdPrivPtr); | |
92 | static void x68kKbdRingBell(DeviceIntPtr, int, int); | 93 | static void x68kKbdRingBell(DeviceIntPtr, int, int); | |
93 | static void x68kKbdBell(int, DeviceIntPtr, pointer, int); | 94 | static void x68kKbdBell(int, DeviceIntPtr, pointer, int); | |
94 | static void x68kKbdCtrl(DeviceIntPtr, KeybdCtrl *); | 95 | static void x68kKbdCtrl(DeviceIntPtr, KeybdCtrl *); | |
95 | static void x68kSetLeds(X68kKbdPrivPtr, u_char); | 96 | static void x68kSetLeds(X68kKbdPrivPtr, u_char); | |
96 | 97 | |||
98 | static void | |||
99 | x68kKbdHandlerNotify(int fd __unused, int ready __unused, void *data __unused) | |||
100 | { | |||
101 | } | |||
102 | ||||
97 | /*------------------------------------------------------------------------ | 103 | /*------------------------------------------------------------------------ | |
98 | * x68kKbdProc -- | 104 | * x68kKbdProc -- | |
99 | * Handle the initialization, etc. of a keyboard. | 105 | * Handle the initialization, etc. of a keyboard. | |
100 | * | 106 | * | |
101 | * Results: | 107 | * Results: | |
102 | * None. | 108 | * None. | |
103 | * | 109 | * | |
104 | *----------------------------------------------------------------------*/ | 110 | *----------------------------------------------------------------------*/ | |
105 | int | 111 | int | |
106 | x68kKbdProc(DeviceIntPtr pDev, /* Keyboard to manipulate */ | 112 | x68kKbdProc(DeviceIntPtr pDev, /* Keyboard to manipulate */ | |
107 | int what) /* What to do to it */ | 113 | int what) /* What to do to it */ | |
108 | { | 114 | { | |
109 | DevicePtr pKeyboard = &pDev->public; | 115 | DevicePtr pKeyboard = &pDev->public; | |
@@ -134,33 +140,34 @@ x68kKbdProc(DeviceIntPtr pDev, /* Keybo | @@ -134,33 +140,34 @@ x68kKbdProc(DeviceIntPtr pDev, /* Keybo | |||
134 | x68kModMap, serverClient); | 140 | x68kModMap, serverClient); | |
135 | #endif | 141 | #endif | |
136 | break; | 142 | break; | |
137 | 143 | |||
138 | case DEVICE_ON: | 144 | case DEVICE_ON: | |
139 | mode = 1; | 145 | mode = 1; | |
140 | if ( fcntl(x68kKbdPriv.fd, F_SETOWN, getpid()) == -1 || | 146 | if ( fcntl(x68kKbdPriv.fd, F_SETOWN, getpid()) == -1 || | |
141 | fcntl(x68kKbdPriv.fd, F_SETFL, O_NONBLOCK|O_ASYNC) == -1 || | 147 | fcntl(x68kKbdPriv.fd, F_SETFL, O_NONBLOCK|O_ASYNC) == -1 || | |
142 | ioctl(x68kKbdPriv.fd, KIOCSDIRECT, &mode) == -1 ) { | 148 | ioctl(x68kKbdPriv.fd, KIOCSDIRECT, &mode) == -1 ) { | |
143 | ErrorF("Async keyboard I/O failed"); | 149 | ErrorF("Async keyboard I/O failed"); | |
144 | return !Success; | 150 | return !Success; | |
145 | } | 151 | } | |
146 | x68kSetLeds(&x68kKbdPriv, (u_char)x68kKbdPriv.leds); | 152 | x68kSetLeds(&x68kKbdPriv, (u_char)x68kKbdPriv.leds); | |
147 | (void) AddEnabledDevice(x68kKbdPriv.fd); | 153 | SetNotifyFd(x68kKbdPriv.fd, x68kKbdHandlerNotify, | |
154 | X_NOTIFY_READ, NULL); | |||
148 | pKeyboard->on = TRUE; | 155 | pKeyboard->on = TRUE; | |
149 | break; | 156 | break; | |
150 | 157 | |||
151 | case DEVICE_CLOSE: | 158 | case DEVICE_CLOSE: | |
152 | case DEVICE_OFF: | 159 | case DEVICE_OFF: | |
153 | RemoveEnabledDevice(x68kKbdPriv.fd); | 160 | RemoveNotifyFd(x68kKbdPriv.fd); | |
154 | pKeyboard->on = FALSE; | 161 | pKeyboard->on = FALSE; | |
155 | break; | 162 | break; | |
156 | default: | 163 | default: | |
157 | FatalError("Unknown keyboard operation\n"); | 164 | FatalError("Unknown keyboard operation\n"); | |
158 | } | 165 | } | |
159 | return Success; | 166 | return Success; | |
160 | } | 167 | } | |
161 | 168 | |||
162 | /*------------------------------------------------------------------------- | 169 | /*------------------------------------------------------------------------- | |
163 | * function "x68kInitModMap" | 170 | * function "x68kInitModMap" | |
164 | * | 171 | * | |
165 | * purpose: initialize modmap with keysym table | 172 | * purpose: initialize modmap with keysym table | |
166 | * argument: (KeySymsRec *)x68kKeySyms : keysym table | 173 | * argument: (KeySymsRec *)x68kKeySyms : keysym table |
--- xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c 2020/04/10 16:49:36 1.4
+++ xsrc/external/mit/xorg-server/dist/hw/netbsd/x68k/x68kMouse.c 2020/07/18 15:37:02 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: x68kMouse.c,v 1.4 2020/04/10 16:49:36 tsutsui Exp $ */ | 1 | /* $NetBSD: x68kMouse.c,v 1.5 2020/07/18 15:37:02 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 | * | |
@@ -77,41 +77,47 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | @@ -77,41 +77,47 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
77 | */ | 77 | */ | |
78 | 78 | |||
79 | #include "x68k.h" | 79 | #include "x68k.h" | |
80 | #include "mi.h" | 80 | #include "mi.h" | |
81 | #include "input.h" | 81 | #include "input.h" | |
82 | #include "inpututils.h" | 82 | #include "inpututils.h" | |
83 | 83 | |||
84 | #include "exevents.h" | 84 | #include "exevents.h" | |
85 | #include "events.h" | 85 | #include "events.h" | |
86 | #include "eventstr.h" | 86 | #include "eventstr.h" | |
87 | #include <X11/Xatom.h> | 87 | #include <X11/Xatom.h> | |
88 | #include "xserver-properties.h" | 88 | #include "xserver-properties.h" | |
89 | 89 | |||
90 | static void x68kMouseHandlerNotify(int, int, void *); | |||
90 | static Bool x68kCursorOffScreen(ScreenPtr *, int *, int *); | 91 | static Bool x68kCursorOffScreen(ScreenPtr *, int *, int *); | |
91 | static void x68kCrossScreen(ScreenPtr, int); | 92 | static void x68kCrossScreen(ScreenPtr, int); | |
92 | static void x68kWarpCursor(DeviceIntPtr, ScreenPtr, int, int); | 93 | static void x68kWarpCursor(DeviceIntPtr, ScreenPtr, int, int); | |
93 | static void x68kMouseCtrl(DeviceIntPtr, PtrCtrl*); | 94 | static void x68kMouseCtrl(DeviceIntPtr, PtrCtrl*); | |
94 | 95 | |||
95 | miPointerScreenFuncRec x68kPointerScreenFuncs = { | 96 | miPointerScreenFuncRec x68kPointerScreenFuncs = { | |
96 | x68kCursorOffScreen, | 97 | x68kCursorOffScreen, | |
97 | x68kCrossScreen, | 98 | x68kCrossScreen, | |
98 | x68kWarpCursor, | 99 | x68kWarpCursor, | |
99 | }; | 100 | }; | |
100 | 101 | |||
101 | DeviceIntPtr x68kPointerDevice = NULL; | 102 | DeviceIntPtr x68kPointerDevice = NULL; | |
102 | 103 | |||
103 | static X68kMousePriv x68kMousePriv; | 104 | static X68kMousePriv x68kMousePriv; | |
104 | 105 | |||
106 | static void | |||
107 | x68kMouseHandlerNotify(int fd __unused, int ready __unused, void *data __unused) | |||
108 | { | |||
109 | } | |||
110 | ||||
105 | /*- | 111 | /*- | |
106 | *----------------------------------------------------------------------- | 112 | *----------------------------------------------------------------------- | |
107 | * x68kMouseProc -- | 113 | * x68kMouseProc -- | |
108 | * Handle the initialization, etc. of a mouse | 114 | * Handle the initialization, etc. of a mouse | |
109 | * | 115 | * | |
110 | * Results: | 116 | * Results: | |
111 | * none. | 117 | * none. | |
112 | * | 118 | * | |
113 | * Side Effects: | 119 | * Side Effects: | |
114 | *----------------------------------------------------------------------- | 120 | *----------------------------------------------------------------------- | |
115 | */ | 121 | */ | |
116 | int | 122 | int | |
117 | x68kMouseProc(DeviceIntPtr device, int what) | 123 | x68kMouseProc(DeviceIntPtr device, int what) | |
@@ -152,33 +158,34 @@ x68kMouseProc(DeviceIntPtr device, int w | @@ -152,33 +158,34 @@ x68kMouseProc(DeviceIntPtr device, int w | |||
152 | } | 158 | } | |
153 | format = VUID_FIRM_EVENT; | 159 | format = VUID_FIRM_EVENT; | |
154 | if (ioctl (x68kMousePriv.fd, VUIDSFORMAT, &format) == -1) { | 160 | if (ioctl (x68kMousePriv.fd, VUIDSFORMAT, &format) == -1) { | |
155 | ErrorF("x68kMouseProc ioctl VUIDSFORMAT"); | 161 | ErrorF("x68kMouseProc ioctl VUIDSFORMAT"); | |
156 | return !Success; | 162 | return !Success; | |
157 | } | 163 | } | |
158 | if ( fcntl(x68kMousePriv.fd, F_SETOWN, getpid()) == -1 || | 164 | if ( fcntl(x68kMousePriv.fd, F_SETOWN, getpid()) == -1 || | |
159 | fcntl(x68kMousePriv.fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1 | 165 | fcntl(x68kMousePriv.fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1 | |
160 | ) { | 166 | ) { | |
161 | ErrorF("Async mouse I/O failed"); | 167 | ErrorF("Async mouse I/O failed"); | |
162 | return !Success; | 168 | return !Success; | |
163 | } | 169 | } | |
164 | x68kMousePriv.bmask = 0; | 170 | x68kMousePriv.bmask = 0; | |
165 | AddEnabledDevice(x68kMousePriv.fd); | 171 | SetNotifyFd(x68kMousePriv.fd, x68kMouseHandlerNotify, | |
172 | X_NOTIFY_READ, NULL); | |||
166 | pMouse->on = TRUE; | 173 | pMouse->on = TRUE; | |
167 | break; | 174 | break; | |
168 | 175 | |||
169 | case DEVICE_OFF: | 176 | case DEVICE_OFF: | |
170 | pMouse->on = FALSE; | 177 | pMouse->on = FALSE; | |
171 | RemoveEnabledDevice(x68kMousePriv.fd); | 178 | RemoveNotifyFd(x68kMousePriv.fd); | |
172 | break; | 179 | break; | |
173 | 180 | |||
174 | case DEVICE_CLOSE: | 181 | case DEVICE_CLOSE: | |
175 | if (ioctl (x68kMousePriv.fd, VUIDSFORMAT, &oformat) == -1) | 182 | if (ioctl (x68kMousePriv.fd, VUIDSFORMAT, &oformat) == -1) | |
176 | ErrorF("x68kMouseProc ioctl VUIDSFORMAT"); | 183 | ErrorF("x68kMouseProc ioctl VUIDSFORMAT"); | |
177 | break; | 184 | break; | |
178 | 185 | |||
179 | } | 186 | } | |
180 | return Success; | 187 | return Success; | |
181 | } | 188 | } | |
182 | 189 | |||
183 | /*- | 190 | /*- | |
184 | *----------------------------------------------------------------------- | 191 | *----------------------------------------------------------------------- |