From: Dave Gilbert <gilbertd@treblig.org>
To: matti.aarnio@sonera.fi
Cc: axp-list@redhat.com
Subject: More X patches
Date: Sun, 28 Jun 1998 02:05:02 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.3.96.980628020128.28566D-100000@tardis.home.dave> (raw)
Hi,
(NOTE: Please reply to me as dg@treblig.demon.co.uk - my
main address is broken over this weekend)
Included are some more X server patches for the Alpha; with
these the server doesn't crash after receiving 25 or so connections;
however it is still not servicing clients on those connections.
I get the feeling the equivalent of my 'ffsl' would be a useful
addition to the C library (since there is an ffs and this is the point of
it!).
Dave
--- ./include/Xpoll.h.predag Sat Jun 27 23:46:31 1998
+++ ./include/Xpoll.h Sat Jun 27 23:47:02 1998
@@ -90,13 +90,13 @@
#endif
#ifndef FD_SET
-#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
#endif
#ifndef FD_CLR
-#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
#endif
#ifndef FD_ISSET
-#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
#endif
#ifndef FD_ZERO
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
./programs/Xserver/dix/Makefile.predag
--- ./programs/Xserver/dix/Makefile.predag Sun Jun 28 00:23:10 1998
+++ ./programs/Xserver/dix/Makefile Sun Jun 28 00:22:35 1998
@@ -638,9 +638,9 @@
XPSRC = xpstubs.c
XPOBJ = xpstubs.o
-SRCS = atom.c colormap.c cursor.c devices.c dispatch.c dixutils.c events.c extension.c gc.c globals.c glyphcurs.c grabs.c main.c property.c resource.c swaprep.c swapreq.c tables.c window.c initatoms.c dixfonts.c privates.c pixmap.c $(FFS_SRC)
+SRCS = atom.c colormap.c cursor.c devices.c dispatch.c dixutils.c events.c extension.c gc.c globals.c glyphcurs.c grabs.c main.c property.c resource.c swaprep.c swapreq.c tables.c window.c initatoms.c dixfonts.c privates.c pixmap.c ffsl.c $(FFS_SRC)
-OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o extension.o gc.o globals.o glyphcurs.o grabs.o main.o property.o resource.o swaprep.o swapreq.o tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ)
+OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o extension.o gc.o globals.o glyphcurs.o grabs.o main.o property.o resource.o swaprep.o swapreq.o tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o ffsl.o $(FFS_OBJ)
INCLUDES = -I../include -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC)
LINTLIBS = ../os/llib-los.ln
./programs/Xserver/dix/ffsl.c.predag
--- ./programs/Xserver/dix/ffsl.c.predag Sun Jun 28 00:23:20 1998
+++ ./programs/Xserver/dix/ffsl.c Sun Jun 28 01:18:37 1998
@@ -0,0 +1,39 @@
+/* $XConsortium: ffs.c /main/1 1996/12/02 10:20:11 lehors $ */
+/*
+
+Copyright (C) 1996 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Soft-
+ware"), to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the following condi-
+tions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
+ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.
+
+*/
+
+int
+ffsl(long i)
+{
+ int j;
+ for (j = 1; (i & 1L) == 0; j++)
+ i >>= 1;
+ return j;
+}
./programs/Xserver/include/dix.h.predag
--- ./programs/Xserver/include/dix.h.predag Sun Jun 28 00:27:10 1998
+++ ./programs/Xserver/include/dix.h Sun Jun 28 00:27:39 1998
@@ -1100,4 +1100,10 @@
int count;
} DeviceEventInfoRec;
+extern int ffsl(
+#if NeedFunctionPrototypes
+ long
+#endif
+);
+
#endif /* DIX_H */
./programs/Xserver/os/connection.c.predag
--- ./programs/Xserver/os/connection.c.predag Sat Jun 27 22:22:40 1998
+++ ./programs/Xserver/os/connection.c Sun Jun 28 01:35:28 1998
@@ -810,8 +810,8 @@
int status;
#ifndef WIN32
- curconn = ffs (readyconnections) - 1;
- readyconnections &= ~(1 << curconn);
+ curconn = ffsl (readyconnections) - 1;
+ readyconnections &= ~(1L << curconn);
#else
curconn = XFD_FD(&readyconnections, i);
#endif
@@ -977,14 +977,14 @@
mask = AllClients.fds_bits[i];
while (mask)
{
- curoff = ffs (mask) - 1;
+ curoff = ffsl (mask) - 1;
curclient = curoff + (i << 5);
FD_ZERO(&tmask);
FD_SET(curclient, &tmask);
r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime);
if (r < 0)
CloseDownClient(clients[ConnectionTranslation[curclient]]);
- mask &= ~(1 << curoff);
+ mask &= ~(1L << curoff);
}
}
#else
./programs/Xserver/os/WaitFor.c.predag
--- ./programs/Xserver/os/WaitFor.c.predag Sun Jun 28 00:25:44 1998
+++ ./programs/Xserver/os/WaitFor.c Sun Jun 28 01:35:16 1998
@@ -418,7 +418,7 @@
{
int client_priority, client_index;
- curclient = ffs (clientsReadable.fds_bits[i]) - 1;
+ curclient = ffsl (clientsReadable.fds_bits[i]) - 1;
client_index = ConnectionTranslation[curclient + (i << 5)];
#else
int highest_priority;
@@ -531,7 +531,7 @@
while (clientsReadable[i]) {
int client_priority, curclient, client_index;
- curclient = ffs (clientsReadable[i]) - 1;
+ curclient = ffsl (clientsReadable[i]) - 1;
client_index = ConnectionTranslation[curclient + (i << 5)];
dbprintf(("%d has input\n", curclient));
#ifdef XSYNC
./programs/Xserver/Makefile.predag
--- ./programs/Xserver/Makefile.predag Sun Jun 28 01:04:12 1998
+++ ./programs/Xserver/Makefile Sun Jun 28 01:04:13 1998
@@ -1125,7 +1125,7 @@
XNESTOBJS =
XNEST = hw/xnest/libxnest.a
-XNESTLIBS = $(DIX) $(OS) $(FONT) $(XPDDX) $(XNEST) $(XPFBLIBS) $(MI) $(EXTENSIONS) $(XNEST)
+XNESTLIBS = $(DIX) $(OS) $(FONT) $(XPDDX) $(XNEST) $(XPFBLIBS) $(MI) $(EXTENSIONS) $(DIX) $(XNEST)
XNESTSYSLIBS = $(LDPRELIBS) $(XLIB) $(SYSLIBS)
$(XNESTOBJS) $(XNESTLIBS) $(XNESTSYSLIBS):: $(XNESTDIRS)
--------------------------------------------------------------------
/ Dr. David Alan Gilbert | Running Linux on Alpha & ARM \
\ gro.gilbert @ treblig.org | ------- Happy in hex ------- /
\____________________________|___ http://www.treblig.demon.co.uk __/
next reply other threads:[~1998-06-28 1:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-28 1:05 Dave Gilbert [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-06-28 22:17 More X patches Matti Aarnio
1998-06-29 2:48 ` Michal Jaegermann
1998-06-29 12:35 ` David Alan Gilbert
1998-06-29 23:06 ` Quant-X Alpha Linux Support
1998-06-29 23:20 ` Matti Aarnio
1998-06-29 23:23 ` Richard Henderson
1998-06-29 23:37 ` Matti Aarnio
1998-06-29 22:07 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox