diff options
Diffstat (limited to 'hw/xfree86')
281 files changed, 17322 insertions, 9188 deletions
diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h index 23760db5e..17bb21f4d 100644 --- a/hw/xfree86/common/atKeynames.h +++ b/hw/xfree86/common/atKeynames.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.18 2001/09/29 20:40:30 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.21 2003/10/09 11:43:59 pascal Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -21,6 +21,33 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */ #ifndef _ATKEYNAMES_H @@ -199,6 +226,71 @@ #define KEY_NFER /* No Kanji Transfer 0x7b */ 123 #define KEY_Yen /* Yen 0x7d */ 125 +#define KEY_Power /* Power Key 0x84 */ 132 +#define KEY_Mute /* Audio Mute 0x85 */ 133 +#define KEY_AudioLower /* Audio Lower 0x86 */ 134 +#define KEY_AudioRaise /* Audio Raise 0x87 */ 135 +#define KEY_Help /* Help 0x88 */ 136 +#define KEY_L1 /* Stop 0x89 */ 137 +#define KEY_L2 /* Again 0x8a */ 138 +#define KEY_L3 /* Props 0x8b */ 139 +#define KEY_L4 /* Undo 0x8c */ 140 +#define KEY_L5 /* Front 0x8d */ 141 +#define KEY_L6 /* Copy 0x8e */ 142 +#define KEY_L7 /* Open 0x8f */ 143 +#define KEY_L8 /* Paste 0x90 */ 144 +#define KEY_L9 /* Find 0x91 */ 145 +#define KEY_L10 /* Cut 0x92 */ 146 + +/* + * Fake 'scancodes' in the following ranges are generated for 2-byte + * codes not handled elsewhere. These correspond to most extended keys + * on so-called "Internet" keyboards: + * + * 0x79-0x93 + * 0x96-0xa1 + * 0xa3-0xac + * 0xb1-0xb4 + * 0xba-0xbd + * 0xc2 + * 0xcc-0xd2 + * 0xd6-0xf7 + */ + +/* + * Remapped 'scancodes' are generated for single-byte codes in the range + * 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards. + */ + +#define KEY_0x59 0x95 +#define KEY_0x5A 0xA2 +#define KEY_0x5B 0xAD +#define KEY_0x5C KEY_KP_EQUAL +#define KEY_0x5D 0xAE +#define KEY_0x5E 0xAF +#define KEY_0x5F 0xB0 +#define KEY_0x62 0xB5 +#define KEY_0x63 0xB6 +#define KEY_0x64 0xB7 +#define KEY_0x65 0xB8 +#define KEY_0x66 0xB9 +#define KEY_0x67 0xBE +#define KEY_0x68 0xBF +#define KEY_0x69 0xC0 +#define KEY_0x6A 0xC1 +#define KEY_0x6B 0xC3 +#define KEY_0x6C 0xC4 +#define KEY_0x6D 0xC5 +#define KEY_0x6E 0xC6 +#define KEY_0x6F 0xC7 +#define KEY_0x70 0xC8 +#define KEY_0x71 0xC9 +#define KEY_0x72 0xCA +#define KEY_0x73 0xCB +#define KEY_0x74 0xD3 +#define KEY_0x75 0xD4 +#define KEY_0x76 0xD5 + /* These are for "notused" and "unknown" entries in translation maps. */ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 4dda2f6c6..bf9fbeee2 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.99 2003/01/29 15:23:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.104 2003/11/03 05:11:01 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -21,6 +21,33 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */ #ifndef _COMPILER_H @@ -423,23 +450,37 @@ __ustw (unsigned long r5, unsigned short * r11) # define stq_u(v,p) __ustq(v,p) # define stl_u(v,p) __ustl(v,p) # define stw_u(v,p) __ustw(v,p) - -# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory") -# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory") + +# ifndef __INTEL_COMPILER +# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory") +# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory") +# else +# include "ia64intrin.h" +# define mem_barrier() __mf() +# define write_mem_barrier() __mf() +# endif /* * This is overkill, but for different reasons depending on where it is used. * This is thus general enough to be used everywhere cache flushes are needed. * It doesn't handle memory access serialisation by other processors, though. */ -# define ia64_flush_cache(Addr) \ +# ifndef __INTEL_COMPILER +# define ia64_flush_cache(Addr) \ __asm__ __volatile__ ( \ "fc %0;;;" \ "sync.i;;;" \ "mf;;;" \ "srlz.i;;;" \ :: "r"(Addr) : "memory") - +# else +# define ia64_flush_cache(Addr) { \ + __fc(Addr);\ + __synci();\ + __mf();\ + __isrlz();\ + } +# endif # undef outb # undef outw # undef outl @@ -448,7 +489,7 @@ __ustw (unsigned long r5, unsigned short * r11) # define outw(a,b) _outw(b,a) # define outl(a,b) _outl(b,a) -# elif defined(linux) && defined(__x86_64__) +# elif defined(linux) && defined(__AMD64__) # include <inttypes.h> @@ -514,7 +555,7 @@ inl(unsigned short port) return ret; } -# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__)) && defined(__sparc__) +# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) # if !defined(Lynx) # ifndef ASI_PL @@ -1515,11 +1556,13 @@ extern void outl(unsigned int a, unsigned int l); # include <sys/types.h> # endif /* IN_MODULE */ # endif /* USL */ +# ifndef sgi # include <sys/inline.h> +# endif # else # include "scoasm.h" # endif -# if !defined(__HIGHC__) && !defined(SCO325) +# if !defined(__HIGHC__) && !defined(SCO325) && !defined(sgi) # pragma asm partial_optimization outl # pragma asm partial_optimization outw # pragma asm partial_optimization outb diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h index 61f403679..e60aa4e83 100644 --- a/hw/xfree86/common/fourcc.h +++ b/hw/xfree86/common/fourcc.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.3 2001/12/03 22:13:24 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.5 2003/08/24 17:36:48 dawes Exp $ */ + +/* + * Copyright (c) 2000-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* This header file contains listings of STANDARD guids for video formats. @@ -7,6 +34,9 @@ For an explanation of fourcc <-> guid mappings see RFC2361. */ +#ifndef _XF86_FOURCC_H_ +#define _XF86_FOURCC_H_ 1 + #define FOURCC_YUY2 0x32595559 #define XVIMAGE_YUY2 \ { \ @@ -128,3 +158,4 @@ XvTopToBottom \ } +#endif /* _XF86_FOURCC_H_ */ diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl index fb76789d6..e31fe28e1 100644 --- a/hw/xfree86/common/modeline2c.pl +++ b/hw/xfree86/common/modeline2c.pl @@ -8,9 +8,33 @@ # perl /modeline2c.pl < [modesfile] > xf86DefModes.c # # hackish perl - author Dirk Hohndel -# Copyright 1999-2001 by The XFree86 Project, Inc. # -# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.8 2001/10/28 03:33:17 tsi Exp $ +# Copyright 1999-2003 by The XFree86 Project, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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 conditions: +# +# 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 MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, 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 copyright holder(s) +# and author(s) 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 copyright holder(s) and author(s). +# +# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.11 2003/11/03 05:11:01 tsi Exp $ #my %flagshash; $flagshash{""} = "0"; @@ -32,17 +56,20 @@ $flagshash{"-hsync -vsync interlace"} = "V_NHSYNC | V_NVSYNC | V_INTERLACE"; # stop CVS from expanding the XFree86 Id here... $proj = "XFree86"; -printf("/* \$$proj: \$ */ +printf("/* \$$proj\$ */ /* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at * modeline2c.pl */ /* - * Copyright 1999 by The XFree86 Project, Inc. + * Copyright 1999-2003 by The XFree86 Project, Inc. * * Author: Dirk Hohndel <hohndel\@XFree86.Org> */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include \"xf86.h\" #include \"xf86Config.h\" #include \"xf86Priv.h\" @@ -50,7 +77,7 @@ printf("/* \$$proj: \$ */ #include \"globals.h\" -#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT +#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT #define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 DisplayModeRec xf86DefaultModes [] = { diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h index 12fe46693..dbf8c8f86 100644 --- a/hw/xfree86/common/scoasm.h +++ b/hw/xfree86/common/scoasm.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.0 1996/10/03 08:34:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.1 2003/08/24 17:36:49 dawes Exp $ */ + +/* + * Copyright (c) 1996 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* * scoasm.h - used to define inline versions of certain functions which diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 119adc5a6..e189e81d2 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.169 2003/02/13 10:49:38 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.172 2003/09/24 02:43:16 dawes Exp $ */ /* - * Copyright (c) 1997 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -203,6 +226,11 @@ void xf86ProcessActionEvent(ActionEvent action, void *arg); /* xf86Helper.c */ +#ifdef printf +#define printf_defined +#undef printf +#endif + void xf86AddDriver(DriverPtr driver, pointer module, int flags); void xf86DeleteDriver(int drvIndex); ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags); @@ -221,12 +249,14 @@ void xf86EnableDisableFBAccess(int scrnIndex, Bool enable); void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args); void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, - const char *format, ...); -void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...); -void xf86MsgVerb(MessageType type, int verb, const char *format, ...); -void xf86Msg(MessageType type, const char *format, ...); -void xf86ErrorFVerb(int verb, const char *format, ...); -void xf86ErrorF(const char *format, ...); + const char *format, ...) _printf_attribute(4,5); +void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) + _printf_attribute(3,4); +void xf86MsgVerb(MessageType type, int verb, const char *format, ...) + _printf_attribute(3,4); +void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3); +void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3); +void xf86ErrorF(const char *format, ...) _printf_attribute(1,2); const char *xf86TokenToString(SymTabPtr table, int token); int xf86StringToToken(SymTabPtr table, const char *string); void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from); @@ -334,6 +364,11 @@ void xf86AddModuleInfo(ModuleInfoPtr info, pointer module); void xf86DeleteModuleInfo(int idx); #endif +#ifdef printf_defined +#define printf xf86printf +#undef printf_defined +#endif + /* xf86Debug.c */ #ifdef BUILDDEBUG void xf86Break1(void); @@ -402,6 +437,12 @@ void xf86RandRSetInitialMode (ScreenPtr pScreen); Bool VidModeExtensionInit(ScreenPtr pScreen); +/* xf86Versions.c */ +CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag); +Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface, + CARD32 version, int flags); + + #endif /* _NO_XF86_PROTOTYPES */ #endif /* _XF86_H */ diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index fd9e3c3d1..2ffbfa964 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -1,7 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.76 2003/02/21 17:19:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.79 2003/11/03 05:11:01 tsi Exp $ */ /* - * Copyright (c) 1997-1999 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ + #define REDUCER /* * This file contains the interfaces to the bus-specific code @@ -1280,14 +1304,14 @@ xf86PrintResList(int verb, resPtr list) switch (list->res_type & ResExtMask) { case ResBlock: xf86ErrorFVerb(verb, - "\t[%d] %d\t%d\t0x%08lx - 0x%08lx (0x%lx)", + "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx (0x%lx)", i, list->entityIndex, (list->res_type & ResDomain) >> 24, list->block_begin, list->block_end, list->block_end - list->block_begin + 1); break; case ResSparse: - xf86ErrorFVerb(verb, "\t[%d] %d\t%d\t0x%08lx - 0x%08lx ", + xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ", i, list->entityIndex, (list->res_type & ResDomain) >> 24, list->sparse_base,list->sparse_mask); @@ -1581,7 +1605,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits, memType new_mask; memType mask1; memType base; - memType bits; memType counter = 0; memType counter1; memType max_counter = ~(memType)0; @@ -1653,7 +1676,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits, counter = 0; while (1) { - bits = make_base(counter,new_mask) | fixed_bits; counter1 = 0; while (1) { base = make_base(counter1,mask1); @@ -2134,7 +2156,7 @@ static void resError(resList list) { FatalError("A driver tried to allocate the %s %sresource at \n" - "0x%x:0x%x which conflicted with another resource. Send the\n" + "0x%lx:0x%lx which conflicted with another resource. Send the\n" "output of the server to %s. Please \n" "specify your computer hardware as closely as possible.\n", ResIsBlock(list)?"Block":"Sparse", diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index 6a129ad56..fbeca7f9c 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -1,6 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.21 2002/11/25 14:04:56 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.23 2003/08/24 17:36:50 dawes Exp $ */ + /* - * Copyright (c) 1997 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -98,7 +122,6 @@ typedef struct x_BusAccRec { int primary_bus; PCITAG acc; pciBridgesSave save; - void (*func)(PCITAG,int,CARD32,CARD32); } pci; } busdep; } BusAccRec, *BusAccPtr; diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 1738222f5..8f6dd2803 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1,17 +1,48 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.269 2003/02/20 04:36:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.277 2003/10/15 22:51:48 dawes Exp $ */ /* - * Copyright 1991-2002 by The XFree86 Project, Inc. - * Copyright 1997 by Metro Link, Inc. - * * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + */ + +/* + * Copyright 1992-2003 by The XFree86 Project, Inc. + * Copyright 1997 by Metro Link, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: * - * <Put copyright message here> + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * - * Author: Dirk Hohndel <hohndel@XFree86.Org> and others. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* + * + * Authors: + * Dirk Hohndel <hohndel@XFree86.Org> + * David Dawes <dawes@XFree86.Org> + * Marc La France <tsi@XFree86.Org> + * Egbert Eich <eich@XFree86.Org> + * ... and others */ #ifdef XF86DRI @@ -19,6 +50,10 @@ #include <grp.h> #endif +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif + #include "xf86.h" #include "xf86Parser.h" #include "xf86tokens.h" @@ -905,9 +940,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if (!xf86NameCmp(s,"flush")) { xf86Msg(X_CONFIG, "Flushing logfile enabled\n"); xf86Info.log = LogFlush; + LogSetParameter(XLOG_FLUSH, TRUE); } else if (!xf86NameCmp(s,"sync")) { xf86Msg(X_CONFIG, "Syncing logfile enabled\n"); xf86Info.log = LogSync; + LogSetParameter(XLOG_SYNC, TRUE); } else { xf86Msg(X_WARNING,"Unknown Log option\n"); } @@ -1143,6 +1180,11 @@ configInputKbd(IDevPtr inputp) xf86Msg(X_PROBED, "Keyboard type: Sun\n"); break; #endif +#ifdef WSKBD_TYPE_SUN5 + case WSKBD_TYPE_SUN5: + xf86Msg(X_PROBED, "Keyboard type: Sun5\n"); + break; +#endif default: xf86ConfigError("Unsupported wskbd type \"%d\"", xf86Info.wsKbdType); @@ -1314,105 +1356,297 @@ configInputKbd(IDevPtr inputp) return TRUE; } +/* + * Locate the core input devices. These can be specified/located in + * the following ways, in order of priority: + * + * 1. The InputDevices named by the -pointer and -keyboard command line + * options. + * 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by + * the active ServerLayout. + * 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard". + * 4. The first InputDevices that use the 'mouse' and 'keyboard' or 'kbd' + * drivers. + * 5. Default devices with an empty (default) configuration. These defaults + * will reference the 'mouse' and 'keyboard' drivers. + */ + static Bool checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) { - Bool havePointer = FALSE, haveKeyboard = FALSE; + IDevPtr corePointer = NULL, coreKeyboard = NULL; Bool foundPointer = FALSE, foundKeyboard = FALSE; + const char *pointerMsg = NULL, *keyboardMsg = NULL; IDevPtr indp; IDevRec Pointer, Keyboard; XF86ConfInputPtr confInput; + XF86ConfInputRec defPtr, defKbd; int count = 0; MessageType from = X_DEFAULT; - /* Check if a core pointer or core keyboard is needed. */ + /* + * First check if a core pointer or core keyboard have been specified + * in the active ServerLayout. If more than one is specified for either, + * remove the core attribute from the later ones. + */ for (indp = servlayoutp->inputs; indp->identifier; indp++) { - if ((indp->commonOptions && - xf86FindOption(indp->commonOptions, "CorePointer")) || - (indp->extraOptions && - xf86FindOption(indp->extraOptions, "CorePointer"))) { - havePointer = TRUE; + pointer opt1 = NULL, opt2 = NULL; + if (indp->commonOptions && + xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) { + opt1 = indp->commonOptions; + } + if (indp->extraOptions && + xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) { + opt2 = indp->extraOptions; + } + if (opt1 || opt2) { + if (!corePointer) { + corePointer = indp; + } else { + if (opt1) + xf86ReplaceBoolOption(opt1, "CorePointer", FALSE); + if (opt2) + xf86ReplaceBoolOption(opt2, "CorePointer", FALSE); + xf86Msg(X_WARNING, "Duplicate core pointer devices. " + "Removing core pointer attribute from \"%s\"\n", + indp->identifier); + } + } + opt1 = opt2 = NULL; + if (indp->commonOptions && + xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) { + opt1 = indp->commonOptions; } - if ((indp->commonOptions && - xf86FindOption(indp->commonOptions, "CoreKeyboard")) || - (indp->extraOptions && - xf86FindOption(indp->extraOptions, "CoreKeyboard"))) { - haveKeyboard = TRUE; + if (indp->extraOptions && + xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) { + opt2 = indp->extraOptions; + } + if (opt1 || opt2) { + if (!coreKeyboard) { + coreKeyboard = indp; + } else { + if (opt1) + xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE); + if (opt2) + xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE); + xf86Msg(X_WARNING, "Duplicate core keyboard devices. " + "Removing core keyboard attribute from \"%s\"\n", + indp->identifier); + } } count++; } - if (!havePointer) { - if (xf86PointerName) { - confInput = xf86findInput(xf86PointerName, - xf86configptr->conf_input_lst); - if (!confInput) { - xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", - xf86PointerName); - return FALSE; + + confInput = NULL; + + /* 1. Check for the -pointer command line option. */ + if (xf86PointerName) { + confInput = xf86findInput(xf86PointerName, + xf86configptr->conf_input_lst); + if (!confInput) { + xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", + xf86PointerName); + return FALSE; + } + from = X_CMDLINE; + /* + * If one was already specified in the ServerLayout, it needs to be + * removed. + */ + if (corePointer) { + for (indp = servlayoutp->inputs; indp->identifier; indp++) + if (indp == corePointer) + break; + for (; indp->identifier; indp++) + indp[0] = indp[1]; + count--; + } + corePointer = NULL; + foundPointer = TRUE; + } + + /* 2. ServerLayout-specified core pointer. */ + if (corePointer) { + foundPointer = TRUE; + from = X_CONFIG; + } + + /* 3. First core pointer device. */ + if (!foundPointer) { + XF86ConfInputPtr p; + + for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { + if (p->inp_option_lst && + xf86CheckBoolOption(p->inp_option_lst, "CorePointer", FALSE)) { + confInput = p; + foundPointer = TRUE; + from = X_DEFAULT; + pointerMsg = "first core pointer device"; + break; } - from = X_CMDLINE; - } else { + } + } + + /* 4. First pointer with 'mouse' as the driver. */ + if (!foundPointer) { + confInput = xf86findInput(CONF_IMPLICIT_POINTER, + xf86configptr->conf_input_lst); + if (!confInput) { + confInput = xf86findInputByDriver("mouse", + xf86configptr->conf_input_lst); + } + if (confInput) { + foundPointer = TRUE; from = X_DEFAULT; - confInput = xf86findInput(CONF_IMPLICIT_POINTER, - xf86configptr->conf_input_lst); - if (!confInput && implicitLayout) { - confInput = xf86findInputByDriver("mouse", - xf86configptr->conf_input_lst); - } + pointerMsg = "first mouse device"; + } + } + + /* 5. Built-in default. */ + if (!foundPointer) { + bzero(&defPtr, sizeof(defPtr)); + defPtr.inp_identifier = "<default pointer>"; + defPtr.inp_driver = "mouse"; + confInput = &defPtr; + foundPointer = TRUE; + from = X_DEFAULT; + pointerMsg = "default mouse configuration"; + } + + /* Add the core pointer device to the layout, and set it to Core. */ + if (foundPointer && confInput) { + foundPointer = configInput(&Pointer, confInput, from); + if (foundPointer) { + count++; + indp = xnfrealloc(servlayoutp->inputs, + (count + 1) * sizeof(IDevRec)); + indp[count - 1] = Pointer; + indp[count - 1].extraOptions = + xf86addNewOption(NULL, "CorePointer", NULL); + indp[count].identifier = NULL; + servlayoutp->inputs = indp; } - if (confInput) - foundPointer = configInput(&Pointer, confInput, from); - } - if (!haveKeyboard) { - if (xf86KeyboardName) { - confInput = xf86findInput(xf86KeyboardName, - xf86configptr->conf_input_lst); - if (!confInput) { - xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", - xf86KeyboardName); - return FALSE; + } + + if (!foundPointer) { + /* This shouldn't happen. */ + xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n"); + return FALSE; + } + + confInput = NULL; + + /* 1. Check for the -keyboard command line option. */ + if (xf86KeyboardName) { + confInput = xf86findInput(xf86KeyboardName, + xf86configptr->conf_input_lst); + if (!confInput) { + xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n", + xf86KeyboardName); + return FALSE; + } + from = X_CMDLINE; + /* + * If one was already specified in the ServerLayout, it needs to be + * removed. + */ + if (coreKeyboard) { + for (indp = servlayoutp->inputs; indp->identifier; indp++) + if (indp == coreKeyboard) + break; + for (; indp->identifier; indp++) + indp[0] = indp[1]; + count--; + } + coreKeyboard = NULL; + foundKeyboard = TRUE; + } + + /* 2. ServerLayout-specified core keyboard. */ + if (coreKeyboard) { + foundKeyboard = TRUE; + from = X_CONFIG; + } + + /* 3. First core keyboard device. */ + if (!foundKeyboard) { + XF86ConfInputPtr p; + + for (p = xf86configptr->conf_input_lst; p; p = p->list.next) { + if (p->inp_option_lst && + xf86CheckBoolOption(p->inp_option_lst, "CoreKeyboard", FALSE)) { + confInput = p; + foundKeyboard = TRUE; + from = X_DEFAULT; + keyboardMsg = "first core keyboard device"; + break; } - from = X_CMDLINE; - } else { + } + } + + /* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */ + if (!foundKeyboard) { + confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD, + xf86configptr->conf_input_lst); + if (!confInput) { + confInput = xf86findInputByDriver("keyboard", + xf86configptr->conf_input_lst); + } + if (!confInput) { + confInput = xf86findInputByDriver("kbd", + xf86configptr->conf_input_lst); + } + if (confInput) { + foundKeyboard = TRUE; from = X_DEFAULT; - confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD, - xf86configptr->conf_input_lst); - if (!confInput && implicitLayout) { - confInput = xf86findInputByDriver("keyboard", - xf86configptr->conf_input_lst); - } + pointerMsg = "first keyboard device"; } - if (confInput) - foundKeyboard = configInput(&Keyboard, confInput, from); } - if (foundPointer) { - count++; - indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec)); - indp[count - 1] = Pointer; - indp[count - 1].extraOptions = xf86addNewOption(NULL, "CorePointer", NULL); - indp[count].identifier = NULL; - servlayoutp->inputs = indp; - } else if (!havePointer) { - if (implicitLayout) - xf86Msg(X_ERROR, "Unable to find a core pointer device\n"); - else - xf86Msg(X_ERROR, "No core pointer device specified\n"); - return FALSE; + + /* 5. Built-in default. */ + if (!foundKeyboard) { + bzero(&defKbd, sizeof(defKbd)); + defKbd.inp_identifier = "<default keyboard>"; + defKbd.inp_driver = "keyboard"; + confInput = &defKbd; + foundKeyboard = TRUE; + keyboardMsg = "default keyboard configuration"; + from = X_DEFAULT; } - if (foundKeyboard) { - count++; - indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec)); - indp[count - 1] = Keyboard; - indp[count - 1].extraOptions = xf86addNewOption(NULL, "CoreKeyboard", NULL); - indp[count].identifier = NULL; - servlayoutp->inputs = indp; - } else if (!haveKeyboard) { - if (implicitLayout) - xf86Msg(X_ERROR, "Unable to find a core keyboard device\n"); - else - xf86Msg(X_ERROR, "No core keyboard device specified\n"); + + /* Add the core keyboard device to the layout, and set it to Core. */ + if (foundKeyboard && confInput) { + foundKeyboard = configInput(&Keyboard, confInput, from); + if (foundKeyboard) { + count++; + indp = xnfrealloc(servlayoutp->inputs, + (count + 1) * sizeof(IDevRec)); + indp[count - 1] = Keyboard; + indp[count - 1].extraOptions = + xf86addNewOption(NULL, "CoreKeyboard", NULL); + indp[count].identifier = NULL; + servlayoutp->inputs = indp; + } + } + + if (!foundKeyboard) { + /* This shouldn't happen. */ + xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n"); return FALSE; } + + if (pointerMsg) { + xf86Msg(X_WARNING, "The core pointer device wasn't specified " + "explicitly in the layout.\n" + "\tUsing the %s.\n", pointerMsg); + } + + if (keyboardMsg) { + xf86Msg(X_WARNING, "The core keyboard device wasn't specified " + "explicitly in the layout.\n" + "\tUsing the %s.\n", keyboardMsg); + } + return TRUE; } @@ -1767,6 +2001,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, int count = 0; XF86ConfDisplayPtr dispptr; XF86ConfAdaptorLinkPtr conf_adaptor; + Bool defaultMonitor = FALSE; xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier, scrnum); @@ -1779,8 +2014,29 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, screenp->defaultbpp = conf_screen->scrn_defaultbpp; screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp; screenp->monitor = xnfcalloc(1, sizeof(MonRec)); - if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor)) - return FALSE; + /* If no monitor is specified, create a default one. */ + if (!conf_screen->scrn_monitor) { + XF86ConfMonitorRec defMon; + + bzero(&defMon, sizeof(defMon)); + defMon.mon_identifier = "<default monitor>"; + /* + * TARGET_REFRESH_RATE may be defined to effectively limit the + * default resolution to the largest that has a "good" refresh + * rate. + */ +#ifdef TARGET_REFRESH_RATE + defMon.mon_option_lst = xf86ReplaceRealOption(defMon.mon_option_lst, + "TargetRefresh", + TARGET_REFRESH_RATE); +#endif + if (!configMonitor(screenp->monitor, &defMon)) + return FALSE; + defaultMonitor = TRUE; + } else { + if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor)) + return FALSE; + } screenp->device = xnfcalloc(1, sizeof(GDevRec)); configDevice(screenp->device,conf_screen->scrn_device, TRUE); screenp->device->myScreenSection = screenp; @@ -1822,6 +2078,10 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, conf_adaptor = (XF86ConfAdaptorLinkPtr)conf_adaptor->list.next; } + if (defaultMonitor) { + xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n" + "\tUsing a default monitor configuration.\n", screenp->id); + } return TRUE; } @@ -2149,7 +2409,7 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from) return TRUE; } - + static Bool modeIsPresent(char * modename,MonPtr monitorp) { @@ -2207,35 +2467,38 @@ addDefaultModes(MonPtr monitorp) /* * load the config file and fill the global data structure */ -Bool -xf86HandleConfigFile(void) +ConfigStatus +xf86HandleConfigFile(Bool autoconfig) { const char *filename; char *searchpath; MessageType from = X_DEFAULT; - if (getuid() == 0) - searchpath = ROOT_CONFIGPATH; - else - searchpath = USER_CONFIGPATH; - - if (xf86ConfigFile) - from = X_CMDLINE; + if (!autoconfig) { + if (getuid() == 0) + searchpath = ROOT_CONFIGPATH; + else + searchpath = USER_CONFIGPATH; - filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT); - if (filename) { - xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename); - xf86ConfigFile = xnfstrdup(filename); - } else { - xf86Msg(X_ERROR, "Unable to locate/open config file"); if (xf86ConfigFile) - xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile); - xf86ErrorFVerb(0, "\n"); - return FALSE; + from = X_CMDLINE; + + filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT); + if (filename) { + xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename); + xf86ConfigFile = xnfstrdup(filename); + } else { + xf86Msg(X_ERROR, "Unable to locate/open config file"); + if (xf86ConfigFile) + xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile); + xf86ErrorFVerb(0, "\n"); + return CONFIG_NOFILE; + } } + if ((xf86configptr = xf86readConfigFile ()) == NULL) { xf86Msg(X_ERROR, "Problem parsing the config file\n"); - return FALSE; + return CONFIG_PARSE_ERROR; } xf86closeConfigFile (); @@ -2260,7 +2523,7 @@ xf86HandleConfigFile(void) if (!configImpliedLayout(&xf86ConfigLayout, xf86configptr->conf_screen_lst)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); - return FALSE; + return CONFIG_PARSE_ERROR; } } else { if (xf86configptr->conf_flags != NULL) { @@ -2272,13 +2535,13 @@ xf86HandleConfigFile(void) if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst, dfltlayout)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); - return FALSE; + return CONFIG_PARSE_ERROR; } } else { if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst, NULL)) { xf86Msg(X_ERROR, "Unable to determine the screen layout\n"); - return FALSE; + return CONFIG_PARSE_ERROR; } } } @@ -2293,7 +2556,7 @@ xf86HandleConfigFile(void) #endif ) { ErrorF ("Problem when converting the config data structures\n"); - return FALSE; + return CONFIG_PARSE_ERROR; } /* @@ -2317,7 +2580,7 @@ xf86HandleConfigFile(void) if (xf86AllowMouseOpenFail) xf86Info.allowMouseOpenFail = TRUE; - return TRUE; + return CONFIG_OK; } diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h index 6a24df0e0..e54da3d09 100644 --- a/hw/xfree86/common/xf86Config.h +++ b/hw/xfree86/common/xf86Config.h @@ -1,6 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.5 2000/02/24 05:36:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.7 2003/10/08 14:58:27 dawes Exp $ */ + /* - * Copyright 1997 by The XFree86 Project, Inc + * Copyright (c) 1997-2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ #ifndef _xf86_config_h @@ -13,6 +37,12 @@ extern XF86ConfigPtr xf86configptr; #endif +typedef enum _ConfigStatus { + CONFIG_OK = 0, + CONFIG_PARSE_ERROR, + CONFIG_NOFILE +} ConfigStatus; + /* * prototypes */ @@ -22,6 +52,8 @@ char ** xf86DriverlistFromCompile(void); char ** xf86InputDriverlistFromConfig(void); char ** xf86InputDriverlistFromCompile(void); Bool xf86BuiltinInputDriver(const char *); -Bool xf86HandleConfigFile(void); +ConfigStatus xf86HandleConfigFile(Bool); + +Bool xf86AutoConfig(void); #endif /* _xf86_config_h */ diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 687730ea5..3dde4ba7d 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.78 2003/01/18 07:27:13 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.81 2003/10/29 04:17:21 dawes Exp $ */ /* * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales. * @@ -46,7 +46,7 @@ #include "Configint.h" #include "vbe.h" #include "xf86DDC.h" -#ifdef __sparc__ +#if defined(__sparc__) && !defined(__OpenBSD__) #include "xf86Bus.h" #include "xf86Sbus.h" #endif @@ -55,7 +55,7 @@ typedef struct _DevToConfig { GDevRec GDev; pciVideoPtr pVideo; -#ifdef __sparc__ +#if defined(__sparc__) && !defined(__OpenBSD__) sbusDevicePtr sVideo; #endif int iDriver; @@ -280,6 +280,8 @@ configureInputSection (void) DFLT_MOUSE_DEV = "/dev/wsmouse"; DFLT_MOUSE_PROTO = "wsmouse"; close(fd); + } else { + ErrorF("cannot open /dev/wsmouse\n"); } #endif @@ -868,7 +870,7 @@ DoConfigure() xf86DoConfigurePass1 = FALSE; /* Try to get DDC information filled in */ xf86ConfigFile = filename; - if (!xf86HandleConfigFile()) { + if (xf86HandleConfigFile(FALSE) != CONFIG_OK) { goto bail; } @@ -990,7 +992,7 @@ DoConfigure() ErrorF("To test the server, run 'XFree86 -xf86config %s'\n\n", filename); bail: - OsCleanup(); + OsCleanup(TRUE); AbortDDX(); fflush(stderr); exit(0); diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 1a214c4ad..22b7b00e6 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.35 2003/02/13 10:49:38 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.37 2003/11/07 22:20:17 dawes Exp $ */ +/* + * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */ #define NEED_EVENTS @@ -77,11 +104,16 @@ xf86InitViewport(ScrnInfoPtr pScr) /* * Compute the initial Viewport if necessary */ - if (pScr->frameX0 < 0) - { + if (pScr->display) { + if (pScr->display->frameX0 < 0) { pScr->frameX0 = (pScr->virtualX - pScr->modes->HDisplay) / 2; pScr->frameY0 = (pScr->virtualY - pScr->modes->VDisplay) / 2; + } else { + pScr->frameX0 = pScr->display->frameX0; + pScr->frameY0 = pScr->display->frameY0; } + } + pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1; pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1; diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 1ad8b42ff..5e4bc29b6 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -1,9 +1,32 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.47 2003/08/24 17:36:51 dawes Exp $ */ /* - Copyright (c) 1999 - The XFree86 Project, Inc. - - Written by Mark Vojkovich -*/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.46 2002/12/03 18:17:40 tsi Exp $ */ + * Copyright (c) 1998-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + * + * Written by Mark Vojkovich + */ #include "xf86.h" #include "xf86str.h" diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c index 0de054ff3..df968797c 100644 --- a/hw/xfree86/common/xf86DPMS.c +++ b/hw/xfree86/common/xf86DPMS.c @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.8 2003/02/13 02:41:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.11 2003/11/11 21:02:28 dawes Exp $ */ /* - * Copyright (c) 1997-1998 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -14,6 +37,8 @@ #include "xf86.h" #include "xf86Priv.h" #ifdef DPMSExtension +#define DPMS_SERVER +#include "extensions/dpms.h" #include "dpmsproc.h" #endif @@ -30,6 +55,7 @@ Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) { #ifdef DPMSExtension + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; DPMSPtr pDPMS; pointer DPMSOpt; @@ -45,13 +71,12 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) return FALSE; pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr; - pDPMS->Set = set; + pScrn->DPMSSet = set; pDPMS->Flags = flags; - DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms"); + DPMSOpt = xf86FindOption(pScrn->options, "dpms"); if (DPMSOpt) { if ((pDPMS->Enabled - = xf86SetBoolOption(xf86Screens[pScreen->myNum]->options, - "dpms",FALSE)) + = xf86SetBoolOption(pScrn->options, "dpms", FALSE)) && !DPMSDisabledSwitch) DPMSEnabled = TRUE; xf86MarkOptionUsed(DPMSOpt); @@ -111,18 +136,23 @@ DPMSSet(int level) { int i; DPMSPtr pDPMS; + ScrnInfoPtr pScrn; DPMSPowerLevel = level; if (DPMSIndex < 0) return; + if (level != DPMSModeOn) + SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverActive); + /* For each screen, set the DPMS level */ for (i = 0; i < xf86NumScreens; i++) { + pScrn = xf86Screens[i]; pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr; - if (pDPMS && pDPMS->Set && pDPMS->Enabled && xf86Screens[i]->vtSema) { - xf86EnableAccess(xf86Screens[i]); - pDPMS->Set(xf86Screens[i], level, 0); + if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) { + xf86EnableAccess(pScrn); + pScrn->DPMSSet(pScrn, level, 0); } } } @@ -137,6 +167,7 @@ DPMSSupported(void) { int i; DPMSPtr pDPMS; + ScrnInfoPtr pScrn; if (DPMSIndex < 0) { return FALSE; @@ -144,8 +175,9 @@ DPMSSupported(void) /* For each screen, check if DPMS is supported */ for (i = 0; i < xf86NumScreens; i++) { + pScrn = xf86Screens[i]; pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr; - if (pDPMS && pDPMS->Set) + if (pDPMS && pScrn->DPMSSet) return TRUE; } return FALSE; diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h index 506e05370..754e20d18 100644 --- a/hw/xfree86/common/xf86Date.h +++ b/hw/xfree86/common/xf86Date.h @@ -1,7 +1,33 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.3.2.3 2003/05/10 01:10:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.52 2003/11/21 06:01:44 dawes Exp $ */ +/* + * Copyright (c) 2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef XF86_DATE -#define XF86_DATE "9 May 2003" +#define XF86_DATE "20 November 2003" #endif diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c index b069743a1..3bf21689f 100644 --- a/hw/xfree86/common/xf86Debug.c +++ b/hw/xfree86/common/xf86Debug.c @@ -1,4 +1,35 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.4 2001/12/13 18:01:50 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.7 2003/09/24 02:43:17 dawes Exp $ */ + +/* + * Copyright (c) 2000-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include <sys/time.h> #include <unistd.h> @@ -154,7 +185,7 @@ xf86SPTimestamp(xf86TsPtr* timestamp, char *str) else diff = ((*timestamp)->sec - ts.tv_sec) * 1000 +(- ts.tv_usec + (*timestamp)->usec) / 1000; - ErrorF("%s Elapsed: %i\n",str,diff); + ErrorF("%s Elapsed: %li\n",str,diff); } else { *timestamp = xnfalloc(sizeof(xf86TsRec)); gettimeofday((struct timeval*)*timestamp,NULL); diff --git a/hw/xfree86/common/xf86DefModes.c b/hw/xfree86/common/xf86DefModes.c index abef13110..7257b204b 100644 --- a/hw/xfree86/common/xf86DefModes.c +++ b/hw/xfree86/common/xf86DefModes.c @@ -1,14 +1,17 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.9 2002/11/11 04:24:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.10 2003/11/03 05:11:02 tsi Exp $ */ /* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at * modeline2c.pl */ /* - * Copyright 1999 by The XFree86 Project, Inc. + * Copyright 1999-2003 by The XFree86 Project, Inc. * * Author: Dirk Hohndel <hohndel@XFree86.Org> */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include "xf86.h" #include "xf86Config.h" #include "xf86Priv.h" @@ -16,7 +19,7 @@ #include "globals.h" -#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT +#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT #define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 DisplayModeRec xf86DefaultModes [] = { diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c index 518f67214..eece97719 100644 --- a/hw/xfree86/common/xf86DoProbe.c +++ b/hw/xfree86/common/xf86DoProbe.c @@ -1,10 +1,34 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.11 2002/07/02 02:00:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.14 2003/10/29 04:17:21 dawes Exp $ */ /* - * finish setting up the server - * Load the driver modules and call their probe functions. + * Copyright (c) 1999-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: * - * Copyright 1999 by The XFree86 Project, Inc. + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* + * finish setting up the server + * Load the driver modules and call their probe functions. */ #include <ctype.h> @@ -67,16 +91,14 @@ DoProbe() /* If we have a result, then call driver's Identify function */ if (xf86DriverList[i]->Identify != NULL) { - int verbose = xf86Verbose; - - xf86Verbose = 1; + int verbose = xf86SetVerbosity(1); (*xf86DriverList[i]->Identify)(0); - xf86Verbose = verbose; + xf86SetVerbosity(verbose); } } } - OsCleanup(); + OsCleanup(TRUE); AbortDDX(); fflush(stderr); exit(0); diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c index 2328d2b05..8938c1d96 100644 --- a/hw/xfree86/common/xf86DoScanPci.c +++ b/hw/xfree86/common/xf86DoScanPci.c @@ -1,11 +1,34 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.15 2003/09/23 06:43:46 dawes Exp $ */ +/* + * Copyright (c) 1999-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.12 2002/07/15 20:46:01 dawes Exp $ */ /* * Finish setting up the server. * Call the functions from the scanpci module. - * - * Copyright 1999-2002 by The XFree86 Project, Inc. - * */ #include <ctype.h> @@ -38,11 +61,12 @@ void DoScanPci(int argc, char **argv, int i) OsInit(); /* - * now we decrease verbosity and remember the value, in case a later - * -verbose on the command line increases it, because that is a - * verbose flag for scanpci... + * The old verbosity processing that was here isn't useful anymore, but + * for compatibility purposes, ignore verbosity changes after the -scanpci + * flag. */ - globalVerbose = --xf86Verbose; + globalVerbose = xf86Verbose; + /* * next we process the arguments that are remaining on the command line, * so that things like the module path can be set there @@ -51,14 +75,19 @@ void DoScanPci(int argc, char **argv, int i) if ((skip = ddxProcessArgument(argc, argv, j))) j += (skip - 1); } + /* - * was the verbosity level increased? + * Was the verbosity level increased? If so, set it back. */ - if( (globalVerbose == 0) && (xf86Verbose > 0) ) - scanpciVerbose = xf86Verbose - globalVerbose -1; - else - scanpciVerbose = xf86Verbose - globalVerbose; - xf86Verbose = globalVerbose; + if (xf86Verbose > globalVerbose) + xf86SetVerbosity(globalVerbose); + + /* + * Setting scanpciVerbose to 0 will ensure that the output will go to + * stderr for all reasonable default stderr verbosity levels. + */ + scanpciVerbose = 0; + /* * now get the loader set up and load the scanpci module */ diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 4d0efbcb9..1c3f3a34f 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.146 2003/02/20 04:20:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.158 2003/11/03 05:11:02 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -21,10 +21,41 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */ /* [JCH-96/01/21] Extended std reverse map to four buttons. */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif + #include "X.h" #include "Xpoll.h" #include "Xproto.h" @@ -315,10 +346,14 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) CloseDownClient(server); } break; -#if !defined(__SOL8__) && (!defined(sun) || defined(i386)) +#if !defined(__SOL8__) && !defined(__UNIXOS2__) && !defined(sgi) && \ + (!defined(sun) || defined(i386)) case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { int vtno = *((int *) arg); +#ifdef SCO + vtno--; +#endif #if defined(QNX4) xf86Info.vtRequestsPending = vtno; #else @@ -329,8 +364,12 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) break; case ACTION_SWITCHSCREEN_NEXT: if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { +#if defined(SCO) /* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */ + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) +#else if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0) -#if defined(SCO) || (defined(sun) && defined (i386) && defined (SVR4)) +#endif +#if defined (SCO) || (defined(sun) && defined (i386) && defined (SVR4)) if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0) #else if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0) @@ -339,12 +378,36 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) } break; case ACTION_SWITCHSCREEN_PREV: - if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { + if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0) ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); } break; #endif + case ACTION_MESSAGE: + { + char *retstr, *message = (char *) arg; + ScrnInfoPtr pScr = XF86SCRNINFO(xf86Info.currentScreen); + +#ifdef DEBUG + ErrorF("ActionMessage: '%s'\n", message); +#endif + /* Okay the message made it to the ddx. The common layer */ + /* can check for relevant messages here and react to any */ + /* that have a global effect. For example: */ + /* */ + /* if (!strcmp(message, "foo") { */ + /* do_foo(); break */ + /* } */ + /* */ + /* otherwise fallback to sending a key event message to */ + /* the current screen's driver: */ + if (*pScr->HandleMessage) { + (void) (*pScr->HandleMessage)(pScr->scrnIndex, + "KeyEventMessage", message, &retstr); + } + } + break; default: break; } @@ -384,7 +447,7 @@ xf86PostKbdEvent(unsigned key) #if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT) static Bool first_time = TRUE; #endif -#if defined(__sparc__) +#if defined(__sparc__) && defined(__linux__) static int kbdSun = -1; #endif /* Disable any keyboard processing while in suspend */ @@ -400,7 +463,7 @@ xf86PostKbdEvent(unsigned key) } #endif -#if defined (__sparc__) +#if defined (__sparc__) && defined(__linux__) if (kbdSun == -1) { if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun")) || (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun"))) @@ -410,26 +473,7 @@ xf86PostKbdEvent(unsigned key) } if (kbdSun) goto special; -#endif /* __sparc__ */ - -#if defined (i386) && defined (SVR4) - /* - * PANIX returns DICOP standards based keycodes in using 106jp - * keyboard. We need to remap some keys. - */ - if(xf86Info.panix106 == TRUE){ - switch (scanCode) { - case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */ - case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/ - case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */ - case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */ - case 0x6B: scanCode = KEY_Left; break; /* Cur Left */ - case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */ - case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */ - case 0x73: scanCode = KEY_RCtrl; break; /* not needed */ - } - } -#endif /* i386 && SVR4 */ +#endif /* __sparc__ && __linux__ */ #ifdef __linux__ if (xf86Info.kbdCustomKeycodes) { @@ -461,6 +505,56 @@ xf86PostKbdEvent(unsigned key) break; #endif } +#if defined (i386) && defined (SVR4) + /* + * PANIX returns DICOP standards based keycodes in using 106jp + * keyboard. We need to remap some keys. + */ + if(xf86Info.panix106 == TRUE){ + switch (scanCode) { + case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */ + case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/ + case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */ + case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */ + case 0x6B: scanCode = KEY_Left; break; /* Cur Left */ + case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */ + case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */ + case 0x73: scanCode = KEY_RCtrl; break; /* not needed */ + } + } else +#endif /* i386 && SVR4 */ + { + switch (scanCode) { + case 0x59: scanCode = KEY_0x59; break; + case 0x5a: scanCode = KEY_0x5A; break; + case 0x5b: scanCode = KEY_0x5B; break; + case 0x5c: scanCode = KEY_KP_Equal; break; /* Keypad Equal */ + case 0x5d: scanCode = KEY_0x5D; break; + case 0x5e: scanCode = KEY_0x5E; break; + case 0x5f: scanCode = KEY_0x5F; break; + case 0x62: scanCode = KEY_0x62; break; + case 0x63: scanCode = KEY_0x63; break; + case 0x64: scanCode = KEY_0x64; break; + case 0x65: scanCode = KEY_0x65; break; + case 0x66: scanCode = KEY_0x66; break; + case 0x67: scanCode = KEY_0x67; break; + case 0x68: scanCode = KEY_0x68; break; + case 0x69: scanCode = KEY_0x69; break; + case 0x6a: scanCode = KEY_0x6A; break; + case 0x6b: scanCode = KEY_0x6B; break; + case 0x6c: scanCode = KEY_0x6C; break; + case 0x6d: scanCode = KEY_0x6D; break; + case 0x6e: scanCode = KEY_0x6E; break; + case 0x6f: scanCode = KEY_0x6F; break; + case 0x70: scanCode = KEY_0x70; break; + case 0x71: scanCode = KEY_0x71; break; + case 0x72: scanCode = KEY_0x72; break; + case 0x73: scanCode = KEY_0x73; break; + case 0x74: scanCode = KEY_0x74; break; + case 0x75: scanCode = KEY_0x75; break; + case 0x76: scanCode = KEY_0x76; break; + } + } } else if ( @@ -534,6 +628,19 @@ xf86PostKbdEvent(unsigned key) scanCode = KEY_Pause; /* pause */ } +#ifndef __sparc64__ + /* + * PC keyboards generate separate key codes for + * Alt+Print and Control+Pause but in the X keyboard model + * they need to get the same key code as the base key on the same + * physical keyboard key. + */ + if (scanCode == KEY_SysReqest) + scanCode = KEY_Print; + else if (scanCode == KEY_Break) + scanCode = KEY_Pause; +#endif + /* * and now get some special keysequences */ @@ -568,7 +675,7 @@ customkeycodes: } } #endif -#if defined (__sparc__) +#if defined (__sparc__) && defined(__linux__) special: if (kbdSun) { switch (scanCode) { @@ -602,7 +709,7 @@ special: */ scanCode--; } -#endif /* defined (__sparc__) */ +#endif /* defined (__sparc__) && defined(__linux__) */ #ifdef XKB if ((xf86Info.ddxSpecialKeys == SKWhenNeeded && @@ -692,9 +799,6 @@ special: int vtno = specialkey - KEY_F1 + 1; if (specialkey == KEY_F11 || specialkey == KEY_F12) vtno = specialkey - KEY_F11 + 11; -#ifdef SCO325 - vtno--; -#endif if (down) xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno); return; @@ -829,17 +933,6 @@ special: #endif /* - * PC keyboards generate separate key codes for - * Alt+Print and Control+Pause but in the X keyboard model - * they need to get the same key code as the base key on the same - * physical keyboard key. - */ - if (scanCode == KEY_SysReqest) - scanCode = KEY_Print; - else if (scanCode == KEY_Break) - scanCode = KEY_Pause; - - /* * Now map the scancodes to real X-keycodes ... */ keycode = scanCode + MIN_KEYCODE; @@ -1060,16 +1153,16 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) pInfo = xf86InputDevs; while (pInfo) { if (pInfo->read_input && pInfo->fd >= 0 && - (FD_ISSET(pInfo->fd, ((fd_set *)pReadmask)) != 0)) { + (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { int sigstate = xf86BlockSIGIO(); pInfo->read_input(pInfo); xf86UnblockSIGIO(sigstate); /* - * Must break here because more than one device may share - * the same file descriptor. + * Remove the descriptior from the set because more than one + * device may share the same file descriptor. */ - break; + FD_CLR(pInfo->fd, &devicesWithInput); } pInfo = pInfo->next; } diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 99c53fb0b..c6dee3731 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.40 2003/02/20 04:05:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.41 2003/08/24 17:36:52 dawes Exp $ */ /* - * Copyright (c) 1997 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 73050eab7..713e7861a 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1,10 +1,36 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.128 2003/02/26 23:45:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.135 2003/10/08 14:58:27 dawes Exp $ */ /* - * Copyright (c) 1997-1998 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* * Authors: Dirk Hohndel <hohndel@XFree86.Org> * David Dawes <dawes@XFree86.Org> + * ... and others * * This file includes the helper functions that the server provides for * different drivers. @@ -38,7 +64,6 @@ #endif static int xf86ScrnInfoPrivateCount = 0; -static FILE *logfile = NULL; #ifdef XFree86LOADER @@ -405,6 +430,14 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad) /* Can the screen handle 24bpp pixmaps for 32bpp fb */ #define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32)) +#ifndef GLOBAL_DEFAULT_DEPTH +#define GLOBAL_DEFAULT_DEPTH 16 +#endif + +#ifndef GLOBAL_DEFAULT_FBBPP +#define GLOBAL_DEFAULT_FBBPP 16 +#endif + Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, int depth24flags) @@ -449,6 +482,39 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, scrp->depth = scrp->confScreen->defaultdepth; scrp->depthFrom = X_CONFIG; } + + if (scrp->confScreen->defaultfbbpp <= 0 && + scrp->confScreen->defaultdepth <= 0) { + /* + * Check for DefaultDepth and DefaultFbBpp options in the + * Device sections. + */ + int i; + GDevPtr device; + Bool found = FALSE; + + for (i = 0; i < scrp->numEntities; i++) { + device = xf86GetDevFromEntity(scrp->entityList[i], + scrp->entityInstanceList[i]); + if (device && device->options) { + if (xf86FindOption(device->options, "DefaultDepth")) { + scrp->depth = xf86SetIntOption(device->options, + "DefaultDepth", -1); + scrp->depthFrom = X_CONFIG; + found = TRUE; + } + if (xf86FindOption(device->options, "DefaultFbBpp")) { + scrp->bitsPerPixel = xf86SetIntOption(device->options, + "DefaultFbBpp", + -1); + scrp->bitsPerPixelFrom = X_CONFIG; + found = TRUE; + } + } + if (found) + break; + } + } } /* If none of these is set, pick a default */ @@ -459,8 +525,8 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, if (depth > 0) scrp->depth = depth; } else { - scrp->bitsPerPixel = 8; - scrp->depth = 8; + scrp->bitsPerPixel = GLOBAL_DEFAULT_FBBPP; + scrp->depth = GLOBAL_DEFAULT_DEPTH; } } @@ -610,11 +676,46 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, break; } } + + /* + * If an exact match can't be found, see if there is one with no + * depth or fbbpp specified. + */ + if (i == scrp->confScreen->numdisplays) { + for (i = 0, disp = scrp->confScreen->displays; + i < scrp->confScreen->numdisplays; i++, disp++) { + if (disp->depth <= 0 && disp->fbbpp <= 0) { + scrp->display = disp; + break; + } + } + } + + /* + * If all else fails, create a default one. + */ if (i == scrp->confScreen->numdisplays) { - xf86DrvMsg(scrp->scrnIndex, X_ERROR, "No Display subsection " - "in Screen section \"%s\" for depth/fbbpp %d/%d\n", + scrp->confScreen->numdisplays++; + scrp->confScreen->displays = + xnfrealloc(scrp->confScreen->displays, + scrp->confScreen->numdisplays * sizeof(DispRec)); + xf86DrvMsg(scrp->scrnIndex, X_INFO, + "Creating default Display subsection in Screen section\n" + "\t\"%s\" for depth/fbbpp %d/%d\n", scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel); - return FALSE; + memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec)); + scrp->confScreen->displays[i].blackColour.red = -1; + scrp->confScreen->displays[i].blackColour.green = -1; + scrp->confScreen->displays[i].blackColour.blue = -1; + scrp->confScreen->displays[i].whiteColour.red = -1; + scrp->confScreen->displays[i].whiteColour.green = -1; + scrp->confScreen->displays[i].whiteColour.blue = -1; + scrp->confScreen->displays[i].defaultVisual = -1; + scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *)); + scrp->confScreen->displays[i].modes[0] = NULL; + scrp->confScreen->displays[i].depth = depth; + scrp->confScreen->displays[i].fbbpp = fbbpp; + scrp->display = &scrp->confScreen->displays[i]; } /* @@ -720,15 +821,17 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask) if (scrp->weight.red) xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n", - scrp->weight.red, scrp->weight.green, scrp->weight.blue); + (int)scrp->weight.red, (int)scrp->weight.green, + (int)scrp->weight.blue); if (scrp->depth > MAX_PSEUDO_DEPTH && (scrp->depth != scrp->weight.red + scrp->weight.green + scrp->weight.blue)) { xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Weight given (%d%d%d) is inconsistent with the " - "depth (%d)\n", scrp->weight.red, scrp->weight.green, - scrp->weight.blue, scrp->depth); + "depth (%d)\n", + (int)scrp->weight.red, (int)scrp->weight.green, + (int)scrp->weight.blue, scrp->depth); return FALSE; } if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) { @@ -1194,123 +1297,36 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable) } } -/* Buffer to hold log data written before the log file is opened */ -static char *saveBuffer = NULL; -static int size = 0, unused = 0, pos = 0; - -/* These functions do the actual writes. */ -static void -VWrite(int verb, const char *f, va_list args) -{ - static char buffer[1024]; - int len = 0; - - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output - * stream(s). - */ - if (verb < 0 || xf86LogVerbose >= verb || xf86Verbose >= verb) { - vsnprintf(buffer, sizeof(buffer), f, args); - len = strlen(buffer); - } - if ((verb < 0 || xf86Verbose >= verb) && len > 0) - fwrite(buffer, len, 1, stderr); - if ((verb < 0 || xf86LogVerbose >= verb) && len > 0) { - if (logfile) { - fwrite(buffer, len, 1, logfile); - if (xf86Info.log) { - fflush(logfile); - if (xf86Info.log == LogSync) - fsync(fileno(logfile)); - } - } else { - /* - * Note, this code is used before OsInit() has been called, so - * xalloc and friends can't be used. - */ - if (len > unused) { - size += 1024; - unused += 1024; - saveBuffer = realloc(saveBuffer, size); - if (!saveBuffer) - FatalError("realloc() failed while saving log messages\n"); - } - unused -= len; - memcpy(saveBuffer + pos, buffer, len); - pos += len; - } - } -} - -static void -Write(int verb, const char *f, ...) -{ - va_list args; - - va_start(args, f); - VWrite(verb, f, args); - va_end(args); -} - /* Print driver messages in the standard format */ +#undef PREFIX_SIZE +#define PREFIX_SIZE 14 + void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args) { - char *s = X_UNKNOWN_STRING; - - /* Ignore verbosity for X_ERROR */ - if (xf86Verbose >= verb || xf86LogVerbose >= verb || type == X_ERROR) { - switch (type) { - case X_PROBED: - s = X_PROBE_STRING; - break; - case X_CONFIG: - s = X_CONFIG_STRING; - break; - case X_DEFAULT: - s = X_DEFAULT_STRING; - break; - case X_CMDLINE: - s = X_CMDLINE_STRING; - break; - case X_NOTICE: - s = X_NOTICE_STRING; - break; - case X_ERROR: - s = X_ERROR_STRING; - if (verb > 0) - verb = 0; - break; - case X_WARNING: - s = X_WARNING_STRING; - break; - case X_INFO: - s = X_INFO_STRING; - break; - case X_NOT_IMPLEMENTED: - s = X_NOT_IMPLEMENTED_STRING; - break; - case X_NONE: - s = NULL; - break; - } + char *tmpFormat; - if (s != NULL) - Write(verb, "%s ", s); - if (scrnIndex >= 0 && scrnIndex < xf86NumScreens) - Write(verb, "%s(%d): ", xf86Screens[scrnIndex]->name, scrnIndex); - VWrite(verb, format, args); -#if 0 - if (type == X_ERROR && xf86Verbose < xf86LogVerbose) { - fprintf(stderr, X_ERROR_STRING " Please check the log file \"%s\"" - " >before<\n\treporting a problem.\n", xf86LogFile); - } -#endif - } + /* Prefix the scrnIndex name to the format string. */ + if (scrnIndex >= 0 && scrnIndex < xf86NumScreens && + xf86Screens[scrnIndex]->name) { + tmpFormat = xalloc(strlen(format) + + strlen(xf86Screens[scrnIndex]->name) + + PREFIX_SIZE + 1); + if (!tmpFormat) + return; + + snprintf(tmpFormat, PREFIX_SIZE + 1, "%s(%d): ", + xf86Screens[scrnIndex]->name, scrnIndex); + + strcat(tmpFormat, format); + LogVMessageVerb(type, verb, tmpFormat, args); + xfree(tmpFormat); + } else + LogVMessageVerb(type, verb, format, args); } +#undef PREFIX_SIZE /* Print driver messages, with verbose level specified directly */ void @@ -1365,7 +1381,7 @@ xf86ErrorFVerb(int verb, const char *format, ...) va_start(ap, format); if (xf86Verbose >= verb || xf86LogVerbose >= verb) - VWrite(verb, format, ap); + LogVWrite(verb, format, ap); va_end(ap); } @@ -1377,15 +1393,10 @@ xf86ErrorF(const char *format, ...) va_start(ap, format); if (xf86Verbose >= 1 || xf86LogVerbose >= 1) - VWrite(1, format, ap); + LogVWrite(1, format, ap); va_end(ap); } -void -OsVendorVErrorF(const char *f, va_list args) -{ - VWrite(-1, f, args); -} void xf86LogInit() @@ -1398,59 +1409,28 @@ xf86LogInit() /* Get the log file name */ if (xf86LogFileFrom == X_DEFAULT) { /* Append the display number and ".log" */ - lf = malloc(strlen(xf86LogFile) + strlen(display) + + lf = malloc(strlen(xf86LogFile) + strlen("%s") + strlen(LOGSUFFIX) + 1); if (!lf) FatalError("Cannot allocate space for the log file name\n"); - sprintf(lf, "%s%s" LOGSUFFIX, xf86LogFile, display); + sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile); xf86LogFile = lf; } - { - struct stat buf; - if (!stat(xf86LogFile,&buf) && S_ISREG(buf.st_mode)) { - char *oldlog = (char *)malloc(strlen(xf86LogFile) - + strlen(LOGOLDSUFFIX)); - if (!oldlog) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(oldlog, "%s" LOGOLDSUFFIX, xf86LogFile); - if (rename(xf86LogFile,oldlog) == -1) - FatalError("Cannot move old logfile \"%s\"\n",oldlog); - free(oldlog); - } - } - - if ((logfile = fopen(xf86LogFile, "w")) == NULL) - FatalError("Cannot open log file \"%s\"\n", xf86LogFile); + + xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX); xf86LogFileWasOpened = TRUE; - setvbuf(logfile, NULL, _IONBF, 0); -#ifdef DDXOSVERRORF - if (!OsVendorVErrorFProc) - OsVendorVErrorFProc = OsVendorVErrorF; -#endif - /* Flush saved log information */ - if (saveBuffer && size > 0) { - fwrite(saveBuffer, pos, 1, logfile); - if (xf86Info.log) { - fflush(logfile); - if (xf86Info.log == LogFlush) - fsync(fileno(logfile)); - } - free(saveBuffer); /* Note, must be free(), not xfree() */ - saveBuffer = 0; - size = 0; - } + xf86SetVerbosity(xf86Verbose); + xf86SetLogVerbosity(xf86LogVerbose); #undef LOGSUFFIX +#undef LOGOLDSUFFIX } void xf86CloseLog() { - if (logfile) { - fclose(logfile); - logfile = NULL; - } + LogClose(); } @@ -1826,7 +1806,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, if (dev || devBus) xf86MsgVerb(X_WARNING, 0, "%s: More than one matching Device section " - "found: %s\n", devList[j]->identifier); + "found: %s\n", driverName, devList[j]->identifier); else dev = devList[j]; } @@ -2233,7 +2213,6 @@ xf86GetVerbosity() return max(xf86Verbose, xf86LogVerbose); } - Pix24Flags xf86GetPix24() { diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h index 5cd66d882..32e3c8e1d 100644 --- a/hw/xfree86/common/xf86InPriv.h +++ b/hw/xfree86/common/xf86InPriv.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.4 1999/05/17 13:17:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.5 2003/08/24 17:36:52 dawes Exp $ */ + +/* + * Copyright (c) 1999 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _xf86InPriv_h #define _xf86InPriv_h diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 7c65ce888..ce8817096 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1,16 +1,49 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.198 2003/02/26 09:21:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.211 2003/11/01 00:47:01 dawes Exp $ */ /* - * Copyright 1991-1999 by The XFree86 Project, Inc. - * * Loosely based on code bearing the following copyright: * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. */ +/* + * Copyright (c) 1992-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include <stdlib.h> +#undef HAS_UTSNAME +#if !defined(WIN32) && !defined(__UNIXOS2__) +#define HAS_UTSNAME 1 +#include <sys/utsname.h> +#endif + #define NEED_EVENTS +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include "X.h" #include "Xmd.h" #include "Xproto.h" @@ -134,7 +167,8 @@ xf86CreateRootWindow(WindowPtr pWin) /* Can't find hook we are hung on */ xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */, "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n", - xf86CreateRootWindow, pScreen->CreateWindow ); + (void *)xf86CreateRootWindow, + (void *)pScreen->CreateWindow ); } /* Unhook this function ... */ @@ -183,7 +217,8 @@ xf86CreateRootWindow(WindowPtr pWin) xf86RegisteredPropertiesTable[pScreen->myNum] = NULL; } else { xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " - "non-root window %p (parent %p)\n", pWin, pWin->parent); + "non-root window %p (parent %p)\n", + (void *)pWin, (void *)pWin->parent); ret = FALSE; } } @@ -202,6 +237,46 @@ xf86CreateRootWindow(WindowPtr pWin) * collecting the pixmap formats. */ +static void +PostConfigInit(void) +{ + /* + * Install signal handler for unexpected signals + */ + xf86Info.caughtSignal=FALSE; + if (!xf86Info.notrapSignals) { + signal(SIGSEGV,xf86SigHandler); + signal(SIGILL,xf86SigHandler); +#ifdef SIGEMT + signal(SIGEMT,xf86SigHandler); +#endif + signal(SIGFPE,xf86SigHandler); +#ifdef SIGBUS + signal(SIGBUS,xf86SigHandler); +#endif +#ifdef SIGSYS + signal(SIGSYS,xf86SigHandler); +#endif +#ifdef SIGXCPU + signal(SIGXCPU,xf86SigHandler); +#endif +#ifdef SIGXFSZ + signal(SIGXFSZ,xf86SigHandler); +#endif +#ifdef MEMDEBUG + signal(SIGUSR2,xf86SigMemDebug); +#endif + } + + xf86OSPMClose = xf86OSPMOpen(); + + /* Run an external VT Init program if specified in the config file */ + xf86RunVtInit(); + + /* Do this after XF86Config is read (it's normally in OsInit()) */ + OsInitColors(); +} + void InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) { @@ -215,6 +290,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) Pix24Flags screenpix24, pix24; MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; + Bool autoconfig = FALSE; #ifdef __UNIXOS2__ os2ServerVideoAccess(); /* See if we have access to the screen before doing anything */ @@ -257,51 +333,20 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* Read and parse the config file */ if (!xf86DoProbe && !xf86DoConfigure) { - if (!xf86HandleConfigFile()) { - xf86Msg(X_ERROR, "Error from xf86HandleConfigFile()\n"); + switch (xf86HandleConfigFile(FALSE)) { + case CONFIG_OK: + break; + case CONFIG_PARSE_ERROR: + xf86Msg(X_ERROR, "Error parsing the config file\n"); return; + case CONFIG_NOFILE: + autoconfig = TRUE; + break; } } - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) { - signal(SIGSEGV,xf86SigHandler); - signal(SIGILL,xf86SigHandler); -#ifdef SIGEMT - signal(SIGEMT,xf86SigHandler); -#endif - signal(SIGFPE,xf86SigHandler); -#ifdef SIGBUS - signal(SIGBUS,xf86SigHandler); -#endif -#ifdef SIGSYS - signal(SIGSYS,xf86SigHandler); -#endif -#ifdef SIGXCPU - signal(SIGXCPU,xf86SigHandler); -#endif -#ifdef SIGXFSZ - signal(SIGXFSZ,xf86SigHandler); -#endif -#ifdef MEMDEBUG - signal(SIGUSR2,xf86SigMemDebug); -#endif - } - - xf86OpenConsole(); - xf86OSPMClose = xf86OSPMOpen(); - - /* Run an external VT Init program if specified in the config file */ - xf86RunVtInit(); - - /* Do this after XF86Config is read (it's normally in OsInit()) */ - OsInitColors(); - - /* Enable full I/O access */ - xf86EnableIO(); + if (!autoconfig) + PostConfigInit(); #ifdef XFree86LOADER /* Initialise the loader */ @@ -349,6 +394,11 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #endif + xf86OpenConsole(); + + /* Enable full I/O access */ + xf86EnableIO(); + /* Do a general bus probe. This will be a PCI probe for x86 platforms */ xf86BusProbe(); @@ -358,6 +408,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) if (xf86DoConfigure) DoConfigure(); + if (autoconfig) { + if (!xf86AutoConfig()) { + xf86Msg(X_ERROR, "Auto configuration failed\n"); + return; + } + PostConfigInit(); + } + /* Initialise the resource broker */ xf86ResourceBrokerInit(); @@ -597,7 +655,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* XXX Should this be before or after loading dependent modules? */ if (xf86ProbeOnly) { - OsCleanup(); + OsCleanup(TRUE); AbortDDX(); fflush(stderr); exit(0); @@ -743,7 +801,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) if (xf86OSPMClose) xf86OSPMClose(); if ((xf86OSPMClose = xf86OSPMOpen()) != NULL) - xf86MsgVerb(3,X_INFO,"APM registered successfully\n"); + xf86MsgVerb(X_INFO, 3, "APM registered successfully\n"); /* Make sure full I/O access is enabled */ xf86EnableIO(); @@ -825,6 +883,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) */ xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; xf86Screens[i]->SetDGAMode = xf86SetDGAMode; + xf86Screens[i]->DPMSSet = NULL; + xf86Screens[i]->LoadPalette = NULL; + xf86Screens[i]->SetOverscan = NULL; scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); if (scr_index == i) { /* @@ -1198,6 +1259,26 @@ OsVendorFatalError() ErrorF("\n"); } +int +xf86SetVerbosity(int verb) +{ + int save = xf86Verbose; + + xf86Verbose = verb; + LogSetParameter(XLOG_VERBOSITY, verb); + return save; +} + +int +xf86SetLogVerbosity(int verb) +{ + int save = xf86LogVerbose; + + xf86LogVerbose = verb; + LogSetParameter(XLOG_FILE_VERBOSITY, verb); + return save; +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is @@ -1217,19 +1298,6 @@ ddxProcessArgument(int argc, char **argv, int i) * yet. Use malloc/free instead. */ -#ifdef DDXOSVERRORF - static Bool beenHere = FALSE; - - if (!beenHere) { - /* - * This initialises our hook into VErrorF() for catching log messages - * that are generated before OsInit() is called. - */ - OsVendorVErrorFProc = OsVendorVErrorF; - beenHere = TRUE; - } -#endif - /* First the options that are only allowed for root */ if (getuid() == 0) { @@ -1346,11 +1414,11 @@ ddxProcessArgument(int argc, char **argv, int i) val = strtol(argv[i], &end, 0); if (*end == '\0') { - xf86Verbose = val; + xf86SetVerbosity(val); return 2; } } - xf86Verbose++; + xf86SetVerbosity(++xf86Verbose); return 1; } if (!strcmp(argv[i],"-logverbose")) @@ -1362,16 +1430,16 @@ ddxProcessArgument(int argc, char **argv, int i) val = strtol(argv[i], &end, 0); if (*end == '\0') { - xf86LogVerbose = val; + xf86SetLogVerbosity(val); return 2; } } - xf86LogVerbose++; + xf86SetLogVerbosity(++xf86LogVerbose); return 1; } if (!strcmp(argv[i],"-quiet")) { - xf86Verbose = 0; + xf86SetVerbosity(0); return 1; } if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version")) @@ -1659,7 +1727,17 @@ xf86PrintBanner() ErrorF("X Protocol Version %d, Revision %d, %s\n", X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR); -#ifdef BUILD_DATE +#ifdef HAS_UTSNAME + { + struct utsname name; + + if (uname(&name) == 0) { + ErrorF("Current Operating System: %s %s %s %s %s\n", + name.sysname, name.nodename, name.release, name.version, name.machine); + } + } +#endif +#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) { struct tm t; char buf[100]; @@ -1673,6 +1751,20 @@ xf86PrintBanner() ErrorF("Build Date: %s\n", buf); } #endif +#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) + { + struct tm t; + char buf[100]; + + bzero(&t, sizeof(t)); + bzero(buf, sizeof(buf)); + t.tm_mday = CLOG_DATE % 100; + t.tm_mon = (CLOG_DATE / 100) % 100 - 1; + t.tm_year = CLOG_DATE / 10000 - 1900; + if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) + ErrorF("Changelog Date: %s\n", buf); + } +#endif #if defined(BUILDERSTRING) ErrorF("%s \n",BUILDERSTRING); #endif @@ -1686,17 +1778,7 @@ xf86PrintBanner() static void xf86PrintMarkers() { - /* Show what the marker symbols mean */ - ErrorF("Markers: " X_PROBE_STRING " probed, " - X_CONFIG_STRING " from config file, " - X_DEFAULT_STRING " default setting,\n" - " " X_CMDLINE_STRING " from command line, " - X_NOTICE_STRING " notice, " - X_INFO_STRING " informational,\n" - " " X_WARNING_STRING " warning, " - X_ERROR_STRING " error, " - X_NOT_IMPLEMENTED_STRING " not implemented, " - X_UNKNOWN_STRING " unknown.\n"); + LogPrintMarkers(); } static void diff --git a/hw/xfree86/common/xf86Io.c b/hw/xfree86/common/xf86Io.c index 06819bccf..bd44bdeb5 100644 --- a/hw/xfree86/common/xf86Io.c +++ b/hw/xfree86/common/xf86Io.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.53 2003/01/15 03:29:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.56 2003/11/03 05:11:02 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -21,6 +21,33 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1992-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86Io.c /main/27 1996/10/19 17:58:55 kaleb $ */ #define NEED_EVENTS @@ -88,7 +115,7 @@ xf86KbdLeds () { int leds, real_leds = 0; -#if defined (__sparc__) +#if defined (__sparc__) && defined(__linux__) static int kbdSun = -1; if (kbdSun == -1) { if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun")) || @@ -122,7 +149,7 @@ xf86KbdLeds () #endif #endif xf86SetKbdLeds(real_leds); - return; + (void)leds; } /* @@ -264,6 +291,7 @@ Bool init; #endif /* INHERIT_LOCK_STATE */ xf86SetKbdLeds(leds); #endif /* LED_CAP */ + (void)leds; if (xf86Info.kbdDelay <= 375) rad = 0x00; else if (xf86Info.kbdDelay <= 625) rad = 0x20; diff --git a/hw/xfree86/common/xf86Kbd.c b/hw/xfree86/common/xf86Kbd.c index c1ad79778..3c7ed7a69 100644 --- a/hw/xfree86/common/xf86Kbd.c +++ b/hw/xfree86/common/xf86Kbd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.24 2002/05/31 18:45:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.26 2003/08/24 17:36:53 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -21,8 +21,39 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1992-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86Kbd.c /main/10 1996/02/21 17:38:32 kaleb $ */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif + #include "X.h" #include "Xmd.h" #include "input.h" diff --git a/hw/xfree86/common/xf86KbdBSD.c b/hw/xfree86/common/xf86KbdBSD.c index a606b14fb..2621e2a81 100644 --- a/hw/xfree86/common/xf86KbdBSD.c +++ b/hw/xfree86/common/xf86KbdBSD.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.20 2002/05/22 21:38:27 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.22 2003/10/07 22:00:52 herrb Exp $ */ /* * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk) * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. @@ -22,6 +22,33 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1994-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86KbdBSD.c /main/6 1996/10/23 13:12:27 kaleb $ */ #include "X.h" @@ -1057,6 +1084,8 @@ static CARD8 wsAdbMap[] = { /* 223 */ KEY_NOTUSED, }; +#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char)) + static CARD8 wsSunMap[] = { /* 0x00 */ KEY_NOTUSED, /* 0x01 */ KEY_NOTUSED, /* stop */ @@ -1190,9 +1219,6 @@ static CARD8 wsSunMap[] = { #define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char)) - -#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char)) - /* * Translate raw wskbd keyboard event values to XFree86 standard keycodes * (based on the AT keyboard scan codes using the tables above @@ -1210,7 +1236,7 @@ WSKbdToKeycode(int keycode) return KEY_UNKNOWN; else return wsUsbMap[keycode]; -#ifdef WSKBD_TYPE_ADB +#ifdef WSKBD_TYPE_ADB case WSKBD_TYPE_ADB: if (keycode < 0 || keycode >= WS_ADB_MAP_SIZE) return KEY_UNKNOWN; @@ -1219,6 +1245,9 @@ WSKbdToKeycode(int keycode) #endif #ifdef WSKBD_TYPE_SUN case WSKBD_TYPE_SUN: +#ifdef WSKBD_TYPE_SUN5 + case WSKBD_TYPE_SUN5: +#endif if (keycode < 0 || keycode >= WS_SUN_MAP_SIZE) return KEY_UNKNOWN; else diff --git a/hw/xfree86/common/xf86KbdLnx.c b/hw/xfree86/common/xf86KbdLnx.c index 1f97c0b15..b023acfbd 100644 --- a/hw/xfree86/common/xf86KbdLnx.c +++ b/hw/xfree86/common/xf86KbdLnx.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.16 2001/03/05 20:18:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.17 2003/08/24 17:36:53 dawes Exp $ */ /* * Linux version of keymapping setup. The kernel (since 0.99.14) has support * for fully remapping the keyboard, but there are some differences between @@ -28,6 +28,33 @@ * PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1994-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: xf86KbdLnx.c /main/7 1996/10/19 17:59:00 kaleb $ */ #include "X.h" diff --git a/hw/xfree86/common/xf86Keymap.h b/hw/xfree86/common/xf86Keymap.h index 45f4dd104..82ea52eef 100644 --- a/hw/xfree86/common/xf86Keymap.h +++ b/hw/xfree86/common/xf86Keymap.h @@ -1,4 +1,32 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.19 2002/05/31 18:45:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.20 2003/08/24 17:36:53 dawes Exp $ */ + +/* + * Copyright (c) 1994-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * * For Scancodes see notes in atKeynames.h !!!! diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c index f04a0b8d8..a36ca52f2 100644 --- a/hw/xfree86/common/xf86MiscExt.c +++ b/hw/xfree86/common/xf86MiscExt.c @@ -1,13 +1,40 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.16 2003/11/03 05:11:02 tsi Exp $ */ /* - * Copyright (c) 1999 by The XFree86 Project, Inc. + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.11 2002/11/20 04:04:57 dawes Exp $ */ /* * This file contains the Pointer/Keyboard functions needed by the * XFree86-Misc extension. */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif + #include "X.h" #include "os.h" #include "xf86.h" @@ -62,31 +89,17 @@ typedef struct { int serverNumLock; /* obsolete */ } kbdParamsRec, *kbdParamsPtr; -typedef enum { - TO_MISC, - FROM_MISC -} MseProtoMapDirection; - -static void MiscExtClientStateCallback(pointer, pointer, pointer); - /* Sigh... The extension should probably be changed to use protocol names instead of ID numbers */ -struct mouse_map { +static struct mouse_map { int mtype; MouseProtocolID proto; -}; - -static int -MapMseProto(int proto, MseProtoMapDirection mapping) +} m_map[] = { - int i; - - static struct mouse_map m_map[] = - { { MTYPE_MICROSOFT, PROT_MS }, { MTYPE_MOUSESYS, PROT_MSC }, { MTYPE_MMSERIES, PROT_MM }, @@ -109,17 +122,30 @@ MapMseProto(int proto, MseProtoMapDirection mapping) { MTYPE_AUTOMOUSE, PROT_AUTO }, { MTYPE_SYSMOUSE, PROT_SYSMOUSE }, { MTYPE_UNKNOWN, PROT_UNKNOWN } - }; +}; + +static int +MapMseProtoToMisc(MouseProtocolID proto) +{ + int i; - if (mapping == TO_MISC) { for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++) - if (proto == m_map[i].proto) return m_map[i].mtype; + if (proto == m_map[i].proto) + return m_map[i].mtype; + return MTYPE_UNKNOWN; - } else { +} + +static MouseProtocolID +MapMseMiscToProto(int proto) +{ + int i; + for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++) - if (proto == m_map[i].mtype) return m_map[i].proto; + if (proto == m_map[i].mtype) + return m_map[i].proto; + return PROT_UNKNOWN; - } } Bool @@ -140,7 +166,7 @@ MiscExtGetMouseSettings(pointer *mouse, char **devname) *devname = xf86FindOptionValue(pInfo->options, "Device"); pMse = pInfo->private; - mseptr->type = MapMseProto(pMse->protocolID, TO_MISC); + mseptr->type = MapMseProtoToMisc(pMse->protocolID); mseptr->baudrate = pMse->baudRate; mseptr->samplerate = pMse->sampleRate; mseptr->resolution = pMse->resolution; @@ -279,7 +305,8 @@ MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value) } static void -MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args) +MiscExtClientStateCallback(CallbackListPtr *callbacks, + pointer data, pointer args) { NewClientInfoRec *clientinfo = (NewClientInfoRec*)args; @@ -287,8 +314,7 @@ MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args) clientinfo->client->clientState == ClientStateGone) { xf86Info.grabInfo.override = NULL; xf86Info.grabInfo.disabled = 0; - DeleteCallback(&ClientStateCallback, - (CallbackProcPtr)MiscExtClientStateCallback, NULL); + DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL); } } @@ -307,13 +333,13 @@ MiscExtSetGrabKeysState(ClientPtr client, int state) if (state == 0 && xf86Info.grabInfo.disabled == 0) { xf86Info.grabInfo.disabled = 1; AddCallback(&ClientStateCallback, - (CallbackProcPtr)MiscExtClientStateCallback, NULL); + MiscExtClientStateCallback, NULL); xf86Info.grabInfo.override = client; } else if (state == 1 && xf86Info.grabInfo.disabled == 1) { xf86Info.grabInfo.disabled = 0; DeleteCallback(&ClientStateCallback, - (CallbackProcPtr)MiscExtClientStateCallback, NULL); + MiscExtClientStateCallback, NULL); xf86Info.grabInfo.override = NULL; } else @@ -426,6 +452,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd) Bool protoChanged = FALSE; int oldflags; Bool reopen = FALSE; + MouseProtocolID newProtocol; mseParamsPtr mse = structure; InputInfoPtr pInfo; MouseDevPtr pMse; @@ -508,7 +535,8 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd) pMse = pInfo->private; oldflags = pMse->mouseFlags; - protoChanged = pMse->protocolID != MapMseProto(mse->type, FROM_MISC); + newProtocol = MapMseMiscToProto(mse->type); + protoChanged = pMse->protocolID != newProtocol; if (protoChanged || pMse->baudRate != mse->baudrate || pMse->sampleRate != mse->samplerate @@ -522,7 +550,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd) if (reopen) (pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE); - pMse->protocolID = MapMseProto(mse->type, FROM_MISC); + pMse->protocolID = newProtocol; pMse->baudRate = mse->baudrate; pMse->sampleRate = mse->samplerate; pMse->resolution = mse->resolution; @@ -608,5 +636,18 @@ MiscExtGetFilePaths(const char **configfile, const char **modulepath, return TRUE; } +int +MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval, + char **retstr) +{ + ScrnInfoPtr pScr = xf86Screens[scrnIndex]; + + DEBUG_P("MiscExtPassMessage"); + + if (*pScr->HandleMessage == NULL) + return BadImplementation; + return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr); +} + #endif /* XF86MISC */ diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index ba73921e4..fd2ff4a22 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1,10 +1,36 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.63.2.1 2003/04/08 20:51:27 tsi Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */ /* - * Copyright (c) 1997,1998 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* * Authors: Dirk Hohndel <hohndel@XFree86.Org> * David Dawes <dawes@XFree86.Org> + * Marc La France <tsi@XFree86.Org> + * ... and others * * This file includes helper functions for mode related things. */ @@ -13,6 +39,7 @@ #include "os.h" #include "servermd.h" #include "mibank.h" +#include "globals.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86DDC.h" @@ -318,6 +345,25 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp, return MODE_OK; } +static double +ModeVRefresh(DisplayModePtr mode) +{ + double refresh = 0.0; + + if (mode->VRefresh > 0.0) + refresh = mode->VRefresh; + else if (mode->HTotal > 0 && mode->VTotal > 0) { + refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal; + if (mode->Flags & V_INTERLACE) + refresh *= 2.0; + if (mode->Flags & V_DBLSCAN) + refresh /= 2.0; + if (mode->VScan > 1) + refresh /= mode->VScan; + } + return refresh; +} + /* * xf86LookupMode * @@ -442,17 +488,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, ModePrivFlags = cp->PrivFlags; break; } - if (p->VRefresh > 0.0) - refresh = p->VRefresh; - else { - refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal; - if (p->Flags & V_INTERLACE) - refresh *= 2.0; - if (p->Flags & V_DBLSCAN) - refresh /= 2.0; - if (p->VScan > 1) - refresh /= p->VScan; - } + refresh = ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { @@ -491,17 +527,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, found = TRUE; if (strategy == LOOKUP_BEST_REFRESH) { - if (p->VRefresh > 0.0) - refresh = p->VRefresh; - else { - refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal; - if (p->Flags & V_INTERLACE) - refresh *= 2.0; - if (p->Flags & V_DBLSCAN) - refresh /= 2.0; - if (p->VScan > 1) - refresh /= p->VScan; - } + refresh = ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { @@ -847,7 +873,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int i, needDiv2; /* Sanity checks */ - if (!scrp || !mode /*|| !clockRanges*/) { + if (!scrp || !mode || !clockRanges) { ErrorF("xf86InitialCheckModeForDriver: " "called with invalid parameters\n"); return MODE_ERROR; @@ -1186,13 +1212,17 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, int linePitch = -1, virtX = 0, virtY = 0; int newLinePitch, newVirtX, newVirtY; int modeSize; /* in pixels */ - Bool validateAllDefaultModes; + Bool validateAllDefaultModes = FALSE; Bool userModes = FALSE; int saveType; PixmapFormatRec *BankFormat; ClockRangePtr cp; ClockRangesPtr storeClockRanges; struct monitor_ranges *mon_range = NULL; + double targetRefresh = 0.0; + int numTimings = 0; + range hsync[MAX_HSYNC]; + range vrefresh[MAX_VREFRESH]; #ifdef DEBUG ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n", @@ -1222,58 +1252,164 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, return -1; } - /* Probe monitor so that we can enforce/warn about its limits */ + /* + * Probe monitor so that we can enforce/warn about its limits. + * If one or more DS_RANGES descriptions are present, use the parameters + * that they provide. Otherwise, deduce limits based on the modes that + * are shown as supported via standard and detailed timings. + * + * XXX The full potential of the DDC/EDID data still isn't being tapped. + */ if (scrp->monitor->DDC) { MonPtr monitor = scrp->monitor; xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC); - struct detailed_monitor_section* detMon; - int i; + int i, j; + float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0; + float h; + struct std_timings *t; + struct detailed_timings *dt; + + numTimings = 0; + for (i = 0; i < DET_TIMINGS; i++) { + switch (DDC->det_mon[i].type) { + case DS_RANGES: + mon_range = &DDC->det_mon[i].section.ranges; + hsync[numTimings].lo = mon_range->min_h; + hsync[numTimings].hi = mon_range->max_h; + vrefresh[numTimings].lo = mon_range->min_v; + vrefresh[numTimings].hi = mon_range->max_v; + numTimings++; + break; - for (i = 0; i < 4; i++) { - detMon = &DDC->det_mon[i]; - if(detMon->type == DS_RANGES) { - mon_range = &detMon->section.ranges; + case DS_STD_TIMINGS: + t = DDC->det_mon[i].section.std_t; + for (j = 0; j < 5; j++) { + if (t[j].hsize > 256) { /* sanity check */ + if (t[j].refresh < vmin) + vmin = t[i].refresh; + if (t[j].refresh > vmax) + vmax = t[i].refresh; + /* + * For typical modes this is a reasonable estimate + * of the horizontal sync rate. + */ + h = t[j].refresh * 1.07 * t[j].vsize / 1000.0; + if (h < hmin) + hmin = h; + if (h > hmax) + hmax = h; + } + } + break; + + case DT: + dt = &DDC->det_mon[i].section.d_timings; + if (dt->clock > 15000000) { /* sanity check */ + float v; + h = (float)dt->clock / (dt->h_active + dt->h_blanking); + v = h / (dt->v_active + dt->v_blanking); + h /= 1000.0; + if (dt->interlaced) + v /= 2.0; + + if (v < vmin) + vmin = v; + if (v > vmax) + vmax = v; + if (h < hmin) + hmin = h; + if (h > hmax) + hmax = h; + } + break; } + + if (numTimings > MAX_HSYNC) + break; } - if (mon_range) { + + if (numTimings == 0) { + t = DDC->timings2; + for (i = 0; i < STD_TIMINGS; i++) { + if (t[i].hsize > 256) { /* sanity check */ + if (t[i].refresh < vmin) + vmin = t[i].refresh; + if (t[i].refresh > vmax) + vmax = t[i].refresh; + /* + * For typical modes this is a reasonable estimate + * of the horizontal sync rate. + */ + h = t[i].refresh * 1.07 * t[i].vsize / 1000.0; + if (h < hmin) + hmin = h; + if (h > hmax) + hmax = h; + } + } + + if (hmax > 0.0) { + hsync[numTimings].lo = hmin; + hsync[numTimings].hi = hmax; + vrefresh[numTimings].lo = vmin; + vrefresh[numTimings].hi = vmax; + numTimings++; + } + } + + if (numTimings > 0) { #ifdef DEBUG - ErrorF("DDC - Max clock %d, Hsync %d-%d kHz - Vrefresh %d-%d Hz\n", - mon_range->max_clock, mon_range->min_h, mon_range->max_h, - mon_range->min_v, mon_range->max_v ); + for (i = 0; i < numTimings; i++) { + ErrorF("DDC - Hsync %.1f-%.1f kHz - Vrefresh %.1f-%.1f Hz\n", + hsync[i].lo, hsync[i].hi, + vrefresh[i].lo, vrefresh[i].hi); + } #endif #define DDC_SYNC_TOLERANCE SYNC_TOLERANCE if (monitor->nHsync > 0) { for (i = 0; i < monitor->nHsync; i++) { - if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_h > - monitor->hsync[i].lo || - (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_h < + Bool good = FALSE; + for (j = 0; j < numTimings; j++) { + if ((1.0 - DDC_SYNC_TOLERANCE) * hsync[j].lo <= + monitor->hsync[i].lo && + (1.0 + DDC_SYNC_TOLERANCE) * hsync[j].hi >= monitor->hsync[i].hi) { + good = TRUE; + break; + } + } + if (!good) { xf86DrvMsg(scrp->scrnIndex, X_WARNING, "config file hsync range %g-%gkHz not within DDC " - "hsync range %d-%dkHz\n", - monitor->hsync[i].lo, monitor->hsync[i].hi, - mon_range->min_h, mon_range->max_h); + "hsync ranges.\n", + monitor->hsync[i].lo, monitor->hsync[i].hi); } } } if (monitor->nVrefresh > 0) { - for (i=0; i<monitor->nVrefresh; i++) { - if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_v > - monitor->vrefresh[0].lo || - (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_v < + for (i = 0; i < monitor->nVrefresh; i++) { + Bool good = FALSE; + for (j = 0; j < numTimings; j++) { + if ((1.0 - DDC_SYNC_TOLERANCE) * vrefresh[j].lo <= + monitor->vrefresh[0].lo && + (1.0 + DDC_SYNC_TOLERANCE) * vrefresh[j].hi >= monitor->vrefresh[0].hi) { + good = TRUE; + break; + } + } + if (!good) { xf86DrvMsg(scrp->scrnIndex, X_WARNING, "config file vrefresh range %g-%gHz not within DDC " - "vrefresh range %d-%dHz\n", - monitor->vrefresh[i].lo, monitor->vrefresh[i].hi, - mon_range->min_v, mon_range->max_v); + "vrefresh ranges.\n", + monitor->vrefresh[i].lo, monitor->vrefresh[i].hi); } } } - } /* if (mon_range) */ + } } /* @@ -1283,58 +1419,61 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, if (strategy & LOOKUP_OPTIONAL_TOLERANCES) { strategy &= ~LOOKUP_OPTIONAL_TOLERANCES; } else { + const char *type = ""; + if (scrp->monitor->nHsync <= 0) { - if (mon_range) { - scrp->monitor->hsync[0].lo = mon_range->min_h; - scrp->monitor->hsync[0].hi = mon_range->max_h; + if (numTimings > 0) { + scrp->monitor->nHsync = numTimings; + for (i = 0; i < numTimings; i++) { + scrp->monitor->hsync[i].lo = hsync[i].lo; + scrp->monitor->hsync[i].hi = hsync[i].hi; + } } else { scrp->monitor->hsync[0].lo = 28; scrp->monitor->hsync[0].hi = 33; + scrp->monitor->nHsync = 1; } - xf86DrvMsg(scrp->scrnIndex, X_WARNING, - "%s: Using default hsync range of %.2f-%.2fkHz\n", - scrp->monitor->id, - scrp->monitor->hsync[0].lo, scrp->monitor->hsync[0].hi); - scrp->monitor->nHsync = 1; - } else { - for (i = 0; i < scrp->monitor->nHsync; i++) + type = "default "; + } + for (i = 0; i < scrp->monitor->nHsync; i++) { if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, - "%s: Using hsync value of %.2f kHz\n", - scrp->monitor->id, + "%s: Using %shsync value of %.2f kHz\n", + scrp->monitor->id, type, scrp->monitor->hsync[i].lo); else xf86DrvMsg(scrp->scrnIndex, X_INFO, - "%s: Using hsync range of %.2f-%.2f kHz\n", - scrp->monitor->id, + "%s: Using %shsync range of %.2f-%.2f kHz\n", + scrp->monitor->id, type, scrp->monitor->hsync[i].lo, scrp->monitor->hsync[i].hi); } + + type = ""; if (scrp->monitor->nVrefresh <= 0) { - if (mon_range) { - scrp->monitor->vrefresh[0].lo = mon_range->min_v; - scrp->monitor->vrefresh[0].hi = mon_range->max_v; + if (numTimings > 0) { + scrp->monitor->nVrefresh = numTimings; + for (i = 0; i < numTimings; i++) { + scrp->monitor->vrefresh[i].lo = vrefresh[i].lo; + scrp->monitor->vrefresh[i].hi = vrefresh[i].hi; + } } else { scrp->monitor->vrefresh[0].lo = 43; scrp->monitor->vrefresh[0].hi = 72; + scrp->monitor->nVrefresh = 1; } - xf86DrvMsg(scrp->scrnIndex, X_WARNING, - "%s: using default vrefresh range of %.2f-%.2fHz\n", - scrp->monitor->id, - scrp->monitor->vrefresh[0].lo, - scrp->monitor->vrefresh[0].hi); - scrp->monitor->nVrefresh = 1; - } else { - for (i = 0; i < scrp->monitor->nVrefresh; i++) + type = "default "; + } + for (i = 0; i < scrp->monitor->nVrefresh; i++) { if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi) xf86DrvMsg(scrp->scrnIndex, X_INFO, - "%s: Using vrefresh value of %.2f Hz\n", - scrp->monitor->id, + "%s: Using %svrefresh value of %.2f Hz\n", + scrp->monitor->id, type, scrp->monitor->vrefresh[i].lo); else xf86DrvMsg(scrp->scrnIndex, X_INFO, - "%s: Using vrefresh range of %.2f-%.2f Hz\n", - scrp->monitor->id, + "%s: Using %svrefresh range of %.2f-%.2f Hz\n", + scrp->monitor->id, type, scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].hi); } @@ -1498,6 +1637,26 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } /* + * Go through the mode pool and see if any modes match the target + * refresh rate, (if specified). If no modes match, abandon the target. + */ + targetRefresh = xf86SetRealOption(scrp->options, + "TargetRefresh", 0.0); + if (targetRefresh > 0.0) { + for (p = scrp->modePool; p != NULL; p = p->next) { + if (ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE)) + break; + } + if (!p) + targetRefresh = 0.0; + } + + if (targetRefresh > 0.0) { + xf86DrvMsg(scrp->scrnIndex, X_CONFIG, + "Target refresh rate is %.1f Hz\n", targetRefresh); + } + + /* * Allocate one entry in scrp->modes for each named mode. */ while (scrp->modes) @@ -1520,7 +1679,15 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, } /* Lookup each mode */ - validateAllDefaultModes = TRUE; +#ifdef RANDR + if (!xf86Info.disableRandR +#ifdef PANORAMIX + && noPanoramiXExtension +#endif + ) + validateAllDefaultModes = TRUE; +#endif + for (p = scrp->modes; ; p = p->next) { Bool repeat; @@ -1561,6 +1728,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, ((double)q->HTotal / (double)q->HDisplay) < 1.15) continue; + /* + * If there is a target refresh rate, skip modes that + * don't match up. + */ + if (ModeVRefresh(q) < + (1.0 - SYNC_TOLERANCE) * targetRefresh) + continue; + if (modeSize < (q->HDisplay * q->VDisplay)) { r = q; modeSize = q->HDisplay * q->VDisplay; @@ -1833,8 +2008,16 @@ xf86PruneDriverModes(ScrnInfoPtr scrp) } while (p != NULL && p != first); /* modePool is no longer needed, turf it */ - while (scrp->modePool) + while (scrp->modePool) { + /* + * A modePool mode's prev field is used to hold a pointer to the + * member of the scrp->modes list for which a match was considered. + * Clear that pointer first, otherwise xf86DeleteMode might get + * confused + */ + scrp->modePool->prev = NULL; xf86DeleteMode(&scrp->modePool, scrp->modePool); + } } @@ -1946,22 +2129,16 @@ xf86PrintModes(ScrnInfoPtr scrp) hsync = (float)p->Clock / (float)p->HTotal; else hsync = 0.0; - if (p->VTotal > 0) - refresh = hsync * 1000.0 / p->VTotal; + refresh = ModeVRefresh(p); if (p->Flags & V_INTERLACE) { - refresh *= 2.0; desc = " (I)"; } if (p->Flags & V_DBLSCAN) { - refresh /= 2.0; desc = " (D)"; } if (p->VScan > 1) { - refresh /= p->VScan; desc2 = " (VScan)"; } - if (p->VRefresh > 0.0) - refresh = p->VRefresh; if (p->type & M_T_BUILTIN) prefix = "Built-in mode"; else if (p->type & M_T_DEFAULT) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 21b9aa590..bd18e895f 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.35 2002/12/22 02:03:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.37 2003/08/24 17:36:54 dawes Exp $ */ /* - * Copyright (c) 1997-2001 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -62,7 +85,7 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 2) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 6) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 7) #define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 4) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 2) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 4) diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h index dc5c2ca67..718732353 100644 --- a/hw/xfree86/common/xf86Opt.h +++ b/hw/xfree86/common/xf86Opt.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.15 2003/10/08 14:30:38 dawes Exp $ */ + +/* + * Copyright (c) 1998-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Option handling things that ModuleSetup procs can use */ @@ -46,7 +73,11 @@ int xf86SetIntOption(pointer optlist, const char *name, int deflt); double xf86SetRealOption(pointer optlist, const char *name, double deflt); char *xf86SetStrOption(pointer optlist, const char *name, char *deflt); int xf86SetBoolOption(pointer list, const char *name, int deflt ); -pointer xf86AddNewOption(pointer head, char *name, char *val ); +int xf86CheckIntOption(pointer optlist, const char *name, int deflt); +double xf86CheckRealOption(pointer optlist, const char *name, double deflt); +char *xf86CheckStrOption(pointer optlist, const char *name, char *deflt); +int xf86CheckBoolOption(pointer list, const char *name, int deflt ); +pointer xf86AddNewOption(pointer head, const char *name, const char *val ); pointer xf86NewOption(char *name, char *value ); pointer xf86NextOption(pointer list ); pointer xf86OptionListCreate(const char **options, int count, int used); @@ -76,7 +107,8 @@ Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value); Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def); int xf86NameCmp(const char *s1, const char *s2); char *xf86NormalizeName(const char *s); -pointer xf86ReplaceIntOption(pointer optlist, char *name, int val); -pointer xf86ReplaceBoolOption(pointer optlist, char *name, Bool val); -pointer xf86ReplaceStrOption(pointer optlist, char *name, char* val); +pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val); +pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val); +pointer xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val); +pointer xf86ReplaceStrOption(pointer optlist, const char *name, const char* val); #endif diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index 6ca1590e4..0ba09b507 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -1,10 +1,33 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.25 2002/09/10 17:39:28 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.29 2003/10/18 12:34:19 dawes Exp $ */ /* - * Copyright (c) 1998 by The XFree86 Project, Inc. + * Copyright (c) 1998-2003 by The XFree86 Project, Inc. * - * Author: David Dawes <dawes@xfree86.org> + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* + * Author: David Dawes <dawes@xfree86.org> * * This file includes public option handling functions. */ @@ -17,7 +40,8 @@ #include "xf86Xinput.h" #include "xf86Optrec.h" -static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p); +static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, + Bool markUsed); /* * xf86CollectOptions collects the options from each of the config file @@ -140,42 +164,41 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, /* Created for new XInput stuff -- essentially extensions to the parser */ -/* These xf86Set* functions are intended for use by non-screen specific code */ - -int -xf86SetIntOption(pointer optlist, const char *name, int deflt) +static int +LookupIntOption(pointer optlist, const char *name, int deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_INTEGER; - if (ParseOptionValue(-1, optlist, &o)) + if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.num; return deflt; } -double -xf86SetRealOption(pointer optlist, const char *name, double deflt) +static double +LookupRealOption(pointer optlist, const char *name, double deflt, + Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_REAL; - if (ParseOptionValue(-1, optlist, &o)) + if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.realnum; return deflt; } -char * -xf86SetStrOption(pointer optlist, const char *name, char *deflt) +static char * +LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_STRING; - if (ParseOptionValue(-1, optlist, &o)) + if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.str; if (deflt) return xstrdup(deflt); @@ -184,24 +207,84 @@ xf86SetStrOption(pointer optlist, const char *name, char *deflt) } -int -xf86SetBoolOption(pointer optlist, const char *name, int deflt) +static int +LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed) { OptionInfoRec o; o.name = name; o.type = OPTV_BOOLEAN; - if (ParseOptionValue(-1, optlist, &o)) + if (ParseOptionValue(-1, optlist, &o, markUsed)) deflt = o.value.bool; return deflt; } +/* These xf86Set* functions are intended for use by non-screen specific code */ + +int +xf86SetIntOption(pointer optlist, const char *name, int deflt) +{ + return LookupIntOption(optlist, name, deflt, TRUE); +} + + +double +xf86SetRealOption(pointer optlist, const char *name, double deflt) +{ + return LookupRealOption(optlist, name, deflt, TRUE); +} + + +char * +xf86SetStrOption(pointer optlist, const char *name, char *deflt) +{ + return LookupStrOption(optlist, name, deflt, TRUE); +} + + +int +xf86SetBoolOption(pointer optlist, const char *name, int deflt) +{ + return LookupBoolOption(optlist, name, deflt, TRUE); +} + +/* + * These are like the Set*Option functions, but they don't mark the options + * as used. + */ +int +xf86CheckIntOption(pointer optlist, const char *name, int deflt) +{ + return LookupIntOption(optlist, name, deflt, FALSE); +} + + +double +xf86CheckRealOption(pointer optlist, const char *name, double deflt) +{ + return LookupRealOption(optlist, name, deflt, FALSE); +} + + +char * +xf86CheckStrOption(pointer optlist, const char *name, char *deflt) +{ + return LookupStrOption(optlist, name, deflt, FALSE); +} + + +int +xf86CheckBoolOption(pointer optlist, const char *name, int deflt) +{ + return LookupBoolOption(optlist, name, deflt, FALSE); +} + /* * addNewOption() has the required property of replacing the option value - * it the option is alread present. + * if the option is already present. */ pointer -xf86ReplaceIntOption(pointer optlist, char *name, int val) +xf86ReplaceIntOption(pointer optlist, const char *name, const int val) { char *tmp = xnfalloc(16); sprintf(tmp,"%i",val); @@ -209,20 +292,29 @@ xf86ReplaceIntOption(pointer optlist, char *name, int val) } pointer -xf86ReplaceBoolOption(pointer optlist, char *name, Bool val) +xf86ReplaceRealOption(pointer optlist, const char *name, const double val) +{ + char *tmp = xnfalloc(32); + snprintf(tmp,32,"%f",val); + return xf86AddNewOption(optlist,name,tmp); +} + +pointer +xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val) { - return xf86AddNewOption(optlist,name,(Bool)val?"True":"False"); + return xf86AddNewOption(optlist,name,val?"True":"False"); } pointer -xf86ReplaceStrOption(pointer optlist, char *name, char* val) +xf86ReplaceStrOption(pointer optlist, const char *name, const char* val) { return xf86AddNewOption(optlist,name,val); } pointer -xf86AddNewOption(pointer head, char *name, char *val) +xf86AddNewOption(pointer head, const char *name, const char *val) { + /* XXX These should actually be allocated in the parser library. */ char *tmp = strdup(val); char *tmp_name = strdup(name); @@ -387,14 +479,17 @@ GetBoolValue(OptionInfoPtr p, const char *s) } static Bool -ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) +ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p, + Bool markUsed) { char *s, *end; - Bool wasUsed; + Bool wasUsed = FALSE; if ((s = xf86findOptionValue(options, p->name)) != NULL) { - wasUsed = xf86CheckIfOptionUsedByName(options, p->name); - xf86MarkOptionUsedByName(options, p->name); + if (markUsed) { + wasUsed = xf86CheckIfOptionUsedByName(options, p->name); + xf86MarkOptionUsedByName(options, p->name); + } switch (p->type) { case OPTV_INTEGER: if (*s == '\0') { @@ -501,7 +596,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) p->found = FALSE; break; } - if (p->found) { + if (p->found && markUsed) { int verb = 2; if (wasUsed) verb = 4; @@ -535,7 +630,8 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) newn = n; } if ((s = xf86findOptionValue(options, newn)) != NULL) { - xf86MarkOptionUsedByName(options, newn); + if (markUsed) + xf86MarkOptionUsedByName(options, newn); if (GetBoolValue(&opt, s)) { p->value.bool = !opt.value.bool; p->found = TRUE; @@ -547,7 +643,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) } else { p->found = FALSE; } - if (p->found) { + if (p->found && markUsed) { xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn); if (*s != 0) { xf86ErrorFVerb(2, " \"%s\"", s); @@ -568,7 +664,7 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo) OptionInfoPtr p; for (p = optinfo; p->name != NULL; p++) { - ParseOptionValue(scrnIndex, options, p); + ParseOptionValue(scrnIndex, options, p, TRUE); } } @@ -576,20 +672,27 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo) OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token) { - const OptionInfoRec *p; + const OptionInfoRec *p, *match = NULL, *set = NULL; if (!table) { ErrorF("xf86TokenToOptinfo: table is NULL\n"); return NULL; } - for (p = table; p->token >= 0 && p->token != token; p++) - ; + for (p = table; p->token >= 0; p++) { + if (p->token == token) { + match = p; + if (p->found) + set = p; + } + } - if (p->token < 0) - return NULL; + if (set) + return (OptionInfoPtr)set; + else if (match) + return (OptionInfoPtr)match; else - return (OptionInfoPtr)p; + return NULL; } diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c index 03f5bdec1..eb56fb614 100644 --- a/hw/xfree86/common/xf86PM.c +++ b/hw/xfree86/common/xf86PM.c @@ -1,5 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.8 2002/09/29 23:54:34 keithp Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.9 2003/08/24 17:36:54 dawes Exp $ */ +/* + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "X.h" #include "xf86.h" diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h index 14f86cf89..19cc009dd 100644 --- a/hw/xfree86/common/xf86PciInfo.h +++ b/hw/xfree86/common/xf86PciInfo.h @@ -1,7 +1,33 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.144 2003/02/07 20:41:11 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.156 2003/10/30 15:26:33 tsi Exp $ */ + /* - * Copyright 1995-2002 by The XFree86 Project, Inc. + * Copyright (c) 1995-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* * This file contains macros for the PCI Vendor and Device IDs for video * cards plus a few other things that are needed in drivers or elsewhere. * This information is used in several ways: @@ -57,12 +83,10 @@ #define PCI_VENDOR_SUN 0x108E #define PCI_VENDOR_DIAMOND 0x1092 #define PCI_VENDOR_BROOKTREE 0x109E -#define PCI_VENDOR_ALI_2 0x10B9 #define PCI_VENDOR_NEOMAGIC 0x10C8 #define PCI_VENDOR_NVIDIA 0x10DE #define PCI_VENDOR_IMS 0x10E0 #define PCI_VENDOR_INTEGRAPHICS 0x10EA -#define PCI_VENDOR_VIA 0x1106 #define PCI_VENDOR_ALLIANCE 0x1142 #define PCI_VENDOR_RENDITION 0x1163 #define PCI_VENDOR_3DFX 0x121A @@ -89,14 +113,31 @@ #define PCI_CHIP_QV1280 0x3033 /* ATI */ +#define PCI_CHIP_RS100_4136 0x4136 +#define PCI_CHIP_RS200_4137 0x4137 #define PCI_CHIP_R300_AD 0x4144 #define PCI_CHIP_R300_AE 0x4145 #define PCI_CHIP_R300_AF 0x4146 #define PCI_CHIP_R300_AG 0x4147 +#define PCI_CHIP_R350_AH 0x4148 +#define PCI_CHIP_R350_AI 0x4149 +#define PCI_CHIP_R350_AJ 0x414A +#define PCI_CHIP_R350_AK 0x414B +#define PCI_CHIP_RV350_AP 0x4150 +#define PCI_CHIP_RV350_AQ 0x4151 +#define PCI_CHIP_RV360_AR 0x4152 +#define PCI_CHIP_RV350_AS 0x4153 +#define PCI_CHIP_RV350_AT 0x4154 +#define PCI_CHIP_RV350_AV 0x4156 #define PCI_CHIP_MACH32 0x4158 +#define PCI_CHIP_RS250_4237 0x4237 #define PCI_CHIP_R200_BB 0x4242 +#define PCI_CHIP_R200_BC 0x4243 +#define PCI_CHIP_RS100_4336 0x4336 +#define PCI_CHIP_RS200_4337 0x4337 #define PCI_CHIP_MACH64CT 0x4354 #define PCI_CHIP_MACH64CX 0x4358 +#define PCI_CHIP_RS250_4437 0x4437 #define PCI_CHIP_MACH64ET 0x4554 #define PCI_CHIP_MACH64GB 0x4742 #define PCI_CHIP_MACH64GD 0x4744 @@ -140,12 +181,23 @@ #define PCI_CHIP_RV250_Le 0x4C65 #define PCI_CHIP_RV250_Lf 0x4C66 #define PCI_CHIP_RV250_Lg 0x4C67 +#define PCI_CHIP_RV250_Ln 0x4C6E #define PCI_CHIP_RAGE128MF 0x4D46 #define PCI_CHIP_RAGE128ML 0x4D4C #define PCI_CHIP_R300_ND 0x4E44 #define PCI_CHIP_R300_NE 0x4E45 #define PCI_CHIP_R300_NF 0x4E46 #define PCI_CHIP_R300_NG 0x4E47 +#define PCI_CHIP_R350_NH 0x4E48 +#define PCI_CHIP_R350_NI 0x4E49 +#define PCI_CHIP_R360_NJ 0x4E4A +#define PCI_CHIP_R350_NK 0x4E4B +#define PCI_CHIP_RV350_NP 0x4E50 +#define PCI_CHIP_RV350_NQ 0x4E51 +#define PCI_CHIP_RV350_NR 0x4E52 +#define PCI_CHIP_RV350_NS 0x4E53 +#define PCI_CHIP_RV350_NT 0x4E54 +#define PCI_CHIP_RV350_NV 0x4E56 #define PCI_CHIP_RAGE128PA 0x5041 #define PCI_CHIP_RAGE128PB 0x5042 #define PCI_CHIP_RAGE128PC 0x5043 @@ -186,11 +238,6 @@ #define PCI_CHIP_RV200_QX 0x5158 #define PCI_CHIP_RV100_QY 0x5159 #define PCI_CHIP_RV100_QZ 0x515A -#define PCI_CHIP_R200_Qh 0x5168 -#define PCI_CHIP_R200_Qi 0x5169 -#define PCI_CHIP_R200_Qj 0x516A -#define PCI_CHIP_R200_Qk 0x516B -#define PCI_CHIP_R200_Ql 0x516C /* Undocumented in all ATI manuals */ #define PCI_CHIP_RAGE128RE 0x5245 #define PCI_CHIP_RAGE128RF 0x5246 #define PCI_CHIP_RAGE128RG 0x5247 @@ -213,6 +260,16 @@ #define PCI_CHIP_MACH64VT 0x5654 #define PCI_CHIP_MACH64VU 0x5655 #define PCI_CHIP_MACH64VV 0x5656 +#define PCI_CHIP_RS300_5834 0x5834 +#define PCI_CHIP_RS300_5835 0x5835 +#define PCI_CHIP_RS300_5836 0x5836 +#define PCI_CHIP_RS300_5837 0x5837 +#define PCI_CHIP_RV280_5960 0x5960 +#define PCI_CHIP_RV280_5961 0x5961 +#define PCI_CHIP_RV280_5962 0x5962 +#define PCI_CHIP_RV280_5964 0x5964 +#define PCI_CHIP_RV280_5C61 0x5C61 +#define PCI_CHIP_RV280_5C63 0x5C63 /* Avance Logic */ #define PCI_CHIP_ALG2064 0x2064 @@ -259,6 +316,7 @@ #define PCI_CHIP_AMD761 0x700E /* Trident */ +#define PCI_CHIP_2100 0x2100 #define PCI_CHIP_8400 0x8400 #define PCI_CHIP_8420 0x8420 #define PCI_CHIP_8500 0x8500 @@ -343,20 +401,21 @@ #define PCI_CHIP_SIS6326 0x6326 #define PCI_CHIP_SIS7001 0x7001 #define PCI_CHIP_SIS300 0x0300 -#define PCI_CHIP_SIS315H 0x0310 -#define PCI_CHIP_SIS315PRO 0x0325 -#define PCI_CHIP_SIS330 0x0330 +#define PCI_CHIP_SIS315H 0x0310 +#define PCI_CHIP_SIS315PRO 0x0325 +#define PCI_CHIP_SIS330 0x0330 #define PCI_CHIP_SIS630 0x6300 #define PCI_CHIP_SIS540 0x5300 -#define PCI_CHIP_SIS550 0x5315 -#define PCI_CHIP_SIS650 0x6325 -#define PCI_CHIP_SIS730 0x7300 +#define PCI_CHIP_SIS550 0x5315 +#define PCI_CHIP_SIS650 0x6325 +#define PCI_CHIP_SIS730 0x7300 /* Hewlett-Packard */ #define PCI_CHIP_ELROY 0x1054 #define PCI_CHIP_ZX1_SBA 0x1229 #define PCI_CHIP_ZX1_IOC 0x122A #define PCI_CHIP_ZX1_LBA 0x122E /* a.k.a. Mercury */ +#define PCI_CHIP_ZX1_AGP8 0x12B4 /* a.k.a. QuickSilver */ /* SGS */ #define PCI_CHIP_STG2000 0x0008 @@ -389,9 +448,6 @@ #define PCI_CHIP_BT848 0x0350 #define PCI_CHIP_BT849 0x0351 -/* Acer Laboratories Inc (ALI_2) */ -#define PCI_CHIP_M1541 0x1541 - /* NVIDIA */ #define PCI_CHIP_NV1 0x0008 #define PCI_CHIP_DAC64 0x0009 @@ -442,10 +498,6 @@ #define PCI_CHIP_IMSTT128 0x9128 #define PCI_CHIP_IMSTT3D 0x9135 -/* VIA Technologies */ -#define PCI_CHIP_APOLLOVP1 0x0585 -#define PCI_CHIP_APOLLOPRO133X 0x0691 - /* Alliance Semiconductor */ #define PCI_CHIP_AP6410 0x3210 #define PCI_CHIP_AP6422 0x6422 @@ -538,7 +590,6 @@ /* Intel */ #define PCI_CHIP_I815_BRIDGE 0x1130 #define PCI_CHIP_I815 0x1132 -#define PCI_CHIP_430HX_BRIDGE 0x1250 #define PCI_CHIP_82801_P2P 0x244E #define PCI_CHIP_845_G_BRIDGE 0x2560 #define PCI_CHIP_845_G 0x2562 @@ -550,7 +601,6 @@ #define PCI_CHIP_I810_DC100 0x7123 #define PCI_CHIP_I810_E_BRIDGE 0x7124 #define PCI_CHIP_I810_E 0x7125 -#define PCI_CHIP_440BX_BRIDGE 0x7190 #define PCI_CHIP_I740_AGP 0x7800 #define PCI_CHIP_460GX_PXB 0x84CB #define PCI_CHIP_460GX_SAC 0x84E0 @@ -565,6 +615,7 @@ #define PCI_CHIP_SMI710 0x0710 #define PCI_CHIP_SMI712 0x0712 #define PCI_CHIP_SMI720 0x0720 +#define PCI_CHIP_SMI731 0x0730 /* VMware */ #define PCI_CHIP_VMWARE0405 0x0405 diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 308e7a72c..a46bfc39b 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.80 2002/12/12 18:29:10 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.82 2003/09/09 03:20:36 dawes Exp $ */ /* - * Copyright (c) 1997 by The XFree86 Project, Inc. + * Copyright (c) 1997-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -167,10 +190,11 @@ void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer); /* xf86Helper.c */ void xf86LogInit(void); void xf86CloseLog(void); -void OsVendorVErrorF(const char *f, va_list args); /* xf86Init.c */ Bool xf86LoadModules(char **list, pointer *optlist); +int xf86SetVerbosity(int verb); +int xf86SetLogVerbosity(int verb); /* xf86Io.c */ diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index ff704b912..8b0a0f4ce 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.37 2003/02/20 04:05:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.40 2003/10/17 20:02:12 alanh Exp $ */ /* - * Copyright (c) 1997,1998 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -159,7 +182,6 @@ typedef struct { #ifdef DPMSExtension /* Private info for DPMS */ typedef struct { - DPMSSetProcPtr Set; CloseScreenProcPtr CloseScreen; Bool Enabled; int Flags; @@ -199,36 +221,4 @@ typedef struct { #define WSCONS 32 #endif -/* Prefix strings for driver messages */ -#ifndef X_UNKNOWN_STRING -#define X_UNKNOWN_STRING "(\?\?)" -#endif -#ifndef X_PROBE_STRING -#define X_PROBE_STRING "(--)" -#endif -#ifndef X_CONFIG_STRING -#define X_CONFIG_STRING "(**)" -#endif -#ifndef X_DEFAULT_STRING -#define X_DEFAULT_STRING "(==)" -#endif -#ifndef X_CMDLINE_STRING -#define X_CMDLINE_STRING "(++)" -#endif -#ifndef X_NOTICE_STRING -#define X_NOTICE_STRING "(!!)" -#endif -#ifndef X_ERROR_STRING -#define X_ERROR_STRING "(EE)" -#endif -#ifndef X_WARNING_STRING -#define X_WARNING_STRING "(WW)" -#endif -#ifndef X_INFO_STRING -#define X_INFO_STRING "(II)" -#endif -#ifndef X_NOT_IMPLEMENTED_STRING -#define X_NOT_IMPLEMENTED_STRING "(NI)" -#endif - #endif /* _XF86PRIVSTR_H */ diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index c2dbcc170..546c909ff 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.4 2003/02/13 10:49:38 eich Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.8 2003/11/10 16:42:13 tsi Exp $ * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * @@ -48,9 +48,9 @@ static int xf86RandRModeRefresh (DisplayModePtr mode) { if (mode->VRefresh) - return (int) mode->VRefresh; + return (int) (mode->VRefresh + 0.5); else - return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal); + return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5); } static Bool @@ -60,7 +60,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; - Bool reportVirtual = TRUE; int refresh0 = 60; *rotations = RR_Rotate_0; @@ -75,9 +74,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) pScreen->mmWidth, pScreen->mmHeight); if (!pSize) return FALSE; - if (mode->HDisplay == randrp->virtualX && - mode->VDisplay == randrp->virtualY) - reportVirtual = FALSE; RRRegisterRate (pScreen, pSize, refresh); if (mode == scrp->currentMode && mode->HDisplay == pScreen->width && mode->VDisplay == pScreen->height) @@ -85,13 +81,14 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) if (mode->next == scrp->modes) break; } - if (reportVirtual) + if (scrp->currentMode->HDisplay != randrp->virtualX || + scrp->currentMode->VDisplay != randrp->virtualY) { mode = scrp->modes; pSize = RRRegisterSize (pScreen, randrp->virtualX, randrp->virtualY, - pScreen->mmWidth * randrp->virtualX / mode->HDisplay, - pScreen->mmHeight * randrp->virtualY / mode->VDisplay); + pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay, + pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay); if (!pSize) return FALSE; RRRegisterRate (pScreen, pSize, refresh0); @@ -202,17 +199,21 @@ xf86RandRSetConfig (ScreenPtr pScreen, static Bool xf86RandRCreateScreenResources (ScreenPtr pScreen) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); +#if 0 + ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); DisplayModePtr mode; +#endif pScreen->CreateScreenResources = randrp->CreateScreenResources; if (!(*pScreen->CreateScreenResources) (pScreen)) return FALSE; +#if 0 mode = scrp->currentMode; if (mode) xf86RandRSetMode (pScreen, mode, TRUE); +#endif return TRUE; } diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h index 6ed3015ec..ce2c62bb3 100644 --- a/hw/xfree86/common/xf86Resources.h +++ b/hw/xfree86/common/xf86Resources.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.14 2002/07/24 01:47:24 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.15 2003/08/24 17:36:55 dawes Exp $ */ + +/* + * Copyright (c) 1999-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86_RESOURCES_H diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h index e548b0437..07253bace 100644 --- a/hw/xfree86/common/xf86Version.h +++ b/hw/xfree86/common/xf86Version.h @@ -1,11 +1,38 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.543.2.1 2003/05/10 01:10:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.563 2003/11/21 06:01:44 dawes Exp $ */ + +/* + * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef XF86_VERSION_CURRENT #define XF86_VERSION_MAJOR 4 #define XF86_VERSION_MINOR 3 -#define XF86_VERSION_PATCH 0 -#define XF86_VERSION_SNAP 1 +#define XF86_VERSION_PATCH 99 +#define XF86_VERSION_SNAP 16 /* This has five arguments for compatibilty reasons */ #define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \ diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index f766f899e..467270e10 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -1,7 +1,30 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.17 2003/08/24 17:36:55 dawes Exp $ */ /* - * Copyright (c) 1999 by The XFree86 Project, Inc. + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.14 2003/01/28 20:52:28 tsi Exp $ */ /* * This file contains the VidMode functions required by the extension. @@ -330,6 +353,8 @@ Bool VidModeSwitchMode(int scrnIndex, pointer mode) { ScrnInfoPtr pScrn; + DisplayModePtr pTmpMode; + Bool retval; DEBUG_P("VidModeSwitchMode"); @@ -337,9 +362,15 @@ VidModeSwitchMode(int scrnIndex, pointer mode) return FALSE; pScrn = xf86Screens[scrnIndex]; + /* save in case we fail */ + pTmpMode = pScrn->currentMode; /* Force a mode switch */ pScrn->currentMode = NULL; - return xf86SwitchMode(pScrn->pScreen, mode); + retval = xf86SwitchMode(pScrn->pScreen, mode); + /* we failed: restore it */ + if (retval == FALSE) + pScrn->currentMode = pTmpMode; + return retval; } Bool @@ -440,10 +471,13 @@ VidModeAddModeline(int scrnIndex, pointer mode) pScrn = xf86Screens[scrnIndex]; + ((DisplayModePtr)mode)->name = strdup(""); /* freed by deletemode */ + ((DisplayModePtr)mode)->status = MODE_OK; ((DisplayModePtr)mode)->next = pScrn->modes->next; ((DisplayModePtr)mode)->prev = pScrn->modes; pScrn->modes->next = (DisplayModePtr)mode; - ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode; + if( ((DisplayModePtr)mode)->next != NULL ) + ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode; return TRUE; } @@ -547,6 +581,7 @@ VidModeCreateMode(void) mode = xalloc(sizeof(DisplayModeRec)); if (mode != NULL) { mode->name = ""; + mode->VScan = 1; /* divides refresh rate. default = 1 */ mode->Private = NULL; mode->next = mode; mode->prev = mode; diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c index ddd3055ab..e1755de1e 100644 --- a/hw/xfree86/common/xf86XKB.c +++ b/hw/xfree86/common/xf86XKB.c @@ -24,7 +24,34 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.11 2002/10/11 01:40:31 dawes Exp $ */ +/* + * Copyright (c) 1994-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.12 2003/08/24 17:36:55 dawes Exp $ */ #include <stdio.h> #define NEED_EVENTS 1 diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 53fa1b3ff..eb871a40d 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -1,4 +1,4 @@ -/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.70 2003/11/03 05:11:02 tsi Exp $ */ /* * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org> * @@ -21,8 +21,33 @@ * PERFORMANCE OF THIS SOFTWARE. * */ - -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.68 2002/10/11 01:40:31 dawes Exp $ */ +/* + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ +/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */ #include "Xfuncproto.h" #include "Xmd.h" @@ -854,7 +879,6 @@ xf86PostMotionEvent(DeviceIntPtr device, int valuator[6]; int oldaxis[6]; int *axisvals; - AxisInfoPtr axes; int dx = 0, dy = 0; float mult; int x, y; @@ -883,7 +907,6 @@ xf86PostMotionEvent(DeviceIntPtr device, } axisvals = val->axisVal; - axes = val->axes; va_start(var, num_valuators); diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 1e9694402..9a0393447 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -22,7 +22,34 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.35 2002/10/11 01:40:31 dawes Exp $ */ +/* + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.36 2003/08/24 17:36:55 dawes Exp $ */ #ifndef _xf86Xinput_h #define _xf86Xinput_h diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index 531a83c08..f7cb065a4 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.23 2001/11/16 16:47:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */ +/* + * Copyright (c) 1998-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #if defined(_XOPEN_SOURCE) || defined(__QNXNTO__) #include <math.h> @@ -52,8 +78,6 @@ typedef struct { DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; - LoadPaletteFuncPtr LoadPalette; - SetOverscanFuncPtr SetOverscan; Bool (*EnterVT)(int, int); Bool (*SwitchMode)(int, DisplayModePtr, int); int (*SetDGAMode)(int, int, DGADevicePtr); @@ -103,8 +127,8 @@ Bool xf86HandleColormaps( ScreenPtr pScreen, int maxColors, int sigRGBbits, - LoadPaletteFuncPtr loadPalette, - SetOverscanFuncPtr setOverscan, + xf86LoadPaletteProc *loadPalette, + xf86SetOverscanProc *setOverscan, unsigned int flags ){ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -155,8 +179,8 @@ Bool xf86HandleColormaps( pScreen->StoreColors = CMapStoreColors; pScreenPriv->pScrn = pScrn; - pScreenPriv->LoadPalette = loadPalette; - pScreenPriv->SetOverscan = setOverscan; + pScrn->LoadPalette = loadPalette; + pScrn->SetOverscan = setOverscan; pScreenPriv->maxColors = maxColors; pScreenPriv->sigRGBbits = sigRGBbits; pScreenPriv->gammaElements = elements; @@ -483,6 +507,7 @@ CMapReinstallMap(ColormapPtr pmap) (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr; CMapColormapPtr cmapPriv = (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr; + ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; int i = cmapPriv->numColors; int *indices = pScreenPriv->PreAllocIndices; @@ -492,13 +517,13 @@ CMapReinstallMap(ColormapPtr pmap) if(cmapPriv->recalculate) CMapRefreshColors(pmap, cmapPriv->numColors, indices); else { - (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, cmapPriv->numColors, + (*pScrn->LoadPalette)(pScrn, cmapPriv->numColors, indices, cmapPriv->colors, pmap->pVisual); - if (pScreenPriv->SetOverscan) { + if (pScrn->SetOverscan) { #ifdef DEBUGOVERSCAN ErrorF("SetOverscan() called from CMapReinstallMap\n"); #endif - pScreenPriv->SetOverscan(pScreenPriv->pScrn, cmapPriv->overscan); + pScrn->SetOverscan(pScrn, cmapPriv->overscan); } } @@ -514,6 +539,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices) CMapColormapPtr pColPriv = (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr; VisualPtr pVisual = pmap->pVisual; + ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; int numColors, i; LOCO *gamma, *colors; EntryPtr entry; @@ -616,10 +642,10 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices) if(LOAD_PALETTE(pmap, pmap->pScreen->myNum)) - (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, defs, indices, + (*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices, colors, pmap->pVisual); - if (pScreenPriv->SetOverscan) + if (pScrn->SetOverscan) CMapSetOverscan(pmap, defs, indices); } @@ -646,6 +672,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr; CMapColormapPtr pColPriv = (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr; + ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; VisualPtr pVisual = pmap->pVisual; int i; LOCO *colors; @@ -771,7 +798,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) #ifdef DEBUGOVERSCAN ErrorF("SetOverscan() called from CmapSetOverscan\n"); #endif - pScreenPriv->SetOverscan(pScreenPriv->pScrn, overscan); + pScrn->SetOverscan(pScreenPriv->pScrn, overscan); } } } diff --git a/hw/xfree86/common/xf86cmap.h b/hw/xfree86/common/xf86cmap.h index b871d6762..4291b971a 100644 --- a/hw/xfree86/common/xf86cmap.h +++ b/hw/xfree86/common/xf86cmap.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.9 2003/10/17 20:02:12 alanh Exp $ */ + +/* + * Copyright (c) 1998-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86CMAP_H #define _XF86CMAP_H @@ -10,25 +37,12 @@ #define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002 #define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004 -typedef void (*LoadPaletteFuncPtr)( - ScrnInfoPtr pScrn, - int numColors, - int *indicies, - LOCO *colors, - VisualPtr pVisual -); - -typedef void (*SetOverscanFuncPtr)( - ScrnInfoPtr pScrn, - int Index -); - Bool xf86HandleColormaps( ScreenPtr pScreen, int maxCol, int sigRGBbits, - LoadPaletteFuncPtr loadPalette, - SetOverscanFuncPtr setOverscan, + xf86LoadPaletteProc *loadPalette, + xf86SetOverscanProc *setOverscan, unsigned int flags ); diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c index 8fcf9b817..8a807624f 100644 --- a/hw/xfree86/common/xf86fbBus.c +++ b/hw/xfree86/common/xf86fbBus.c @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.2 2001/10/28 03:33:19 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.3 2003/08/24 17:36:55 dawes Exp $ */ /* - * Copyright (c) 2000 by The XFree86 Project, Inc. + * Copyright (c) 2000-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index 7f4cffaae..b7c4afa1c 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.24 2001/12/05 19:23:52 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.28 2003/11/03 05:11:03 tsi Exp $ */ + +/* + * Copyright (c) 1998-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "misc.h" #include "xf86.h" @@ -8,6 +35,10 @@ #include "regionstr.h" #include "xf86fbman.h" +/* +#define DEBUG +*/ + static int xf86FBMangerIndex = -1; static unsigned long xf86ManagerGeneration = 0; @@ -118,19 +149,19 @@ xf86FreeOffscreenArea(FBAreaPtr area) void -xf86FreeOffscreenLinear(FBLinearPtr area) +xf86FreeOffscreenLinear(FBLinearPtr linear) { FBManagerFuncsPtr funcs; - if(!area) return; + if(!linear) return; if(xf86FBMangerIndex < 0) return; if(!(funcs = - (FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr)) + (FBManagerFuncsPtr)linear->pScreen->devPrivates[xf86FBMangerIndex].ptr)) return; - (*funcs->FreeOffscreenLinear)(area); + (*funcs->FreeOffscreenLinear)(linear); return; } @@ -244,18 +275,19 @@ typedef struct _FBLink { } FBLink, *FBLinkPtr; typedef struct _FBLinearLink { - FBLinear linear; - FBAreaPtr area; + FBLinear linear; + int free; /* need to add free here as FBLinear is publicly accessible */ + FBAreaPtr area; /* only used if allocation came from XY area */ struct _FBLinearLink *next; } FBLinearLink, *FBLinearLinkPtr; typedef struct { - ScreenPtr pScreen; - RegionPtr InitialBoxes; - RegionPtr FreeBoxes; - FBLinkPtr UsedAreas; - int NumUsedAreas; + ScreenPtr pScreen; + RegionPtr InitialBoxes; + RegionPtr FreeBoxes; + FBLinkPtr UsedAreas; + int NumUsedAreas; FBLinearLinkPtr LinearAreas; CloseScreenProcPtr CloseScreen; int NumCallbacks; @@ -772,6 +804,97 @@ LinearRemoveCBWrapper(FBAreaPtr area) xfree(pLink); } +#ifdef DEBUG +static void +Dump(FBLinearLinkPtr pLink) +{ + if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n"); + + while (pLink) { + ErrorF(" Offset:%08x, Size:%08x, %s,%s\n", + pLink->linear.offset, + pLink->linear.size, + pLink->free ? "Free" : "Used", + pLink->area ? "Area" : "Linear"); + + pLink = pLink->next; + } +} +#endif + +static FBLinearPtr +AllocateLinear( + FBManagerPtr offman, + int size, + int granularity, + pointer privData +){ + ScreenPtr pScreen = offman->pScreen; + FBLinearLinkPtr linear = NULL; + FBLinearLinkPtr newlink = NULL; + int offset, end; + + if(size <= 0) return NULL; + + if (!offman->LinearAreas) return NULL; + + linear = offman->LinearAreas; + while (linear) { + /* Make sure we get a free area that's not an XY fallback case */ + if (!linear->area && linear->free) { + offset = (linear->linear.offset + granularity) & ~granularity; + end = offset+size; + if (end <= (linear->linear.offset + linear->linear.size)) + break; + } + linear = linear->next; + } + if (!linear) + return NULL; + + /* break left */ + if (offset > linear->linear.offset) { + newlink = xalloc(sizeof(FBLinearLink)); + if (!newlink) + return NULL; + newlink->area = NULL; + newlink->linear.offset = offset; + newlink->linear.size = linear->linear.size - (offset - linear->linear.offset); + newlink->free = 1; + newlink->next = linear->next; + linear->linear.size -= newlink->linear.size; + linear->next = newlink; + linear = newlink; + } + + /* break right */ + if (size < linear->linear.size) { + newlink = xalloc(sizeof(FBLinearLink)); + if (!newlink) + return NULL; + newlink->area = NULL; + newlink->linear.offset = offset + size; + newlink->linear.size = linear->linear.size - size; + newlink->free = 1; + newlink->next = linear->next; + linear->linear.size = size; + linear->next = newlink; + } + + /* p = middle block */ + linear->linear.granularity = granularity; + linear->free = 0; + linear->linear.pScreen = pScreen; + linear->linear.MoveLinearCallback = NULL; + linear->linear.RemoveLinearCallback = NULL; + linear->linear.devPrivate.ptr = NULL; + +#ifdef DEBUG + Dump(offman->LinearAreas); +#endif + + return &(linear->linear); +} static FBLinearPtr localAllocateOffscreenLinear( @@ -791,28 +914,21 @@ localAllocateOffscreenLinear( offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; - if(!(link = xalloc(sizeof(FBLinearLink)))) - return NULL; + /* Try to allocate from linear memory first...... */ +#ifdef DEBUG + ErrorF("ALLOCATING LINEAR\n"); +#endif + if ((linear = AllocateLinear(offman, length, gran, privData))) + return linear; -#if 0 - if(we have linear heap space) { - if(able to allocate some) { - link->area = NULL; - link->next = offman->LinearAreas; - offman->LinearAreas = link; - linear = link->linear; - linear->pScreen = pScreen; - linear->size = length; - linear->offset = ????; - linear->granularity = gran; - linear->MoveLinearAreaCallback = moveCB; - linear->RemoveLinearAreaCallback = removeCB; - linear->devPrivate.ptr = privData; - return linear; - } /* else fallthrough */ - } +#ifdef DEBUG + ErrorF("NOPE, ALLOCATING AREA\n"); #endif + if(!(link = xalloc(sizeof(FBLinearLink)))) + return NULL; + + /* No linear available, so try and pinch some from the XY areas */ extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); pitch = extents->x2 - extents->x1; @@ -836,6 +952,7 @@ localAllocateOffscreenLinear( privData))) { link->area = area; + link->free = 0; link->next = offman->LinearAreas; offman->LinearAreas = link; linear = &(link->linear); @@ -849,6 +966,10 @@ localAllocateOffscreenLinear( } else xfree(link); +#ifdef DEBUG + Dump(offman->LinearAreas); +#endif + return linear; } @@ -861,7 +982,7 @@ localFreeOffscreenLinear(FBLinearPtr linear) ScreenPtr pScreen = linear->pScreen; offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; - + pLink = offman->LinearAreas; if(!pLink) return; @@ -872,16 +993,42 @@ localFreeOffscreenLinear(FBLinearPtr linear) } if(pLink->area) { /* really an XY area */ - localFreeOffscreenArea(pLink->area); - } else { - /* free the linear area */ +#ifdef DEBUG + ErrorF("FREEING AREA\n"); +#endif + localFreeOffscreenArea(pLink->area); + if(pLinkPrev) + pLinkPrev->next = pLink->next; + else offman->LinearAreas = pLink->next; + xfree(pLink); +#ifdef DEBUG + Dump(offman->LinearAreas); +#endif + return; } - if(pLinkPrev) - pLinkPrev->next = pLink->next; - else offman->LinearAreas = pLink->next; + pLink->free = 1; - xfree(pLink); + if (pLink->next && pLink->next->free) { + FBLinearLinkPtr p = pLink->next; + pLink->linear.size += p->linear.size; + pLink->next = p->next; + free(p); + } + + if(pLinkPrev) { + if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) { + FBLinearLinkPtr p = pLinkPrev->next; + pLinkPrev->linear.size += p->linear.size; + pLinkPrev->next = p->next; + free(p); + } + } + +#ifdef DEBUG + ErrorF("FREEING LINEAR\n"); + Dump(offman->LinearAreas); +#endif } @@ -889,7 +1036,7 @@ static Bool localResizeOffscreenLinear(FBLinearPtr resize, int length) { FBManagerPtr offman; - FBLinearLinkPtr pLink, pLinkPrev = NULL; + FBLinearLinkPtr pLink; ScreenPtr pScreen = resize->pScreen; offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; @@ -898,7 +1045,6 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length) if(!pLink) return FALSE; while(&(pLink->linear) != resize) { - pLinkPrev = pLink; pLink = pLink->next; if(!pLink) return FALSE; } @@ -928,7 +1074,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length) return TRUE; } } else { - /* resize the linear area */ + /* TODO!!!! resize the linear area */ } return FALSE; @@ -943,22 +1089,45 @@ localQueryLargestOffscreenLinear( int priority ) { - int w, h; + FBManagerPtr offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; + FBLinearLinkPtr pLink; + FBLinearLinkPtr pLinkRet; *size = 0; + + if (!offman->LinearAreas) return FALSE; - /* for now, we only look at XY space */ - if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran, - FAVOR_WIDTH_THEN_AREA, priority)) - { - FBManagerPtr offman; - BoxPtr extents; + pLink = offman->LinearAreas; + pLinkRet = pLink; - offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; - extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); - if((extents->x2 - extents->x1) == w) - *size = w * h; - return TRUE; + if (!pLink->area) { + while (pLink) { + if (pLink->free) { + if (pLink->linear.size > pLinkRet->linear.size) + pLinkRet = pLink; + } + pLink = pLink->next; + } + + if (pLinkRet->free) { + *size = pLinkRet->linear.size; + return TRUE; + } + } else { + int w, h; + + if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran, + FAVOR_WIDTH_THEN_AREA, priority)) + { + FBManagerPtr offman; + BoxPtr extents; + + offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; + extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); + if((extents->x2 - extents->x1) == w) + *size = w * h; + return TRUE; + } } return FALSE; @@ -1189,6 +1358,44 @@ xf86InitFBManagerRegion( return TRUE; } +Bool +xf86InitFBManagerLinear( + ScreenPtr pScreen, + int offset, + int size +){ + FBManagerPtr offman; + FBLinearLinkPtr link; + FBLinearPtr linear; + + if (size <= 0) + return FALSE; + + /* we expect people to have called the Area setup first for pixmap cache */ + if (!pScreen->devPrivates[xf86FBScreenIndex].ptr) + return FALSE; + + offman = pScreen->devPrivates[xf86FBScreenIndex].ptr; + + offman->LinearAreas = xalloc(sizeof(FBLinearLink)); + if (!offman->LinearAreas) + return FALSE; + + link = offman->LinearAreas; + link->area = NULL; + link->next = NULL; + link->free = 1; + linear = &(link->linear); + linear->pScreen = pScreen; + linear->size = size; + linear->offset = offset; + linear->granularity = 0; + linear->MoveLinearCallback = NULL; + linear->RemoveLinearCallback = NULL; + linear->devPrivate.ptr = NULL; + + return TRUE; +} /* This is an implementation specific function and should diff --git a/hw/xfree86/common/xf86fbman.h b/hw/xfree86/common/xf86fbman.h index 673c7bc33..adb26a1f1 100644 --- a/hw/xfree86/common/xf86fbman.h +++ b/hw/xfree86/common/xf86fbman.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.12 2001/08/28 16:55:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.14 2003/10/09 12:40:54 alanh Exp $ */ + +/* + * Copyright (c) 1998-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86FBMAN_H #define _XF86FBMAN_H @@ -108,6 +135,13 @@ xf86InitFBManager( BoxPtr FullBox ); +Bool +xf86InitFBManagerLinear( + ScreenPtr pScreen, + int offset, + int size +); + Bool xf86FBManagerRunning( ScreenPtr pScreen diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c index cfe6ed000..1b9890d5e 100644 --- a/hw/xfree86/common/xf86isaBus.c +++ b/hw/xfree86/common/xf86isaBus.c @@ -1,9 +1,32 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.6 2003/08/24 17:36:55 dawes Exp $ */ /* - * Copyright (c) 1997-1999 by The XFree86 Project, Inc. + * Copyright (c) 1997-2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ + /* * This file contains the interfaces to the bus-specific code */ diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c index a9efcdbc4..2d79ab476 100644 --- a/hw/xfree86/common/xf86noBus.c +++ b/hw/xfree86/common/xf86noBus.c @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.1 2002/09/18 08:54:55 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.2 2003/08/24 17:36:55 dawes Exp $ */ /* - * Copyright (c) 2000 by The XFree86 Project, Inc. + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index c40fc1016..641d1c919 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1,6 +1,29 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.68.2.1 2003/05/06 17:00:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.77 2003/11/03 05:11:03 tsi Exp $ */ /* - * Copyright (c) 1997-2002 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -270,8 +293,8 @@ FindPCIVideoInfo(void) } /* - * 64-bit base addresses are checked for and avoided. - * XXX Should deal with them on platforms that support them. + * 64-bit base addresses are checked for and avoided on 32-bit + * platforms. */ if (pcrp->pci_base0) { if (pcrp->pci_base0 & PCI_MAP_IO) { @@ -454,7 +477,7 @@ FindPCIVideoInfo(void) memdone = TRUE; } else xf86ErrorF(", "); - xf86ErrorF("0x%08x/%d", info->memBase[i], info->size[i]); + xf86ErrorF("0x%08lx/%d", info->memBase[i], info->size[i]); } } for (i = 0; i < 6; i++) { @@ -465,12 +488,12 @@ FindPCIVideoInfo(void) iodone = TRUE; } else xf86ErrorF(", "); - xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]); + xf86ErrorF("0x%04lx/%d", info->ioBase[i], info->size[i]); } } if (info->biosBase && (info->biosBase < (memType)(-1 << info->biosSize))) - xf86ErrorF(", BIOS @ 0x%08x/%d", info->biosBase, info->biosSize); + xf86ErrorF(", BIOS @ 0x%08lx/%d", info->biosBase, info->biosSize); xf86ErrorF("\n"); } } @@ -567,7 +590,7 @@ pciIoAccessEnable(void* arg) ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -577,7 +600,7 @@ pciIoAccessDisable(void* arg) ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS @@ -589,7 +612,7 @@ pciIo_MemAccessEnable(void* arg) ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -599,7 +622,7 @@ pciIo_MemAccessDisable(void* arg) ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS @@ -611,7 +634,7 @@ pciMemAccessEnable(void* arg) ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } static void @@ -621,38 +644,48 @@ pciMemAccessDisable(void* arg) ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg); #endif pArg->ctrl &= ~SETBITS; - (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); + pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl); } #undef SETBITS #undef pArg /* move to OS layer */ -#define PCI_PCI_BRDG_CTRL_BASE (PCI_PCI_BRIDGE_CONTROL_REG & 0xFC) -#define SHIFT_BITS ((PCI_PCI_BRIDGE_CONTROL_REG & 0x3) << 3) -#define SETBITS (CARD32)((PCI_PCI_BRIDGE_VGA_EN) << SHIFT_BITS) +#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN) static void pciBusAccessEnable(BusAccPtr ptr) { + PCITAG tag = ptr->busdep.pci.acc; + CARD16 ctrl; + #ifdef DEBUG ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus); #endif - (*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE, - SETBITS, SETBITS); + ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) { + ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) & + ~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET); + pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + } } /* move to OS layer */ static void pciBusAccessDisable(BusAccPtr ptr) { + PCITAG tag = ptr->busdep.pci.acc; + CARD16 ctrl; + #ifdef DEBUG ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus); #endif - (*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE, - SETBITS, 0); + ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + if (ctrl & MASKBITS) { + ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); + pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + } } -#undef SETBITS -#undef SHIFT_BITS +#undef MASKBITS /* move to OS layer */ static void @@ -740,23 +773,34 @@ restorePciState(PCITAG tag, pciSavePtr ptr) static void savePciBusState(BusAccPtr ptr) { + PCITAG tag = ptr->busdep.pci.acc; + ptr->busdep.pci.save.control = - pciReadWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG) & + pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG) & ~PCI_PCI_BRIDGE_SECONDARY_RESET; /* Allow master aborts to complete normally on non-root buses */ if (ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN) - pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, - ptr->busdep.pci.save.control - & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN); + pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, + ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN); } /* move to OS layer */ +#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN) static void restorePciBusState(BusAccPtr ptr) { - pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG, - ptr->busdep.pci.save.control); + PCITAG tag = ptr->busdep.pci.acc; + CARD16 ctrl; + + /* Only restore the bits we've changed (and don't cause resets) */ + ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG); + if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) { + ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET); + ctrl |= ptr->busdep.pci.save.control & MASKBITS; + pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl); + } } +#undef MASKBITS /* move to OS layer */ static void @@ -828,12 +872,17 @@ correctPciSize(memType base, memType oldsize, memType newsize, #if defined(LONG64) || defined(WORD64) || (B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base) +#else + || + (!basep[i+1] + && (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base)) #endif ))) { pcrp->basesize[i] = new_bits; break; /* to next device */ } } + if (PCI_MAP_IS64BITMEM(basep[i])) i++; } } @@ -883,7 +932,7 @@ removeOverlapsWithBridges(int busIndex, resPtr target) target->block_end - target->block_begin, target->res_type); xf86MsgVerb(X_INFO, 3, - "PCI %s resource overlap reduced 0x%08x from 0x%08x to 0x%08x\n", + "PCI %s resource overlap reduced 0x%08lx from 0x%08lx to 0x%08lx\n", ((target->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O", range.rBegin, range.rEnd, target->block_end); } @@ -988,28 +1037,38 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) (subclass == PCI_SUBCLASS_BRIDGE_HOST)) resMisc |= ResOverlap; - if ((pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE))) - res = activeRes; - else - res = inactiveRes; - basep = &pcrp->pci_base0; for (i = 0; i < 6; i++) { if (basep[i]) { - if (PCI_MAP_IS_IO(basep[i])) - P_I_RANGE(range,pcrp->tag,PCIGETIO(basep[i]), + if (PCI_MAP_IS_IO(basep[i])) { + if (pcrp->pci_command & PCI_CMD_IO_ENABLE) + res = activeRes; + else + res = inactiveRes; + P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]), pcrp->basesize[i], ResExcIoBlock | resMisc) - else if (!PCI_MAP_IS64BITMEM(basep[i])) - P_M_RANGE(range,pcrp->tag,PCIGETMEMORY(basep[i]), - pcrp->basesize[i], ResExcMemBlock | resMisc) - else { + } else if (!PCI_MAP_IS64BITMEM(basep[i])) { + if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) + res = activeRes; + else + res = inactiveRes; + P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]), + pcrp->basesize[i], ResExcMemBlock | resMisc) + } else { i++; #if defined(LONG64) || defined(WORD64) - P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i-1]), - pcrp->basesize[i-1], ResExcMemBlock | resMisc) + P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i - 1]), + pcrp->basesize[i - 1], ResExcMemBlock | resMisc) #else + if (basep[i]) continue; + P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i - 1]), + pcrp->basesize[i - 1], ResExcMemBlock | resMisc) #endif + if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) + res = activeRes; + else + res = inactiveRes; } if (range.rBegin) { /* catch cases where PCI base is unset */ tmp = xf86AddResToList(NULL, &range, -1); @@ -1018,15 +1077,16 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) } } } + /* Ignore disabled non-video ROMs */ - if ((res == activeRes) && + if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) && (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) { P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom), pcrp->basesize[6], ResExcMemBlock | resMisc); if (range.rBegin) { tmp = xf86AddResToList(NULL, &range, -1); - removeOverlapsWithBridges(pcrp->busnum,tmp); - *res = xf86JoinResLists(tmp,*res); + removeOverlapsWithBridges(pcrp->busnum, tmp); + *activeRes = xf86JoinResLists(tmp, *activeRes); } } } @@ -1063,8 +1123,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) pRes->block_end - pRes->block_begin, pRes->res_type); xf86MsgVerb(X_INFO, 3, - "PCI %s resource overlap reduced 0x%08x" - " from 0x%08x to 0x%08x\n", + "PCI %s resource overlap reduced 0x%08lx" + " from 0x%08lx to 0x%08lx\n", ((pRes->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O", range.rBegin, range.rEnd, pRes->block_end); @@ -1092,8 +1152,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) pRes->block_end - pRes->block_begin, pRes->res_type); xf86MsgVerb(X_INFO, 3, - "PCI %s resource overlap reduced 0x%08x" - " from 0x%08x to 0x%08x\n", + "PCI %s resource overlap reduced 0x%08lx" + " from 0x%08lx to 0x%08lx\n", ((pRes->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O", range.rBegin, range.rEnd, pRes->block_end); @@ -1760,8 +1820,8 @@ xf86GetPciBridgeInfo(void) break; } - if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses) - (*pBusInfo->funcs->pciGetBridgeBusses)(secondary, + if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses) + (*pBusInfo->funcs->pciGetBridgeBuses)(secondary, &primary, &secondary, &subordinate); @@ -1899,8 +1959,8 @@ xf86GetPciBridgeInfo(void) break; } - if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses) - (*pBusInfo->funcs->pciGetBridgeBusses)(secondary, + if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses) + (*pBusInfo->funcs->pciGetBridgeBuses)(secondary, &primary, &secondary, &subordinate); @@ -2087,8 +2147,8 @@ xf86GetPciBridgeInfo(void) if (pBusInfo) { PciBus->primary = PciBus->secondary = secondary; - if (pBusInfo->funcs->pciGetBridgeBusses) - (*pBusInfo->funcs->pciGetBridgeBusses) + if (pBusInfo->funcs->pciGetBridgeBuses) + (*pBusInfo->funcs->pciGetBridgeBuses) (secondary, &PciBus->primary, &PciBus->secondary, @@ -2275,7 +2335,6 @@ ValidatePci(void) pciConfigPtr pcrp, *pcrpp; CARD32 *basep; resPtr Sys; - resPtr Fix; resRange range; int n = 0, m, i; @@ -2286,6 +2345,7 @@ ValidatePci(void) * the ones which have been assigned to a screen. */ Sys = xf86DupResList(osRes); + /* Only validate graphics devices in use */ for (i=0; i<xf86NumScreens; i++) { for (m = 0; m < xf86Screens[i]->numEntities; m++) if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m]))) @@ -2328,6 +2388,7 @@ ValidatePci(void) } for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) { + /* These were handled above */ if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class)) continue; @@ -2350,13 +2411,16 @@ ValidatePci(void) pcrp->basesize[i], ResExcMemBlock) } else { i++; -#if defined(LONG64) || defined(WORD64) if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE)) continue; +#if defined(LONG64) || defined(WORD64) P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]), pcrp->basesize[i-1], ResExcMemBlock) #else - continue; + if (basep[i]) + continue; + P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]), + pcrp->basesize[i-1], ResExcMemBlock) #endif } Sys = xf86AddResToList(Sys, &range, -1); @@ -2458,7 +2522,6 @@ ValidatePci(void) xf86MsgVerb(X_INFO, 3,"MEM/IO:\n"); xf86PrintResList(3,res_m_io); #endif - Fix = NULL; for (i = 0; i < 6; i++) { int j; resPtr own = NULL; @@ -2596,8 +2659,6 @@ initPciState(void) pcaccp->devnum = pvp->device; pcaccp->funcnum = pvp->func; pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func); - pcaccp->arg.func = - (WriteProcPtr)pciLongFunc(pcaccp->arg.tag,WRITE); pcaccp->ioAccess.AccessDisable = pciIoAccessDisable; pcaccp->ioAccess.AccessEnable = pciIoAccessEnable; pcaccp->ioAccess.arg = &pcaccp->arg; @@ -2674,8 +2735,6 @@ initPciBusState(void) pbap->enable_f = pciBusAccessEnable; pbap->disable_f = pciBusAccessDisable; pbap->busdep.pci.acc = pciTag(pbp->brbus,pbp->brdev,pbp->brfunc); - pbap->busdep.pci.func = - (SetBitsProcPtr)pciLongFunc(pbap->busdep.pci.acc,SET_BITS); savePciBusState(pbap); break; case PCI_SUBCLASS_BRIDGE_ISA: diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h index fbe3fbe62..fbb733ae7 100644 --- a/hw/xfree86/common/xf86pciBus.h +++ b/hw/xfree86/common/xf86pciBus.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.8 2002/09/16 16:55:33 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.10 2003/08/24 17:36:56 dawes Exp $ */ + +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86_PCI_BUS_H #define _XF86_PCI_BUS_H @@ -11,12 +38,8 @@ typedef struct { CARD32 biosBase; } pciSave, *pciSavePtr; -typedef void (*SetBitsProcPtr)(PCITAG, int, CARD32, CARD32); -typedef void (*WriteProcPtr)(PCITAG, int, CARD32); - typedef struct { PCITAG tag; - WriteProcPtr func; CARD32 ctrl; } pciArg; diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 2b6deed33..367cb19a9 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.90 2002/11/25 14:04:56 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.97 2003/10/30 17:36:56 tsi Exp $ */ /* - * Copyright (c) 1997-2000 by The XFree86 Project, Inc. + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* @@ -16,6 +39,7 @@ #include "input.h" #include "scrnintstr.h" #include "pixmapstr.h" +#include "colormapst.h" #include "xf86Module.h" #include "xf86Opt.h" #include "xf86Pci.h" @@ -452,24 +476,10 @@ typedef struct _confdrirec { /* These values should be adjusted when new fields are added to ScrnInfoRec */ #define NUM_RESERVED_INTS 16 #define NUM_RESERVED_POINTERS 15 -#define NUM_RESERVED_FUNCS 16 +#define NUM_RESERVED_FUNCS 12 typedef pointer (*funcPointer)(void); -/* Flags for driver messages */ -typedef enum { - X_PROBED, /* Value was probed */ - X_CONFIG, /* Value was given in the config file */ - X_DEFAULT, /* Value is a default */ - X_CMDLINE, /* Value was given on the command line */ - X_NOTICE, /* Notice */ - X_ERROR, /* Error message */ - X_WARNING, /* Warning message */ - X_INFO, /* Informational message */ - X_NONE, /* No prefix */ - X_NOT_IMPLEMENTED /* Not implemented */ -} MessageType; - /* flags for depth 24 pixmap options */ typedef enum { Pix24DontCare = 0, @@ -747,12 +757,16 @@ typedef void xf86AdjustFrameProc (int, int, int, int); typedef Bool xf86EnterVTProc (int, int); typedef void xf86LeaveVTProc (int, int); typedef void xf86FreeScreenProc (int, int); -typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int); +typedef ModeStatus xf86ValidModeProc (int, DisplayModePtr, Bool, int); typedef void xf86EnableDisableFBAccessProc(int, Bool); typedef int xf86SetDGAModeProc (int, int, DGADevicePtr); typedef int xf86ChangeGammaProc (int, Gamma); typedef void xf86PointerMovedProc (int, int, int); typedef Bool xf86PMEventProc (int, pmEvent, Bool); +typedef int xf86HandleMessageProc (int, const char*, const char*, char**); +typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int); +typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr); +typedef void xf86SetOverscanProc (ScrnInfoPtr, int); /* * ScrnInfoRec @@ -903,6 +917,10 @@ typedef struct _ScrnInfoRec { xf86ChangeGammaProc *ChangeGamma; xf86PointerMovedProc *PointerMoved; xf86PMEventProc *PMEvent; + xf86HandleMessageProc *HandleMessage; + xf86DPMSSetProc *DPMSSet; + xf86LoadPaletteProc *LoadPalette; + xf86SetOverscanProc *SetOverscan; /* * This can be used when the minor ABI version is incremented. @@ -1023,7 +1041,32 @@ typedef enum { ACTION_CLOSECLIENT, /* Kill client holding grab */ ACTION_SWITCHSCREEN = 100, /* VT switch */ ACTION_SWITCHSCREEN_NEXT, - ACTION_SWITCHSCREEN_PREV + ACTION_SWITCHSCREEN_PREV, + ACTION_MESSAGE = 9999 /* Generic message passing */ } ActionEvent; +/* xf86Versions.c */ +/* + * Never change existing values, and always assign values explicitly. + * NUM_BUILTIN_IFS must always be the last entry. + */ +typedef enum { + BUILTIN_IF_OSMOUSE = 0, + BUILTIN_IF_OSKBD = 1, + NUM_BUILTIN_IFS +} BuiltinInterface; + +/* + * These are intentionally the same as the module version macros. + * It is possible to register a module as providing a specific interface, + * in which case the module's version is used. This feature isn't + * really ready for use yet though. + */ + +#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \ + ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF)) +#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF) +#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF) +#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF) + #endif /* _XF86STR_H */ diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index c6a09121b..90289057b 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -1,12 +1,34 @@ -/* - - XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) - - Copyright (C) 1998, 1999 - The XFree86 Project Inc. - -*/ - -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.33 2002/11/09 01:18:11 keithp Exp $ */ +/* + * XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) + */ +/* + * Copyright (c) 1998-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.37 2003/11/10 18:22:15 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -31,7 +53,7 @@ #include "xvmodproc.h" #endif -#include "xf86xv.h" +#include "xf86xvpriv.h" /* XvScreenRec fields */ @@ -44,29 +66,29 @@ static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*); static int xf86XVFreePort(XvPortPtr); static int xf86XVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr, - INT16, INT16, CARD16, CARD16, + INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr, - INT16, INT16, CARD16, CARD16, + INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr, - INT16, INT16, CARD16, CARD16, + INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr, - INT16, INT16, CARD16, CARD16, + INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16); static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr); static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32); static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*); static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8, - CARD16, CARD16,CARD16, CARD16, + CARD16, CARD16,CARD16, CARD16, unsigned int*, unsigned int*); static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr, - INT16, INT16, CARD16, CARD16, + INT16, INT16, CARD16, CARD16, INT16, INT16, CARD16, CARD16, XvImagePtr, unsigned char*, Bool, CARD16, CARD16); -static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, +static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, CARD16*, CARD16*, int*, int*); @@ -107,7 +129,7 @@ int (*XvScreenInitProc)(ScreenPtr) = XvScreenInit; ((XvScreenPtr)((pScreen)->devPrivates[XF86XvScreenIndex].ptr)) #define GET_XF86XV_SCREEN(pScreen) \ - ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr)) + ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr)) #define GET_XF86XV_WINDOW(pWin) \ ((XF86XVWindowPtr)((pWin)->devPrivates[XF86XVWindowIndex].ptr)) @@ -121,12 +143,12 @@ xf86XVRegisterGenericAdaptorDriver( ){ xf86XVInitGenericAdaptorPtr *newdrivers; - newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) * + newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) * (1 + NumGenDrivers)); if (!newdrivers) return 0; GenDrivers = newdrivers; - + GenDrivers[NumGenDrivers++] = InitFunc; return 1; @@ -134,7 +156,7 @@ xf86XVRegisterGenericAdaptorDriver( int xf86XVListGenericAdaptors( - ScrnInfoPtr pScrn, + ScrnInfoPtr pScrn, XF86VideoAdaptorPtr **adaptors ){ int i,j,n,num; @@ -142,8 +164,13 @@ xf86XVListGenericAdaptors( num = 0; *adaptors = NULL; - for (i = 0; i < NumGenDrivers; i++) { - n = GenDrivers[i](pScrn,&DrivAdap); + /* + * The v4l driver registers itself first, but can use surfaces registered + * by other drivers. So, call the v4l driver last. + */ + for (i = NumGenDrivers; --i >= 0; ) { + DrivAdap = NULL; + n = (*GenDrivers[i])(pScrn, &DrivAdap); if (0 == n) continue; new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n)); @@ -156,6 +183,38 @@ xf86XVListGenericAdaptors( return num; } + +/**************** Offscreen surface stuff *******************/ + +typedef struct { + XF86OffscreenImagePtr images; + int num; +} OffscreenImageRec; + +static OffscreenImageRec OffscreenImages[MAXSCREENS]; + +Bool +xf86XVRegisterOffscreenImages( + ScreenPtr pScreen, + XF86OffscreenImagePtr images, + int num +){ + OffscreenImages[pScreen->myNum].num = num; + OffscreenImages[pScreen->myNum].images = images; + + return TRUE; +} + +XF86OffscreenImagePtr +xf86XVQueryOffscreenImages( + ScreenPtr pScreen, + int *num +){ + *num = OffscreenImages[pScreen->myNum].num; + return OffscreenImages[pScreen->myNum].images; +} + + XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn) { @@ -171,7 +230,7 @@ xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr) Bool xf86XVScreenInit( - ScreenPtr pScreen, + ScreenPtr pScreen, XF86VideoAdaptorPtr *adaptors, int num ){ @@ -181,7 +240,7 @@ xf86XVScreenInit( if(num <= 0 || !XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc) - return FALSE; + return FALSE; if(XF86XVGeneration != serverGeneration) { if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0) @@ -190,7 +249,7 @@ xf86XVScreenInit( } if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,0)) - return FALSE; + return FALSE; if(Success != (*XvScreenInitProc)(pScreen)) return FALSE; @@ -245,31 +304,28 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) { int i; - if(pAdaptor->name) - xfree(pAdaptor->name); + xfree(pAdaptor->name); if(pAdaptor->pEncodings) { XvEncodingPtr pEncode = pAdaptor->pEncodings; - for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) { - if(pEncode->name) xfree(pEncode->name); - } + for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) + xfree(pEncode->name); xfree(pAdaptor->pEncodings); } - if(pAdaptor->pFormats) - xfree(pAdaptor->pFormats); + xfree(pAdaptor->pFormats); if(pAdaptor->pPorts) { XvPortPtr pPort = pAdaptor->pPorts; XvPortRecPrivatePtr pPriv; for(i = 0; i < pAdaptor->nPorts; i++, pPort++) { - pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; + pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; if(pPriv) { - if(pPriv->clientClip) + if(pPriv->clientClip) REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip); - if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) + if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip); xfree(pPriv); } @@ -280,23 +336,18 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) if(pAdaptor->nAttributes) { XvAttributePtr pAttribute = pAdaptor->pAttributes; - for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) { - if(pAttribute->name) xfree(pAttribute->name); - } - + for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) + xfree(pAttribute->name); xfree(pAdaptor->pAttributes); } - if(pAdaptor->nImages) - xfree(pAdaptor->pImages); - - if(pAdaptor->devPriv.ptr) - xfree(pAdaptor->devPriv.ptr); + xfree(pAdaptor->pImages); + xfree(pAdaptor->devPriv.ptr); } static Bool xf86XVInitAdaptors( - ScreenPtr pScreen, + ScreenPtr pScreen, XF86VideoAdaptorPtr *infoPtr, int number ) { @@ -325,7 +376,7 @@ xf86XVInitAdaptors( pxvs->nAdaptors = 0; pxvs->pAdaptors = NULL; - if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec)))) + if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec)))) return FALSE; for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) { @@ -339,7 +390,7 @@ xf86XVInitAdaptors( if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings) continue; - pa->type = adaptorPtr->type; + pa->type = adaptorPtr->type; if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo) pa->type &= ~XvVideoMask; @@ -350,19 +401,19 @@ xf86XVInitAdaptors( if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes) pa->type &= ~XvImageMask; - if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage && + if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage && !adaptorPtr->PutStill) pa->type &= ~XvInputMask; if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill) pa->type &= ~XvOutputMask; - - if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask))) + + if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask))) continue; - if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask))) + if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask))) continue; - pa->pScreen = pScreen; + pa->pScreen = pScreen; pa->ddAllocatePort = xf86XVAllocatePort; pa->ddFreePort = xf86XVFreePort; pa->ddPutVideo = xf86XVPutVideo; @@ -376,33 +427,33 @@ xf86XVInitAdaptors( pa->ddQueryBestSize = xf86XVQueryBestSize; pa->ddQueryImageAttributes = xf86XVQueryImageAttributes; if((pa->name = xalloc(strlen(adaptorPtr->name) + 1))) - strcpy(pa->name, adaptorPtr->name); + strcpy(pa->name, adaptorPtr->name); if(adaptorPtr->nEncodings && (pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) { - for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; - i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) - { + for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0; + i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++) + { pe->id = encodingPtr->id; pe->pScreen = pScreen; if((pe->name = xalloc(strlen(encodingPtr->name) + 1))) - strcpy(pe->name, encodingPtr->name); + strcpy(pe->name, encodingPtr->name); pe->width = encodingPtr->width; pe->height = encodingPtr->height; pe->rate.numerator = encodingPtr->rate.numerator; pe->rate.denominator = encodingPtr->rate.denominator; } pa->nEncodings = adaptorPtr->nEncodings; - pa->pEncodings = pEncode; - } + pa->pEncodings = pEncode; + } if(adaptorPtr->nImages && - (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { + (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) { - for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; - i < adaptorPtr->nImages; i++, pi++, imagePtr++) - { + for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages; + i < adaptorPtr->nImages; i++, pi++, imagePtr++) + { pi->id = imagePtr->id; pi->type = imagePtr->type; pi->byte_order = imagePtr->byte_order; @@ -425,7 +476,7 @@ xf86XVInitAdaptors( pi->vert_v_period = imagePtr->vert_v_period; memcpy(pi->component_order, imagePtr->component_order, 32); pi->scanline_order = imagePtr->scanline_order; - } + } pa->nImages = adaptorPtr->nImages; pa->pImages = pImage; } @@ -433,65 +484,65 @@ xf86XVInitAdaptors( if(adaptorPtr->nAttributes && (pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec)))) { - for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0; - i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) - { + for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0; + i < adaptorPtr->nAttributes; pat++, i++, attributePtr++) + { pat->flags = attributePtr->flags; pat->min_value = attributePtr->min_value; pat->max_value = attributePtr->max_value; if((pat->name = xalloc(strlen(attributePtr->name) + 1))) - strcpy(pat->name, attributePtr->name); + strcpy(pat->name, attributePtr->name); } pa->nAttributes = adaptorPtr->nAttributes; - pa->pAttributes = pAttribute; - } + pa->pAttributes = pAttribute; + } totFormat = adaptorPtr->nFormats; if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) { - xf86XVFreeAdaptor(pa); - continue; + xf86XVFreeAdaptor(pa); + continue; } - for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats; - i < adaptorPtr->nFormats; i++, formatPtr++) + for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats; + i < adaptorPtr->nFormats; i++, formatPtr++) { numVisuals = pScreen->numVisuals; - pVisual = pScreen->visuals; + pVisual = pScreen->visuals; - while(numVisuals--) { - if((pVisual->class == formatPtr->class) && - (pVisual->nplanes == formatPtr->depth)) { + while(numVisuals--) { + if((pVisual->class == formatPtr->class) && + (pVisual->nplanes == formatPtr->depth)) { if(numFormat >= totFormat) { - void *moreSpace; + void *moreSpace; totFormat *= 2; - moreSpace = xrealloc(pFormat, + moreSpace = xrealloc(pFormat, totFormat * sizeof(XvFormatRec)); if(!moreSpace) break; pFormat = moreSpace; pf = pFormat + numFormat; } - pf->visual = pVisual->vid; + pf->visual = pVisual->vid; pf->depth = formatPtr->depth; pf++; numFormat++; - } - pVisual++; - } + } + pVisual++; + } } pa->nFormats = numFormat; - pa->pFormats = pFormat; + pa->pFormats = pFormat; if(!numFormat) { - xf86XVFreeAdaptor(pa); - continue; + xf86XVFreeAdaptor(pa); + continue; } if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) { - xf86XVFreeAdaptor(pa); - continue; + xf86XVFreeAdaptor(pa); + continue; } adaptorPriv->flags = adaptorPtr->flags; @@ -510,47 +561,47 @@ xf86XVInitAdaptors( pa->devPriv.ptr = (pointer)adaptorPriv; if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) { - xf86XVFreeAdaptor(pa); - continue; + xf86XVFreeAdaptor(pa); + continue; } - for(pp = pPort, i = 0, numPort = 0; + for(pp = pPort, i = 0, numPort = 0; i < adaptorPtr->nPorts; i++) { - if(!(pp->id = FakeClientID(0))) + if(!(pp->id = FakeClientID(0))) continue; - if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate)))) + if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate)))) continue; - + if(!AddResource(pp->id, PortResource, pp)) { xfree(portPriv); continue; } - pp->pAdaptor = pa; - pp->pNotify = (XvPortNotifyPtr)NULL; - pp->pDraw = (DrawablePtr)NULL; - pp->client = (ClientPtr)NULL; - pp->grab.client = (ClientPtr)NULL; - pp->time = currentTime; - pp->devPriv.ptr = portPriv; + pp->pAdaptor = pa; + pp->pNotify = (XvPortNotifyPtr)NULL; + pp->pDraw = (DrawablePtr)NULL; + pp->client = (ClientPtr)NULL; + pp->grab.client = (ClientPtr)NULL; + pp->time = currentTime; + pp->devPriv.ptr = portPriv; portPriv->pScrn = pScrn; portPriv->AdaptorRec = adaptorPriv; - portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr; - - pp++; - numPort++; + portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr; + + pp++; + numPort++; } pa->nPorts = numPort; pa->pPorts = pPort; if(!numPort) { - xf86XVFreeAdaptor(pa); - continue; + xf86XVFreeAdaptor(pa); + continue; } pa->base_id = pPort->id; - + pa++; numAdaptor++; } @@ -576,23 +627,25 @@ xf86XVInitAdaptors( the GC and used it's clip list when they needed to reclip the window, even if the client clip was different from the one the video was initialized with. If the original GC was destroyed, they had to stop - the video. I like the new method better (MArk). + the video. I like the new method better (MArk). This function only works for windows. Will need to rewrite when (if) we support pixmap rendering. */ -static void +static void xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) { RegionPtr pregWin, pCompositeClip; WindowPtr pWin; - Bool freeCompClip = FALSE; + ScreenPtr pScreen; + Bool freeCompClip = FALSE; if(portPriv->pCompositeClip) return; pWin = (WindowPtr)portPriv->pDraw; + pScreen = pWin->drawable.pScreen; /* get window clip list */ if(portPriv->subWindowMode == IncludeInferiors) { @@ -607,19 +660,19 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) return; } - pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1); - REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip); - REGION_TRANSLATE(pWin->pScreen, pCompositeClip, + pCompositeClip = REGION_CREATE(pScreen, NullBox, 1); + REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip); + REGION_TRANSLATE(pScreen, pCompositeClip, portPriv->pDraw->x + portPriv->clipOrg.x, portPriv->pDraw->y + portPriv->clipOrg.y); - REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip); + REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; portPriv->FreeCompositeClip = TRUE; if(freeCompClip) { - REGION_DESTROY(pWin->pScreen, pregWin); - } + REGION_DESTROY(pScreen, pregWin); + } } /* Save the current clientClip and update the CompositeClip whenever @@ -627,23 +680,25 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) static void xf86XVCopyClip( - XvPortRecPrivatePtr portPriv, + XvPortRecPrivatePtr portPriv, GCPtr pGC ){ + ScreenPtr pScreen = pGC->pScreen; + /* copy the new clip if it exists */ if((pGC->clientClipType == CT_REGION) && pGC->clientClip) { if(!portPriv->clientClip) - portPriv->clientClip = REGION_CREATE(pGC->pScreen, NullBox, 1); + portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1); /* Note: this is in window coordinates */ - REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip); + REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip); } else if(portPriv->clientClip) { /* free the old clientClip */ - REGION_DESTROY(pGC->pScreen, portPriv->clientClip); + REGION_DESTROY(pScreen, portPriv->clientClip); portPriv->clientClip = NULL; } /* get rid of the old clip list */ if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) { - REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip); + REGION_DESTROY(pScreen, portPriv->pCompositeClip); } portPriv->clipOrg = pGC->clipOrg; @@ -670,12 +725,12 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; - + /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); - + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + /* that's all if it's totally obscured */ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { clippedAway = TRUE; @@ -686,11 +741,11 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); } - ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn, - portPriv->vid_x, portPriv->vid_y, - WinBox.x1, WinBox.y1, - portPriv->vid_w, portPriv->vid_h, - portPriv->drw_w, portPriv->drw_h, + ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn, + portPriv->vid_x, portPriv->vid_y, + WinBox.x1, WinBox.y1, + portPriv->vid_w, portPriv->vid_h, + portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr); if(ret == Success) @@ -734,27 +789,27 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; - + /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; - VPBox.x1 = portPriv->pScrn->frameX0; + VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; - VPBox.x2 = portPriv->pScrn->frameX1; + VPBox.x2 = portPriv->pScrn->frameX1; VPBox.y2 = portPriv->pScrn->frameY1; REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); + REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); REGION_UNINIT(pScreen, &VPReg); } - + /* that's all if it's totally obscured */ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { clippedAway = TRUE; @@ -765,8 +820,8 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { BoxPtr clipBox = REGION_RECTS(&ClipRegion); if( (REGION_NUM_RECTS(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) + (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || + (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; @@ -777,11 +832,11 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); } - ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn, - portPriv->vid_x, portPriv->vid_y, + ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn, + portPriv->vid_x, portPriv->vid_y, WinBox.x1, WinBox.y1, - portPriv->vid_w, portPriv->vid_h, - portPriv->drw_w, portPriv->drw_h, + portPriv->vid_w, portPriv->vid_h, + portPriv->drw_w, portPriv->drw_h, &ClipRegion, portPriv->DevPriv.ptr); if(ret == Success) portPriv->isOn = XV_ON; @@ -823,27 +878,27 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y; WinBox.x2 = WinBox.x1 + portPriv->drw_w; WinBox.y2 = WinBox.y1 + portPriv->drw_h; - + /* clip to the window composite clip */ REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; - VPBox.x1 = portPriv->pScrn->frameX0; + VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; - VPBox.x2 = portPriv->pScrn->frameX1; + VPBox.x2 = portPriv->pScrn->frameX1; VPBox.y2 = portPriv->pScrn->frameY1; REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); + REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); REGION_UNINIT(pScreen, &VPReg); } - + /* that's all if it's totally obscured */ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { clippedAway = TRUE; @@ -854,8 +909,8 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { BoxPtr clipBox = REGION_RECTS(&ClipRegion); if( (REGION_NUM_RECTS(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || - (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) + (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || + (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; @@ -866,7 +921,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); } - ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn, + ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn, WinBox.x1, WinBox.y1, &ClipRegion, portPriv->DevPriv.ptr); @@ -910,7 +965,7 @@ xf86XVReputAllVideo(WindowPtr pWin, pointer data) static int xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { - XF86XVWindowPtr winPriv, PrivRoot; + XF86XVWindowPtr winPriv, PrivRoot; winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin); @@ -927,7 +982,7 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) winPriv->PortRec = portPriv; winPriv->next = PrivRoot; pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv; - } + } return Success; } @@ -941,15 +996,15 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) while(winPriv) { if(winPriv->PortRec == portPriv) { - if(prevPriv) + if(prevPriv) prevPriv->next = winPriv->next; - else - pWin->devPrivates[XF86XVWindowIndex].ptr = + else + pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv->next; xfree(winPriv); break; } - prevPriv = winPriv; + prevPriv = winPriv; winPriv = winPriv->next; } portPriv->pDraw = NULL; @@ -1008,7 +1063,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) /* filter out XClearWindow/Area */ if (!pWin->valdata) return; - + pPrev = NULL; while(WinPriv) { @@ -1019,10 +1074,10 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) switch(pPriv->type) { case XvInputMask: xf86XVReputVideo(pPriv); - break; + break; case XvOutputMask: - xf86XVRegetVideo(pPriv); - break; + xf86XVRegetVideo(pPriv); + break; default: /* overlaid still/image*/ if (pPriv->AdaptorRec->ReputImage) xf86XVReputImage(pPriv); @@ -1036,8 +1091,8 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) } pPriv->pDraw = NULL; - if(!pPrev) - pWin->devPrivates[XF86XVWindowIndex].ptr = + if(!pPrev) + pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)(WinPriv->next); else pPrev->next = WinPriv->next; @@ -1054,7 +1109,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) } -static void +static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -1073,7 +1128,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) pPriv->pCompositeClip = NULL; - /* Stop everything except images, but stop them too if the + /* Stop everything except images, but stop them too if the window isn't visible. But we only remove the images. */ if(pPriv->type || !visible) { @@ -1086,8 +1141,8 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) if(!pPriv->type) { /* overlaid still/image */ pPriv->pDraw = NULL; - if(!pPrev) - pWin->devPrivates[XF86XVWindowIndex].ptr = + if(!pPrev) + pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)(WinPriv->next); else pPrev->next = WinPriv->next; @@ -1122,6 +1177,9 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) XvAdaptorPtr pa; int c; + /* Clear offscreen images */ + (void)memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0])); + if(!ScreenPriv) return TRUE; if(ScreenPriv->videoGC) { @@ -1133,20 +1191,16 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; - pScrn->EnterVT = ScreenPriv->EnterVT; - pScrn->LeaveVT = ScreenPriv->LeaveVT; + pScrn->EnterVT = ScreenPriv->EnterVT; + pScrn->LeaveVT = ScreenPriv->LeaveVT; pScrn->AdjustFrame = ScreenPriv->AdjustFrame; - for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) { + for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) { xf86XVFreeAdaptor(pa); } - if(pxvs->pAdaptors) - xfree(pxvs->pAdaptors); - + xfree(pxvs->pAdaptors); xfree(ScreenPriv); - - return TRUE; } @@ -1168,7 +1222,7 @@ xf86XVQueryAdaptors( /**** ScrnInfoRec fields ****/ -static Bool +static Bool xf86XVEnterVT(int index, int flags) { ScreenPtr pScreen = screenInfo.screens[index]; @@ -1177,12 +1231,12 @@ xf86XVEnterVT(int index, int flags) ret = (*ScreenPriv->EnterVT)(index, flags); - if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0); - + if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0); + return ret; } -static void +static void xf86XVLeaveVT(int index, int flags) { ScreenPtr pScreen = screenInfo.screens[index]; @@ -1229,14 +1283,14 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) WindowPtr pWin; XvAdaptorPtr pa; int c, i; - + if(ScreenPriv->AdjustFrame) { pScrn->AdjustFrame = ScreenPriv->AdjustFrame; (*pScrn->AdjustFrame)(index, x, y, flags); pScrn->AdjustFrame = xf86XVAdjustFrame; } - - for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) { + + for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) { XvPortPtr pPort = pa->pPorts; XvPortRecPrivatePtr pPriv; @@ -1254,7 +1308,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) if ((pPriv->AdaptorRec->ReputImage) && ((pWin->visibility == VisibilityUnobscured) || - (pWin->visibility == VisibilityPartiallyObscured))) + (pWin->visibility == VisibilityPartiallyObscured))) { xf86XVReputImage(pPriv); } else { @@ -1297,8 +1351,8 @@ xf86XVPutVideo( DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, - INT16 vid_x, INT16 vid_y, - CARD16 vid_w, CARD16 vid_h, + INT16 vid_x, INT16 vid_y, + CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ @@ -1310,7 +1364,7 @@ xf86XVPutVideo( pPort->pDraw = (DrawablePtr)NULL; return BadAlloc; } - + /* If we are changing windows, unregister our port in the old window */ if(portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); @@ -1333,7 +1387,7 @@ xf86XVPutVideo( /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; - + if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ return(xf86XVReputVideo(portPriv)); @@ -1345,8 +1399,8 @@ xf86XVPutStill( DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, - INT16 vid_x, INT16 vid_y, - CARD16 vid_w, CARD16 vid_h, + INT16 vid_x, INT16 vid_y, + CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ @@ -1369,22 +1423,22 @@ xf86XVPutStill( WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - + REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; - VPBox.x1 = portPriv->pScrn->frameX0; + VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; - VPBox.x2 = portPriv->pScrn->frameX1; + VPBox.x2 = portPriv->pScrn->frameX1; VPBox.y2 = portPriv->pScrn->frameY1; REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); + REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); REGION_UNINIT(pScreen, &VPReg); } @@ -1400,11 +1454,11 @@ xf86XVPutStill( if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { BoxPtr clipBox = REGION_RECTS(&ClipRegion); if( (REGION_NUM_RECTS(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || + (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { clippedAway = TRUE; - goto PUT_STILL_BAILOUT; + goto PUT_STILL_BAILOUT; } } @@ -1412,7 +1466,7 @@ xf86XVPutStill( REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); } - ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn, + ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn, vid_x, vid_y, WinBox.x1, WinBox.y1, vid_w, vid_h, drw_w, drw_h, &ClipRegion, portPriv->DevPriv.ptr); @@ -1433,9 +1487,9 @@ xf86XVPutStill( PUT_STILL_BAILOUT: if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { - (*portPriv->AdaptorRec->StopVideo)( - portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); - portPriv->isOn = XV_PENDING; + (*portPriv->AdaptorRec->StopVideo)( + portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); + portPriv->isOn = XV_PENDING; } REGION_UNINIT(pScreen, &WinRegion); @@ -1450,8 +1504,8 @@ xf86XVGetVideo( DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, - INT16 vid_x, INT16 vid_y, - CARD16 vid_w, CARD16 vid_h, + INT16 vid_x, INT16 vid_y, + CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ @@ -1463,7 +1517,7 @@ xf86XVGetVideo( pPort->pDraw = (DrawablePtr)NULL; return BadAlloc; } - + /* If we are changing windows, unregister our port in the old window */ if(portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); @@ -1486,7 +1540,7 @@ xf86XVGetVideo( /* To indicate to the DI layer that we were successful */ pPort->pDraw = pDraw; - + if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ return(xf86XVRegetVideo(portPriv)); @@ -1498,8 +1552,8 @@ xf86XVGetStill( DrawablePtr pDraw, XvPortPtr pPort, GCPtr pGC, - INT16 vid_x, INT16 vid_y, - CARD16 vid_w, CARD16 vid_h, + INT16 vid_x, INT16 vid_y, + CARD16 vid_w, CARD16 vid_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h ){ @@ -1522,10 +1576,10 @@ xf86XVGetStill( WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - + REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->pDraw) { xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); @@ -1548,9 +1602,9 @@ xf86XVGetStill( GET_STILL_BAILOUT: if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { - (*portPriv->AdaptorRec->StopVideo)( - portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); - portPriv->isOn = XV_PENDING; + (*portPriv->AdaptorRec->StopVideo)( + portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); + portPriv->isOn = XV_PENDING; } REGION_UNINIT(pScreen, &WinRegion); @@ -1559,7 +1613,7 @@ GET_STILL_BAILOUT: return ret; } - + static int xf86XVStopVideo( @@ -1571,7 +1625,7 @@ xf86XVStopVideo( if(pDraw->type != DRAWABLE_WINDOW) return BadAlloc; - + xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv); if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ @@ -1595,8 +1649,8 @@ xf86XVSetPortAttribute( INT32 value ){ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); - - return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn, + + return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn, attribute, value, portPriv->DevPriv.ptr)); } @@ -1609,8 +1663,8 @@ xf86XVGetPortAttribute( INT32 *p_value ){ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); - - return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn, + + return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn, attribute, p_value, portPriv->DevPriv.ptr)); } @@ -1626,8 +1680,8 @@ xf86XVQueryBestSize( unsigned int *p_w, unsigned int *p_h ){ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); - - (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn, + + (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn, (Bool)motion, vid_w, vid_h, drw_w, drw_h, p_w, p_h, portPriv->DevPriv.ptr); @@ -1635,14 +1689,14 @@ xf86XVQueryBestSize( } -static int +static int xf86XVPutImage( - ClientPtr client, - DrawablePtr pDraw, - XvPortPtr pPort, + ClientPtr client, + DrawablePtr pDraw, + XvPortPtr pPort, GCPtr pGC, - INT16 src_x, INT16 src_y, - CARD16 src_w, CARD16 src_h, + INT16 src_x, INT16 src_y, + CARD16 src_w, CARD16 src_h, INT16 drw_x, INT16 drw_y, CARD16 drw_w, CARD16 drw_h, XvImagePtr format, @@ -1669,22 +1723,22 @@ xf86XVPutImage( WinBox.y1 = pDraw->y + drw_y; WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - + REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + REGION_NULL(pScreen, &ClipRegion); + REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; BoxRec VPBox; - VPBox.x1 = portPriv->pScrn->frameX0; + VPBox.x1 = portPriv->pScrn->frameX0; VPBox.y1 = portPriv->pScrn->frameY0; - VPBox.x2 = portPriv->pScrn->frameX1 + 1; + VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); + REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); REGION_UNINIT(pScreen, &VPReg); } @@ -1700,11 +1754,11 @@ xf86XVPutImage( if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { BoxPtr clipBox = REGION_RECTS(&ClipRegion); if( (REGION_NUM_RECTS(&ClipRegion) != 1) || - (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || + (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { clippedAway = TRUE; - goto PUT_IMAGE_BAILOUT; + goto PUT_IMAGE_BAILOUT; } } @@ -1712,7 +1766,7 @@ xf86XVPutImage( REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); } - ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn, + ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn, src_x, src_y, WinBox.x1, WinBox.y1, src_w, src_h, drw_w, drw_h, format->id, data, width, height, sync, &ClipRegion, portPriv->DevPriv.ptr); @@ -1733,9 +1787,9 @@ xf86XVPutImage( PUT_IMAGE_BAILOUT: if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) { - (*portPriv->AdaptorRec->StopVideo)( - portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); - portPriv->isOn = XV_PENDING; + (*portPriv->AdaptorRec->StopVideo)( + portPriv->pScrn, portPriv->DevPriv.ptr, FALSE); + portPriv->isOn = XV_PENDING; } REGION_UNINIT(pScreen, &WinRegion); @@ -1745,19 +1799,19 @@ PUT_IMAGE_BAILOUT: } -static int +static int xf86XVQueryImageAttributes( - ClientPtr client, + ClientPtr client, XvPortPtr pPort, - XvImagePtr format, - CARD16 *width, - CARD16 *height, + XvImagePtr format, + CARD16 *width, + CARD16 *height, int *pitches, int *offsets ){ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); - return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn, + return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn, format->id, width, height, pitches, offsets); } @@ -1778,7 +1832,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) pval[0] = key; pval[1] = IncludeInferiors; ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode, - pval, &status); + pval, &status); if(!ScreenPriv->videoGC) return; ValidateGC(root, ScreenPriv->videoGC); } else if (key != ScreenPriv->videoGC->fgPixel){ @@ -1795,20 +1849,20 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } - + (*ScreenPriv->videoGC->ops->PolyFillRect)( - root, ScreenPriv->videoGC, nbox, rects); + root, ScreenPriv->videoGC, nbox, rects); DEALLOCATE_LOCAL(rects); } -/* xf86XVClipVideoHelper - +/* xf86XVClipVideoHelper - Takes the dst box in standard X BoxRec form (top and left edges inclusive, bottom and right exclusive). The new dst - box is returned. The source boundaries are given (x1, y1 - inclusive, x2, y2 exclusive) and returned are the new source - boundaries in 16.16 fixed point. + box is returned. The source boundaries are given (x1, y1 + inclusive, x2, y2 exclusive) and returned are the new source + boundaries in 16.16 fixed point. */ #define DummyScreen screenInfo.screens[0] @@ -1824,112 +1878,169 @@ xf86XVClipVideoHelper( INT32 width, INT32 height ){ - INT32 vscale, hscale, delta; + double xsw, xdw, ysw, ydw; + INT32 delta; BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); int diff; - hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1); - vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1); + xsw = (*xb - *xa) << 16; + xdw = dst->x2 - dst->x1; + ysw = (*yb - *ya) << 16; + ydw = dst->y2 - dst->y1; *xa <<= 16; *xb <<= 16; *ya <<= 16; *yb <<= 16; diff = extents->x1 - dst->x1; - if(diff > 0) { - dst->x1 = extents->x1; - *xa += diff * hscale; + if (diff > 0) { + dst->x1 = extents->x1; + *xa += (diff * xsw) / xdw; } diff = dst->x2 - extents->x2; - if(diff > 0) { - dst->x2 = extents->x2; - *xb -= diff * hscale; + if (diff > 0) { + dst->x2 = extents->x2; + *xb -= (diff * xsw) / xdw; } diff = extents->y1 - dst->y1; - if(diff > 0) { - dst->y1 = extents->y1; - *ya += diff * vscale; + if (diff > 0) { + dst->y1 = extents->y1; + *ya += (diff * ysw) / ydw; } diff = dst->y2 - extents->y2; - if(diff > 0) { - dst->y2 = extents->y2; - *yb -= diff * vscale; + if (diff > 0) { + dst->y2 = extents->y2; + *yb -= (diff * ysw) / ydw; } - if(*xa < 0) { - diff = (- *xa + hscale - 1)/ hscale; - dst->x1 += diff; - *xa += diff * hscale; + if (*xa < 0) { + diff = (((-*xa) * xdw) + xsw - 1) / xsw; + dst->x1 += diff; + *xa += (diff * xsw) / xdw; } delta = *xb - (width << 16); - if(delta > 0) { - diff = (delta + hscale - 1)/ hscale; - dst->x2 -= diff; - *xb -= diff * hscale; + if (delta > 0) { + diff = ((delta * xdw) + xsw - 1) / xsw; + dst->x2 -= diff; + *xb -= (diff * xsw) / xdw; } - if(*xa >= *xb) return FALSE; + if (*xa >= *xb) return FALSE; - if(*ya < 0) { - diff = (- *ya + vscale - 1)/ vscale; - dst->y1 += diff; - *ya += diff * vscale; + if (*ya < 0) { + diff = (((-*ya) * ydw) + ysw - 1) / ysw; + dst->y1 += diff; + *ya += (diff * ysw) / ydw; } delta = *yb - (height << 16); - if(delta > 0) { - diff = (delta + vscale - 1)/ vscale; - dst->y2 -= diff; - *yb -= diff * vscale; + if (delta > 0) { + diff = ((delta * ydw) + ysw - 1) / ysw; + dst->y2 -= diff; + *yb -= (diff * ysw) / ydw; } - if(*ya >= *yb) return FALSE; + if (*ya >= *yb) return FALSE; - if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) || - (dst->y1 != extents->y1) || (dst->y2 != extents->y2)) + if ((dst->x1 > extents->x1) || (dst->x2 < extents->x2) || + (dst->y1 > extents->y1) || (dst->y2 < extents->y2)) { - RegionRec clipReg; - REGION_INIT(DummyScreen, &clipReg, dst, 1); - REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); - REGION_UNINIT(DummyScreen, &clipReg); + RegionRec clipReg; + REGION_INIT(DummyScreen, &clipReg, dst, 1); + REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); + REGION_UNINIT(DummyScreen, &clipReg); } return TRUE; } +void +xf86XVCopyYUV12ToPacked( + const void *srcy, + const void *srcv, + const void *srcu, + void *dst, + int srcPitchy, + int srcPitchuv, + int dstPitch, + int h, + int w +){ + CARD32 *Dst; + const CARD8 *Y, *U, *V; + int i, j; -/**************** Offscreen surface stuff *******************/ - -typedef struct { - XF86OffscreenImagePtr images; - int num; -} OffscreenImageRec; + w >>= 1; + + for (j = 0; j < h; j++) { + Dst = dst; + Y = srcy; V = srcv; U = srcu; + i = w; + while (i >= 4) { +#if X_BYTE_ORDER == X_LITTLE_ENDIAN + Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24); + Dst[1] = Y[2] | (Y[3] << 16) | (U[1] << 8) | (V[1] << 24); + Dst[2] = Y[4] | (Y[5] << 16) | (U[2] << 8) | (V[2] << 24); + Dst[3] = Y[6] | (Y[7] << 16) | (U[3] << 8) | (V[3] << 24); +#else + /* This assumes a little-endian framebuffer */ + Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0]; + Dst[1] = (Y[2] << 24) | (Y[3] << 8) | (U[1] << 16) | Y[1]; + Dst[2] = (Y[4] << 24) | (Y[5] << 8) | (U[2] << 16) | Y[2]; + Dst[3] = (Y[6] << 24) | (Y[7] << 8) | (U[3] << 16) | Y[3]; +#endif + Dst += 4; Y += 8; V += 4; U += 4; + i -= 4; + } -static OffscreenImageRec OffscreenImages[MAXSCREENS]; -static Bool offscreenInited = FALSE; + while (i--) { +#if X_BYTE_ORDER == X_LITTLE_ENDIAN + Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24); +#else + /* This assumes a little-endian framebuffer */ + Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0]; +#endif + Dst++; Y += 2; V++; U++; + } -Bool -xf86XVRegisterOffscreenImages( - ScreenPtr pScreen, - XF86OffscreenImagePtr images, - int num -){ - if(!offscreenInited) { - bzero(OffscreenImages, sizeof(OffscreenImages[MAXSCREENS])); - offscreenInited = TRUE; + dst = (CARD8 *)dst + dstPitch; + srcy = (const CARD8 *)srcy + srcPitchy; + if (j & 1) { + srcu = (const CARD8 *)srcu + srcPitchuv; + srcv = (const CARD8 *)srcv + srcPitchuv; + } } - - OffscreenImages[pScreen->myNum].num = num; - OffscreenImages[pScreen->myNum].images = images; - - return TRUE; } -XF86OffscreenImagePtr -xf86XVQueryOffscreenImages( - ScreenPtr pScreen, - int *num +void +xf86XVCopyPacked( + const void *src, + void *dst, + int srcPitch, + int dstPitch, + int h, + int w ){ - if(!offscreenInited) { - *num = 0; - return NULL; - } - - *num = OffscreenImages[pScreen->myNum].num; - return OffscreenImages[pScreen->myNum].images; + const CARD32 *Src; + CARD32 *Dst; + int i; + + w >>= 1; + while (--h >= 0) { + do { + Dst = dst; Src = src; + i = w; + while (i >= 4) { + Dst[0] = Src[0]; + Dst[1] = Src[1]; + Dst[2] = Src[2]; + Dst[3] = Src[3]; + Dst += 4; Src += 4; i -= 4; + } + if (!i) break; + Dst[0] = Src[0]; + if (i == 1) break; + Dst[1] = Src[1]; + if (i == 2) break; + Dst[2] = Src[2]; + } while (0); + + src = (const CARD8 *)src + srcPitch; + dst = (CARD8 *)dst + dstPitch; + } } diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h index 9fd6b4edf..316d6c9e5 100644 --- a/hw/xfree86/common/xf86xv.h +++ b/hw/xfree86/common/xf86xv.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.23 2002/11/09 01:18:33 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.25 2003/08/24 17:36:56 dawes Exp $ */ + +/* + * Copyright (c) 1998-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86XV_H_ #define _XF86XV_H_ @@ -218,55 +245,27 @@ xf86XVClipVideoHelper( INT32 height ); -/*** These are DDX layer privates ***/ - -extern int XF86XvScreenIndex; - -typedef struct { - DestroyWindowProcPtr DestroyWindow; - ClipNotifyProcPtr ClipNotify; - WindowExposuresProcPtr WindowExposures; - void (*AdjustFrame)(int, int, int, int); - Bool (*EnterVT)(int, int); - void (*LeaveVT)(int, int); - GCPtr videoGC; -} XF86XVScreenRec, *XF86XVScreenPtr; - -typedef struct { - int flags; - PutVideoFuncPtr PutVideo; - PutStillFuncPtr PutStill; - GetVideoFuncPtr GetVideo; - GetStillFuncPtr GetStill; - StopVideoFuncPtr StopVideo; - SetPortAttributeFuncPtr SetPortAttribute; - GetPortAttributeFuncPtr GetPortAttribute; - QueryBestSizeFuncPtr QueryBestSize; - PutImageFuncPtr PutImage; - ReputImageFuncPtr ReputImage; - QueryImageAttributesFuncPtr QueryImageAttributes; -} XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr; - -typedef struct { - ScrnInfoPtr pScrn; - DrawablePtr pDraw; - unsigned char type; - unsigned int subWindowMode; - DDXPointRec clipOrg; - RegionPtr clientClip; - RegionPtr pCompositeClip; - Bool FreeCompositeClip; - XvAdaptorRecPrivatePtr AdaptorRec; - XvStatus isOn; - Bool moved; - int vid_x, vid_y, vid_w, vid_h; - int drw_x, drw_y, drw_w, drw_h; - DevUnion DevPriv; -} XvPortRecPrivate, *XvPortRecPrivatePtr; +void +xf86XVCopyYUV12ToPacked( + const void *srcy, + const void *srcv, + const void *srcu, + void *dst, + int srcPitchy, + int srcPitchuv, + int dstPitch, + int h, + int w +); -typedef struct _XF86XVWindowRec{ - XvPortRecPrivatePtr PortRec; - struct _XF86XVWindowRec *next; -} XF86XVWindowRec, *XF86XVWindowPtr; +void +xf86XVCopyPacked( + const void *src, + void *dst, + int srcPitch, + int dstPitch, + int h, + int w +); #endif /* _XF86XV_H_ */ diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c index 4559359ec..832861ea4 100644 --- a/hw/xfree86/common/xf86xvmc.c +++ b/hw/xfree86/common/xf86xvmc.c @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.3 2001/04/01 14:00:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.6 2003/10/08 22:31:59 mvojkovi Exp $ */ + +/* + * Copyright (c) 2001-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "misc.h" #include "xf86.h" @@ -14,6 +41,7 @@ #include "xvmodproc.h" #endif +#include "xf86xvpriv.h" #include "xf86xvmc.h" #ifdef XFree86LOADER @@ -199,3 +227,13 @@ Bool xf86XvMCScreenInit( return TRUE; } + +XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void) +{ + return xcalloc(1, sizeof(XF86MCAdaptorRec)); +} + +void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor) +{ + xfree(adaptor); +} diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h index 074edbebe..0b073aac8 100644 --- a/hw/xfree86/common/xf86xvmc.h +++ b/hw/xfree86/common/xf86xvmc.h @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.5 2001/11/14 21:54:39 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.7 2003/10/08 22:31:59 mvojkovi Exp $ */ + +/* + * Copyright (c) 2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86XVMC_H #define _XF86XVMC_H @@ -131,4 +158,7 @@ Bool xf86XvMCScreenInit( XF86MCAdaptorPtr *adaptors ); +XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void); +void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor); + #endif /* _XF86XVMC_H */ diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c index 4132c7abf..facc27842 100644 --- a/hw/xfree86/common/xisb.c +++ b/hw/xfree86/common/xisb.c @@ -24,7 +24,7 @@ * in this Software without prior written authorization from Metro Link. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.5 2000/11/06 19:24:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.6 2003/03/25 04:18:21 dawes Exp $ */ /* X Input Serial Buffer routines for use in any XInput driver that accesses @@ -36,6 +36,10 @@ * Standard Headers ****************************************************************************/ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif + #include <misc.h> #include <xf86.h> #include <xf86Version.h> diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index d779834c2..666dfc632 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -3,7 +3,7 @@ * * Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.9 2001/10/28 03:33:21 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.10 2003/11/03 05:11:04 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -100,10 +100,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC) EDID1Atom, XA_INTEGER, 8, 128, (unsigned char *)EDID1rawdata ); -#ifdef DEBUG + if (ret != Success) ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret ); -#endif - } if (makeEDID2prop) { @@ -127,9 +125,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC) EDID2Atom, XA_INTEGER, 8, 256, (unsigned char *)EDID2rawdata ); -#ifdef DEBUG + if (ret != Success) ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret ); -#endif } if (DDC->vdif) { @@ -151,9 +148,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC) strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING ); -#ifdef DEBUG + if (ret != Success) ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret ); -#endif } return TRUE; diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c index 3451e52f6..064533800 100644 --- a/hw/xfree86/ddc/print_edid.c +++ b/hw/xfree86/ddc/print_edid.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.15 2001/05/22 17:01:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.16 2003/09/24 02:43:17 dawes Exp $ */ /* print_edid.c: print out all information retrieved from display device * @@ -41,7 +41,7 @@ static void print_vendor(int scrnIndex, struct vendor *c) { xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n", - &c->name, c->prod_id, c->serial); + (char *)&c->name, c->prod_id, c->serial); xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week); } diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c index c65d1a0c9..fbb540e1d 100644 --- a/hw/xfree86/ddc/print_vdif.c +++ b/hw/xfree86/ddc/print_vdif.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.3 2003/02/17 16:08:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.5 2003/11/06 18:37:58 tsi Exp $ */ #include "vdif.h" #include "misc.h" diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h index 38026e56a..8d358613e 100644 --- a/hw/xfree86/ddc/vdif.h +++ b/hw/xfree86/ddc/vdif.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.3 2000/04/14 12:16:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */ #ifndef _VDIF_H #define _VDIF_H @@ -24,7 +24,8 @@ #include "Xmd.h" -#pragma pack(1) +#undef CARD32 +#define CARD32 unsigned int /* ... on all supported platforms */ typedef struct _VDIF { /* Monitor Description: */ CARD8 VDIFId[4]; /* alway "VDIF" */ @@ -169,6 +170,6 @@ typedef struct _vdif { char * strings; } xf86vdif, *xf86vdifPtr; -#pragma pack() +#undef CARD32 #endif diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c index 736fb741b..496f3573f 100644 --- a/hw/xfree86/ddc/xf86DDC.c +++ b/hw/xfree86/ddc/xf86DDC.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.23 2003/02/17 16:08:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.27 2003/10/30 17:48:19 tsi Exp $ */ /* xf86DDC.c * @@ -19,6 +19,7 @@ const char *i2cSymbols[] = { "xf86CreateI2CDevRec", "xf86I2CDevInit", "xf86I2CWriteRead", + "xf86I2CFindDev", "xf86DestroyI2CDevRec", NULL }; @@ -332,19 +333,22 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) int i; xf86LoaderReqSymLists(i2cSymbols, NULL); - dev = xf86CreateI2CDevRec(); - dev->DevName = "ddc2"; - dev->SlaveAddr = 0xA0; - dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */ - dev->StartTimeout = 550; - dev->BitTimeout = 40; - dev->ByteTimeout = 40; - dev->AcknTimeout = 40; - - dev->pI2CBus = pBus; - if (! xf86I2CDevInit(dev)) { - xf86DrvMsg(X_PROBED,scrnIndex,"No DDC2 device\n"); - return NULL; + + if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) { + dev = xf86CreateI2CDevRec(); + dev->DevName = "ddc2"; + dev->SlaveAddr = 0xA0; + dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */ + dev->StartTimeout = 550; + dev->BitTimeout = 40; + dev->ByteTimeout = 40; + dev->AcknTimeout = 40; + + dev->pI2CBus = pBus; + if (!xf86I2CDevInit(dev)) { + xf86DrvMsg(scrnIndex, X_PROBED, "No DDC2 device\n"); + return NULL; + } } if (start < 0x100) { w_bytes = 1; @@ -358,10 +362,9 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) * (len)); for (i=0; i<RETRIES; i++) { if (xf86I2CWriteRead(dev, W_Buffer,w_bytes, R_Buffer,len)) { - if (!DDC_checksum(R_Buffer,len)) { - xf86DestroyI2CDevRec(dev,TRUE); + if (!DDC_checksum(R_Buffer,len)) return R_Buffer; - } + #ifdef DEBUG else ErrorF("Checksum error in EDID block\n"); #endif @@ -375,5 +378,3 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) xfree(R_Buffer); return NULL; } - - diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h index 2b0118f15..a0108053c 100644 --- a/hw/xfree86/dixmods/extmod/dgaproc.h +++ b/hw/xfree86/dixmods/extmod/dgaproc.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.22 2003/07/16 01:38:29 dawes Exp $ */ #ifndef __DGAPROC_H #define __DGAPROC_H @@ -53,9 +53,6 @@ typedef struct { int reserved2; } XDGAModeRec, *XDGAModePtr; - -void XFree86DGAExtensionInit(void); - /* DDX interface */ int diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c index d97b88fa4..dc76cbf21 100644 --- a/hw/xfree86/dixmods/extmod/modinit.c +++ b/hw/xfree86/dixmods/extmod/modinit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.17 2003/07/16 01:38:33 dawes Exp $ */ /* * @@ -31,113 +31,9 @@ #include "Xproto.h" -static MODULESETUPPROTO(extmodSetup); - -extern Bool noTestExtensions; - -#ifdef SHAPE -extern void ShapeExtensionInit(INITARGS); -#define _SHAPE_SERVER_ /* don't want Xlib structures */ -#include "shapestr.h" -#endif - -#ifdef MULTIBUFFER -extern void MultibufferExtensionInit(INITARGS); -#define _MULTIBUF_SERVER_ /* don't want Xlib structures */ -#include "multibufst.h" -#endif - -#ifdef MITMISC -extern void MITMiscExtensionInit(INITARGS); -#define _MITMISC_SERVER_ -#include "mitmiscstr.h" -#endif - -#ifdef XTEST -extern void XTestExtensionInit(INITARGS); -#define _XTEST_SERVER_ -#include "XTest.h" -#include "xteststr.h" -#endif - -#ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); -#include "bigreqstr.h" -#endif - -#ifdef XSYNC -extern void SyncExtensionInit(INITARGS); -#define _SYNC_SERVER -#include "sync.h" -#include "syncstr.h" -#endif - -#ifdef SCREENSAVER -extern void ScreenSaverExtensionInit (INITARGS); -#include "saver.h" -#endif - -#ifdef XCMISC -extern void XCMiscExtensionInit(INITARGS); -#include "xcmiscstr.h" -#endif - -#ifdef XF86VIDMODE -extern void XFree86VidModeExtensionInit(INITARGS); -#define _XF86VIDMODE_SERVER_ -#include "xf86vmstr.h" -#endif - -#ifdef XF86MISC -extern void XFree86MiscExtensionInit(INITARGS); -#define _XF86MISC_SERVER_ -#define _XF86MISC_SAVER_COMPAT_ -#include "xf86mscstr.h" -#endif - -#ifdef XFreeXDGA -extern void XFree86DGAExtensionInit(INITARGS); -extern void XFree86DGARegister(INITARGS); -#define _XF86DGA_SERVER_ -#include "xf86dgastr.h" -#endif - -#ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); -#include "dpmsstr.h" -#endif - -#ifdef FONTCACHE -extern void FontCacheExtensionInit(INITARGS); -#define _FONTCACHE_SERVER_ -#include "fontcacheP.h" -#include "fontcachstr.h" -#endif - -#ifdef TOGCUP -extern void XcupExtensionInit(INITARGS); -#define _XCUP_SERVER_ -#include "Xcupstr.h" -#endif - -#ifdef EVI -extern void EVIExtensionInit(INITARGS); -#define _XEVI_SERVER_ -#include "XEVIstr.h" -#endif +#include "modinit.h" -#ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -extern void XvRegister(INITARGS); -#include "Xv.h" -#include "XvMC.h" -#endif - -#ifdef RES -extern void ResExtensionInit(INITARGS); -#include "XResproto.h" -#endif +static MODULESETUPPROTO(extmodSetup); /* * Array describing extensions to be initialized diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c index 9593c4a40..973f54e23 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga.c +++ b/hw/xfree86/dixmods/extmod/xf86dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.22 2003/07/16 01:38:30 dawes Exp $ */ /* @@ -24,6 +24,8 @@ Copyright (c) 1995, 1996, 1999 XFree86 Inc #include "swaprep.h" #include "dgaproc.h" +#include "xf86dgaext.h" + static DISPATCH_PROC(ProcXF86DGADirectVideo); static DISPATCH_PROC(ProcXF86DGAGetVidPage); @@ -270,8 +272,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client) } int -ProcXF86DGADispatch (client) - register ClientPtr client; +ProcXF86DGADispatch(register ClientPtr client) { REQUEST(xReq); diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index c0d51b809..2556743bb 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -3,7 +3,7 @@ Written by Mark Vojkovich */ -/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.18 2003/07/16 01:38:30 dawes Exp $ */ #define NEED_REPLIES @@ -24,6 +24,7 @@ #include "xf86dgastr.h" #include "swaprep.h" #include "dgaproc.h" +#include "xf86dgaext.h" #ifdef EXTMODULE #include "xf86_ansic.h" @@ -31,6 +32,7 @@ #include <string.h> #endif +#include "modinit.h" static DISPATCH_PROC(ProcXDGADispatch); static DISPATCH_PROC(SProcXDGADispatch); @@ -51,10 +53,6 @@ static DISPATCH_PROC(ProcXDGASetClientVersion); static DISPATCH_PROC(ProcXDGAChangePixmapMode); static DISPATCH_PROC(ProcXDGACreateColormap); - -extern DISPATCH_PROC(ProcXF86DGADispatch); - - static void XDGAResetProc(ExtensionEntry *extEntry); static void DGAClientStateChange (CallbackListPtr*, pointer, pointer); @@ -78,7 +76,7 @@ typedef struct { #define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr) void -XFree86DGAExtensionInit(void) +XFree86DGAExtensionInit(INITARGS) { ExtensionEntry* extEntry; @@ -766,7 +764,7 @@ ProcXDGADispatch (ClientPtr client) #ifdef EXTMODULE void -XFree86DGARegister() +XFree86DGARegister(INITARGS) { XDGAEventBase = &DGAEventBase; } diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c index bc8e94b45..620761742 100644 --- a/hw/xfree86/dixmods/extmod/xf86misc.c +++ b/hw/xfree86/dixmods/extmod/xf86misc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.41 2003/11/17 22:20:27 dawes Exp $ */ /* * Copyright (c) 1995, 1996 The XFree86 Project, Inc @@ -54,9 +54,7 @@ typedef struct { #define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr) static void XF86MiscResetProc( -#if NeedFunctionPrototypes ExtensionEntry* /* extEntry */ -#endif ); static void @@ -84,6 +82,7 @@ static DISPATCH_PROC(ProcXF86MiscSetMouseSettings); static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState); static DISPATCH_PROC(ProcXF86MiscSetClientVersion); static DISPATCH_PROC(ProcXF86MiscGetFilePaths); +static DISPATCH_PROC(ProcXF86MiscPassMessage); #ifdef _XF86MISC_SAVER_COMPAT_ static DISPATCH_PROC(ProcXF86MiscGetSaver); static DISPATCH_PROC(ProcXF86MiscSetSaver); @@ -97,12 +96,15 @@ static DISPATCH_PROC(SProcXF86MiscSetMouseSettings); static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState); static DISPATCH_PROC(SProcXF86MiscSetClientVersion); static DISPATCH_PROC(SProcXF86MiscGetFilePaths); +static DISPATCH_PROC(SProcXF86MiscPassMessage); #ifdef _XF86MISC_SAVER_COMPAT_ static DISPATCH_PROC(SProcXF86MiscGetSaver); static DISPATCH_PROC(SProcXF86MiscSetSaver); #endif +#if 0 static unsigned char XF86MiscReqCode = 0; +#endif #ifdef DEBUG # define DEBUG_P(x) ErrorF(x"\n"); @@ -148,7 +150,9 @@ XFree86MiscExtensionInit(void) SProcXF86MiscDispatch, XF86MiscResetProc, StandardMinorOpcode))) { +#if 0 XF86MiscReqCode = (unsigned char)extEntry->base; +#endif miscErrorBase = extEntry->errorBase; } } @@ -354,14 +358,13 @@ ProcXF86MiscSetMouseSettings(client) if (xf86GetVerbosity() > 1) { ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n", - stuff->mousetype, stuff->baudrate, - stuff->samplerate, stuff->chordmiddle); - ErrorF(" em3but: %d em3tim: %d res: %d flags: %d\n", - stuff->emulate3buttons, stuff->emulate3timeout, - stuff->resolution, stuff->flags); + (int)stuff->mousetype, (int)stuff->baudrate, + (int)stuff->samplerate, stuff->chordmiddle); + ErrorF(" em3but: %d em3tim: %d res: %d flags: %ld\n", + stuff->emulate3buttons, (int)stuff->emulate3timeout, + (int)stuff->resolution, (unsigned long)stuff->flags); } - if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0) return BadAlloc; @@ -427,8 +430,8 @@ ProcXF86MiscSetKbdSettings(client) if (xf86GetVerbosity() > 1) ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n", - stuff->kbdtype, stuff->rate, - stuff->delay, stuff->servnumlock); + (int)stuff->kbdtype, (int)stuff->rate, + (int)stuff->delay, stuff->servnumlock); if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0) return BadAlloc; @@ -555,6 +558,59 @@ ProcXF86MiscGetFilePaths(client) } static int +ProcXF86MiscPassMessage(client) + register ClientPtr client; +{ + xXF86MiscPassMessageReply rep; + char *msgtype, *msgval, *retstr; + int retval, size; + register int n; + + REQUEST(xXF86MiscPassMessageReq); + + DEBUG_P("XF86MiscPassMessage"); + + REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq); + size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2; + size+= (stuff->typelen + 3) >> 2; + size+= (stuff->vallen + 3) >> 2; + if (client->req_len < size) + return BadLength; + if (stuff->typelen) { + if (!(msgtype = xalloc(stuff->typelen))) + return BadAlloc; + strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen); + } else return BadValue; + if (stuff->vallen) { + if (!(msgval = xalloc(stuff->vallen))) + return BadAlloc; + strncpy(msgval,(char*)(&stuff[1] + ((stuff->typelen + 3) & ~3)), + stuff->vallen); + } else return BadValue; + + if ((retval= MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0) + return retval; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.mesglen = (retstr? strlen(retstr): 0); + rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) + + ((rep.mesglen + 3) & ~3)) >> 2; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.mesglen, n); + } + WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep); + + if (rep.mesglen) + WriteToClient(client, rep.mesglen, (char *)retstr); + + return (client->noClientException); +} + +static int ProcXF86MiscDispatch (client) register ClientPtr client; { @@ -577,6 +633,8 @@ ProcXF86MiscDispatch (client) return ProcXF86MiscSetClientVersion(client); case X_XF86MiscGetFilePaths: return ProcXF86MiscGetFilePaths(client); + case X_XF86MiscPassMessage: + return ProcXF86MiscPassMessage(client); default: if (!xf86GetModInDevEnabled()) return miscErrorBase + XF86MiscModInDevDisabled; @@ -724,6 +782,17 @@ SProcXF86MiscGetFilePaths(client) } static int +SProcXF86MiscPassMessage(client) + ClientPtr client; +{ + register int n; + REQUEST(xXF86MiscPassMessageReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq); + return ProcXF86MiscPassMessage(client); +} + +static int SProcXF86MiscDispatch (client) register ClientPtr client; { @@ -746,6 +815,8 @@ SProcXF86MiscDispatch (client) return SProcXF86MiscSetClientVersion(client); case X_XF86MiscGetFilePaths: return SProcXF86MiscGetFilePaths(client); + case X_XF86MiscPassMessage: + return SProcXF86MiscPassMessage(client); default: if (!xf86GetModInDevEnabled()) return miscErrorBase + XF86MiscModInDevDisabled; diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h index 63db938d1..208260947 100644 --- a/hw/xfree86/dixmods/extmod/xf86miscproc.h +++ b/hw/xfree86/dixmods/extmod/xf86miscproc.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.6 2003/04/03 16:15:47 dawes Exp $ */ /* Prototypes for Pointer/Keyboard functions that the DDX must provide */ @@ -59,6 +59,8 @@ MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd); Bool MiscExtSetMouseDevice(pointer mouse, char* device); Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath, const char **logfile); +int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval, + char **retstr); #endif diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index f9882f2f1..f4751a1c7 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.54 2002/12/22 00:46:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.59 2003/11/17 22:20:27 dawes Exp $ */ /* @@ -64,9 +64,7 @@ typedef struct { #define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr) static void XF86VidModeResetProc( -#if NeedFunctionPrototypes ExtensionEntry* /* extEntry */ -#endif ); static DISPATCH_PROC(ProcXF86VidModeDispatch); @@ -112,8 +110,9 @@ static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp); static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp); static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize); +#if 0 static unsigned char XF86VidModeReqCode = 0; - +#endif /* The XF86VIDMODE_EVENTS code is far from complete */ @@ -217,7 +216,9 @@ XFree86VidModeExtensionInit(void) SProcXF86VidModeDispatch, XF86VidModeResetProc, StandardMinorOpcode))) { +#if 0 XF86VidModeReqCode = (unsigned char)extEntry->base; +#endif VidModeErrorBase = extEntry->errorBase; #ifdef XF86VIDMODE_EVENTS XF86VidModeEventBase = extEntry->eventBase; @@ -467,14 +468,14 @@ ProcXF86VidModeGetModeLine(ClientPtr client) rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); if (xf86GetVerbosity() > 1) { - ErrorF("GetModeLine - scrn: %d clock: %d\n", - stuff->screen, rep.dotclock); + ErrorF("GetModeLine - scrn: %d clock: %ld\n", + stuff->screen, (unsigned long)rep.dotclock); ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", rep.hdisplay, rep.hsyncstart, rep.hsyncend, rep.htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", rep.vdisplay, rep.vsyncstart, rep.vsyncend, - rep.vtotal, rep.flags); + rep.vtotal, (unsigned long)rep.flags); } /* @@ -675,22 +676,23 @@ ProcXF86VidModeAddModeLine(ClientPtr client) stuff->after_flags = oldstuff->after_flags; } if (xf86GetVerbosity() > 1) { - ErrorF("AddModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("AddModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); - ErrorF(" after - scrn: %d clock: %d\n", - stuff->screen, stuff->after_dotclock); + stuff->vtotal, (unsigned long)stuff->flags); + ErrorF(" after - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->after_dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->after_hdisplay, stuff->after_hsyncstart, stuff->after_hsyncend, stuff->after_htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->after_vdisplay, stuff->after_vsyncstart, - stuff->after_vsyncend, stuff->after_vtotal, stuff->after_flags); + stuff->after_vsyncend, stuff->after_vtotal, + (unsigned long)stuff->after_flags); } if (ver < 2) { @@ -742,6 +744,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client) if (mode == NULL) return BadValue; + VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend); @@ -821,14 +824,14 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("DeleteModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock, stuff->dotclock); + ErrorF("DeleteModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -840,8 +843,11 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) } if (len != stuff->privsize) { if (xf86GetVerbosity() > 1) { - ErrorF("req_len = %d, sizeof(Req) = %d, privsize = %d, len = %d, length = %d\n", - client->req_len, sizeof(xXF86VidModeDeleteModeLineReq)>>2, stuff->privsize, len, stuff->length); + ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, " + "len = %d, length = %d\n", + (unsigned long)client->req_len, + (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2, + (unsigned long)stuff->privsize, len, stuff->length); } return BadLength; } @@ -935,11 +941,11 @@ ProcXF86VidModeModModeLine(ClientPtr client) } if (xf86GetVerbosity() > 1) { ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n", - stuff->screen, stuff->hdisplay, stuff->hsyncstart, + (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -989,18 +995,23 @@ ProcXF86VidModeModModeLine(ClientPtr client) break; case MODE_HSYNC: case MODE_H_ILLEGAL: + xfree(modetmp); return VidModeErrorBase + XF86VidModeBadHTimings; case MODE_VSYNC: case MODE_V_ILLEGAL: + xfree(modetmp); return VidModeErrorBase + XF86VidModeBadVTimings; default: + xfree(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } /* Check that the driver is happy with the mode */ if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) { + xfree(modetmp); return VidModeErrorBase + XF86VidModeModeUnsuitable; } + xfree(modetmp); VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay); VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart); @@ -1029,7 +1040,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; xXF86VidModeValidateModeLineReply rep; - pointer mode, modetmp; + pointer mode, modetmp = NULL; int len, status, dotClock; int ver; @@ -1055,14 +1066,14 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("ValidateModeLine - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("ValidateModeLine - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { @@ -1119,6 +1130,9 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) status = VidModeCheckModeForDriver(stuff->screen, modetmp); status_reply: + if(modetmp) + xfree(modetmp); + rep.type = X_Reply; rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply) - SIZEOF(xGenericReply)) >> 2; @@ -1186,14 +1200,14 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) stuff->privsize = oldstuff->privsize; } if (xf86GetVerbosity() > 1) { - ErrorF("SwitchToMode - scrn: %d clock: %d\n", - stuff->screen, stuff->dotclock); + ErrorF("SwitchToMode - scrn: %d clock: %ld\n", + (int)stuff->screen, (unsigned long)stuff->dotclock); ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); - ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n", + ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n", stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, - stuff->vtotal, stuff->flags); + stuff->vtotal, (unsigned long)stuff->flags); } if (ver < 2) { diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c index e44c94984..ceb5485c0 100644 --- a/hw/xfree86/dixmods/ftmodule.c +++ b/hw/xfree86/dixmods/ftmodule.c @@ -23,7 +23,7 @@ * dealings in this Software without prior written authorization from the * XFree86 Project. */ -/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.14 2003/02/13 03:01:45 dawes Exp $ */ +/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.18 2003/11/02 04:30:57 dawes Exp $ */ #include "misc.h" @@ -40,11 +40,11 @@ static MODULESETUPPROTO(freetypeSetup); static XF86ModuleVersionInfo VersRec = { "freetype", - MODULEVENDORSTRING, + MODULEVENDORSTRING " & the After X-TT Project", MODINFOSTRING1, MODINFOSTRING2, XF86_VERSION_CURRENT, - 2, 0, 2, + 2, 1, 0, ABI_CLASS_FONT, /* Font module */ ABI_FONT_VERSION, MOD_CLASS_FONT, diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c index 513bb7647..f449d55ec 100644 --- a/hw/xfree86/dixmods/glxmodule.c +++ b/hw/xfree86/dixmods/glxmodule.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.12 2003/09/28 20:15:40 alanh Exp $ */ /* * Authors: @@ -104,6 +104,7 @@ static const char *glcoreSymbols[] = { "__glLightiv_size", "__glMaterialfv_size", "__glMaterialiv_size", + "__glPointParameterfvARB_size", "__glReadPixels_size", "__glTexEnvfv_size", "__glTexEnviv_size", @@ -146,6 +147,7 @@ static const char *glcoreSymbols[] = { "__glXDestroyContext", "__glXDestroyGLXPixmap", "__glXDispSwap_Accum", + "__glXDispSwap_ActiveStencilFaceEXT", "__glXDispSwap_ActiveTextureARB", "__glXDispSwap_AlphaFunc", "__glXDispSwap_AreTexturesResident", @@ -357,6 +359,8 @@ static const char *glcoreSymbols[] = { "__glXDispSwap_PixelTransferf", "__glXDispSwap_PixelTransferi", "__glXDispSwap_PixelZoom", + "__glXDispSwap_PointParameterfARB", + "__glXDispSwap_PointParameterfvARB", "__glXDispSwap_PointSize", "__glXDispSwap_PolygonMode", "__glXDispSwap_PolygonOffset", @@ -451,7 +455,9 @@ static const char *glcoreSymbols[] = { "__glXDispSwap_Vertex4iv", "__glXDispSwap_Vertex4sv", "__glXDispSwap_Viewport", + "__glXDispSwap_WindowPos3fARB", "__glXDisp_Accum", + "__glXDisp_ActiveStencilFaceEXT", "__glXDisp_ActiveTextureARB", "__glXDisp_AlphaFunc", "__glXDisp_AreTexturesResident", @@ -663,6 +669,8 @@ static const char *glcoreSymbols[] = { "__glXDisp_PixelTransferf", "__glXDisp_PixelTransferi", "__glXDisp_PixelZoom", + "__glXDisp_PointParameterfARB", + "__glXDisp_PointParameterfvARB", "__glXDisp_PointSize", "__glXDisp_PolygonMode", "__glXDisp_PolygonOffset", @@ -757,6 +765,7 @@ static const char *glcoreSymbols[] = { "__glXDisp_Vertex4iv", "__glXDisp_Vertex4sv", "__glXDisp_Viewport", + "__glXDisp_WindowPos3fARB", "__glXDrawArraysSize", "__glXDrawPixelsReqSize", "__glXDrawableRes", @@ -886,6 +895,7 @@ static const char *glcoreSymbols[] = { "__glXWaitX", "__glXcombine_strings", "glAccum", + "glActiveStencilFaceEXT", "glActiveTextureARB", "glAlphaFunc", "glAreTexturesResident", @@ -1102,6 +1112,8 @@ static const char *glcoreSymbols[] = { "glPixelTransferf", "glPixelTransferi", "glPixelZoom", + "glPointParameterfARB", + "glPointParameterfvARB", "glPointSize", "glPolygonMode", "glPolygonOffset", @@ -1198,6 +1210,7 @@ static const char *glcoreSymbols[] = { "glVertex4sv", "glVertexPointer", "glViewport", + "glWindowPos3fARB", "glxSwapQueryExtensionsStringReply", "glxSwapQueryServerStringReply", NULL diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI index 66a5a5ff8..e663f2928 100644 --- a/hw/xfree86/doc/README.DRI +++ b/hw/xfree86/doc/README.DRI @@ -1251,7 +1251,7 @@ demo programs is available from http://dri.sourceforge.net/res.phtml o In the future there may be IHV and Linux vendor support resources for the DRI. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 2003/02/17 03:57:29 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.21 2003/02/17 04:04:07 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.22 2003/07/15 02:28:28 dawes Exp $ diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts index fb1c1f5fb..7563c1c56 100644 --- a/hw/xfree86/doc/README.fonts +++ b/hw/xfree86/doc/README.fonts @@ -2,7 +2,7 @@ Juliusz Chroboczek, <jch@xfree86.org> - 17 January 2003 + 17 November 2003 1. Introduction @@ -16,8 +16,8 @@ this document for background information. 1.1 Two font systems -XFree86 includes two font systems: the core X11 fonts system, which is pre- -sent in all implementations of X11, and the Xft fonts system, which is not +XFree86 includes two font systems: the core X11 fonts system, which is +present in all implementations of X11, and the Xft fonts system, which is not currently distributed with implementations of X11 that are not based on XFree86 but will hopefully be included by them in the future @@ -596,7 +596,7 @@ Please note: the X-TrueType (X-TT) backend does not use the fontenc layer, but instead uses its own method for font reencoding. If you are only inter- ested in X-TT you may want to skip to Using Symbol Fonts (section 4.1.5, page 1), as the intervening information does not apply to X-TT. X-TT itself is -described in more detail in X-TrueType (section 4.2.3, page 1). +described in more detail in X-TrueType (section 4.2.2, page 1). In the fontenc layer, an encoding is defined by a name (such as iso8859-1), possibly a number of aliases (alternate names), and an ordered collection of @@ -926,75 +926,111 @@ more precisely described in the mkfontdir(1) manual page. 4.2 Additional notes about scalable core fonts -The FreeType backend (module `freetype', formerly known as xfsft) is able to -deal with both TrueType and Type 1 fonts. This puts it in conflict with the -X-TT and Type 1 backends respectively. +The FreeType (libfreetype-xtt2) backend (module `freetype', formerly known as +xfsft) is able to deal with both TrueType and Type 1 fonts. This puts it in +conflict with the X-TT and Type 1 backends respectively. If both the FreeType and the Type 1 backends are loaded, the FreeType backend will be used for Type 1 fonts. If both the FreeType and X-TT backends are loaded, X-TT will be used for TrueType fonts. -4.2.1 Delayed glyph rasterisation +4.2.1 About the FreeType backend -Both FreeType and X-TT delay glyph rasterisation up to the time at which a -glyph is first used. For this reason, they only provide an approximate value -for the ``average width'' font property. +The FreeType (libfreetype-xtt2) backend (formerly xfsft) is a backend based +on version 2 of the FreeType library (see the FreeType web site +<URL:http://www.freetype.org/>) and has the X-TT functionalities for CJKV +support provided by the After X-TT Project (see the After X-TT Project web +site <URL:http://x-tt.sourceforge.jp/>). The FreeType module has support for +the ``fontenc'' style of internationalisation (see The fontenc layer (section +4.1.1, page 1)). This backend supports TrueType font files (`*.ttf'), Open- +Type font files (`*.otf'), TrueType Collections (`*.ttc'), OpenType Collec- +tions (`*.otc') and Type 1 font files (`*.pfa' and `*.pfb'). -Both backends also support an optimisation for character-cell fonts (fonts -with all glyph metrics equal, or terminal fonts). A font with an XLFD speci- -fying a character-cell spacing `c', as in +In order to access the faces in a TrueType Collection file, the face number +must be specified in the fonts.dir file before the filename, within a pair of +colons, or by setting the 'fn' TTCap option. For example, - -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 + :1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0 -will not rasterise glyphs at metrics computation time, but instead trust the -font really to be a character-cell font. You are encouraged to make use of -this optimisation when useful, but be warned that not all monospaced fonts -are character-cell fonts. +refers to face 1 in the `mincho.ttc' TrueType Collection file. -4.2.2 About the FreeType backend +The new FreeType backend supports the extended `fonts.dir' syntax introduced +by X-TrueType with a number of options, collectively known as `TTCap'. A +`TTCap' entry follows the general syntax -The FreeType backend (formerly xfsft) is a backend based on version 2 of the -FreeType library (see the FreeType web site <URL:http://www.freetype.org/>) -and has support for the ``fontenc'' style of internationalisation (see The -fontenc layer (section 4.1.1, page 1)). This backend supports TrueType font -files (`*.ttf'), OpenType font files (`*.otf'), TrueType Collections -(`*.ttc'), OpenType Collections (`*.otc') and Type 1 font files (`*.pfa' and -`*.pfb'). + option=value: -In order to access the faces in a TrueType Collection file, the face number -must be specified in the fonts.dir file before the filename within colons. -For example, +and should be specified before the filename. The new FreeType almost per- +fectly supports TTCap options that are compatible with X-TT 1.4. The Auto- +matic Italic (`ai'), Double Strike (`ds') and Bounding box Width (`bw') +options are indispensable in CJKV. For example, - :2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 + mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 + ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0 + ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0 + ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0 + bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0 + bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0 + bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0 + bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0 -refers to face 2 in the `mincho.ttc' TrueType Collection file. +setup the complete combination of jisx0208 and jisx0201 using mincho.ttc +only. More information on the TTCap syntax is found on the After X-TT +Project page <URL:http://x-tt.sourceforge.jp/>. The FreeType backend uses the fontenc layer in order to support recoding of fonts; this was described in The fontenc layer (section 4.1.1, page 1) and especially FreeType-specific notes about fontenc (section 4.1.2.1, page 1) earlier in this document. -4.2.3 About the X-TrueType TrueType backend +4.2.2 About the X-TrueType TrueType backend The `X-TrueType' backend is a backend based on version 1 of the FreeType library. X-TrueType doesn't use the `fontenc' layer for managing font encod- -ings, but instead uses its own database of encodings. - -X-TrueType extends the `fonts.dir' syntax with a number of options, collec- -tively known as `TTCap'. A `TTCap' entry follows the general syntax +ings, but instead uses its own database of encodings. Since the functionali- +ties for CJKV support introduced by X-TT have been merged into the new +FreeType backend, the X-TT backend will be removed from XFree86's tree near +the future. Therefore, the use of FreeType backend is preferred over the X- +TT backend. General information on X-TrueType may be found at ." + +4.2.3 Delayed glyph rasterisation + +When loading a large character set, the old FreeType delayed glyph rasterisa- +tion until the time at which the glyph was first used. The new FreeType +(libfreetype-xtt2) has an improved `very lazy' metric calculation method to +speed up the process when loading TrueType or OpenType fonts. Although the +X-TT module also has this method, the "vl=y" TTCap option must be set if you +want to use it. This is the default method for FreeType when it loads multi- +byte fonts. Even if you use a unicode font which has tens of thousands of +glyphs, this delay will not be worrisome as long as you use the new FreeType +backend -- its `very lazy' method is super-fast. + +The maximum error of bitmap position using `very lazy' method is 1 pixel, and +is the same as that of a character-cell spacing. When the X-TT backend is +used with the `vl=y' option, a chipped bitmap is displayed with certain +fonts. However, the new FreeType backend has minimal problem with this, +since it corrects left- and right-side bearings using `italicAngle' in the +TrueType/OpenType post table, and does automatic correction of bitmap posi- +tions when rasterisation so that chipped bitmaps are not displayed. Never- +theless if you don't want to use the `very lazy' method when using multi- +bytes fonts, set `vl=n' in the TTCap option to disable it: + + vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1 + +Of course, both backends also support an optimisation for character-cell +fonts (fonts with all glyph metrics equal, or terminal fonts). A font with +an XLFD specifying a character-cell spacing `c', as in - :option=value: - -and should be specified before the filename. + -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 -The most useful TTCap option is used to specify the face number to use with -TTCs; this is the `fn' TTCap option. For example, face 2 of font file `min- -cho.ttc' is specified using: +or - :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 + fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0 -More information on the TTCap syntax, and on X-TrueType in general, may be -found on the X-TrueType home page <URL:http://x-tt.dsl.gr.jp/>. +will not compute the metric for each glyph, but instead trust the font to be +a character-cell font. You are encouraged to make use of this optimisation +when useful, but be warned that not all monospaced fonts are character-cell +fonts. 5. Appendix: background and terminology @@ -1126,8 +1162,8 @@ The author's software pages <URL:http://www.pps.jussieu.fr/~jch/software/> might or might not contain related scribbles and development versions of software. -The documentation of X-TrueType is available from the X-TrueType home page -<URL:http://x-tt.dsl.gr.jp/>. +The documentation of X-TrueType is available from the After X-TT Project page +<URL:http://x-tt.sourceforge.jp/>. A number of East-Asian CIDFonts are available from O'Reilly's FTP site <URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/>. @@ -1140,7 +1176,7 @@ The IANA RFC documents, available from a number of sites throughout the world, often provide interesting information about character set issues; see for example RFC 373. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.20 2003/01/20 03:43:07 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.22 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.22 2003/01/20 04:10:01 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.26 2003/11/19 01:44:58 dawes Exp $ diff --git a/hw/xfree86/doc/changelogs/CHANGELOG b/hw/xfree86/doc/changelogs/CHANGELOG index 732330eec..78f7f2e84 100644 --- a/hw/xfree86/doc/changelogs/CHANGELOG +++ b/hw/xfree86/doc/changelogs/CHANGELOG @@ -1,46 +1,1696 @@ -XFree86 4.3.0.2 (xx May 2003) +XFree86 4.3.99.17 (xx November 2003) + +XFree86 4.3.99.16 (20 November 2003) + 609. Fix 'constype' for modern framebuffers on Solaris (Bugzilla #890, + Alan Coopersmith). + 608. Fix a thread deadlock problem in libXp (Bugzilla #887, Roland Mainz). + 607. Fix event buffer overrun in the wacom driver (Bugzilla #882, David Dawes, + reported by Jonathan Hough). + 606. Add unmapping code to DGAUnmapPhysical() for most systems that use + mmap(). Without this lots of map/unmap calls would result in running + out of address space and/or file handles (Bugzilla #880, David Dawes, + reported by Eckhard Neber). + 605. Restore the Windows keycodes in the 'xfree86' XKB keycodes map, + and add the Solaris-compatible tokens as aliases (reported by + Panagiotis Papadakos). + 604. Fix some problems building against external installations of + freetype2 (David Dawes). + 603. Add font bounds checking to the X server side of the font server + interface (Chisato Yamauchi, David Dawes). + 602. Fix ForcePCIMode option to work as advertised in Radeon driver + (Bugzilla #850, Kevin Martin). + 601. Update the fonts document for the FreeType backend changes + (Chisato Yamauchi, Reiko Nakajima, After X-TT Project). + 600. Don't allow the lack of "SUPERSCRIPT TWO" to prevent Adobe Standard + Cyrillic encoded fonts from being accepted as "koi8" capable + (Michail Vidiassov). + 599. Xvfb didn't have enough pixmap formats for Render (David Dawes). + 598. Fix the processing of xdm/config/Xres.cpp, which is broken with + gcc 3.3.2 (reported by Chisato Yamauchi). + 597. Fix two problems with Xvfb: + - Too much memory was allocated because of a confusion between + bytes and pixels. + - The XWD header was corrupted at server reset. + (David Dawes). + 596. Fix several problems xwud has displaying TrueColor dumps (extreme + slowness displaying on TrueColor visuals, and incorrectness displaying + on DirectColor visuals) (David Dawes). + 595. Rank TrueColor above DirectColor in xwud. This avoids colourmap flashing + by default when running on a server with both visuals available + (David Dawes). + 594. Build with Xplugin support by default on Panther (Torrey T. Lyons). + 593. On Mac OS X, allow "X -version" to work without connecting to + CoreGraphics (Torrey T. Lyons, reported by Benjamin Reed). + 592. Don't optimize away window restacks in rootless mode (John Harper). + 591. Fix problems preventing mesa-based GLX from working with Xnest, even + though it is linked in and advertised (David Dawes). + 590. Fix typing in XDarwin Preference panel going to X11 (Torrey T. Lyons). + 589. Fix rootless build after REGION_* macro rework (Torrey T. Lyons). + 588. Fix broken GLX indirect rendering (David Dawes). + 587. Fix the XKB definitions for the "Hiragana_Katakana" key, and fix + some incorrect definitions in symbols/jp (Chisato Yamauchi). + 586. Change the mkfontdir wrapper script to invoke mkfontscale via its full + path name (Chisato Yamauchi). + 585. Modify xf86config and xf86cfg to enable loading the "freetype" module + (Chisato Yamauchi). + 584. Wrap ucs2any with ProgramTargetName in dependencies, as needed for + OS/2, and note that OS/2 doesn't have basename(3) (Bugzilla #871, + Frank Giessler). + 583. Fix atimisc's decoding of the mode on input for large panels + (Marc La France). + 582. Fix SEGV when ATIPreinit() fails (Marc La France). + 581. In rootless XDarwin, don't send ButtonPress events when clicking in + non-X11 windows (Torrey T. Lyons, John Harper). + 580. AppleWM compatibility fixes: + - Disable XDarwin handling cut and paste if AppleWM-aware cut and + paste manager is available. + - Set _NATIVE_SCREEN_ORIGIN property on root window. + (John Harper, Torrey T. Lyons). + 579. Change ProjectRoot from /XFree86 to /usr/X11R6 on OS/2 (Bugzilla #865, + Frank Giessler). + 578. Fix building of new Mesa on OS/2 (Bugzilla #865, Frank Giessler). + 577. Change the way how libraries with long file names are handed on + OS/2 (Bugzilla #865, Frank Giessler). + 576. Force screen blanking when entering DPMS states (Bugzilla #866, + David Dawes, reported by Ed Fardos). + 575. XDarwin fixes/cleanups: + - Handle X11 executables opened from the Finder. + - Use xcodebuild instead of pbxbuild on Panther. + - Clean up Darwin specific imake #defines. + - Fix compiler warnings on Panther. + (Torrey T. Lyons). + 574. A workaround for platforms (like *BSD) where IPv6 sockets don't accept + IPv4 connections: disable IPv6 XDMCP code by default. This allows IPv4 + XDMCP to work on such platforms (David Dawes). + 573. Rework REGION_* macros to eliminate NEED_SCREEN_REGIONS build failures + (Marc La France). + 572. Fix an old bug in the X server and xfs related to usage of + c->savedName (Bugzilla #818, Owen Taylor). + 571. Fix FontFileListOneFontWithInfo() so that it handles aliases in the + same was as FontFileOpenFont() (Bugzilla #818, Owen Taylor). + 570. Respect USE_SSE_ASM for the .S files in the r200 and radeon 3D drivers. + This should fix the reported OpenBSD build problem (David Dawes). + 569. Some missing FreeBSD AMD64/Sparc64 patches (Bugzilla #786, Eric Anholt). + 568. The call to xf86RandRSetMode() from xf86RandRCreateScreenResources() + doesn't appear to be necessary. Removing it restores the documented + ViewPort behaviour when RandR is enabled (David Dawes). + 567. Make the vesa driver blank the screen during initialisation for + cosmetic reasons (David Dawes). + 566. Make the cirrus driver blank the screen during initialisation for + cosmetic reaons (most other drivers do this) (Bugzilla #781, + Nicholas Miell). + 565. The vesa driver wasn't setting the viewport correctly either at + ScreenInit or EnterVT (David Dawes). + 564. Fix the viewport initialisation. The ViewPort parameters from the + XF86Config file were being ignored, and the default was a 0,0 viewport + rather than centred on the virtual screen as documented. When RandR + is enabled, it undoes all of this though... (David Dawes). + 563. Fix an off-by-one bug in libXcursor that can result in segfaulting + applications (David Dawes, reported by Agustin Gianni). + 562. Fix RandR initialization problem when default screen resolution is + different from the virtual resolution. (Bugzilla #853, Bob Paauwe). + 561. Fix an Xv problem with the via driver where updating a portion of the + overlay causes excessive CPU usage (Bugzilla #821, Neil Terry). + 560. Fix an Xnest hang on OS/2 (Bugzilla #852, Frank Giessler). + 559. OS/2 update for the recent move to building most libraries shared, + and add some functions to the export lists for freetype and Xt for + compatibility with older applications (Bugzilla #852, Frank Giessler). + 558. Fix the installation location of the XRes and Xss manpage aliases + (Bugzilla #848, ISHIKAWA Mutsumi). + 557. Include backwards compatibility API for renamed stream functions in + Freetype2 library (Torrey T. Lyons). + 556. Fix acecad driver to call xf86DeleteInput() (Bugzilla #855, S. Voltz). + 555. Register to handle X11 executables on Panther (John Harper). + 554. Fixes for GLX on Mac OS X: + - Make libGL not export libGLU symbols. + - Fix uninitialized mutex for threaded direct GLX. + (John Harper). + 553. Fix "Non-aligned pointer being freed" warnings on XDarwin startup + (Torrey T. Lyons). + 552. Miscellaneous fixes for Panther: + - Fix spurious #pragma getting inserted by cpp (Martin Costabel). + - Fix startup failure due to bad keymapping file (Torrey T. Lyons). + - Fix startup warning about missing semicolons (Torrey T. Lyons). + 551. Mesa X86 asm build fix for Solaris (David Dawes). + 550. Fix building libOSMesa on Darwin (Torrey T. Lyons). + 549. Get backlight working on Apple's GeForce4 powerbooks (Guido Guenther). + +XFree86 4.3.99.15 ( 1 November 2003) + 548. Update libfreetype-xtt2 to version 1.1: + - Improved the very lazy method. To prevent displaying chipped bitmap + when having italic angle, the lsb and rsb are adjusted by using + italicAngle in post table. + - Added automatic correction of bitmap position for preventing + displaying chipped bitmap when using charcell or very lazy method. + - Set DEFAULT_VERY_LAZY macro. If post table is available, the very + lazy method is used as default when handling multi-bytes fonts. + - Added additional glyphs(0x2d21-0x2d7c) to jisx0208.1990-0.enc. + (Chisato Yamauchi, After X-TT Project). + 547. Set the pixel clock limit above which hzoom is enabled for the video + overlay for G450 and G550 cards to 234MHz. This fixes a problem with + the Xv support having half horizontal resolution (Michel Lespinasse). + 546. Add support on Mac OS X for building keymap using Carbon Keyboard + Layout API (John Harper). + 545. Map holes in kdrive VESA driver (#5436, Juliusz Chroboczek). + 544. Add option to Radeon driver to allow minimum dot clock to be + overridden (Bugzilla #831, Nils Philippsen). + 543. Add shared libraries run-path information to pkg-config datafiles + provided for some libraries. (Bugzilla #832, Frederick Bruckman, + Matthieu Herrb). + 542. Fix buglets detected by SGI compiler in neomagic, sis and tseng drivers + (Marc La France). + 541. Fix I/O alignment in mga and via drivers (Marc La France). + 540. Improve xkbcomp's key types auto-recognition (Ivan Pascal). + 539. Add support for multi-threaded direct GLX rendering with AppleDRI + (John Harper). + 538. Fix a problem in Xlib that was cause by the ANSI prototype cleanups + (Bugzilla #839, Owen Taylor). + 537. Limit the rate of duplicate audit messages in the X server. (Matthieu + Herrb, David Dawes). + 536. Fix ChipValidMode() return type (Marc La France). + 535. Fix for AGP8x support on HP zx1-based systems (Marc La France). + 534. Workaround for mysterious segfault related to mkfontscale's use of + memcmp() (Marc La France). + 533. Support the new Linear allocator in the trident driver and make the + hardware cursor use it. Xv automagically uses it. (Alan Hourihane). + 532. Fix acecad input driver build and re-enable it + (Bugzilla #816, Alan Hourihane). + 531. Fix DRM_CAS on ia64 as used by the DRI (Bugzilla #778, John Dennis). + 530. Call OsCleanup() at the end of each server generation, and add an + argument to indicate when the server is terminating. This allows + misc end-of-generation cleanups to be added to OsCleanup() (David Dawes). + 529. Explicitly free the DPMS and ScreenSaver timer resources at the end + of each server generation (David Dawes). + 528. Cygwin configuration updates and install script updates (Bugzilla #799, + 805, Harold L Hunt II, Alexander Gottwald) + 527. Build shared libraries for Xt and Xaw on Cygwin. (Bugzilla #804, + Ralf Habacker). + 526. Xterm patches #180, 181 (Thomas Dickey). + 525. Update libfreetype-xtt2 to version 1.0d: + - Fixed server crash caused by loading fonts for which encoding file + does not exist. + - Some fixes for minor bugs when handling errors. + - Some minor cleanups. + (Chisato Yamauchi, After X-TT Project). + 524. Export strl{cat,cpy} functions to the server modules and provide + an implementation for the systems that don't have them. (Matthieu + Herrb). + 523. Fixes and updates for XKB keyboard maps: + - Update Serbian layouts (Bugzilla #92, Danilo Segan). + - Add 'MS Windows like' US International variant for 'us' keymap (Ivan + Pascal). + - Change CapsLock default behavior to 'Caps acts as locking Shift, + Shift cancels Caps'. Add new type for four-level keys (Ivan Pascal). + 522. Fix generic rootless code bug which tests CopyWindow instead of CopyBytes + (Kensuke Matsuzaki). + 521. Update libfreetype-xtt2 to version 1.0c. This consists of some minor + fixes and cleanups (Chisato Yamauchi, After X-TT Project). + 520. Add accelerated rootless drawing support and fix bug in rootless + FillSpans (Torrey T. Lyons and John Harper). + 519. Update SiS driver: + - Merge 661/741/760 support + - Clean up + - Fix Xv problems after swsuspend + - Fix LCD-via-CRT1 on various machines + 518. Prevent some compilers from optimising out Mesa's X11 error interface + (Marc La France). + 517. Add rules to generate post-processed and assembler source from C++ files + (Marc La France). + 516. Change `make World` so that well it interrupts itself to build a utility + (makedepend, pswrap, etc), it only builds that utility. Some things were + being built too early (Marc La France). + 515. When the i830 driver's checks for sufficient memory for tiled mode + fail, don't later try to allocate with tiling enabled (David Dawes). + 514. Enable I845G_VBE_WORKAROUND in the i830 driver for all platforms, since + this reportedly fixes VT switching problems on hardware other than the + 845G. + 513. Updated README.SiS (Thomas Winischhofer). + 512. Add the After X-TT Project's libfreetype-xtt2 1.0b fixes and + enhancements to the "freetype" module (Chisato Yamauchi, + After X-TT Project). This should make it possible to deprecate the + "xtt" module in a future release. Fixes and enhancements include: + - Fixed crash caused by using fonts which have OS2 sfnt table. + - Corrected metrics calculation error. Although the original code uses + size->metrics, the FT_Size_Metrics does not have exact values when + handling the outline. So the codes for metrics calculation were + drastically rewritten. + - Fixed some problems with FreeTypeRasteriseGlyph(): + + Made "only metrics is required" distinct from "both metrics and + rasterised bitmap are required" to improve performance when + loading large charset. + + Fixed the erroneous usage of freetype2 API. To get valid metrics, + FT_Outline_Get_BBox() or FT_Outline_Get_CBox() is used for outline. + + Took the strange code for raster copying and rewrote it. + - Fixed UNDERLINE_POSITION so that it counts downwards. + - Fixed a risky calculational method for info->maxbound and + info->minbound when spacing is not charcell. All glyphs' metrics are + calculated and valid info->maxbounds and info->minbounds are set + without cutting any corners. + - Added TTCap option "fn","ai","ds","fs","vl","cr","bw","eb","hi", + "fc" and "fm" which are compatible with X-TT 1.4. + - Supported character width for vertical layouts. + 511. Encoding file updates (After X-TT Project): + - Removed jisx0208.1983-0.enc and added 'ALIAS jisx0208.1983-0' to + jisx0208.1990-0.enc. + - Added Windows ucs2 cmap(3,1) to jisx0208.1990-0.enc and + jisx0201.1976-0.enc. + - Added files for GB18030-0 and GB18030-1 (James Su). + 510. Update X-TrueType (X-TT) to version 1.4.2 (Chisato Yamauchi, + After X-TT Project): + - Fixed several bugs of make_up_italic_bitmap() function. + - Changed the order of priority of mapIDRelations in JISX0208 and + JISX0201 code converter. The windows ucs2 is given the highest + priority for kochi-substitute Japanese fonts. + - Fixed code relation in cc_jisx0208_to_std_ucs2() function + (not 0x215d -> 0x00b1 but 0x215d -> 0x2212) + - Added minor improvements. + 509. Fixes and updates for HTML and PDF versions of spec docs for + installation and inclusion in the online docs (David Dawes). + 508. Implement SharedLibtoolLibraryTarget, etc for bsdLib/ELF, including + creating links for older but compatible revisions of such + libraries (David Dawes). + 507. Allow a simple form of option name aliasing for options handled + via OptionInfoRec (David Dawes). + 506. Add optimized code for RENDER with rootless XDarwin (John Harper, + Torrey T. Lyons). + 505. Declare LoadPalette, SetOverscan and DPMSSet as public functions through + the XFree86's ScrnInfoRec, so these functions can be wrapped. + (Alan Hourihane). + 504. XDarwin improvements: + - Add complete server side support for AppleWM with xpr. + - Allow Aqua and X11 windows to interleave when AppleWM-aware window + manager is present. + - Fix hang on server reset. + (Torrey T. Lyons, John Harper). + 503. Fix double-free at server regeneration in the screensave/DPMS timer + code (David Dawes). + 502. Build most libraries as shared by default. (Matthieu Herrb, + David Dawes). + 501. Add missing symbol definition files for libraries (Matthieu Herrb). + 500. Add 'inet' keymaps for two Logitec keyboard models (Bugzilla #762, + Eric Mountain; Bugzilla #766, Chris Hornbaker) and cleanup Logitec + keymaps (Ivan Pascal). + 499. Add missing SetScreenSaverTimer() to ProcSetScreenSaver (Ivan Pascal). + 498. Fix building on Mac OS X after DRI merge (Torrey T. Lyons). + +XFree86 4.3.99.14 (10 October 2003) + 497. Add an xf86InitFBManagerLinear() function and implement the Linear + allocation routines. These still fallback to XY area allocation if + no (or the lack of) linear space is available. It assumes the driver + has already called one of the init routines to the FBManager for Areas + before this new setup can be used (Alan Hourihane). + 496. Added USB keyboard support for Solaris/x86 platform (Bugzilla #352, + Daniel Rock). + 495. i830/i810 driver: + * Added Christian Ziez's code to tweak BIOS image to convince chipset of + resized video RAM. + * Fixed viewport/video overlay window alignment issues. + * Fixed calculation of video overlay memory size. + * Fixed video overlay on TV out (Bugzilla #213). (Egbert Eich). + 494. Fixed mode setting in trident driver: use mode passed in function + argument, not value in currentMode (Bugzilla #197, Egbert Eich). + 493. Added delay when writing to Glint PM2 ramdac to avoid lockups + (Egbert Eich). + 492. Fixed bug in Glint Bresenham line fallback code that caused line be drawn + beyond framebuffer boundaries (Bugzilla #624, Egbert Eich). + 490. Force sane pallette when entering DGA mode in Matrox driver + (Egbert Eich). + 489. ATI Rage128: Wait with modifying FP video mode according to BIOS values + until final call of ValidMode() to prevent modes from being rejected + (Bugzilla #661, Egbert Eich). + 488. Some Savage BIOSes turn on clock doubling on non-doubled modes. + Added code that catches and fixes this situation (Egbert Eich). + 487. Tdfx driver: Fixed order of initialization/deinitialization in + ScreenInit()/ CloseScreen(). + Fixed texture video support, removed artefacts in last line of overlay + video support (Bugzilla #299). (Egbert Eich). + 486. Add "automatic configuration" support for the XFree86 server, allowing + it to be started in a useful way without an XF86Config file. + - Add support to the config file parser for processing internally + supplied configuration data. + - Modify the algorithm for finding core input devices to maximise the + likelihood that they will be found. + - Add a FindDevice function to the OSMouse interface, allowing + an OS-specific function to be called to find the mouse device when + none is specified in the configuration. Implementations included for + Linux and FreeBSD. + - Add a GuessProtocol function to the OSMouse interface, allowing + an OS-specific function to be called as a fallback when the mouse + protocol can't otherwise be detected. Implementation included for + Linux. + - Bump the OSMouse interface version to 1.1 with the addition of the + above two functions. + - An interface for calling an external utility "getconfig" to generate + some configuration data. Implementation of getconfig included. + - Generate a default internal configuration, autodetecting as much + as possible, with reasonable fallbacks. + - Recognise "DefaultDepth" and "DefaultFbbpp" options in the Device + section. + - Add a "TargetRefreshRate" option to help prevent modes with too + high a resolution (and poor refresh rate) being used as the default. + - Use DDC-probed mode timings to estimate the monitor parameters when + the DDC-probed information doesn't include a DS_RANGES property. + This should improve the reliability of monitor auto-detection. + (David Dawes, X-Oz Technologies). + 485. Add functions for checking option values without marking them as "used" + (David Dawes). + 484. Add missing xf86ReplaceRealOption() function (David Dawes). + 483. Added support for Siliconmotion Cougar3DR chip (Bugzilla #754, + Chris Edgington). + 482. Cygwin: + * Added another German keyboard layout. + * Added Japanese keyboard layout to the list of defaults as jp. + * Added a new default keyboard layout for Portuguese (Brazil, ABNT2). + * Print the layout number in hexadecimal. + * Display the argument to the -query option in the window title. + (Bugzilla #763, Alexander Gottwald) + 481. Add processing for WM_WINDOWPOSCHANGED to cause window to repaint when + using TweakUI's focus-follows-mouse behavior. (Bugzilla #763, + Harold L Hunt II) + 480. Added runtime detection of SHM support by checking the return value of + shmget to the SHM and xf86BIGFONT extension to support SHM on Cygwin + (Bugzilla #764, Harold L Hunt II). + 479. Adding O_BINARY flag when opening an xkm file if this flag is defined + (Bugzilla #768, Alexander Gottwald). + 478. Radeon driver fixes (Hui Yu@ATI) + - 9200 DVI fix and TMDS_PLL initialization for all chips + - New chips support (9800XT/SE, 9600XT/SE, M11, T2/X2 etc.) + - Cleanup unused/secondary chip ids + - Autodetect PCI cards + - Add BusType to override PCI card autodetect + - Add display bandwidth calculation routine to fix flickering/tearing + display problem + - Workaround for corrupted BIOS image causing incorrect panel size + - Fix the LCD table reading loop + - Various small changes (including improving DDC reliability and + CRTC_MORE_CNTL initialization) + 477. Fix XAA Color8x8 cache bug: + Pattern was expanded from source instead of destination + (Thomas Winischhofer) + 476. Fixes and updates for XKB keyboard maps: + - Add 'United Kingdom w/deadkeys' gb(intl) keymap (Bugzilla #744, + Phil Jones). + - Add multi_layout compliant 'us_intl' keymap (Ivan Pascal). + - Fix 'macintosh' geometry file (Bugzilla #753, Simon Vallet). + 475. APM driver: + . improved clock parameter calculation. + . Fixed order of initialization of cursor. + . Fixed restauration of graphical text mode. + . Added YUY2 video format. + . Corrected accel framebuffer pitches and max screen height + (Bugzilla #528, Egbert Eich). + 474. Moved DisableMMIO() out of the unmap() function, added call to + EnableMMIO() to EnterVT() to work around lockup problems when + switching between two Xserver (Bugzilla #748, Egbert Eich). + 473. Fixed problem with text widget in Xaw when widget has a different + depth than the default visual (Bugzilla #745, Wolfram Gloger). + 472. Fixed Sig11 when calling X -query with no ipv6 support in kernel + (Bugzilla #737, Egbert Eich). + 471. Added support for Sparc64 and AMD64 on FreeBSD. + This patch also disables warnings from system headers, fixes some elf + relocations also relevant for other platforms and disables translation of + KEY_SysReqest and KEY_Break on sparc64. (Bugzilla #739, Eric Anholt). + 470. Switched VIA video driver to fillkey helper function (Bugzilla #525, + Alan Cox). + 469. Fixed CRT modes > FP panel size for siliconmotion (Bugzilla #727, + Hugues Fournier). + 468. Fixed xedit coredumps: update counter of free objects when getting an + object from the list (Bugzilla #722, Egbert Eich). + 467. Fixed definition of UseInstalledOnCrossCompile so that it never is + undefined (Harlod L. Hunt II). + 466. Add the 'b' flag to fopen() when opening binary xkm files. This is + irrelevant for *nix OSes, but required for Cygwin. (Bugzilla #689, + Harold L Hunt II). + 465. Cygwin: + * MultiWindow Mode: Automatically validate the size of windows that are + being resized. (Earle F. Philhower III) + * Safely shutdown the MultiWindow Mode and Clipboard Manager threads on + server shutdown. (Earle F. Philhower III) + * MultiWindow Mode - Fix a crash from a string copy bug. + (Earle F. Philhower III) + * Add lots of defaults for keyboardlayout. (Alexander Gottwald) + * Add a system tha allows arbitrary commands to be added to the tray menu + icon. (Earle F. Philhower III) + * Print the name of the keyboardlayout to aid in adding more layouts. + (Alexander Gottwald) + * Stop printing the IDirectDrawSurface4_Blt() failure messages after 10 + times. (Harold L Hunt II) + * Disable check for pc105 keyboard and just assume that it is present. + This check was causing problems with certain keyboard drivers that + failed to report that a pc105 keyboard was present. + (Alexander Gottwald) + * MultiWindow Mode - Add handling for WM_CHANGE_STATE IconicState + messages; + minimize the associated Windows window when these messages are + received. (Harold L Hunt II). + Submitted: (Bugzilla #704, Harold L. Hunt). + 464. cygwin.cf: + * removed BuildDPS flag. + * Changed Alloca flag as Cygwin 1.5.x supports alloca, now. + * Use external expat package by default. + * Changed XawI18nDefines to utilize improved wide char support in + Cygwin 1.5.x. (Bugzilla #699, Harold L. Hunt II). + 463. Fixed C&T panel register setting (Akira Taniguchi, Egbert Eich). + 462. Fixing crash on ia64 because of wrong setjmp buffer alignment (Bugzilla + #596, John Dennis). + 461. Changing ImPS/2 mouse Z-axis range to -8 to 7 (Bugzilla #691, + Matthew W. S. Bell, Egbert Eich). + 460. Making sure the compiled xkb config file is found by Xnest if + ProjectRoot is modified (Bugzilla #688, Frank Giessler). + 459. Fixing build of machine code .S files on OS/2 (Bugzilla #689, + Frank Giessler). + 458. Import Mesa 5.0.2 (Alan Hourihane). + 457. DRI merge (DRI Project) + * details to follow.......... + 456. Fixes and updates for XKB keyboard maps: + - Update xkb geometry files (Alexander Pohoyda). + - Fix German-Romanian maps (Manfred Pohler). + - Cleanup Hungarian layout (Bugzilla #730, Egmont Koblinger). + 455. Change the order of the timeouts processing and the input devices + reading in WaitForSomething() which caused unneeded keyboard autorepat + events (Ivan Pascal). + +XFree86 4.3.99.13 (25 September 2003) + 454. Add support for chip ID 5964 (Radeon 9200 SE) to the radeon driver, and + fix detection of IDs 5962 and 5963 with Driver "ati" (Bugzilla #732, + Michel Daenzer) + 453. Add gcc format checking for the X server's message and logging + functions, and fix lots of associated warnings (David Dawes). + 452. Replace the perl version of ucs2any with a C version ( Ben Collver and + other NetBSD developers, Matthieu Herrb). + 451. For drivers that support 'Option "dri"' have the driver request + loading the dri module when this option is true. This brings + it in to line with how other things are handled. Other drivers + that have DRI support need to have the "dri" option added (David Dawes). + 450. Fix libGL bug that could cause deadlock when switching contexts + (John Harper). + 449. Improve the contrast of the whiteglass xterm cursor, and fix the + hotspot of the whiteglass right_ptr cursor and add transparency + to it (#5867, René Rebe). + 448. Fix a problem with the "pl2" (Polish qwertz) map where the order in + which the Alt_R and Shift keys are pressed affects the results + (Tom Pala). + 447. In xdm, use better pseudo-random number generators to generate + magic cookies. Add support for EGD and other compatible entropy + gathering daemons. (Oswald Buddenhagen from KDE, Matthieu Herrb). + 446. Fix IMPS/2 mouse wheel on platforms where char defaults to unsigned + (Rene Rebe). + 445. Fix rare xterm crash on Darwin due to dyld deadlock when a signal comes + in while dyld is looking up a symbol (Rob Braun). + 444. XDarwin cleanup and improvements: + - Load bundle at runtime for chosen Quartz mode: xpr, cr, or fullscreen. + - AppleWM extension has been generalized to work with any Quartz mode. + Currently only the xpr implementation is complete. + - Wrote a man page for AppleWM. + - Moved hw/darwin/quartz/aqua* files that contained code to protect + the alpha channel to miext/rootless/safeAlpha. + (Torrey T. Lyons). + 443. Remove lots of redundant redeclarations (David Dawes). + 442. VIA driver: + Fixed video memory detection. (Bugzilla #525, Alan Cox). + Fixed TV and FP initialization problems (Bugzilla #525, Frederic Crozat, + Alan Cox). + Removed remaining globals (Egbert Eich). + 441. Fixed memory leaks in the loader (Bugzilla #682 and #683, Juergen Keil). + 440. Fixed erroneous freeing of DisplayModeRec in xf86DeleteMode() when + deleting the modePool in xf86PruneDriverModes() the 'prev' member has + a different meaning for modePool modes than for ScrnInfoPtr->modes modes + where it creates a doubly linked list (Bugzilla #678, Juergen Keil). + 439. Fixed SDK for VIA driver (Bugzilla #674, Bernhard Rosenkraenzer). + 438. Extended list of monitor ranges and modes in xf86cfg (Egbert Eich). + +XFree86 4.3.99.12 (10 September 2003) + 437. Move the X server log file handling from the XFree86 DDX to the DIX, + allowing the more descriptive logging to be used throughout the server, + and the log messages to be more uniform in formatting (David Dawes). + 436. Added support for the Compaq Evo keyboard (Stanislav Brabec). + 435. Fixed writes past end of array in via_bios.c (Bugzilla #662, + Egbert Eich). + 434. Let luit copy the termios settings from the calling terminal (Bugzilla + #641, Juliusz Chroboczek). + 433. Add _ADOBE_POSTSCRIPT_FONTNAME to the list of font properties xlsfonts + that are atoms and should be converted to strings when run with the + -ll flag. Also fixed the lenght problems that may arise (Bugzilla # 659, + Alan Coopersmith). + 432. Backing out 321.: sysMem gets initialized once during server lifetime + (Egbert Eich). + 431. Fixing X11.tmpl to set XFTINCLUDES after defining a non-standard path + to fontconfig, adding FONTCONFIGINCLUDES to the build rules for fontconfig + (Kevin P. Fleming). + 430. Added support for the hp5181 inet keyboard (Bugzilla #648, Alan Strohm). + 429. Added support for Apple Laptop keyboards, added level3/group switching to + KP_Enter, modified layout so keyboards acts the same way as under Mac OS + (Bugzilla #642, Frank Murphy). + 428. Adding ANGKHANKHU (U+0E5A) character to level 3 of keycode <AD09> on + th_tis keymap (Theppitak Karoonboonyanan). + 427. Fixes and updates for XKB keyboard maps: + - Add 'Romanian keymap for German keyboard' and 'Romanian keymap with + access to German umlauts' (Manfred Pohler). + - Update xfree86.dtd file (Sergey V. Oudaltsov). + - Add an XkbOption that makes a keyboard map without special keysyms + on Ctrl+Alt+smth for those who use such combinations for another + purposes (Ivan Pascal). + 426. Reverse patch #423 because it causes compile problems (Ivan Pascal). + 425. Disable the bytecode interpreter by default in FreeType 1, bringing it + into line with the default for FreeType 2. Document how to enable + it in xf86site.def for those with no legal impediment to doing so + (David Dawes). + 424. Improvement of Xlib's keysym compose module: + - Allow to figure out a mulibyte string if it is omitted in Compose file. + - Add 'include' instruction with some substitutions. + - Add a searching of Compose file as a value of XCOMPOSEFILE environment + variable and as a $HOME/.XCompose file. (Ivan Pascal). + 423. Add a writing of some Xserver XKB module error messages into a servers + log file (Ivan Pascal). + 422. Add Trident CyberBladeXP4 support, but acceleration is currently + disabled. (Alan Hourihane). + 421. Xinstall.sh updates to reduce its reliance on external utilities and + provide better diagnostics when required external utilities don't exist. + (David Dawes). + 420. Fixes and updates for XKB keyboard maps: + - Fix unneeded BKSL redefinition in Ukrainian 'winkeys' keyboard map + (Andriy Rysin). + - Fix some keycodes for jp106 keyboard model (Bugzilla #657, + Stephen J. Turnbull). + - Update xfree86.xml registry file (Andriy Rysin, Sergey V. Oudaltsov). + 419. Add a missing xf86UnblockSIGIO() call to xf86InstallSIGIOHandler() + (#5839, NetBSD PR xsrc/22668, Yorick Hardy). + 418. Fix a problem with the "pl" map where the order in which the Alt_R and + Shift keys are pressed affects the results (#5832, Tom Pala). + 417. Fix the warning generated by the ONE_LEVEL <RALT> definition in + the "level3" map (#5832, Tom Pala). + 416. Remove the unnecessary dependence of RandR on RENDER (David Dawes). + 415. Remove some static variables that should be per-screen (David Dawes). + 414. SiS driver update: + - Add 8x8 Color Pattern Fill (315/330 series) + - Add transparency support for 8x8 Mono Pattern (300/315/330 series) + - Fix Xv "insufficency" triggered by MPlayer (315 series) + 413. Add missing REQUEST_SIZE_MATCH() to xSyncSetCounter protocol request + (noticed by Ruben Nunez Francisco). + 412. Allow building libOSMesa during non-XFree86 builds (Marc La France). + 411. Rip out incorrect limits on the number of PCI buses an ix86 chipset can + handle and implement an improved solution for avoiding "phantom" PCI + buses (Marc La France, Bugzilla #604). + 410. Fixes for potential integer overflows in font libraries. (blexim, + Matthieu Herrb). + 409. SiS driver: Add RENDER hardware acceleration + 408. Add a Fopen() function to open the Xauthority file without spawning + a shell (Bugzilla #255, Aidan Kehoe, Matthieu Herrb). + 407. Fix a bug introduced with #397 that results in the core pointer and + keyboard devices specified in a ServerLayout section being ignored + (David Dawes). + 406. Added big5hkscs encoding to font encoding files (Bugzilla #575, + Jungshik Shin). + 405. Don't call FBIOPAN_DISPLAY ioctl with arguments that will cause a + confusing if harmless error; make an fbdevhw internal function static to + fix a warning. (Michel Dänzer) + 404. Passing correct virtual screen size to xf86ValidateModes() in VIA driver + (Luc Verhaegen). + 403. Added RGB overlays to i810 driver (Bugzilla# 625, Alastair M. Robinson). + 402. Fixed mode switching and mode comparison for xf86VidMode extension for S3 + driver (Bugzilla #613, Alexey Baj, Egbert Eich). + 401. Via driver: Fixed remaining globals, some formatting issues, out of + memory handling in Xv overlay code and a couple of small glitches caused + by the fixes (Bugzilla# 525, Alan Cox) + Fixed some missing globals and static build (Egbert Eich). + A handful globals still remain. + 400. Update the Xserver(1), XFree86(1) and XF86Config(5) man pages to + clarify how XFree86 configuration/run-time parameters are specified + and their order of precedence (David Dawes). + +XFree86 4.3.99.11 (25 August 2003) + 399. Try to make the state of libXfont more consistent. It shouldn't depend + on whether a static or loadable XFree86 server is being built, so it + now always has a dependency on the FreeType2 library (when FreeType + support is enabled) (David Dawes). + 398. Make the specification of a Monitor in the Screen sections of the + XF86Config file optional. Some drivers may need changes (coming later) + to maximise the utility of this (David Dawes). + 397. When a core keyboard or core pointer cannot be found in the + configuration, create default ones. The pointer part of this + requires some changes to the mouse driver (coming later) before + the default core pointer configuration will be useful on most + platforms (David Dawes). + 396. Add a facility for assigning version numbers to builtin XFree86 server + interfaces and allowing modules to query them. Assign versions for + the os-mouse and os-kbd interfaces (David Dawes). + 395. Include uname(2) information in the server's banner messages + (Marc La France). + 394. Fix bug in detection of multi-function PCI devices (Marc La France, in + partial resolution of Bugzilla #574). + 393. Change the XFree86 server's global default depth to 16, and change most + drivers that support the three common depths (8, 16, 24) to defer to + the global default rather than specifying their own (David Dawes). + 392. Fixed a crash when _XIMProtoOpenIM(), hich is called through XOpenIM() + API when protocol IM is being set up, fails (Bugzilla #618, + Hisashi MIYASHITA). + 391. Fixed a possible source of Sig11 in Jamstudio driver (Bugzilla #617, + Jonathan Hough, Egbert Eich). + 390. Fixed building without RENDER support (Bugzilla #306, Matthieu Herrb, + Egbert Eich). + 389. Pass pointer obtained by Xalloc() to Xfree() not the one that may be + manipulated in the mean time (Bugzilla #614, Alan Coopersmith). + 388. Added reverse mapping of keysyms to keycodes (XKeysymToKeycode()) + to xev to detect situations where this maps to a different keycode than + the one of the key pressed (Egbert Eich). + 387. Made xauth called by startx quiet (Bugzilla #597, Stas Sergeev). + 386. Added missing operand size override handling to PUSH imm8 in x86emu + (Bugzilla #590, Boris Weissman). + 385. Fixed compile glitch with NetBSD in xdm/genauth.c (Bugzilla #587, + Nicolas JOLY) + 384. Fix bugs in Xlib's EUC string converters that cause incorrect work of + _Xmblen. Fix _Xmblen usage in imCallbk.c when Xlib is built with + X_LOCALE (Etsushi Kato). + 383. Update xev program for print the result of XmbLookupString call + (Bugzilla #582, Noah Levitt, Ivan Pascal) + 382. Fixes and updates for XKB keyboard maps: + - Fix for Uzbek keyboard map (Bugzilla #595, Mashrab Kuvatov). + - Fix for the problem with Alt+Tab combinations in some window mangers + (Bugzilla #580,616): window chooser menu doesn't disappear after + Alt key release (Egbert Eich, Ivan Pascal). + 381. Allow a Display subsection with no depth or fbbpp specified to match + any depth/fbbpp, and make Display subsections optional, creating one + with default parameters when no suitable one can be found (David Dawes). + 380. Include <sys/param.h> to get the BSD macro for luit (ITO Tsuyoshi). + 379. DRM resync from the DRI trunk... + - Lots of misc fixes/cleanups, and some resyncs with 2.4 and 2.6 + kernels. + - Fix maplist entries being used after they were freed; thanks to + Benjamin Herrenschmidt for tracking this down (Michel Daenzer). + - FreeBSD updates (Eric Anholt). + - Fail in DRM(agp_acquire) if the AGP aperture can't be used, such + that the X server falls back to PCI GART or disables the DRI + gracefully (Michel Daenzer). + - Possibly fix stanford checker complaints about sarea for radeon + (Keith Whitwell). + - Restore i830 texture age waiting when swapping in new textures + (Keith Whitwell). + - Fix texture rectangle support for r100 (Keith Whitwell). + - Add i810 add page flipping support to the DRM (Dave Airlie). + - Merged DRM documentation (Jose Fonseca). + - r128 MESA_ycbcr_texture (Ian Romanick, Leif Delgass). + 378. Linux drm module build fixes for newish kernels from the DRI + repository (Michel Daenzer, Linus Torvalds, Leif Delgass). This + addresses Bugzilla #603, 605 (Calum Mackay). + 377. Fix the test for 2.5.x with x < 52 Linux kernels for the drm module + build (Bugzilla #601, Callum Mackay). + 376. Fix an XAA pixmap cache server crash that can happen in some cases + when the off-screen memory is heavily fragmented (David Dawes, based + on #5752, Koike Kazuhiko, Chisato Yamauchi). + 375. Fix for the Brazilian ABNT2 keyboard extra key that now translates to + a different keycode value. Patch suggested by Ivan Pascal. + 374. Fixed XDarwin fullscreen crash in some screen sizes (Torrey T. Lyons). + 373. Be a little more precise about differentiating between active and + inactive non-video PCI resources (Marc La France). + 372. Added Apple-WM extension and library (John Harper, Torrey T. Lyons). + 371. Fixed indirect GLX on Mac OS X when the client can not make a + connection to the CoreGraphics window server (John Harper). + 370. Fixed support for 64bit PCI bus on 32bit systems (Egbert Eich). + 369. Added support for using aliases in the -nolisten option. '-nolisten tcp' + aliases to IPv4 and IPv6 (Matthieu Herrb, Egbert Eich). + 368. Added fallback Xlib transport layer if IPv6 socket cannot be openend + (Egbert Eich). + 367. Added missing symbol to the vbeSymbols table in i740 driver (Bugzilla + #583, Egbert Eich). + 366. Changed scripts containing 'head -1' which is not supported by + POSIX 1003.1-2001 any more (Bugzilla #570, #569, Paul Eggert, + Egbert Eich). + 365. Changed POSIX 1003.1-2001 non-conformant 'sort +2' to 'sort -k 3' with + backward compatibility (Bugzilla #568, Paul Eggert). + 364. Add Microsoft Pro OEM model to XKB inet map (Bugzilla #458, + maxim@wzzrd.com) + 363. Extract the CHANGELOG's commit date and include it in the XFree86 + server log/version information (David Dawes). + 362. Change the way xf86Build.h is created so that it doesn't cause its + dependencies to be rebuilt when its contents are not changed + (David Dawes). -XFree86 4.3.0.1 (9 May 2003) - 987. Fix a FreeBSD/alpha build problem (#5679, Fred Clift). - 986. Fix SiliconMotion driver for mode switching and SEGV problem when - initializing Xv functionality (Bugzilla #50, Alan Hourihane). - 985. Fix a SEGV that can happen with Riva128 cards (Mark Vojkovich). - 984. Prevent a SIGFPE with the glint/pm3 driver when attempting to display +XFree86 4.3.99.10 (10 August 2003) + 361. Fixes and updates for XKB keyboard maps: + - Added numpad:microsoft XKB option (Bugzilla #558, Will Styles). + - Fixed inconsistence in indicator names (Bugzilla #577, Noah Levitt). + - Added type6 model of Sun keyboard (Warren Turkal). + 360. Add UK (gb) layout to the dvorak XKB map (#5739, Mike Sulivan). + 359. More work on the NativeGDI server for Cygwin/XFree86. The span routines + are nearing completion (albeit they run slowly until the higher + level X primitive functions are implemented). The obvious issue with + the current code is the problems surrounding 1-bit DIBsections which + have msb/lsb issues compared to the other types of DIBsections. + This work was done quite some time ago in the Cygwin/XFree86 CVS. + (Alan Hourihane). + 358. SiS driver update: + - Added pseudo-Xinerama extension for MergedFB mode + - Fixes for Clevo L285/L287 (1024x768) + 357. Include Xmd.h in Xpm/lib/XpmI.h to get definitions of LONG64 + (Bugzilla #562, John Dennis). + 356. Moved Meta_L/R keys and added Super_L/R keys on macintosh keyboard. + This makes the layout more compatible to the PC keyboard layout + (Bugzilla #565, Frank Murphy). + 355. Add check for Xmalloc() return value in XGetErrorDatabaseText() to avoid + Sig11 (Bugzilla #563, Alan Coopersmith). + 354. Separated build of libglx.a module and normal libglx.a library + (Bugzilla #541, Frank Giessler). + 353. Fixed build of Xnest, Xprt and Xvfb for OS/2 by linking with the linker + definition files (Bugzilla #541, Frank Giessler). + 352. Fixed freeing of properties form xkb_geomerty block (Bugzilla #550, + Alexander Pohoyda). + 351. Fixed string octal number parsing and string to int conversion for "\00" + in xkbcomp (Bugzilla #553, Egbert Eich). + 350. Removed stale definition from XftCompat.h (Bugzilla #543, Egbert Eich). + 349. Added XLC_LOCALE file for zh_CN.UTF-8, moved iso10646 encoding to the end + in ja_JP, ko_KR and zh_TW UTF-8 XLC_LOCALE files + (Bugzilla #544, Akira TAGOH). + 348. Fixed typo in #if conditional in cfb code (Bugzilla #556, Dave Love). + 347. Fixed ValidMode() in C&T driver to work with option 'FixPanelSize' + (Egbert Eich). + 346. Fixed Meta_R key on us layout Macintosh keyboard (Bugzilla #539, + Frank Murphy). + 345. Add new charset sequence for CText at the end of list. This way the + sequence of a charsets that were added earlier will be picked if two + sequences for the same charset are registered (Bugzilla #228, + Egbert Eich). + 344. Use return value sysconf (_SC_OPEN_MAX) instead of the fixed number 256 + for allowed number of open files on POSIX.1 conformant systems + (Egbert Eich). + 343. Added missing exported functions in libfreetype to compile mkfontscale, + made mkfontsdir script install on platforms that use extensions (Bugzilla + 536, Frank Giessler). + 342, Fixed a sig11 in Xaw that may appear on the rare condition that no font + can be found (Bugzilla #482, Egbert Eich). + 341. Added KP_Separator to symbols that can generate decimal() in xcalc + (Egbert Eich). + 340. Disabled Color8x8PatternFill() in savage driver (Egbert Eich). + 339. Fixed a sig11 in twm when used with a session manager (Egbert Eich). + 338. Fixed rounding of refresh rate in RandR, updated Xrandr man page + (Bugzilla #527, Egbert Eich). + 337. Added MenuBorderWidth and MenuBorderColor options to twm (Bugzilla #529, + Alexander Pohoyda) + 336. Update for VIA driver: + - DGA no longer hangs (eg freedroidRPG now runs reliably) + - Starting two copies of Xine no longer aborts the X server + - Added support for KM400/K8M400 + - Improved video overlay support. + - Fixed video overlay clipping when the image cliprects change but + not the size. + - TV tuner support via XV interface for two overlay ports. + - DRI support (the client side library is not yet fully ported to 4.3). + - Disable Xv in modes with insufficient bandwidth (1600c1200x16). + - Updated documentation + It differs from the base VIA codedrop. + - Several of the fixes were done by me on top of it (the dual Xine fix, + and bandwidth) + - Various system types have been turned to CARD32 to make the code + portable + - The hybrid Video4Linux/XV glue was racy and has been removed + (the XV layer is more than sufficient anyway) + - DRI library client code is not included (porting not yet finished) + - Additional debugging + (Bugzilla #525, VIA, Alan Cox) . + - Cleaning up namespace pollution, removing dependency on via_drm.h + removing some global symbols from driver (Egbert Eich). + Please note: there are more global symbols yet to be removed. + 335. Remove the 'xc/xkbcomp/geometry/HP' directory from the CVS repository. + 334. Substantial rewrite of the "nv" driver (Mark Vojkovich). + 333. Resync with Cygwin/XFree86 changes up to Test92 (#5721, Harold Hunt and + the Cygwin/XFree86 project). + 332. Add a clean target for Cygwin's ResourceObjectRule() rule (#5720, + Harold Hunt). + 331. Fix xman's formatting/displaying of manual pages on Darwin, where + 'groff' defaults to PostScript formatting (#5719, T. M. Pederson). + 330. SiS driver update: + - Fixed SiS 620 support + - Added interface for sisctrl utility + (Thomas Winischhofer) + 329. Fixes for regressions in xauth and xhost with IPv6 code + (Matthieu Herrb, Hideki ONO). + 328. Update X-TrueType (X-TT) to version 1.4.1 (Chisato Yamauchi, + After X-TT Project): + - Extension of code converter modules for ARABIC, ARMSCII8, + BIG5HKSCS, GB18030, ISO8859.*, etc. (Pablo Saratxaga, James Su) + - Try to use TT_Load_Glyph_Bitmap() in get_metrics() when `bs' + option is not set. + - Use Embedded Bitmap with the option `eb=y' when Auto Italic is set. + - Enhancements for `ds', `eb' and `bw' options. + - New options for TTCap, `fc' and `fm': they enable the *extremely* + fast loading of big Japanese or unicode fonts with `-p-' in the XLFD. + - Performance improvement of FreeTypeGetMetrics() function. + - Improved performance based on the solution to the buffer + overflow problem, caused by exceeding the range of + maxbounds.ascent/maxbounds.descent. This problem occurred only + when `-m-' spacing was used. + - Improved fix to crashes caused when certain fonts (e.g. verdana.ttf) + are used; solution based on investigating the true nature of the + problem. + - Added patch for mktcapdir-0.5.4 and some ttfconf files suitable for + X-TT 1.4.0. + - Preparation for extending the encoding field of XLFD. X-TT permits + the following additional XLFD format: + "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.0" + "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.1" + The last number can be used to indicate the plane number of a huge + character set. + - Support for reverse `fc' specification. `fc=0xaa00-0xa0ff' means + specifying the ranges 0x0000-0xa0ff and 0xaa00-0xffff. This is + useful for GB18030 proportional fonts. + - Improved fix for server crash that appears on Linux/PPC. + - Added ksc5601.*-3 and ksx1001.*-3 to KSCJOHAB/main.c (Jungshik Shin). + - Added U+20AC and U+00AE characters to KSCJOHABtoUCS2.c and + KSC5601toUCS2.c (Jungshik Shin). + - Fixed an X server crash when using LucidaSansRegular.ttf + (reported by Koike Kazuhiko). + - Improved fix to prevent NULL dereference when the font cache + becomes full; solution by allocation of a dummy area for bitmap. + - Fixed an X server crash because of an inconsistency problem between + XFree86 and X-TT (reported by Koike Kazuhiko). + - Numerous minor improvements. + +XFree86 4.3.99.9 (25 July 2003) + 327. Add Mach64 I2C framework. Derived from GATOS project (Marc La France). + 326. Removed ru_yawerty xkb symbols file as it is misleading as suggested + by Ivan Pasacal (Bugzilla #516, Ivan Pascal). + 325. Fixed two bounds errors in rman + (Bugzilla #505, Dan Nelson, Bugzilla #506, Eric Anholt). + 324. Cleaned up MMIO map/unmap in RADEONPreInit(), unmapped MMIO in + CloseScreen() even when server is switched away (Bugzilla #504, + Hui Yu, Egbert Eich). + 323. Modified transport code so that a bind to an IPv4 socket fails silently + when the bind to an IPv6 socket for the same port was successful. + This works around a problem in theIPv6 implementation on some OSes + that also handle IPv4 calls over IPv6 sockets (Egbert Eich). + 322. Simplified handling of the -nolisten option as suggested by + Alan Coopersmith. This option can now be issued multiple times. + 321. Added code to unmap sysMem when freeing int10 (Bugzilla #504, + Frank Giessler). + 320. Fix generic rootless crash while resizing when CopyBytes is not defined + by the implementation (Torrey T. Lyons). + 319. Fix XDarwin Cocoa rootless crash when unshaping a shaped window + (Torrey T. Lyons). + 318. More IPv6 changes from Alan Coopersmith as follows: + - Add support for IPv6 bracketed numeric addresses, similar to RFC 2732 + syntax to a number of areas. + - Fix some issues with colon parsing and determining which addresses are + DECnet (two colons between hostname and display number) and which are + non-bracketed IPv6 numeric addresses ending in two colons, followed by + another colon and the display number (three colons in a row). + - Fix additional places Fabio forgot to change the string length when + switching "inetv6" to "inet6". + - Use MAXHOSTNAMELEN if it is defined for MAXHOSTNAME in xrdb. (Perhaps + NI_MAXHOST should be used as well on platforms that support it.) + - Make #include <sys/socket.h> in Xtrans.h look like the other places + it's included in the tree, with checks for Lynx & Win32 + 317. IPv6: 2003.07.11 update to X.Org's response to comment #13; i.e. + s/FamilyInternetV6/FamilyInternet6/g (Marc La France). + 316. IPv6 build fixes for older Linux systems; Many of these are derived from + a suggestion by Alan Coopersmith (Marc La France). + 315. Change DEVID macro to work around glitch in SCO's C compiler + (Marc La France). + 314. Fixed Radeon driver so that clone modes survive server reset + (Bugzilla #487, Egbert Eich). + 313. Changed behavior of FreeType and Type1 renderer: when no encoding file + is found fail with BadFontName instead of using an iso8859-1 encoding + (Bugzilla #479, Roland Mainz, Juliusz Chroboczek, Egbert Eich). + 312. Fixed screen switching problem on SCO where VT was off by one + (Bugzilla #470, Kean Johnston). + 311. S3 driver: + . allow only specific displayWidths when acceleration is enabled + . added double_scan support (Egbert Eich). + 310. Removed build rules for hp Xserver that was recently removed from + Xserver/Imakefile (Egbert Eich). + 309. Fixes for C&T driver: + . switch to SW mouse in doublescan modes. + . centered video correctly for all interlaced modes (docs were + misleading). + . fixed README (Egbert Eich). + 308. Fixed a typo in mkfontscale (Bugzilla #491, Juliusz Chroboczek). + 307. A lot of X server prototype cleanups, including fixing an + inconsistency between the cfbBitBlt and CopyPlane functions + exposed by the prototyping (#A.1859, Alexander Stohr). + 306. Fix missing newline in Message -> MessageF transition in dri_glx.c + (#A.1833, Alexander Stohr). + 305. Fill out the sunleo man page (#A.1783, Arnaud Quette). + 304. Fix a typo in the XSetWMProtocols(3) man page (#5697, Alexander Pohoyda). + 303. Fix for a few Xlib charset converters (Bruno Haible). + 302. Fix calculation of CRTC2 frame offset with page flipping in radeon driver + (Michel Daenzer) + 301. Xinerama-fy the XTest extension (Rik Faith). + +XFree86 4.3.99.8 (10 July 2003) + 300. X.Org IPv6 changes (Bugzilla #227, Alan Coopersmith, Marc La France). + See http://www.x.org/IPV6_Specific_Changes.html for details. This has + been further modified as follows. + - Deal with small memory leaks in xdm & xauth. + - Fix a number of compilation issues. + - Where supported, use SIOCGLIFCONF to query network interfaces on more + than only Solaris. + - Incorporate X.Org responses to comments #'s 1, 2, 4, 5, 7, 10, 11, 12, + 13, 14 and 15 (taken from an X.Org-internal document dated 2003.06.17). + - Replace HasIPv6 imake symbol with BuildIPv6, defaulting it to YES, and + build in IPv6 support whenever BuildIPv6 is asserted _and_ the OS + #define's AF_INET6. This is to maximise IPv6 code exposure and + eliminate <OS>.cf file changes to support IPv6. + 299. On Solaris, don't allow remote root xdm logins if CONSOLE is set in + /etc/default/login (Bugzilla #227, Alan Coopersmith). + 298. Fix SEGV in fstobdf when font server is not specified and FSServerName() + returns NULL (Bugzilla #227, Alan Coopersmith). + 297. Fix XDMCP bug that could cause local host entries in /etc/X0.hosts to be + lost (Bugzilla #227, Alan Coopersmith). + 296. Make certain xtrans static variable volatile to avoid optimisation issues + that occur when they are modified by SIGALRM handlers + (Bugzilla #227, Alan Coopersmith). + 295. Use %p instead of %x to print pointer values in xtrans debug messages to + avoid overflow on platforms with 32-bit ints & 64-bit pointers + (Bugzilla #227, Alan Coopersmith). + 294. Change SUN-RPC code to use authdes_seccreate() call rather than the + deprecated authdes_create() (Bugzilla #227, Alan Coopersmith). + 293. Add xdm /dev/random handling for Solaris + (Bugzilla #227, Alan Coopersmith). + 292. Solaris compile fixes (Bugzilla #227, Alan Coopersmith). + 291. Update X.Org version numbers to X11R6.6 or X11R6.7 and replace old + references to X Consortium with X.Org (Bugzilla #227, Alan Coopersmith). + 290. Update the usage of DRM AGP handles so that valid handles aren't + mis-interpreted as invalid handles (based on Bugzilla #484, Dave Airlie). + 289. Twisting fontfile.c and fontdir.c to be able to pass all fonts (bitmap + and scaleable) to the scalable renderer as this one can deal with + XLFD names (Bugzilla #475, Juliusz Chroboczek). PLEASE TEST! + 288. Changing PS/2 mouse resolution to 8 counts/mm as some broken mice have + problems with other values (W. uses 8) (Egbert Eich). + 287. Fixing mode setting by BIOS. Wrong clock selection in MiscOut register + caused screen to stay blank (Egbert Eich). + 286. Added description for -dumpSched and -schedInterval to the usage + message (Egbert Eich) + 285. Update the SCO OpenServer port, fixing these specific problems: + . Fixed the Imake template so i[3456]86 and friends arent defined + . Fixed bad preprocessor stuff in X11.tmpl that was producing warnings + . Updated default GCC flags to more aggresively optimize + . Fixed keyboard LED handling + . Enable SCO function keys in xterm + . Make Delete key send DEL by default on SCO in xterm + . Fix to make fonttosfnt compile (Bugzilla #470, Kean Johnston). + 284. Added missing ro2 symbols file to list of files to install + (Bugzilla #476, Egbert Eich). + 283. Corrected precedence problem in test in xc/lib/X11/XKBUse.c: + XkbUseExtension(). This avoids an extra round trip during application + startup (Bugzilla #473, Owen Taylor). + 282. Fixing deadlock in libXi - when is called _XLockDisplay() twice - when + calling a Xi function that calls XGetExtensionVersion() (Bugzilla #260, + Bastien Nocera, Owen Taylor). + 281. Adding support for video modes <320x240 to S3 driver by changing the + minimal clock frequency to 15.6 MHz (Bugzilla #472, Alexey Baj). + 280. Made mkfontscale behavior and options compatible to mkfontdir, fixed + bugs in output format (Bugzilla #425, Juliusz Chroboczek, Kean Johnston). + 279. Changed xclock hands back to black (antialiased) , created XClk-col.ad + to set colored hands instead, added missing documentation for missing + resources. This follows the behavior of the other X applications more + closely (Bugzilla #437, Joerg Wunsch). + 278. Added support for Trio64UV+ and Trio64V2/DX/GX to S3 driver (backport + from 3.x) (Bugzilla #465, Alexej Baj). + 277. Increased Xlib default buffer size to 16k (was 2048), made size + configurable thru environment variable XLIBBUFFERSIZE (minimum 2048) + (Bugzilla #466, Roland Mainz). + 276. Increased maximum BIGREQUEST size to 4Mb and made it configurable thru + a command line option. This increases performance of certain + applications considerably (Bugzilla #460, Roland Mainz). + 275. VIA driver: initialized screen parameters in PreInit() instead of + AccelInit() so that they are set even when acceleration is disabled + (Egbert Eich). + 274. Do not drop H&V sync during screen blanking for Radeon + (Bugzilla #320, Michael Breuer, Hui Yu@ATI). + 273. Let out-of-limit pixel clocks only use the frequency below pll output + lower limit for Radeons (Bugzilla #262, John Vickers, Hui Yu@ATI). + 272. Add support for Radeon cards with DAC/TMDS wire up in different ways + from what the driver was originally programmed to; includes support + for dual DVI cards (Hui Yu@ATI). + 271. Add Radeon DPMS handling for flat panels (Bugzilla #26, Hui Yu@ATI). + 270. Decreased the retry loops in DDC probing so that Radeon startup + time won't be too long in the worst case (Hui Yu@ATI). + 269. Fix Radeon Asic bug in RMX unit of IGP chips (Hui Yu@ATI). + 268. Fix Radeon register initialization for RGB offset to fix the + "milky-screen" problem (Bugzilla #351, Hui Yu@ATI). + 267. Add support for new Radeon chips: R350(9800), RV350(9600,M10), + RS250(IGP7000), RS300(IGP9000), RV280(9200) (Hui Yu@ATI). + 266. Fix a lockup with the trident driver when stopping/starting Xv + applications (Alan Hourihane). + 265. Fix initialisation in xauth (Martin Birgmeier). + 264. Calling RADEONSaveFPRegisters() regardless of display type to catch + register restauration problems (Bugzilla #193, Hui Yu). + 263. Fixed order of name and filename in encodings.dir files generated by + mkfontscale (Roland Mainz). + 262. Changed resource registration in TDFX driver: VGA mem resources + are unused during OPERATING state, RAC isn't required for memory + resources (Bugzilla #357, Egbert Eich). + 261. Attempt to fix VIA driver lockups when moving windows: + assumed bug compatibility to previous S3 products + (Bugzilla #435, Egbert Eich). + 260. Disabled mode writeback to client program from MGA driver (Egbert Eich). + 259. #ifdef'ed variables in os-support/bsd in cases they are not needed + (Bugzilla #430, Jason L. Wright). + 258. Fixes and updates for XKB keyboard maps: + - add Faroese keyboard map (Bugzilla #401, Roi a Torkilsheyggi) + - add missing KPPT key to ABNT2 keycodes list (Bugzilla #431, Christian + Tosta) + - fix geometry/pc file (Alexander Pohoyda). + 257. Don't sleep on Darwin for directory owner/mode problems (John Harper). + 256. Limit 430TX and 430VX to 128 and 32 PCI buses respectively + (Marc La France). + 255. Add direct GLX rendering on Mac OS X and Apple-DRI extension + (John Harper). + 254. Replaced inline asms with compier intrinsics for Intel compiler + (Bugzilla #427, Slava Sysoltsev). + 253. Partly fixed build problems caused by mkfontdir replacement + (Bugzilla #425, Egbert Eich). + 252. SiS driver update: + Fixed Xabre support + (Final) fix for Compaq 3045US + Customized timing for 848x480 parallel panels + 251. Replaced mkfontdir by simple shell script that calls mkfontscale + (see #233) (Bugzilla #388, Juliusz Chroboczek). + 250. Added encoding files for Arabic (iso8859-6.16 and iso8859-6.8x) + (Bugzilla #420, Roland Mainz). + 249. Removed O_SYNC from open call for /dev/mem for all Linux platforms. + This hopefully takes care of the speed problem + (Bugzilla #419, #414, Egbert Eich). + 248. Fixed fontstosfnt to build on OS/2 (Bugzilla #415, Frank Giessler + Juliusz Chroboczek). + 247. Fixed DMC touchscreen driver: button press events are properly + recognized now, made sure device is still recognized after a restart, + fixed misleading error messages (Bugzilla #418, Andreas Kies). + 246. Added PanoramiX supprt for the RENDER requests: Trapezoids, Triangles, + TriStrip, TriFan, SetPictureTransform and SetPictureFilter + (Bugzilla #138, Egbert Eich). + 245. Fixed SW/Theme cursor drawing glitches in i740 driver (Bugzilla #21, + Egbert Eich). + 244. Added input driver for Aiptek tablet (Bugzilla: #393, (list #5686), + Bryan W. Headley). + +XFree86 4.3.99.7 (25 June 2003) + 243. Added 'BitKeeper' to the directories that get excluded by lndir + (Bugzilla #408, H.J.Lu). + 242. Fixed gcc warnings in xdmauth.c (Bugzilla #410, Jason L. Wright). + 241. Updated Citron touchscreen driver: set 'block duration time' + to one second to avoid timeouts, added user strings to inform about + HW version (Peter Kunzmann). + 240. Fixed wraparound bug in TimerSet() (Peter Osterlund). + 239. Fixed X*LookupString() in imDevLkup.c to return status + XBufferOverflow and the required size as required + (Bugzilla #397, Kusanagi Kouichi). + Dto. for imLcLkup.c (Egbert Eich). + 238. Removed unused function QualifyName, Exit() from Xprint + and CountBits(), matchVisuals() from GLX + (Bugzilla #395, #400, #394 Jason L. Wright). + 237. Fixed type warning when building sunffb driver on 64bit + (Bugzilla #404, Jason L. Wright). + 236. Fixed warnings when building Palmex touchscreen driver statically + (Bugzilla #405, Jason L. Wright). + 235. Fixes and updates for XKB keyboard maps: + - add programmers variant to the Turkish keyboard map (Nilgün Belma + Bugüner) + - add a variant of the Romanian keyboard map for German keyboard + (Manfred Pohler) + - add layout for BTC 9001AH keyboard (Nick Kurshev) + - add Uzbek keymap description (Bugzilla #391, Mashrab Kuvatov) + - update geometry files (Alexander Pohoyda) + 234. Added fonttosfnt, a utility that generates bitmap-only TTFs. It is + capable of reading most font formats (Bugzilla #389, + Juliusz Chroboczek). + 233. Added functionalities to mkfontscale so mkfontscale performs every + functionality mkfontdir does (Bugzilla #387, Juliusz Chroboczek). + 232. Removed absolute path from cpp for Linux as /usr/bin/ should be + in the default search patch (Egbert Eich). + 231. Fix regression of Xvideo not working with some videos on the + CyberBladeXP/Ai1 chips (Bugzilla #251, Stephane Voltz). + 230. Added early failure and warning message when not sufficient memory + available for DRI in i8xx driver (Egbert Eich). + 229. Fix bug in original patch which added support for two new relocation + types for IA64 (Bugzilla #195, John Dennis). + 228. Fix scaling calculus in savage driver (Bugzilla #274, Emmanuel). + 227. Clarifying if conditions, fixing memory leaks in error path, removing + useless code in savage driver (Bugzilla #278+279, Emmanuel). + 226. Adding message to R128 driver which informs about modified modes for LCD + according to VBIOS (Bugzilla #23, Egbert Eich). + 225. Fixed chipset ID for v2100/v2200 for overrides (Egbert Eich). + 224. Added interlaced support for Voodoo 3,4,5 to TDFX driver (Bugzilla #383, + Jakub Bogusz). + 223. Fixed typo in getPciBiosTypes() (Bugzilla #382, Jakub Bogusz). + 222. Restore previous mode if mode switch fails (Bugzilla #381, Jakub Bogusz). + 221. Fixed typo that prevented lubB19 fonts with different maps from being + generated (Bugzilla #380, Jakub Bogusz). + 220. Sync entrypoints for OS/2 with recent changes in fontconfig and Xft + (Bugzilla #374, Frank Giessler). + 219. Added detection of 2Mb memory for CLGD7548, fixed a possible memory + leak and did minor cleanups (Bugzilla #369, Lucas Correia Villa Real). + (PLEASE TEST!) + 218. Recode single-byte keyboard scancodes that clash with recoded + double-byte scancodes (David Dawes). + 217. Fixes and updates for XKB keyboard maps: + - add more EuroSign to "us_intl" keyboard map (Paul Bolle) + - update geometry files (Alexander Pohoyda) + - add AudioMute key to inet(hpxe3gc) (Bugzilla #350, Paul Pacheco) + - add option for replacing RCtrl key with Right Alt (Bugzilla #343, + Adam Tlalka) + - add Uzbek keyboard map (Bugzilla #372, Mashrab Kuvatov) + 216. (Re-)fix portability of gccmakedep and generate ccmakedep on all + platforms (Marc La France). + 215. Fix i810/i815 problem with interlaced modes where only the top half + of the screen gets displayed (Paul Stewart). + 214. Changed any occurance of x86_64 to AMD64, the official name of the + architecture (Egbert Eich). + 213. Removed Copyright sign from man pages as this causes some formatters + to choke (Egbert Eich). + 212. Export SysV IPC functions to modules in Net and OpenBSD + (Bugzilla #355, Quentin Garnier). + 211. Fix rootless bug when reordering windows behind others (Torrey T Lyons). + 210. Fix page size issues that prevented the mmap()'ing of SBUS devices + (Marc La France). + 209. Fixes for the following problems on OS/2: + - long startup delay of xinit + - recovery from hard-error popups + - text-mode version of xf86cfg + - xf86cfg unable to find default config file + - installation of static libraries + - missing exported functions in X11.dll + - typo in xf86pathIsAbsolute() + (Bugzilla #267, Frank Giessler). + 208. SiS driver update: + Fixed 1280x960 and 1280x1024 LCD support (SiS 30x) + Added Chroma-Keying support to Xv part + Added support for Barco iQ R and G series projectors + +XFree86 4.3.99.6 (10 June 2003) + 207. Add support for the Mac's KP_Equal key (untested) (David Dawes). + 206. Import fontconfig 2.1.0 as an external package, and update the build + to use this version (David Dawes). + 205. New version of the FreeType backend. (Bugzilla #325, Juliusz Chroboczek). + 204. Rework XDarwin's Cocoa rootless implementation to use new generic + rootless code in miext/rootless (Torrey T. Lyons). + 203. Fix repeated image problem when using a vesa video mode before starting + the Xserver on the S3 Trio3D cards (Alan Hourihane). + 202. Import zlib 1.1.4 for systems that don't provide it (Matthieu Herrb). + 201. Improve fonts width and weight detection (Bugzilla #265-266, + Juliusz Chroboczek). + 200. Fix library dependencies for xlibi18n modules (Bugzilla #82, Joe Kelsey, + Matthieu Herrb). + 199. Fix manual pages typos (Bugzilla #316, Jens Schweikhardt). + 198. Fix bug (Bugzilla #315) in _XTextPropertyToTextList() that causes + an application crash in some circumstances (Ivan Pascal). + 197. Fixes and updates for XKB keyboard maps: + - add asciitilde to Swedish 'nodeadkeys' map (Bugzilla #291). + - add map for true Romanian keyboard (Bugzilla #300, Manfred Pohler). + - add EuroSign to "us_intl" keyboard map (Bugzilla #309, Paul Bolle). + - fix some keys in Armenian 'phonetic' layout (Bugzilla #313, Ani). + - add some geometry files (Alexander Pohoyda). + - some cosmetic changes. + 196. Import FreeType 2.1.4, and do initial merge for config/build + (David Dawes). + 195. Remove unnecessary links of libm (Marc La France). + 194. IRIX 6.5 build fixes and noise reductions (Marc La France). + 193. Clean up confusion in Imakefiles between XONLYLIB and XLIBONLY (and + between DEPXONLYLIB and the previously non-existent DEPXLIBONLY) + (Marc La France). + 192. Do not unnecessarily link libXmu, libXt and/or libXext into executables + (Marc La France). + 191. Fix makedepend for IRIX 6.5 (Marc La France). + 190. Make the handling of X_BYTE_ORDER in Imakefiles more portable + (Marc La France). + 189. Allow building of a libXfont without font cache support (Marc La France). + 188. When using cpp to generate scripts and data files, change XCOMM to pound + signs even when preceeded by only whitespace, and provide a means to + generate output lines with trailing backslashes. Change `startx` script + accordingly (Marc La France). + +XFree86 4.3.99.5 (25 May 2003) + 187. Fix XDMCP queries in xdm on systems using getifaddrs(). + (Bugzilla #277, Joel Ray Holveck). + 186. Initial imake/config support for more closely (and more + automatically) emulating how libtool handles shared library revisions. + Implmemented for Linux only so far (David Dawes). + 185. Fix libexpat shared lib revision on platforms that use minor version + numbers (David Dawes). + 184. Update Tamil keyboard map (Thuraiappah Vaseeharan). + 183. Add missing xfs reply to GetEventMask requests (Marc La France). + 182. Change the ELF loader to ignore .debug* sections (Marc La France). + 181. Simplify internal interfaces in the PCI code and remove the Xserver's + interference with normal PCMCIA operation (Marc La France). + 180. i810/815 depth buffer needs to be a multiple of the tile size. This + fixes 3D corruption near the bottom of the screen at 800x600@16bpp + (Bugzilla #283, Dave Airlie). + 179. SiS driver update + - Allow Modelines for LCD and secondary VGA on 301B + - Support plasma panels natively (including a small + database for some known panels since some panels + report wrong timing data via DDC) + 178. DRM resync from the DRI trunk... + - Lots of fixes/cleanups/resyncs for the BSD DRM drivers (Eric Anholt). + - Fix potential oops and memory leaks when allocations fail in + addbufs_agp/pci (Leif Delgass). + - Add support for buffer private structs with PCI DMA buffers + (Leif Delgass). + - Disable MTRRS on FreeBSD-stable (Eric Anholt). + - Remove some unused code (Keith Whitwell). + - Move prototypes for gamma functions to gamma_drv.h (Keith Whitwell). + - 2.5.x resync (Linus Torvalds). + - Ensure driver has been initialized before installing irq handler, + and modify all drivers to ensure irq handler is removed before + cleanup, and cleanup is called at takedown (Leif Delgass). + - Check for lock on init/cleanup in all drivers except i810/i830 + (Leif Delgass). + - Put back __HAVE_KERNEL_CTX_SWITCH for the sparc drm driver + (Keith Whitwell). + - Only free original pagelist in addbufs_pci if one already exists + (fixes oops) (Leif Delgass). + - texmem-0-0-1 branch merge (Ian Romanick). + - Fix warning on machines where sizeof(drm_addr_t) != 4 (Randy Dunlap). + - Support AGP bridges where the AGP aperture can't be accessed directly + by the CPU (David Mosberger, Benjamin Herrenschmidt, Michel Daenzer, + Paul Mackerras, Jeff Wiedemeier). + 177. Fix another xedit compile problem (Marc La France). + 176. Small fix for Italian keyboard map (Sebastiano Vigna). + 175. Don't ship xf86Bus.h and xf86pciBus.h with the SDK (Marc La France). + 174. Restore VGA driver's checking for depths 1, 4 & 8 (Marc La France). + 173. Fix a problem with savage driver when UseBIOS is off, such that the + performance drops dramatically. Now the performance matches or + exceeds that of the option UseBIOS (Alan Hourihane). + 172. Add workaround for problems that arise when in multi-layout map + different modifier keysyms share the same key (Ivan Pascal). + 171. Fix bug that causes XGetKeyboardMapping produce incorrect map when keys + have more then two keysyms. Also add a map columns duplication for better + compatibility with core protocol keyboard maps (Ivan Pascal). + 170. Fix XKB bug (Bugzilla #253) that causes an Xserver crash when XKB action + RedirectKey is used (Ivan Pascal). + 169. Add missing letters to Ukrainian phonetic keyboard map (Andriy Rysin). + +XFree86 4.3.99.4 (10 May 2003) + 168. Prevent a SIGFPE with the glint/pm3 driver when attempting to display an XVideo image less than 8 pixels wide (Måns Rullgård). - 983. Fix double free bug when a Mac-specific font fails to load with + 167. Support for building a DRI enabled server on OpenBSD (Wilbern Cobb, + Matthieu Herrb). + 166. Fix double free bug when a Mac-specific font fails to load with Freetype (Torrey T. Lyons). - 982. Check for NULL tObj in the i830 3D driver's TexEnv function. This + 165. Check for NULL tObj in the i830 3D driver's TexEnv function. This fixes a FlightGear crash (Keith Whitwell). - 981. Fix lockup on server reset in radeon driver - (Michel Dänzer, Keith Whitwell). - 980. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers + 164. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers (Keith Whitwell). - 979. Fix to prevent PCI and CardBus resets when switching out of the server's + 163. Add an entry to the i2c module that drivers can call to retrieve an array + of all I2C buses associated with a screen (Marc La France). + 162. Fix to prevent PCI and CardBus resets when switching out of the server's virtual console (Marc La France). - 978. Fix infinite loop that occurs on systems whose PCI configuration space + 161. Change the /dev/ file used on some *BSD's to mmap the framebuffer in DGA + clients to match the /dev/ file used by the server (Marc La France). + 160. SiS driver fixes: + - Added MergedFB mode (including HWCursor and Xv) + - Xv enhancements and fixes for all chipsets + - New Xv properties (SWITCHCRT, TVPOSITION, etc) + - Added support for custom LCD resolutions (via DDC) + - Fixed DVI output (DVI-D and DVI-A), automatic detection + - Numerous bugfixes and enhancements + (Thomas Winischhofer) + 159. Make freetype-config more useful on NetBSD (#5693, Thomas Klausner). + 158. Small fixes in keyboard maps: + - add an explicit type declaration in level3(ralt_switch) + (Bugzilla #225, Séamus Ó Ciardhuáin); + - fix wrong group number in Russian keyboard map (Ivan Pascal). + 157. Add rootless implementation for XDarwin using Apple's Xplugin API + (John Harper, Torrey T. Lyons). + 156. Fix precision problems in xf86XVClipVideoHelper and in Mach64 XVideo + support (Marc La France). + 155. Add missing symbols when DRI is disabled to glint driver + (Bugzilla #203, Mike Harris). + 154. Fix a memory leak caused by the data allocated in XGetDefault() never + being freed (Jim Radford). + 153. Update keysym capitalization rules in XConvertCase() with unicode + keysyms and some missed charsets (Bugzilla #209, Séamus Ó Ciardhuáin). + 152. Use C89 style function prototypes in manual pages (Bugzilla #208, + Aidan Kehoe). + 151. Fix small memory leaks in XvQueryAdaptors() and __driUtilCreateScreen() + (Jim Radford). + 150. Updated Wacom driver to support ntuos 2 2D mouse and a few styli, + TabletPC with ISD V4 protocol, intiq 15X and Cintiq 18SX + (Wacom). + 149. Fix programming error in ix86 motherboard chipset determination + (Marc La France). + 148. Ansi prototypes cleanup in Xserver/include and Xserver/os + (Matthieu Herrb). + 147. Fix shared libXp dependencies on *BSD and Darwin (Dale Rahn). + 146. Fix infinite loop that occurs on systems whose PCI configuration space doesn't advertise a host bridge (Marc La France). - 977. Workaround for broken devices that don't implement the header type field + 145. Workaround for broken devices that don't implement the header type field in their PCI configuration space (Marc La France). - 976. Fix programming error in ix86 motherboard chipset determination + 144. Portability changes for older Sun compilers (Alan Coopersmith). + +XFree86 4.3.99.3 (25 April 2003) + 143. Fix building of the dristat and drmstat utilities (David Dawes). + 142. From the DRI trunk... + - Remove more dead code from the BSD DRM (Eric Anholt). + - Remove some #if 0'd code and unused string functions from the Linux + DRM (Keith Whitwell). + - Move debug versions of the DRM memory functions to a new file + (Keith Whitwell). + - drm_memory cleanup (Leif Delgass). + - dristat and drmstat cleanups (Leif Delgass). + - Remove unused dev->map_count (Leif Delgass). + - For the i830 DRM driver, pass the dma handle from pci_alloc_consistent + to the card for status page rather than using virt_to_bus on + the virtual address (Leif Delgass). + - Cleanup the style of the linux-compat code in the BSD DRM, and use + ioctl directly rather than reimplementing it (Eric Anholt). + 141. Remove old XF86Setup source code. (Matthieu Herrb). + 140. Only add all default modes to mode list when RandR is enabled and + active (Egbert Eich). + 139. MGA driver: vertical blanking can generate interrupt (2D driver part) + (Ville Syrjala Bugz.: 199). + 138. Fix mmapw SEGV (Marc La France). + 137. From the DRI trunk... + - Install dummy/noop read & poll fops unless the driver has + replacements (Keith Whitwell). + - Remove gamma-specific stuff from the BSD DRM (Eric Anholt). + - Remove DRM_DMA_HISTOGRAM and associated code from the BSD DRM + (Eric Anholt). + - Remove BSD DRM's unused drm_init.h (Eric Anholt). + - Handle read() failures in the drm X server module (Michel Daenzer). + - Set DRM device major for NetBSD. + 136. Fix bug that prevented fbman from using the last partial scanline of a + Mach64 framebuffer (Marc La France). + 135. Make ATI Mach64 FIFO cache integrity testing optional (Marc La France). + 134. Export ATI Mach64 hardware overlay as an XVideo adaptor (derived from + GATOS project, Egbert Eich, Marc La France). + 133. Reorganise ATI Mach64 support into separate source files (Marc La France). - 975. Fix bug in mode validation that occurs when the XF86Config doesn't + 132. Refine atimisc's decoding of the panel mode on server entry in an attempt + to reduce the effect of atyfb bugs (Marc La France). + 131. Make Rage128 and Radeon XVideo available even when 2D acceleration is + disabled (Marc La France). + 130. There is no longer any need to require hardware cursors during Rage128 + and Radeon XVideo displays (Marc La France). + 129. Initialise v4l's XVideo adaptors last (Marc La France). + 128. Reduce cut&paste effects by adding more helpers to Xv + (derived from #5645, Björn Augustsson, Marc La France). + 127. Centralise a region comparison primitive into 'mi' and use it instead of + local definitions throughout the server (Marc La France). + 126. DPMSExtension & XvExtension driver cleanups (Marc La France). + 125. Add missing tests for vtSema to xaa 'Picture' functions. + These missing checks caused strange behavior with some drivers + when RENDER extension requests were made while X was switched away. + (Egbert Eich). + 124. i810 driver: call drmCtlUninstHandler() on CloseScreen() + (David Airlie). + 123. Savage driver updated to 1.1.1.27: several fixes for video glitches + (Tim Roberts). + 122. Put back the DRM part of Charl Botha's Radeon suspend/resume support + that was inadvertently backed out in the DRI resync last week. + 121. Resync the Linux drm modules with the DRI trunk. Includes: + - Check for NULL map before calling DRM(ioremapfree) on cleanup + (Leif Delgass). + - Remove DRM read, poll and write_string (Keith Whitwell). + - Add more get_param queries for embedded project (Keith Whitwell). + - Move a bunch of gamma-specific code into a gamma-specific file, + and restore the kooky DRM(write_string) code for gamma + (Keith Whitwell). + - Remove unused DMA histogram code (Keith Whitwell). + - Remove unused 'DRM_FLAG_NOCTX' option (Keith Whitwell). + - Remove unused __HAVE_KERNEL_CTX_SWITCH code (Keith Whitwell). + - Fix templates so the i8x0 drivers don't have to define + __HAVE_DMA_WAITLIST (Keith Whitwell). + - Gamma drm updates (Alan Hourihane). + - Only mga, i810, i830 require AGP (Leif Delgass). + - Remove PCIGART_ENABLED define for radeon, pcigart support now + included for any arch (Leif Delgass). + - Get rid of superfluous fields in struct drm_radeon_ring_buffer + (Michel Daenzer). + - Use correct address for radeon ring read pointer writeback + (Michel Daenzer). + 120. Fix a potential bug in ZX1 support (Marc La France). + 119. Fix a buffer overflow in xkbprint (Ivan Pascal). + 118. Fix a bug in Xlib that prevents a vertical text drawing with + X[mb|wc]DrawString (bugzilla #178, OSAME Ken-ichiro). + 117. Added missing files to the SDK so it can actually be used (Sven Luther). + 116. mkfontscale enhancements (bugzilla #166, Julius Chroboczek). + 115. Fix handling of local host names in /etc/X<n>.hosts (bugzilla #156, + Alan Coopersmith). + 114. Add to XLookupString an automatic search of the layout which keysym can + be converted to a control-code when Control modifier is set (Ivan Pascal). + 113. Fix xkbcomp crash with some combinations of layouts in a multi-layout + keyboard map (Ivan Pascal). + 112. Keyboard maps cleanups, including: + - fix incorrect aliases in a keycodes file. + - remove unneeded type declarations. + - remove ThirdLevel modifier key descriptions in maps and replace them + with references to a common one in 'level3' file. + - some cosmetic changes. + (Ivan Pascal). + 111. Fix some function definition conflicts from Xlib cleanup when X_LOCALE + or NeedWidePrototypes is set (Torrey T. Lyons). + 110. Resync the BSD drm modules with the DRI trunk (Eric Anholt). + 109. Resync the Linux drm modules with the DRI trunk. Includes: + - Add 2nd arg for DRM_FREE (Keith Whitwell). + - Use file pointers instead of pids for resource and lock tracking + (Keith Whitwell). + - Add 'SG' map type identifier string ((pci scatter/gather) to /proc vm + info (Leif Delgass). + - Use list_entry() to get container struct from struct list_head + pointers. Build fix for RedHat 9 kernel (5 args to + remap_page_range()) (Leif Delgass). + 108. Fix a server crash with shadowfb and render when refreshing outside the + visible screen (Sven Luther). + 107. Fix a potential infinite loop during server generation when in + Xinerama (Rik Faith). + 106. Fix DRM module build on 2.5.41 and later kernels (tqueue -> workqueue) + (David Dawes). + 105. Fix lockup when using Xv in the trident driver (Alan Hourihane). + 104. Add support for TV chipsets VT1621 and CH7005 to the trident driver + (VIA, Alan Hourihane). + 103. Add VIA CLE266 driver (Bugzilla #154, VIA/S3) + 102. Remove non-functioning glxStub, and remove external GlxStaticServerLib + support (David Dawes). + 101. Change the WORLDOPTS default to empty. This means that 'make World' + will now stop on the first error. To get the old behaviour, run + 'make WORLDOPTS=-k World' (David Dawes). + 100. Add preliminary version of generic rootless code based on XDarwin's + rootless mode (Torrey T. Lyons, John Harper). + 99. Remove PEX and XIE source code (Matthieu Herrb). + 98. The XKB version of XRefreshKeyboardMapping() had an UnlockDisplay() + call without a preceding LockDisplay() call (Yoel Perl). + 97. Xlib cleanups and fixes, including: + - Fixed up any old style function defintions that raised warnings. + - Fixed functions with no parameter or return value. + - Moved any external prototype in a c-files to h-files. + - Set unreferenced and unmentioned functions to static. + - Completed any forward declartion with its calling parameters. + - Established function typedefs where might be helpful. + - Fixed bogus XIM callback function to XID type, fixed XPointer* - + XPointer mismatch on some callback. + - Added explicit FIXME XXX statement on locations for the work around + macro XCMS_CONVERSION_HARDWARE where the compiler was unsatisfied + about a known problem with the currently inconsistent src_to_CIEXYZ + table types. + - Split _XcmsSetGetColor and *Colors handling routine in order + to avoid any type conflicts there, fixed a memory leak for + error case in that area. Used stack based Buffer for single-color + version (should be simpler and faster). + - Fixed _XAsyncReply where a "register variable pend" was passed + and returned with the & operator. This location is further + suspect of variable size problems on anything else but 32 bit + platforms, with the new code it might more likely raise a type + mismatch warning for those specific location. + (#A.1729, Alexander Stohr). + 96. Fix the <KPDL> mapping for the hr XKB map, and add an hr_US map (#A.1726, + Vlatko Kosturjak). + 95. Fix vmware driver crash when running two X servers concurrently (#5688, + Nolan Leake). + 94. Rework the Linux drm kernel module build to leverage off the standard + kernel build system. This is based on suggestions and examples from + David Woodhouse. This approach has the advantage that the build + requirements of a wider range of standard kernels are now supported + transparently, but the disadvantage of some extra complexity to handle + building against clean vendor-distributed kernel source trees. + This has been tested with some recent Red Hat and SuSE distributions + (David Dawes). + 93. Update Italian keyboard map (Bugzilla #109, Sebastiano Vigna). + 92. Add keys missed in multi-layout keyboard maps: LSGT key in Belgian map + and 'old','phonetic' variants in Armenian map (Ivan Pascal). + 91. More reliable workaround for handling the I830Sync() function being + called while VT switched away (David Dawes). + 90. Fix references to DRI functions in non-DRI i810_driver.c build + (David Dawes). + 89. Import expat 1.95.4 (Matthieu Herrb). + +XFree86 4.3.99.2 (10 April 2003) + 88. Fix file descriptor leaks in xman (Ted Unangst, OpenBSD PR#3186). + 87. Fix bug in mode validation that occurs when the XF86Config doesn't specify any mode or virtual resolution information (Marc La France). - 974. Another int10 fix. This time for adapters found at PCI:0:0:0. This + 86. Resetting 'bound' flag for an agp entry after undbind succeeded in + drm_agpsupport.h (Egbert Eich). + 85. Ignoring hw_lock for drm device if lock was set by a different instance + (ie Xserver) to prevent second server to spin in driver release function + (currently only relevant for i8xx drm drivers) (David Dawes). + 84. Adding extra delay before doing a slowBcopy in ia64 to prevent a MC + when saving/restoring VGA fonts (Egbert Eich). + 83. Turn off needToSync in LeaveVT() in i830 driver to prevent server + crashes because xaa tries to sync blitter while switched away + (Egbert Eich). + 82. Added the O_SYNC flag when opening /dev/mem to work around a kernel bug + which causes conflits between WC settings in MTRR registers and cacheable + attribute in page table (Egbert Eich). + 81. Reduced retry count for mouse configuration to 4. This should speed + up server start for people who use a mouse repeater like gpm + (Egbert Eich). + 80. Fixed xf86cfg to duplicate font names before they get freed when + unloading the module (Egbert Eich). + 79. Added missing functions to xf86cfg (Egbert Eich). + 78. Added missing ROP_NEEDS_SOURCE to Savage driver; + now all 2D accel functions should use this flag (Egbert Eich). + 77. Reduced flicker with video playback in Savage driver (Tim Roberts). + 76. Load vgahw submodule in RENDITION driver before using it + (Egbert Eich). + 75. Magically speed up video playback on Neomagic (Egbert Eich). + 74. Added drmAgpUnbind()/drmAgpBind() functionality on Leave/Enter for i810 + cards to allow a second Xserver to be started if the first one has + DRI enabled (Egbert Eich). + 73. Set NeedRingBufferLow for i855/i865 to avoid lockups on vt switches + (Egbert Eich). + 72. Check for vtSema before accessing registers in I830BIOSSaveScreen() + (Egbert Eich). + 71. Some sanity fixes for atiprobe to work better with xf86cfg: Handle + situation gracefully if the PCI config pointer doesn't exist + (Egbert Eich). + 70. Changed behavior of fontfile: don't drop the entire directory if some + fonts cannot be rendered (Egbert Eich). + 69. Fixed B&H bdf fonts: AVERAGE_WIDTH is not a string but an int (Mike Fabian). + 68. Fixed type in radeon driver which caused display to go into + powersaving mode when Xcursor is disabled (Bugz: 90, Michel Dänzer). + 67. Fixed typo in XKB-Config.sgml (Bugz: 53, Hiroyuki Bessho). + 66. Fix SiliconMotion driver for mode switching and SEGV problem when + initializing Xv functionality (Bugzilla #50, Alan Hourihane). + 65. Add Radeon DRI suspend/resume support (Charl Botha, #A.1431). + 64. Rage 128 Xv fix for high resolution displays (Rik Faith). + 63. PPC updates for Radeon (Michel Dänzer, Hui Yu@ATI). + 62. Radeon patch from ATI (Hui Yu@ATI). + - IGP320/330/340 support (2D only) + - RV280 (9200/M9+) support + - Fix for some M9 laptop panels + - Improved version of monitor detection code previously submitted + - Fixed bug for two or more radeon cards + - Man page updates + - Workaround for double scan modes problem at high resolutions + - Overlay scaling problem when RMX is used + 61. Fix xprop to get all windows (not only the first) in a property holding + a window list printed (#A.1676, Kim Woelders). + 60. Fix for spontaneous repeated keyboard events during sync grab (#A.1713, + Michal Maruska). + 59. Fixed DPMS problem on C&T 69000 due to incorrect LCD flag + (Bugzilla #101, Egbert Eich). + 58. Added xkb symbols layout for BTC 5090 internet keyboard + (Bugzilla #57, Jack Angel). + 57. Fix the Xinstall.sh script so that it can handle being run from a + directory with white space in its path name (#A.1690, Eric Branlund). + 56. Allow AGPGART support to be enabled for OpenBSD (#A.1684, Brian Feldman). + 55. Make the mouse driver check the SendDragEvents option (based on #A.1682, + Juuso Åberg). + 54. Fix a double allocation in _XTextPropertyToTextList() (#A.1681, + Lubos Lunak). + 53. Fix a typo that causes the 'yu' keymap to emit a lower case 'L' in + both shift states (#A.1675, Nikola Smolenski). + 52. Allow the remote shell command for xon to be specified from the + command line. This allows ssh to be used (for example) (#A.1657, + Mike Urban). + 51. Fix segfaults that can happen when using composition of RENDER and + non-RENDER fonts (#A.1656, Wu Jian Feng). + 50. Add convenient ways to enter "double quote" and "cedilla" with the + en_US.UTF-8 compose rules (Alexandre Oliva). + 49. Improve support for Wacom Cintiq boards (#A.1547, Sebastian Rittau). + 48. Add support for Kensington's "ValuMouse" to the mouse driver (#A.1494, + Roy Wood). + 47. Workaround for a crash that happens if a scalable font has a bitmap + entry in fonts.dir (#5687, Juliusz Chroboczek). + 46. Single/dual rasterizer quiescence patch for the glint/gamma DRI driver + (#5685, Sven Luther). + 45. Fix a FreeBSD/alpha build problem (#5679, Fred Clift). + 44. Fix a bug in the GLU/project.3gl man page (#5676, Thomas Klausner). + 43. Luit fixes: + - Fix a buffer overflow. + - Allow for holes in the pty space, and use the union of the pty + names in 4.4BSD and recent FreeBSD. + - Allow luit to be set-uid on all BSD releases, and introduce an + additional security fix on POSIX saved-id systems. + (#5672, 5674, ITO Tsuyoshi, Juliusz Chroboczek). + 42. Fix memory leaks in ProcXF86VidModeModModeLine and + ProcXF86VidModeValidateModeLine, and unintialized fields of the mode + structure in ProcXF86VidModeAddModeLine, VidModeCreateMode, and + VidModeAddModeline (#5671, Miguel Freitas). + 41. Fix SEGV in fbdev's mode validation (Alexandr Andreev). + 40. Add two more variations of Thai XKB maps (#5658, + Theppitak Karoonboonyanan, Visanu Euarchukiati, + Supphachoke Santiwichaya). + 39. Fix a twm crash when the window menu is used and no windows are open + (#5667, Matthias Scheler). + 38. Restore the sign of UNDERLINE_POSITION in the FreeType backend (#5665, + Roman Kagan). + 37. Check the return value of fclose() in xauth to prevent losing the + existing contents of an Xauthority file when there is insufficient + space to write the new one (#5663, Owen Taylor). + 36. Fix case in xmag which would cause a BadMatch during a X_GetImage for + single child of root class InputOnly. Also do some null pointer + protection (#5657, Kevin Brosius). + 35. Allow an arbitary message to be sent to the DDX by pressing a key + which has the appropriate action definition (#5519, Joe Moss). + 34. Add a new request to the XF86Misc extension that allows a client + to send an arbitrary message to the DDX, which in turn can send the + message to the driver. The driver may also send a string back. + An example of this is implemented for the radeon driver (#5518, + Joe Moss). + 33. Remove duplicate XShmGetEventBase() declaration (#5656, + Branden Robinson). + 32. Fix drag lock when using a mouse button greater than 4 + (Bugzilla #51, Paul Elliott) + 31. Fix lockup on server shutdown/restart with the radeon driver + (Bugzilla #94, Michel Dänzer). + 30. Add missing symbols to reference list that show up when DRI is not + loaded in r128 driver (Bugzilla #83, Leif Delgass). + 29. Add missing symbols to reference list that show up when DRI is not + loaded in mga driver (Bugzilla #84, Leif Delgass). + 28. Various build and warning fixes (#A.1703, Peter Breitenlohner). + 27. Avoid overlapping strcpy() in imake.c (Dan Nelson). + 26. Updates for building on OS/2 (#5650, Frank Giessler). + +XFree86 4.3.99.1 (23 March 2003) + 25. Xterm patch #176 (Thomas Dickey). + 24. Another int10 fix. This time for adapters found at PCI:0:0:0. This fix is particularly important for ZX1-based systems (Marc La France). - 973. int10 fix for all ix86 non-Linux systems (Marc La France). - 972. Fix compatibility problem between modules generated without the recent + 23. int10 fix for all ix86 non-Linux systems (Marc La France). + 22. Add preliminary support for generating HTML and PDF versions of most + spec documents (David Dawes). + 21. Use lower-case extensions uniformly for text and PostScript documents + (based on #4876, Branden Robinson). + 20. Disable cuase of SEGV's in rendition driver (Marc La France). + 18. Limit 440EX & 440LX based systems to 32 PCI buses (Marc La France). + 18. Fix typo that caused incorrect initialization of xkb memory + (John Heasley). + 17. Fix bug in trident driver that caused old Cyber 9382/9385 chipsets + to display half a jittered screen (Alan Hourihane). + 16. Add shadowfb support to XDarwin IOKit mode (Torrey T. Lyons). + 15. Change most of os-support/ to respect VIDMEM_READONLY (Marc La France). + 14. Fix compatibility problem between modules generated without the recent setjmp/longjmp work and a server generated using glibc <= 2.2.* (Marc La France). - 971. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France). - 970. Make setjmp/longjmp emulation save/restore blocked signal masks on all + 13. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France). + 12. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb). + 11. Various NetBSD fixes for non-i386 (#5662, #5666 Aymeric Vincent, + Matthew Green, Chris Gilbert, Thomas Klausner). + 10. Enable native thread support on NetBSD 1.6M and later (#5597, #5660, + Matthias Scheler). + 9. Make setjmp/longjmp emulation save/restore blocked signal masks on all libc5 & glibc systems (Marc La France). - 969. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove + 8. Fix for non-PC keyboard bug introduced by changes to make SysRq + generate the same keycode as PrtScrn (Ivan Pascal). + 7. Workaround for problems linking C programs against libGLU on FreeBSD 3.x + (David Dawes). + 6. Make setjmp/longjmp emulation save/restore blocked signal masks on all + 5. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove HasGlibc21Sigsetjmp override (Marc La France). - 968. setjmp/longjmp-related compilation fixes for libc5 systems + 4. setjmp/longjmp-related compilation fixes for libc5 systems (Marc La France). - 967. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb). - 966. Fix XDarwin build broken by #960 (Shantonu Sen). - 965. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun). + 3. Fix minor glitch in the generation of Makefiles for libraries that don't + need threads support (Marc La France). + 2. Fix XDarwin build broken by #960 (Shantonu Sen). + 1. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun). XFree86 4.3.0 (27 February 2003) 964. Add an imake option to allow the glibc21-style setjmp() behaviour @@ -91,7 +1741,7 @@ XFree86 4.3.0 (27 February 2003) ARGB cursors by always using the ARGB mode (#A.1639, Michel Dänzer and Fredrik Höglund). 944. Fix rootless XDarwin crash when trying to GetImage with a rectangle - bigger then the associated top level window (Apple). + bigger then the associated top level window (John Harper). 943. Add support for multi-head on ZX1-based Itanium2 systems (Marc La France with documentation and assistance from Hewlett-Packard). 942. Correctly initialize the RE_LINE_PATTERN register in the radeon @@ -443,14 +2093,14 @@ XFree86 4.2.99.901 (4 February 2003) 797. Fix for memory fences on PowerPC (Marc La France). 796. Work-around for Radeon int10 problems (Marc La France). 795. Fix XDarwin crash in rootless mode with 16-bit color by ensuring that - window pixmap pointers are 32-bit aligned (Apple, Torrey T. Lyons). + window pixmap pointers are 32-bit aligned (John Harper, Torrey T. Lyons). 794. Update the i810 2D driver and i830 3D drivers to recognise and handle the Intel 852GM/855GM integrated graphics chipsets (David Dawes, Keith Whitwell). 793. Force extension-generated mode switches always occur (Marc La France). 792. Fix OS/2 library build problem (Frank Giessler). 791. Fix bug that at times prevented recognition of resources decoded on PCI - root busses (Marc La France). + root buses (Marc La France). 790. Fix XDarwin's spurious transparent regions in rootless windows (Torrey T. Lyons). 789. Fix bug in recognition of certain ix86 Host-to-PCI bridges @@ -483,7 +2133,7 @@ XFree86 4.2.99.901 (4 February 2003) (#A.1539, Juergen Keil). 773. Fix artifacts left by XDarwin when reshaping a shaped window (reported by Adrian Umpleby). - 772. Fix XDarwin rootless crash when resizing a window (Apple). + 772. Fix XDarwin rootless crash when resizing a window (John Harper). 771. Fix vbe module to not assume BIOS call results are zero-extended (Paulo Cesar Pereira de Andrade). 770. Fix improper initialisation of pciConfigRec's. Reported by Marcel @@ -495,7 +2145,7 @@ XFree86 4.2.99.901 (4 February 2003) (reported by Alexis Vartanian). XFree86 4.2.99.4 (20 January 2003) - 766. Fix XDarwin's rootless mode with 16-bit color (Apple). + 766. Fix XDarwin's rootless mode with 16-bit color (John Harper). 765. Allow UTF8 conversion to work for Japanese locales (#A.1527, Etsushi Kato). 764. Add a method for working around a problem that can show up when @@ -16580,7 +18230,7 @@ XFree86 3.0a (28 April 1994) XFree86 3.0 (26 April 1994) -$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2588.2.13 2003/05/10 01:12:56 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2982 2003/11/21 06:01:42 dawes Exp $ diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp index 1e9773ccc..0f1bd1b69 100644 --- a/hw/xfree86/doc/devel/README.DRIcomp +++ b/hw/xfree86/doc/devel/README.DRIcomp @@ -374,6 +374,13 @@ a 2.4.x kernel, you should add the following: #define MesaUseSSE YES +If you want to build the DRM kernel modules as part of the full build pro- +cess, add the following: + + #define BuildXF86DRM YES + +Otherwise, you'll need to build them separately as described below. + 8.3 Compilation To compile the complete DRI tree: @@ -401,11 +408,21 @@ work with XFree86/DRI. Using your text editor, examine world.log for errors by searching for the pattern ***. -Verify that the DRI kernel module(s) for your system were built: +After fixing the errors, run make World again. Later, you might just compile +parts of the source tree but it's important that the whole tree will build +first. + +If you edited your host.def file to enable automatic building of the DRI ker- +nel module(s), verify that they were built: cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel ls +Otherwise, build them now by running + + cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel + make -f Makefile.linux + For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI Radeon, you should see radeon.o. For the Intel i810, you should see i810.o. @@ -416,17 +433,14 @@ always supported. If your build machine is running a different version of the kernel than your target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel -headers. This can be fixed by explicitly setting the value of TREE. If the -path to your kernel source is /usr/src/linux-2.4.x, +source tree. This can be fixed by explicitly setting the value of LINUXDIR. +If the path to your kernel source is /usr/src/linux-2.4.x, cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make TREE=/usr/src/linux-2.4.x/include - -or alternatively, edit Makefile to include this change. + make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x -After fixing the errors, run make World again. Later, you might just compile -parts of the source tree but it's important that the whole tree will build -first. +or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN- +UXDIR line. 8.5 DRI kernel module installation @@ -537,7 +551,7 @@ At this point your X server should be up and running with hardware-acceler- ated direct rendering. Please read the DRI User Guide for information about trouble shooting and how to use the DRI-enabled X server for 3D applications. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 2002/11/26 01:05:50 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.20 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.16 2002/11/26 02:24:01 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.17 2003/07/15 02:28:28 dawes Exp $ diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml index 322ab00e0..365acaf1a 100644 --- a/hw/xfree86/doc/sgml/DESIGN.sgml +++ b/hw/xfree86/doc/sgml/DESIGN.sgml @@ -36,7 +36,7 @@ <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.52 2003/02/25 19:31:00 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.53 2003/08/23 14:10:14 dawes Exp $ </ident> @@ -6784,11 +6784,13 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags) */ /* - * Set the depth/bpp. Our preferred default depth/bpp is 8, and - * we support both 24bpp and 32bpp framebuffer layouts. + * Set the depth/bpp. Use the globally preferred depth/bpp. If the + * driver has special default depth/bpp requirements, the defaults should + * be specified here explicitly. + * We support both 24bpp and 32bpp framebuffer layouts. * This sets pScrn->display also. */ - if (!xf86SetDepthBpp(pScrn, 8, 8, 8, + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) { return FALSE; } else { diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index b08379099..409ada437 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.38 2002/11/20 18:10:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -1557,7 +1557,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) if(pDRIPriv->nrWindows > 0) { RegionRec reg; - REGION_INIT(pScreen, ®, NullBox, 0); + REGION_NULL(pScreen, ®); TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); if(REGION_NOTEMPTY(pScreen, ®)) { diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h index 99c04b9e9..fcb4b59bd 100644 --- a/hw/xfree86/dri/sarea.h +++ b/hw/xfree86/dri/sarea.h @@ -1,40 +1,41 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) 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 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, 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. - -**************************************************************************/ +/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */ +/** + * \file sarea.h + * SAREA definitions. + * + * \author Kevin E. Martin <kevin@precisioninsight.com> + * \author Jens Owen <jens@tungstengraphics.com> + * \author Rickard E. (Rik) Faith <faith@valinux.com> + */ /* - * Authors: - * Kevin E. Martin <kevin@precisioninsight.com> - * Jens Owen <jens@tungstengraphics.com> - * Rickard E. (Rik) Faith <faith@valinux.com> - * + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) 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 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, 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. */ +/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */ + #ifndef _SAREA_H_ #define _SAREA_H_ @@ -54,11 +55,21 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 +/** + * SAREA per drawable information. + * + * \sa _XF86DRISAREA. + */ typedef struct _XF86DRISAREADrawable { unsigned int stamp; unsigned int flags; } XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; +/** + * SAREA frame information. + * + * \sa _XF86DRISAREA. + */ typedef struct _XF86DRISAREAFrame { unsigned int x; unsigned int y; @@ -67,10 +78,13 @@ typedef struct _XF86DRISAREAFrame { unsigned int fullscreen; } XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; +/** + * SAREA definition. + */ typedef struct _XF86DRISAREA { - /* first thing is always the drm locking structure */ + /** first thing is always the DRM locking structure */ drmLock lock; - /* NOT_DONE: Use readers/writer lock for drawable_lock */ + /** \todo Use readers/writer lock for drawable_lock */ drmLock drawable_lock; XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; XF86DRISAREAFrameRec frame; diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 7920b217d..3df0cca59 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.13 2003/09/24 02:43:12 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -241,7 +241,7 @@ ProcXF86DRIAuthConnection( rep.authenticated = 1; if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) { - ErrorF("Failed to authenticate %u\n", stuff->magic); + ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic); rep.authenticated = 0; } WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep); diff --git a/hw/xfree86/dummylib/dummylib.h b/hw/xfree86/dummylib/dummylib.h index 4b685e272..d8a0d285a 100644 --- a/hw/xfree86/dummylib/dummylib.h +++ b/hw/xfree86/dummylib/dummylib.h @@ -1,8 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.1 2000/02/13 03:06:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #ifndef _DUMMY_LIB_H #define _DUMMY_LIB_H -extern void VErrorFVerb(int verb, const char *format, va_list ap); - #endif /* _DUMMY_LIB_H */ diff --git a/hw/xfree86/dummylib/xf86drvmsg.c b/hw/xfree86/dummylib/xf86drvmsg.c index ffcefd6bf..5780d9c13 100644 --- a/hw/xfree86/dummylib/xf86drvmsg.c +++ b/hw/xfree86/dummylib/xf86drvmsg.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86DrvMsg(int i, MessageType type, const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(1, format, ap); + LogVWrite(1, format, ap); va_end(ap); } diff --git a/hw/xfree86/dummylib/xf86drvmsgverb.c b/hw/xfree86/dummylib/xf86drvmsgverb.c index f59c42abf..b7c0ddb53 100644 --- a/hw/xfree86/dummylib/xf86drvmsgverb.c +++ b/hw/xfree86/dummylib/xf86drvmsgverb.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86DrvMsgVerb(int i, MessageType type, int verb, const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(verb, format, ap); + LogVWrite(verb, format, ap); va_end(ap); } diff --git a/hw/xfree86/dummylib/xf86errorf.c b/hw/xfree86/dummylib/xf86errorf.c index 072f639ca..122f46d43 100644 --- a/hw/xfree86/dummylib/xf86errorf.c +++ b/hw/xfree86/dummylib/xf86errorf.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.2 2000/05/31 07:15:05 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.3 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86ErrorF(const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(1, format, ap); + LogVWrite(1, format, ap); va_end(ap); } @@ -26,6 +25,6 @@ ErrorF(const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(1, format, ap); + LogVWrite(1, format, ap); va_end(ap); } diff --git a/hw/xfree86/dummylib/xf86errorfverb.c b/hw/xfree86/dummylib/xf86errorfverb.c index 61bff15a5..61c3e02a2 100644 --- a/hw/xfree86/dummylib/xf86errorfverb.c +++ b/hw/xfree86/dummylib/xf86errorfverb.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86ErrorFVerb(int verb, const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(verb, format, ap); + LogVWrite(verb, format, ap); va_end(ap); } diff --git a/hw/xfree86/dummylib/xf86msg.c b/hw/xfree86/dummylib/xf86msg.c index bc8c76626..2d36bea97 100644 --- a/hw/xfree86/dummylib/xf86msg.c +++ b/hw/xfree86/dummylib/xf86msg.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86Msg(MessageType type, const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(1, format, ap); + LogVWrite(1, format, ap); va_end(ap); } diff --git a/hw/xfree86/dummylib/xf86msgverb.c b/hw/xfree86/dummylib/xf86msgverb.c index b9e343fd9..f460b6b9f 100644 --- a/hw/xfree86/dummylib/xf86msgverb.c +++ b/hw/xfree86/dummylib/xf86msgverb.c @@ -1,10 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */ #include "X.h" #include "os.h" #include "xf86.h" #include "xf86Priv.h" -#include "dummylib.h" /* * Utility functions required by libxf86_os. @@ -16,7 +15,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...) va_list ap; va_start(ap, format); - VErrorFVerb(verb, format, ap); + LogVWrite(verb, format, ap); va_end(ap); } diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index a90fff34c..752cdb044 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.30 2002/11/25 14:05:00 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.33 2003/10/30 17:37:16 tsi Exp $ */ /* all driver need this */ #include "xf86.h" @@ -462,7 +462,7 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn) int virtY = pScrn->display->virtualY; struct fb_var_screeninfo var; char **modename; - DisplayModePtr mode,this,last = NULL; + DisplayModePtr mode,this,last = pScrn->modes; TRACE_ENTER("VerifyModes"); if (NULL == pScrn->display->modes) @@ -542,7 +542,7 @@ fbdevHWUseBuildinMode(ScrnInfoPtr pScrn) /* -------------------------------------------------------------------- */ -void +static void calculateFbmem_len(fbdevHWPtr fPtr) { fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK; @@ -747,7 +747,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, /* -------------------------------------------------------------------- */ /* these can be hooked directly into ScrnInfoRec */ -int +ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; @@ -789,6 +789,11 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); TRACE_ENTER("AdjustFrame"); + + if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual || + y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual ) + return; + fPtr->var.xoffset = x; fPtr->var.yoffset = y; if (-1 == ioctl(fPtr->fd,FBIOPAN_DISPLAY,(void*)&fPtr->var)) diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h index 78a5b5882..cfc47f905 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.h +++ b/hw/xfree86/fbdevhw/fbdevhw.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.11 2001/10/01 13:44:12 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.12 2003/10/30 17:37:16 tsi Exp $ */ #ifndef _FBDEVHW_H_ #define _FBDEVHW_H_ @@ -40,7 +40,7 @@ void fbdevHWRestore(ScrnInfoPtr pScrn); void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); -int fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); +ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); void fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags); Bool fbdevHWEnterVT(int scrnIndex, int flags); diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c index 02086ef8f..b262be90f 100644 --- a/hw/xfree86/fbdevhw/fbdevhwstub.c +++ b/hw/xfree86/fbdevhw/fbdevhwstub.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.12 2001/10/28 03:33:55 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.13 2003/10/30 17:37:16 tsi Exp $ */ #include "xf86.h" #include "xf86cmap.h" @@ -130,7 +130,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, { } -int +ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { return MODE_ERROR; diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 494f9303b..a7f5adf1a 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -6,7 +6,7 @@ * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.13 2002/09/16 18:06:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.15 2003/08/29 21:08:06 tsi Exp $ */ #if 1 #include "misc.h" @@ -750,7 +750,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too) if (b) { I2CBusPtr *p; - /* Remove this from the list of active I2C busses. */ + /* Remove this from the list of active I2C buses */ for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus) if (*p == b) { @@ -794,7 +794,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too) Bool xf86I2CBusInit(I2CBusPtr b) { - /* I2C busses must be identified by a unique scrnIndex + /* I2C buses must be identified by a unique scrnIndex * and name. If scrnIndex is unspecified (a negative value), * then the name must be unique throughout the server. */ @@ -861,3 +861,32 @@ xf86I2CFindBus(int scrnIndex, char *name) return NULL; } + +/* + * Return an array of I2CBusPtr's related to a screen. The caller is + * responsible for freeing the array. + */ +int +xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) +{ + I2CBusPtr pI2CBus; + int n = 0; + + if (pppI2CBus) + *pppI2CBus = NULL; + + for (pI2CBus = I2CBusList; pI2CBus; pI2CBus = pI2CBus->NextBus) { + if ((pI2CBus->scrnIndex >= 0) && (pI2CBus->scrnIndex != scrnIndex)) + continue; + + n++; + + if (!pppI2CBus) + continue; + + *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); + *pppI2CBus[n - 1] = pI2CBus; + } + + return n; +} diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h index 42b68a179..e7423155a 100644 --- a/hw/xfree86/i2c/xf86i2c.h +++ b/hw/xfree86/i2c/xf86i2c.h @@ -2,11 +2,11 @@ * Copyright (C) 1998 Itai Nahshon, Michael Schimek */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.8 2001/07/19 14:19:40 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.11 2003/08/29 21:08:06 tsi Exp $ */ #ifndef _XF86I2C_H #define _XF86I2C_H -#include "miscstruct.h" +#include "regionstr.h" typedef unsigned char I2CByte; typedef unsigned short I2CSlaveAddr; @@ -52,6 +52,8 @@ I2CBusPtr xf86CreateI2CBusRec(void); void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too); Bool xf86I2CBusInit(I2CBusPtr pI2CBus); I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name); +int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus); + /* I2C slave devices */ diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index d481f000d..845c8a177 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.25.2.1 2003/03/20 15:14:25 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.29 2003/09/24 02:43:33 dawes Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -139,20 +139,22 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) if (bios.bus == BUS_ISA && bios.location.legacy) { xf86DrvMsg(screen, X_CONFIG, - "Overriding BIOS location: 0x%lx\n", + "Overriding BIOS location: 0x%x\n", bios.location.legacy); cs = bios.location.legacy >> 4; #define CHECK_V_SEGMENT_RANGE(x) \ - if ((x << 4) < V_BIOS) {\ + if (((x) << 4) < V_BIOS) {\ xf86DrvMsg(screen, X_ERROR, \ - "V_BIOS address 0x%x out of range\n",x << 4); \ + "V_BIOS address 0x%lx out of range\n", \ + (unsigned long)(x) << 4); \ goto error1; \ } CHECK_V_SEGMENT_RANGE(cs); vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4); if (!int10_check_bios(screen, cs, vbiosMem)) { xf86DrvMsg(screen, X_ERROR, - "No V_BIOS at specified address 0x%x\n",cs << 4); + "No V_BIOS at specified address 0x%lx\n", + (unsigned long)cs << 4); goto error1; } } else { @@ -182,7 +184,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } } - xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs); + xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", + (unsigned long)cs); set_return_trap(pInt); pInt->BIOSseg = cs; diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 2d6c0eb24..7528fea0e 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.24 2002/11/25 21:05:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.26 2003/11/06 18:38:12 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -145,7 +145,7 @@ void dump_code(xf86Int10InfoPtr pInt) { int i; - CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); + unsigned long lina = SEG_ADR((CARD32), X86_CS, IP); xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina); for (i=0; i<0x10; i++) @@ -160,25 +160,28 @@ void dump_registers(xf86Int10InfoPtr pInt) { xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, - "EAX=0x%8.8x, EBX=0x%8.8x, ECX=0x%8.8x, EDX=0x%8.8x\n", - X86_EAX, X86_EBX, X86_ECX, X86_EDX); + "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n", + (unsigned long)X86_EAX, (unsigned long)X86_EBX, + (unsigned long)X86_ECX, (unsigned long)X86_EDX); xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, - "ESP=0x%8.8x, EBP=0x%8.8x, ESI=0x%8.8x, EDI=0x%8.8x\n", - X86_ESP, X86_EBP, X86_ESI, X86_EDI); + "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n", + (unsigned long)X86_ESP, (unsigned long)X86_EBP, + (unsigned long)X86_ESI, (unsigned long)X86_EDI); xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "CS=0x%4.4x, SS=0x%4.4x," " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n", X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS); xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, - "EIP=0x%8.8x, EFLAGS=0x%8.8x\n", X86_EIP, X86_EFLAGS); + "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n", + (unsigned long)X86_EIP, (unsigned long)X86_EFLAGS); } void stack_trace(xf86Int10InfoPtr pInt) { int i = 0; - CARD32 stack = SEG_ADR((CARD32), X86_SS, SP); - CARD32 tail = (CARD32)((X86_SS << 4) + 0x1000); + unsigned long stack = SEG_ADR((CARD32), X86_SS, SP); + unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000); if (stack >= tail) return; diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c index d6c5d1f43..a74bbeacd 100644 --- a/hw/xfree86/int10/xf86int10.c +++ b/hw/xfree86/int10/xf86int10.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.10.2.1 2003/03/21 22:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.11 2003/03/21 22:26:11 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment diff --git a/hw/xfree86/loader/aout.h b/hw/xfree86/loader/aout.h index 2e58f2cab..cd7807531 100644 --- a/hw/xfree86/loader/aout.h +++ b/hw/xfree86/loader/aout.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.7 2002/05/31 18:46:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.8 2003/10/15 16:29:02 dawes Exp $ */ /* * Borrowed from NetBSD's exec_aout.h @@ -41,8 +41,8 @@ #include <ctype.h> /* OS/2 EMX has ntohl in this file */ -#ifdef __UNIXOS2__ -#include <sys/param.h> +#ifdef __UNIXOS2__ +#include <sys/param.h> #endif #define __LDPGSZ 4096U @@ -54,44 +54,44 @@ * a.out header */ typedef struct AOUT_exec { - unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ - unsigned long a_text; /* text segment size */ - unsigned long a_data; /* initialized data size */ - unsigned long a_bss; /* uninitialized data size */ - unsigned long a_syms; /* symbol table size */ - unsigned long a_entry; /* entry point */ - unsigned long a_trsize; /* text relocation size */ - unsigned long a_drsize; /* data relocation size */ + unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ + unsigned long a_text; /* text segment size */ + unsigned long a_data; /* initialized data size */ + unsigned long a_bss; /* uninitialized data size */ + unsigned long a_syms; /* symbol table size */ + unsigned long a_entry; /* entry point */ + unsigned long a_trsize; /* text relocation size */ + unsigned long a_drsize; /* data relocation size */ } AOUTHDR; /* a_magic */ -#define OMAGIC 0407 /* old impure format */ -#define NMAGIC 0410 /* read-only text */ -#define ZMAGIC 0413 /* demand load format */ -#define QMAGIC 0314 /* "compact" demand load format; deprecated */ +#define OMAGIC 0407 /* old impure format */ +#define NMAGIC 0410 /* read-only text */ +#define ZMAGIC 0413 /* demand load format */ +#define QMAGIC 0314 /* "compact" demand load format; deprecated */ /* * a_mid - keep sorted in numerical order for sanity's sake * ensure that: 0 < mid < 0x3ff */ -#define MID_ZERO 0 /* unknown - implementation dependent */ -#define MID_SUN010 1 /* sun 68010/68020 binary */ -#define MID_SUN020 2 /* sun 68020-only binary */ -#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */ -#define MID_HP200 200 /* hp200 (68010) BSD binary */ -#define MID_I386 134 /* i386 BSD binary */ -#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */ -#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */ -#define MID_NS32532 137 /* ns32532 */ -#define MID_SPARC 138 /* sparc */ -#define MID_PMAX 139 /* pmax */ -#define MID_VAX 140 /* vax */ -#define MID_ALPHA 141 /* Alpha BSD binary */ -#define MID_MIPS 142 /* big-endian MIPS */ -#define MID_ARM6 143 /* ARM6 */ -#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */ -#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */ -#define MID_HPUX800 0x20B /* hp800 HP-UX binary */ +#define MID_ZERO 0 /* unknown - implementation dependent */ +#define MID_SUN010 1 /* sun 68010/68020 binary */ +#define MID_SUN020 2 /* sun 68020-only binary */ +#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */ +#define MID_HP200 200 /* hp200 (68010) BSD binary */ +#define MID_I386 134 /* i386 BSD binary */ +#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */ +#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */ +#define MID_NS32532 137 /* ns32532 */ +#define MID_SPARC 138 /* sparc */ +#define MID_PMAX 139 /* pmax */ +#define MID_VAX 140 /* vax */ +#define MID_ALPHA 141 /* Alpha BSD binary */ +#define MID_MIPS 142 /* big-endian MIPS */ +#define MID_ARM6 143 /* ARM6 */ +#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */ +#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */ +#define MID_HPUX800 0x20B /* hp800 HP-UX binary */ /* * a_flags @@ -179,19 +179,19 @@ typedef struct AOUT_exec { #define AOUT_STROFF(ex) \ (AOUT_SYMOFF(ex) + (ex)->a_syms) - /* Relocation format. */ struct relocation_info_i386 { - int r_address; /* offset in text or data segment */ - unsigned int r_symbolnum : 24, /* ordinal number of add symbol */ - r_pcrel : 1, /* 1 if value should be pc-relative */ - r_length : 2, /* log base 2 of value's width */ - r_extern : 1, /* 1 if need to add symbol to value */ - r_baserel : 1, /* linkage table relative */ - r_jmptable : 1, /* relocate to jump table */ - r_relative : 1, /* load address relative */ - r_copy : 1; /* run time copy */ + int r_address; /* offset in text or data segment */ + unsigned int r_symbolnum:24, /* ordinal number of add symbol */ + r_pcrel:1, /* 1 if value should be pc-relative */ + r_length:2, /* log base 2 of value's width */ + r_extern:1, /* 1 if need to add symbol to value */ + r_baserel:1, /* linkage table relative */ + r_jmptable:1, /* relocate to jump table */ + r_relative:1, /* load address relative */ + r_copy:1; /* run time copy */ }; + #define relocation_info relocation_info_i386 /* @@ -200,33 +200,32 @@ struct relocation_info_i386 { */ typedef struct AOUT_nlist { union { - char *n_name; /* symbol name (in memory) */ - long n_strx; /* file string table offset (on disk) */ + char *n_name; /* symbol name (in memory) */ + long n_strx; /* file string table offset (on disk) */ } n_un; - -#define AOUT_UNDF 0x00 /* undefined */ -#define AOUT_ABS 0x02 /* absolute address */ -#define AOUT_TEXT 0x04 /* text segment */ -#define AOUT_DATA 0x06 /* data segment */ -#define AOUT_BSS 0x08 /* bss segment */ -#define AOUT_INDR 0x0a /* alias definition */ -#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */ -#define AOUT_COMM 0x12 /* common reference */ -#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */ -#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */ - -#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */ -#define AOUT_TYPE 0x1e /* mask for all the type bits */ - unsigned char n_type; /* type defines */ - - char n_other; /* spare */ -#define n_hash n_desc /* used internally by ld(1); XXX */ - short n_desc; /* used by stab entries */ - unsigned long n_value; /* address/value of the symbol */ +#define AOUT_UNDF 0x00 /* undefined */ +#define AOUT_ABS 0x02 /* absolute address */ +#define AOUT_TEXT 0x04 /* text segment */ +#define AOUT_DATA 0x06 /* data segment */ +#define AOUT_BSS 0x08 /* bss segment */ +#define AOUT_INDR 0x0a /* alias definition */ +#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */ +#define AOUT_COMM 0x12 /* common reference */ +#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */ +#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */ + +#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */ +#define AOUT_TYPE 0x1e /* mask for all the type bits */ + unsigned char n_type; /* type defines */ + + char n_other; /* spare */ +#define n_hash n_desc /* used internally by ld(1); XXX */ + short n_desc; /* used by stab entries */ + unsigned long n_value; /* address/value of the symbol */ } AOUT_nlist; -#define AOUT_FORMAT "%08x" /* namelist value format; XXX */ -#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */ +#define AOUT_FORMAT "%08x" /* namelist value format; XXX */ +#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */ #endif diff --git a/hw/xfree86/loader/aoutloader.c b/hw/xfree86/loader/aoutloader.c index 98e657dca..f77b3d73c 100644 --- a/hw/xfree86/loader/aoutloader.c +++ b/hw/xfree86/loader/aoutloader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.17 2001/11/16 16:47:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.20 2003/10/15 17:46:00 dawes Exp $ */ /* * @@ -52,10 +52,13 @@ #include "loader.h" #include "aoutloader.h" -/* -#define AOUTDEBUG ErrorF -*/ +#ifndef LOADERDEBUG +#define LOADERDEBUG 0 +#endif +#if LOADERDEBUG +#define AOUTDEBUG ErrorF +#endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) @@ -67,22 +70,22 @@ */ typedef struct { - int handle; - int module; - int fd; - loader_funcs *funcs; - AOUTHDR *header;/* file header */ - unsigned char *text; /* Start address of the text section */ - unsigned int textsize; /* Size of the text section */ - unsigned char *data; /* Start address of the data section */ - unsigned int datasize; /* Size of the data section */ - unsigned char *bss; /* Start address of the bss data */ - unsigned int bsssize; /* Size of the bss section */ - struct relocation_info *txtrel; /* Start address of the text relocation table */ - struct relocation_info *datarel; /* Start address of the data relocation table */ - AOUT_nlist *symtab; /* Start address of the symbol table */ - unsigned char *strings; /* Start address of the string table */ - unsigned long strsize; /* size of string table */ + int handle; + int module; + int fd; + loader_funcs *funcs; + AOUTHDR *header; /* file header */ + unsigned char *text; /* Start address of the text section */ + unsigned int textsize; /* Size of the text section */ + unsigned char *data; /* Start address of the data section */ + unsigned int datasize; /* Size of the data section */ + unsigned char *bss; /* Start address of the bss data */ + unsigned int bsssize; /* Size of the bss section */ + struct relocation_info *txtrel; /* Start address of the text relocation table */ + struct relocation_info *datarel; /* Start address of the data relocation table */ + AOUT_nlist *symtab; /* Start address of the symbol table */ + unsigned char *strings; /* Start address of the string table */ + unsigned long strsize; /* size of string table */ unsigned char *common; /* Start address of the common data */ unsigned long comsize; /* size of common data */ } AOUTModuleRec, *AOUTModulePtr; @@ -121,10 +124,12 @@ static void *AOUTGetSymbolValue(AOUTModulePtr, int); static AOUTCommonPtr AOUTAddCommon(struct AOUT_nlist *, int); static LOOKUP *AOUTCreateCommon(AOUTModulePtr); static LOOKUP *AOUT_GetSymbols(AOUTModulePtr); -static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int, struct relocation_info_i386 *); +static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int, + struct relocation_info_i386 *); static AOUTRelocPtr AOUTCollectRelocations(AOUTModulePtr); static void AOUT_Relocate(unsigned long *, unsigned long, int); -static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int, struct relocation_info_i386 *); +static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int, + struct relocation_info_i386 *); /* * Return 1 if the symbol in item belongs to aoutfile @@ -133,6 +138,7 @@ static int AOUTHashCleanOut(void *voidptr, itemPtr item) { AOUTModulePtr aoutfile = (AOUTModulePtr) voidptr; + return (aoutfile->handle == item->handle); } @@ -140,8 +146,8 @@ AOUTHashCleanOut(void *voidptr, itemPtr item) * Manage listResolv */ static AOUTRelocPtr -AOUTDelayRelocation(AOUTModulePtr aoutfile, int type, - struct relocation_info *rel) +AOUTDelayRelocation(AOUTModulePtr aoutfile, int type, + struct relocation_info *rel) { AOUTRelocPtr reloc; @@ -158,8 +164,6 @@ AOUTDelayRelocation(AOUTModulePtr aoutfile, int type, reloc->next = 0; return reloc; } - - /* * Manage listCOMMON @@ -170,8 +174,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index) { AOUTCommonPtr common; - if ((common = xf86loadermalloc(sizeof (AOUTCommonRec))) == NULL) { - ErrorF( "AOUTAddCommon() Unable to allocate memory\n" ); + if ((common = xf86loadermalloc(sizeof(AOUTCommonRec))) == NULL) { + ErrorF("AOUTAddCommon() Unable to allocate memory\n"); return 0; } common->sym = sym; @@ -183,8 +187,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index) static LOOKUP * AOUTCreateCommon(AOUTModulePtr aoutfile) { - int numsyms = 0, size = 0, l = 0; - int offset = 0; + int numsyms = 0, size = 0, l = 0; + int offset = 0; AOUTCommonPtr common; LOOKUP *lookup; @@ -194,46 +198,47 @@ AOUTCreateCommon(AOUTModulePtr aoutfile) common = listCOMMON; for (common = listCOMMON; common; common = common->next) { /* Ensure long word alignment */ - if( (common->sym->n_value & (sizeof(long)-1)) != 0 ) - common->sym->n_value = (common->sym->n_value + (sizeof(long)-1)) - & ~(sizeof(long)-1); + if ((common->sym->n_value & (sizeof(long) - 1)) != 0) + common->sym->n_value = (common->sym->n_value + (sizeof(long) - 1)) + & ~(sizeof(long) - 1); /* accumulate the sizes */ size += common->sym->n_value; numsyms++; - } /* while */ + } /* while */ #ifdef AOUTDEBUG AOUTDEBUG("AOUTCreateCommon() %d entries (%d bytes) of COMMON data\n", - numsyms, size ); + numsyms, size); #endif - - if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) { - ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" ); - return NULL; + + if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) { + ErrorF("AOUTCreateCommon() Unable to allocate memory\n"); + return NULL; } - + aoutfile->comsize = size; - if ((aoutfile->common = xf86loadercalloc(1,size)) == NULL) { - ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" ); - return NULL; + if ((aoutfile->common = xf86loadercalloc(1, size)) == NULL) { + ErrorF("AOUTCreateCommon() Unable to allocate memory\n"); + return NULL; } - + while (listCOMMON) { - common = listCOMMON; - lookup[l].symName= AOUTGetSymbolName(aoutfile, common->sym); - lookup[l].offset = (funcptr)(aoutfile->common+offset); + common = listCOMMON; + lookup[l].symName = AOUTGetSymbolName(aoutfile, common->sym); + lookup[l].offset = (funcptr) (aoutfile->common + offset); #ifdef AOUTDEBUG - AOUTDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName ); + AOUTDEBUG("Adding %p %s\n", (void *)lookup[l].offset, + lookup[l].symName); #endif - listCOMMON = common->next; - offset += common->sym->n_value; - xf86loaderfree(common); - l++; - } /* while */ + listCOMMON = common->next; + offset += common->sym->n_value; + xf86loaderfree(common); + l++; + } /* while */ /* listCOMMON == NULL */ - lookup[l].symName=NULL; /* Terminate the list */ + lookup[l].symName = NULL; /* Terminate the list */ return lookup; } @@ -244,7 +249,7 @@ AOUTCreateCommon(AOUTModulePtr aoutfile) static char * AOUTGetString(AOUTModulePtr aoutfile, int index) { - char *symname = (char *) &(aoutfile->strings[index]); + char *symname = (char *)&(aoutfile->strings[index]); if (symname[0] == '_') { symname++; @@ -252,20 +257,21 @@ AOUTGetString(AOUTModulePtr aoutfile, int index) return symname; } + /* * Return the name of a symbol */ static char * AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym) { - char *symname = AOUTGetString(aoutfile,sym->n_un.n_strx); + char *symname = AOUTGetString(aoutfile, sym->n_un.n_strx); char *name; - name=xf86loadermalloc(strlen(symname)+1); + name = xf86loadermalloc(strlen(symname) + 1); if (!name) FatalError("AOUTGetSymbolName: Out of memory\n"); - strcpy(name,symname); + strcpy(name, symname); return name; } @@ -276,13 +282,13 @@ AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym) static void * AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index) { - void *symval = NULL; /* value of the indicated symbol */ - itemPtr symbol = NULL; /* name/value of symbol */ + void *symval = NULL; /* value of the indicated symbol */ + itemPtr symbol = NULL; /* name/value of symbol */ char *name = NULL; name = AOUTGetSymbolName(aoutfile, aoutfile->symtab + index); - if( name ) + if (name) symbol = LoaderHashFind(name); if (symbol) @@ -292,7 +298,6 @@ AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index) return symval; } - /* * Perform the actual relocation */ @@ -300,28 +305,27 @@ static void AOUT_Relocate(unsigned long *destl, unsigned long val, int pcrel) { #ifdef AOUTDEBUG - AOUTDEBUG("AOUT_Relocate %p : %08x %s", - destl, *destl, pcrel == 1 ? "rel" : "abs"); + AOUTDEBUG("AOUT_Relocate %p : %08lx %s", + (void *)destl, *destl, pcrel == 1 ? "rel" : "abs"); #endif if (pcrel) { /* relative to PC */ - *destl = val - ((unsigned long)destl + sizeof(long)); + *destl = val - ((unsigned long)destl + sizeof(long)); } else { *destl += val; } #ifdef AOUTDEBUG - AOUTDEBUG(" -> %08x\n", *destl); + AOUTDEBUG(" -> %08lx\n", *destl); #endif } - /* * Fix the relocation for text or data section */ static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type, - struct relocation_info *rel) + struct relocation_info *rel) { AOUTHDR *header = aoutfile->header; AOUT_nlist *symtab = aoutfile->symtab; @@ -330,22 +334,23 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type, unsigned long *destl; /* address of the location to be modified */ symnum = rel->r_symbolnum; -#ifdef AOUTDEBUG +#ifdef AOUTDEBUG { - char *name; - if (rel->r_extern) { - AOUTDEBUG("AOUT_RelocateEntry: extern %s\n", - name=AOUTGetSymbolName(aoutfile, symtab+symnum)); - xf86loaderfree(name); - } else { - AOUTDEBUG("AOUT_RelocateEntry: intern\n"); - } - AOUTDEBUG(" pcrel: %d", rel->r_pcrel); - AOUTDEBUG(" length: %d", rel->r_length); - AOUTDEBUG(" baserel: %d", rel->r_baserel); - AOUTDEBUG(" jmptable: %d", rel->r_jmptable); - AOUTDEBUG(" relative: %d", rel->r_relative); - AOUTDEBUG(" copy: %d\n", rel->r_copy); + char *name; + + if (rel->r_extern) { + AOUTDEBUG("AOUT_RelocateEntry: extern %s\n", + name = AOUTGetSymbolName(aoutfile, symtab + symnum)); + xf86loaderfree(name); + } else { + AOUTDEBUG("AOUT_RelocateEntry: intern\n"); + } + AOUTDEBUG(" pcrel: %d", rel->r_pcrel); + AOUTDEBUG(" length: %d", rel->r_length); + AOUTDEBUG(" baserel: %d", rel->r_baserel); + AOUTDEBUG(" jmptable: %d", rel->r_jmptable); + AOUTDEBUG(" relative: %d", rel->r_relative); + AOUTDEBUG(" copy: %d\n", rel->r_copy); } #endif /* AOUTDEBUG */ @@ -356,15 +361,15 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type, * First find the address to modify */ switch (type) { - case AOUT_TEXT: + case AOUT_TEXT: /* Check that the relocation offset is in the text segment */ if (rel->r_address > header->a_text) { ErrorF("AOUT_RelocateEntry(): " "text relocation out of text section\n"); - } + } destl = (unsigned long *)(aoutfile->text + rel->r_address); break; - case AOUT_DATA: + case AOUT_DATA: /* Check that the relocation offset is in the data segment */ if (rel->r_address > header->a_data) { ErrorF("AOUT_RelocateEntry():" @@ -372,10 +377,10 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type, } destl = (unsigned long *)(aoutfile->data + rel->r_address); break; - default: + default: ErrorF("AOUT_RelocateEntry(): unknown section type %d\n", type); return 0; - } /* switch */ + } /* switch */ /* * Now handle the relocation @@ -385,70 +390,70 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type, symval = AOUTGetSymbolValue(aoutfile, symnum); if (symval != 0) { /* we've got the value */ - AOUT_Relocate(destl, (unsigned long) symval, rel->r_pcrel); + AOUT_Relocate(destl, (unsigned long)symval, rel->r_pcrel); return 0; } else { /* The symbol should be undefined */ switch (symtab[symnum].n_type & AOUT_TYPE) { - case AOUT_UNDF: + case AOUT_UNDF: #ifdef AOUTDEBUG AOUTDEBUG(" extern AOUT_UNDEF\n"); #endif /* Add this relocation back to the global list */ - return AOUTDelayRelocation(aoutfile,type,rel); + return AOUTDelayRelocation(aoutfile, type, rel); - default: + default: ErrorF("AOUT_RelocateEntry():" - " impossible intern relocation type: %d\n", + " impossible intern relocation type: %d\n", symtab[symnum].n_type); return 0; - } /* switch */ + } /* switch */ } } else { /* intern */ switch (rel->r_symbolnum) { - case AOUT_TEXT: + case AOUT_TEXT: #ifdef AOUTDEBUG AOUTDEBUG(" AOUT_TEXT\n"); #endif /* Only absolute intern text relocations need to be handled */ - if (rel->r_pcrel == 0) - AOUT_Relocate(destl, (unsigned long)aoutfile->text, + if (rel->r_pcrel == 0) + AOUT_Relocate(destl, (unsigned long)aoutfile->text, rel->r_pcrel); return 0; - case AOUT_DATA: + case AOUT_DATA: #ifdef AOUTDEBUG AOUTDEBUG(" AOUT_DATA\n"); #endif - if (rel->r_pcrel == 0) + if (rel->r_pcrel == 0) AOUT_Relocate(destl, (unsigned long)aoutfile->data - header->a_text, rel->r_pcrel); else ErrorF("AOUT_RelocateEntry(): " "don't know how to handle data pc-relative reloc\n"); - + return 0; - case AOUT_BSS: + case AOUT_BSS: #ifdef AOUTDEBUG AOUTDEBUG(" AOUT_BSS\n"); #endif if (rel->r_pcrel == 0) AOUT_Relocate(destl, (unsigned long)aoutfile->bss - - header->a_text - header->a_data, + - header->a_text - header->a_data, rel->r_pcrel); else ErrorF("AOUT_RelocateEntry(): " "don't know how to handle bss pc-relative reloc\n"); - + return 0; - default: + default: ErrorF("AOUT_RelocateEntry():" " unknown intern relocation type: %d\n", rel->r_symbolnum); return 0; - } /* switch */ + } /* switch */ } -} /* AOUT_RelocateEntry */ - +} /* AOUT_RelocateEntry */ + static AOUTRelocPtr AOUTCollectRelocations(AOUTModulePtr aoutfile) { @@ -460,7 +465,7 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile) /* Text relocations */ if (aoutfile->text != NULL && aoutfile->txtrel != NULL) { - nreloc = header->a_trsize/sizeof(struct relocation_info); + nreloc = header->a_trsize / sizeof(struct relocation_info); for (i = 0; i < nreloc; i++) { rel = aoutfile->txtrel + i; @@ -469,28 +474,28 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile) tmp->next = reloc_head; reloc_head = tmp; } - } /* for */ + } /* for */ } /* Data relocations */ if (aoutfile->data != NULL && aoutfile->datarel != NULL) { - nreloc = header->a_drsize/sizeof(struct relocation_info); - + nreloc = header->a_drsize / sizeof(struct relocation_info); + for (i = 0; i < nreloc; i++) { rel = aoutfile->datarel + i; tmp = AOUTDelayRelocation(aoutfile, AOUT_DATA, rel); tmp->next = reloc_head; reloc_head = tmp; - } /* for */ + } /* for */ } return reloc_head; -} /* AOUTCollectRelocations */ +} /* AOUTCollectRelocations */ /* * AOUT_GetSymbols() * * add the symbols to the loader's symbol table */ -static LOOKUP * +static LOOKUP * AOUT_GetSymbols(AOUTModulePtr aoutfile) { int fd = aoutfile->fd; @@ -501,11 +506,11 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile) LOOKUP *lookup, *lookup_common; AOUTCommonPtr tmp; - aoutfile->symtab = (AOUT_nlist *)_LoaderFileToMem(fd, - AOUT_SYMOFF(header), - header->a_syms, - "symbols"); - nsyms = header->a_syms/sizeof(AOUT_nlist); + aoutfile->symtab = (AOUT_nlist *) _LoaderFileToMem(fd, + AOUT_SYMOFF(header), + header->a_syms, + "symbols"); + nsyms = header->a_syms / sizeof(AOUT_nlist); lookup = xf86loadermalloc(nsyms * sizeof(LOOKUP)); if (lookup == NULL) { ErrorF("AOUT_GetSymbols(): can't allocate memory\n"); @@ -513,17 +518,16 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile) } for (i = 0, l = 0; i < nsyms; i++) { s = aoutfile->symtab + i; - soff=s->n_un.n_strx; - if (soff == 0 || (s->n_type & AOUT_STAB) != 0) + soff = s->n_un.n_strx; + if (soff == 0 || (s->n_type & AOUT_STAB) != 0) continue; - symname=AOUTGetSymbolName(aoutfile,s); + symname = AOUTGetSymbolName(aoutfile, s); #ifdef AOUTDEBUG - AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08x\n", - symname, s->n_type, - s->n_other, s->n_value); + AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08lx\n", + symname, s->n_type, s->n_other, s->n_value); #endif switch (s->n_type & AOUT_TYPE) { - case AOUT_UNDF: + case AOUT_UNDF: if (s->n_value != 0) { if (!LoaderHashFind(symname)) { #ifdef AOUTDEBUG @@ -542,51 +546,54 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile) } xf86loaderfree(symname); break; - case AOUT_TEXT: + case AOUT_TEXT: if (s->n_type & AOUT_EXT) { lookup[l].symName = symname; /* text symbols start at 0 */ - lookup[l].offset = (funcptr)(aoutfile->text + s->n_value); + lookup[l].offset = (funcptr) (aoutfile->text + s->n_value); #ifdef AOUTDEBUG - AOUTDEBUG("Adding text %s %08x\n", symname, lookup[l].offset); + AOUTDEBUG("Adding text %s %p\n", symname, + (void *)lookup[l].offset); #endif l++; } else { xf86loaderfree(symname); } break; - case AOUT_DATA : + case AOUT_DATA: if (s->n_type & AOUT_EXT) { lookup[l].symName = symname; /* data symbols are following text */ - lookup[l].offset = (funcptr)(aoutfile->data + - s->n_value - header->a_text); + lookup[l].offset = (funcptr) (aoutfile->data + + s->n_value - header->a_text); #ifdef AOUTDEBUG - AOUTDEBUG("Adding data %s %08x\n", symname, lookup[l].offset); + AOUTDEBUG("Adding data %s %p\n", symname, + (void *)lookup[l].offset); #endif l++; } else { xf86loaderfree(symname); } break; - case AOUT_BSS: + case AOUT_BSS: if (s->n_type & AOUT_EXT) { lookup[l].symName = symname; /* bss symbols follow both text and data */ - lookup[l].offset = (funcptr)(aoutfile->bss + s->n_value - - (header->a_data - + header->a_text)); + lookup[l].offset = (funcptr) (aoutfile->bss + s->n_value + - (header->a_data + + header->a_text)); #ifdef AOUTDEBUG - AOUTDEBUG("Adding bss %s %08x\n", symname, lookup[l].offset); + AOUTDEBUG("Adding bss %s %p\n", symname, + (void *)lookup[l].offset); #endif l++; } else { xf86loaderfree(symname); } break; - case AOUT_FN: + case AOUT_FN: #ifdef AOUTDEBUG - if (n->n_type& AOUT_EXT) { + if (s->n_type & AOUT_EXT) { AOUTDEBUG("Ignoring AOUT_FN %s\n", symname); } else { AOUTDEBUG("Ignoring AOUT_WARN %s\n", symname); @@ -594,68 +601,66 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile) #endif xf86loaderfree(symname); break; - default: - ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE); - xf86loaderfree(symname); - } /* switch */ - } /* for */ + default: + ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE); + xf86loaderfree(symname); + } /* switch */ + } /* for */ lookup[l].symName = NULL; - + lookup_common = AOUTCreateCommon(aoutfile); if (lookup_common) { LOOKUP *p; - for (i = 0, p = lookup_common; p->symName; i++, p++) - ; - memcpy(&(lookup[l]), lookup_common, i * sizeof (LOOKUP)); + for (i = 0, p = lookup_common; p->symName; i++, p++) ; + memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP)); xf86loaderfree(lookup_common); l += i; lookup[l].symName = NULL; } return lookup; -} /* AOUT_GetSymbols */ +} /* AOUT_GetSymbols */ /* * Public API for the a.out implementation of the loader */ void * -AOUTLoadModule(loaderPtr modrec, - int aoutfd, - LOOKUP **ppLookup) +AOUTLoadModule(loaderPtr modrec, int aoutfd, LOOKUP ** ppLookup) { AOUTModulePtr aoutfile = NULL; AOUTHDR *header; AOUTRelocPtr reloc, tail; - void *v; + void *v; #ifdef AOUTDEBUG AOUTDEBUG("AOUTLoadModule(%s, %d, %d)\n", modrec->name, modrec->handle, aoutfd); #endif - if ((aoutfile=xf86loadercalloc(1,sizeof(AOUTModuleRec))) == NULL ) { - ErrorF( "Unable to allocate AOUTModuleRec\n" ); + if ((aoutfile = xf86loadercalloc(1, sizeof(AOUTModuleRec))) == NULL) { + ErrorF("Unable to allocate AOUTModuleRec\n"); return NULL; } - aoutfile->handle=modrec->handle; - aoutfile->module=modrec->module; - aoutfile->fd=aoutfd; - v=aoutfile->funcs=modrec->funcs; + aoutfile->handle = modrec->handle; + aoutfile->module = modrec->module; + aoutfile->fd = aoutfd; + v = aoutfile->funcs = modrec->funcs; /* * Get the a.out header */ - aoutfile->header=(AOUTHDR *)_LoaderFileToMem(aoutfd,0,sizeof(AOUTHDR), - "header"); - header= (AOUTHDR *)aoutfile->header; + aoutfile->header = + (AOUTHDR *) _LoaderFileToMem(aoutfd, 0, sizeof(AOUTHDR), + "header"); + header = (AOUTHDR *) aoutfile->header; /* * Load the 6 other sections */ /* text */ if (header->a_text != 0) { - aoutfile->text = _LoaderFileToMem(aoutfile->fd, + aoutfile->text = _LoaderFileToMem(aoutfile->fd, AOUT_TXTOFF(header), header->a_text, "text"); aoutfile->textsize = header->a_text; @@ -689,13 +694,13 @@ AOUTLoadModule(loaderPtr modrec, /* Data Relocations */ if (header->a_drsize != 0) { aoutfile->datarel = _LoaderFileToMem(aoutfile->fd, - AOUT_DRELOFF(header), - header->a_drsize, "datarel"); + AOUT_DRELOFF(header), + header->a_drsize, "datarel"); } else { aoutfile->datarel = NULL; } /* String table */ - _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header), + _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header), &(aoutfile->strsize), sizeof(int)); if (aoutfile->strsize != 0) { aoutfile->strings = _LoaderFileToMem(aoutfile->fd, @@ -711,8 +716,7 @@ AOUTLoadModule(loaderPtr modrec, reloc = AOUTCollectRelocations(aoutfile); if (reloc) { - for (tail = reloc; tail->next; tail = tail->next) - ; + for (tail = reloc; tail->next; tail = tail->next) ; tail->next = _LoaderGetRelocations(v)->aout_reloc; _LoaderGetRelocations(v)->aout_reloc = reloc; } @@ -721,8 +725,7 @@ AOUTLoadModule(loaderPtr modrec, } void -AOUTResolveSymbols(mod) -void *mod; +AOUTResolveSymbols(void *mod) { AOUTRelocPtr newlist, p, tmp; @@ -731,7 +734,7 @@ void *mod; #endif newlist = 0; - for (p = _LoaderGetRelocations(mod)->aout_reloc; p; ) { + for (p = _LoaderGetRelocations(mod)->aout_reloc; p;) { tmp = AOUT_RelocateEntry(p->file, p->type, p->rel); if (tmp) { /* Failed to relocate. Keep it in the list. */ @@ -743,11 +746,10 @@ void *mod; xf86loaderfree(tmp); } _LoaderGetRelocations(mod)->aout_reloc = newlist; -} /* AOUTResolveSymbols */ +} /* AOUTResolveSymbols */ int -AOUTCheckForUnresolved(mod) -void *mod; +AOUTCheckForUnresolved(void *mod) { int symnum; AOUTRelocPtr crel; @@ -763,18 +765,20 @@ void *mod; while (crel) { if (crel->type == AOUT_TEXT) { /* Attempt to make unresolved text references - point to a default function */ - AOUT_Relocate((unsigned long *)(crel->file->text - + crel->rel->r_address) , - (unsigned long)LoaderDefaultFunc, + * point to a default function */ + AOUT_Relocate((unsigned long *)(crel->file->text + + crel->rel->r_address), + (unsigned long)LoaderDefaultFunc, crel->rel->r_pcrel); } symnum = crel->rel->r_symbolnum; - name=AOUTGetSymbolName(crel->file, crel->file->symtab + symnum); - flag = _LoaderHandleUnresolved(name, - _LoaderHandleToName(crel->file->handle)); + name = AOUTGetSymbolName(crel->file, crel->file->symtab + symnum); + flag = _LoaderHandleUnresolved(name, + _LoaderHandleToName(crel->file-> + handle)); xf86loaderfree(name); - if (flag) fatalsym = 1; + if (flag) + fatalsym = 1; crel = crel->next; } return fatalsym; @@ -783,8 +787,9 @@ void *mod; void AOUTUnloadModule(void *modptr) { - AOUTModulePtr aoutfile = (AOUTModulePtr)modptr; + AOUTModulePtr aoutfile = (AOUTModulePtr) modptr; AOUTRelocPtr relptr, *prevptr; + #ifdef AOUTDEBUG AOUTDEBUG("AOUTUnLoadModule(0x%p)\n", modptr); #endif @@ -793,8 +798,8 @@ AOUTUnloadModule(void *modptr) * Delete any unresolved relocations */ - relptr=_LoaderGetRelocations(aoutfile->funcs)->aout_reloc; - prevptr=&(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc); + relptr = _LoaderGetRelocations(aoutfile->funcs)->aout_reloc; + prevptr = &(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc); while (relptr) { if (relptr->file == aoutfile) { @@ -805,19 +810,19 @@ AOUTUnloadModule(void *modptr) prevptr = &(relptr->next); relptr = relptr->next; } - } /* while */ - + } /* while */ + /* clean the symbols table */ LoaderHashTraverse((void *)aoutfile, AOUTHashCleanOut); #define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size)) - CheckandFree(aoutfile->strings,aoutfile->strsize); - CheckandFree(aoutfile->symtab,aoutfile->header->a_syms); - CheckandFree(aoutfile->datarel,aoutfile->header->a_drsize); - CheckandFree(aoutfile->txtrel,aoutfile->header->a_trsize); - CheckandFree(aoutfile->data,aoutfile->header->a_data); - CheckandFree(aoutfile->text,aoutfile->header->a_text); + CheckandFree(aoutfile->strings, aoutfile->strsize); + CheckandFree(aoutfile->symtab, aoutfile->header->a_syms); + CheckandFree(aoutfile->datarel, aoutfile->header->a_drsize); + CheckandFree(aoutfile->txtrel, aoutfile->header->a_trsize); + CheckandFree(aoutfile->data, aoutfile->header->a_data); + CheckandFree(aoutfile->text, aoutfile->header->a_text); /* Free allocated sections */ if (aoutfile->bss != NULL) { xf86loaderfree(aoutfile->bss); @@ -838,21 +843,20 @@ AOUTUnloadModule(void *modptr) char * AOUTAddressToSection(void *modptr, unsigned long address) { - AOUTModulePtr aoutfile = (AOUTModulePtr)modptr; - - if( address >= (unsigned long)aoutfile->text && - address <= (unsigned long)aoutfile->text+aoutfile->textsize ) { - return "text"; - } - if( address >= (unsigned long)aoutfile->data && - address <= (unsigned long)aoutfile->data+aoutfile->datasize ) { - return "data"; - } - if( address >= (unsigned long)aoutfile->bss && - address <= (unsigned long)aoutfile->bss+aoutfile->bsssize ) { - return "bss"; - } + AOUTModulePtr aoutfile = (AOUTModulePtr) modptr; + + if (address >= (unsigned long)aoutfile->text && + address <= (unsigned long)aoutfile->text + aoutfile->textsize) { + return "text"; + } + if (address >= (unsigned long)aoutfile->data && + address <= (unsigned long)aoutfile->data + aoutfile->datasize) { + return "data"; + } + if (address >= (unsigned long)aoutfile->bss && + address <= (unsigned long)aoutfile->bss + aoutfile->bsssize) { + return "bss"; + } return NULL; } - diff --git a/hw/xfree86/loader/aoutloader.h b/hw/xfree86/loader/aoutloader.h index 2714b140f..b0e156319 100644 --- a/hw/xfree86/loader/aoutloader.h +++ b/hw/xfree86/loader/aoutloader.h @@ -19,13 +19,13 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.3 1998/09/20 14:41:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */ #ifndef _AOUTLOADER_H #define _AOUTLOADER_H extern void *AOUTLoadModule(loaderPtr, int, LOOKUP **); extern void AOUTResolveSymbols(void *); extern int AOUTCheckForUnresolved(void *); -extern char *AOUTAddressToSection(void *,unsigned long); +extern char *AOUTAddressToSection(void *, unsigned long); extern void AOUTUnloadModule(void *); #endif diff --git a/hw/xfree86/loader/ar.h b/hw/xfree86/loader/ar.h index 4dbc97901..956b810a0 100644 --- a/hw/xfree86/loader/ar.h +++ b/hw/xfree86/loader/ar.h @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.3 1998/07/25 16:56:12 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */ #ifndef _AR_H #define _AR_H @@ -10,13 +9,13 @@ #if !(defined(__powerpc__) && defined(Lynx)) struct ar_hdr { - char ar_name[16], - ar_date[12], - ar_uid[6], - ar_gid[6], - ar_mode[8], - ar_size[10], - ar_fmag[2]; + char ar_name[16]; + char ar_date[12]; + char ar_uid[6]; + char ar_gid[6]; + char ar_mode[8]; + char ar_size[10]; + char ar_fmag[2]; }; #else @@ -25,35 +24,31 @@ struct ar_hdr { #define SAIAMAG 8 #define AIAFMAG "`\n" -struct fl_hdr /* archive fixed length header - printable ascii */ -{ - char fl_magic[SAIAMAG]; /* Archive file magic string */ - char fl_memoff[12]; /* Offset to member table */ - char fl_gstoff[12]; /* Offset to global symbol table */ - char fl_fstmoff[12]; /* Offset to first archive member */ - char fl_lstmoff[12]; /* Offset to last archive member */ - char fl_freeoff[12]; /* Offset to first mem on free list */ +struct fl_hdr { /* archive fixed length header - printable ascii */ + char fl_magic[SAIAMAG]; /* Archive file magic string */ + char fl_memoff[12]; /* Offset to member table */ + char fl_gstoff[12]; /* Offset to global symbol table */ + char fl_fstmoff[12]; /* Offset to first archive member */ + char fl_lstmoff[12]; /* Offset to last archive member */ + char fl_freeoff[12]; /* Offset to first mem on free list */ }; #define FL_HDR struct fl_hdr #define FL_HSZ sizeof(FL_HDR) - -struct ar_hdr /* archive file member header - printable ascii */ -{ - char ar_size[12]; /* file member size - decimal */ - char ar_nxtmem[12]; /* pointer to next member - decimal */ - char ar_prvmem[12]; /* pointer to previous member - decimal */ - char ar_date[12]; /* file member date - decimal */ - char ar_uid[12]; /* file member user id - decimal */ - char ar_gid[12]; /* file member group id - decimal */ - char ar_mode[12]; /* file member mode - octal */ - char ar_namlen[4]; /* file member name length - decimal */ - union - { - char an_name[2]; /* variable length member name */ - char an_fmag[2]; /* AIAFMAG - string to end header */ - } _ar_name; /* and variable length name */ +struct ar_hdr { /* archive file member header - printable ascii */ + char ar_size[12]; /* file member size - decimal */ + char ar_nxtmem[12]; /* pointer to next member - decimal */ + char ar_prvmem[12]; /* pointer to previous member - decimal */ + char ar_date[12]; /* file member date - decimal */ + char ar_uid[12]; /* file member user id - decimal */ + char ar_gid[12]; /* file member group id - decimal */ + char ar_mode[12]; /* file member mode - octal */ + char ar_namlen[4]; /* file member name length - decimal */ + union { + char an_name[2]; /* variable length member name */ + char an_fmag[2]; /* AIAFMAG - string to end header */ + } _ar_name; /* and variable length name */ }; #define ar_name _ar_name.an_name @@ -74,4 +69,3 @@ struct ar_hdr /* archive file member header - printable ascii */ #endif /* !__powerpc__ && Lynx */ #endif /* _AR_H */ - diff --git a/hw/xfree86/loader/coff.h b/hw/xfree86/loader/coff.h index cebf5e179..52553278e 100644 --- a/hw/xfree86/loader/coff.h +++ b/hw/xfree86/loader/coff.h @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.5 1998/07/25 16:56:12 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.6 2003/10/15 16:29:02 dawes Exp $ */ /* This file was implemented from the information in the book Understanding and Using COFF @@ -20,7 +19,7 @@ #ifndef _COFF_H #define _COFF_H -#define E_SYMNMLEN 8 /* Number of characters in a symbol name */ +#define E_SYMNMLEN 8 /* Number of characters in a symbol name */ /* * Intel 386/486 */ @@ -29,15 +28,14 @@ * FILE HEADER */ -typedef struct COFF_filehdr -{ - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* number of sections */ - long f_timdat; /* time & date stamp */ - long f_symptr; /* file pointer to symtab */ - long f_nsyms; /* number of symtab entries */ - unsigned short f_opthdr; /* sizeof(optional hdr) */ - unsigned short f_flags; /* flags */ +typedef struct COFF_filehdr { + unsigned short f_magic; /* magic number */ + unsigned short f_nscns; /* number of sections */ + long f_timdat; /* time & date stamp */ + long f_symptr; /* file pointer to symtab */ + long f_nsyms; /* number of symtab entries */ + unsigned short f_opthdr; /* sizeof(optional hdr) */ + unsigned short f_flags; /* flags */ } FILHDR; #define FILHSZ sizeof(FILHDR) @@ -46,18 +44,17 @@ typedef struct COFF_filehdr * SECTION HEADER */ -typedef struct COFF_scnhdr -{ - char s_name[8]; /* section name */ - long s_paddr; /* physical address */ - long s_vaddr; /* virtual address */ - long s_size; /* section size */ - long s_scnptr; /* raw data for section */ - long s_relptr; /* relocation */ - long s_lnnoptr; /* line numbers */ - unsigned short s_nreloc; /* number of relocation entries */ - unsigned short s_nlnno; /* number of line number entries*/ - long s_flags; /* flags */ +typedef struct COFF_scnhdr { + char s_name[8]; /* section name */ + long s_paddr; /* physical address */ + long s_vaddr; /* virtual address */ + long s_size; /* section size */ + long s_scnptr; /* raw data for section */ + long s_relptr; /* relocation */ + long s_lnnoptr; /* line numbers */ + unsigned short s_nreloc; /* number of relocation entries */ + unsigned short s_nlnno; /* number of line number entries */ + long s_flags; /* flags */ } SCNHDR; #define COFF_SCNHDR struct COFF_scnhdr @@ -68,41 +65,36 @@ typedef struct COFF_scnhdr * the optional COFF header as used by Linux COFF */ -typedef struct -{ - char magic[2]; /* type of file */ - char vstamp[2]; /* version stamp */ - char tsize[4]; /* text size in bytes */ - char dsize[4]; /* initialized data */ - char bsize[4]; /* uninitialized data */ - char entry[4]; /* entry point */ - char text_start[4]; /* base of text */ - char data_start[4]; /* base of data */ +typedef struct { + char magic[2]; /* type of file */ + char vstamp[2]; /* version stamp */ + char tsize[4]; /* text size in bytes */ + char dsize[4]; /* initialized data */ + char bsize[4]; /* uninitialized data */ + char entry[4]; /* entry point */ + char text_start[4]; /* base of text */ + char data_start[4]; /* base of data */ } AOUTHDR; - /* * SYMBOLS */ -typedef struct COFF_syment -{ - union - { - char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */ - struct - { - long _n_zeroes; /* Leading zeros */ - long _n_offset; /* Offset for a header section */ +typedef struct COFF_syment { + union { + char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */ + struct { + long _n_zeroes; /* Leading zeros */ + long _n_offset; /* Offset for a header section */ } _n_n; - char *_n_nptr[2]; /* allows for overlaying */ - } _n; - - long n_value; /* address of the segment */ - short n_scnum; /* Section number */ - unsigned short n_type; /* Type of section */ - char n_sclass; /* Loader class */ - char n_numaux; /* Number of aux entries following */ + char *_n_nptr[2]; /* allows for overlaying */ + } _n; + + long n_value; /* address of the segment */ + short n_scnum; /* Section number */ + unsigned short n_type; /* Type of section */ + char n_sclass; /* Loader class */ + char n_numaux; /* Number of aux entries following */ } SYMENT; #define n_name _n._n_name @@ -110,8 +102,8 @@ typedef struct COFF_syment #define n_zeroes _n._n_n._n_zeroes #define n_offset _n._n_n._n_offset -#define COFF_E_SYMNMLEN 8 /* characters in a short symbol name */ -#define COFF_E_FILNMLEN 14 /* characters in a file name */ +#define COFF_E_SYMNMLEN 8 /* characters in a short symbol name */ +#define COFF_E_FILNMLEN 14 /* characters in a file name */ #define COFF_E_DIMNUM 4 /* array dimensions in aux entry */ #define SYMNMLEN COFF_E_SYMNMLEN #define SYMESZ 18 /* not really sizeof(SYMENT) due to padding */ @@ -131,62 +123,59 @@ typedef struct COFF_syment * AUX Entries */ typedef struct COFF_auxent { - long x_scnlen; - long x_parmhash; - unsigned short x_snhash; - unsigned char x_smtyp; - unsigned char x_smclas; - long x_stab; - unsigned short x_snstab; + long x_scnlen; + long x_parmhash; + unsigned short x_snhash; + unsigned char x_smtyp; + unsigned char x_smclas; + long x_stab; + unsigned short x_snstab; } AUXENT; /* Auxillary Symbol type values */ -#define XTY_ER 0 /* Enternal Reference */ -#define XTY_SD 1 /* csect section definition */ -#define XTY_LD 2 /* Label definition */ -#define XTY_CM 3 /* common csect definition */ +#define XTY_ER 0 /* Enternal Reference */ +#define XTY_SD 1 /* csect section definition */ +#define XTY_LD 2 /* Label definition */ +#define XTY_CM 3 /* common csect definition */ /* Auxillary Symbol storage mapping class values */ -#define XMC_PR 0 /* Program code */ -#define XMC_RO 1 /* Read-only constant */ -#define XMC_DB 2 /* Debug dictionary */ -#define XMC_TC 3 /* TOC entry */ -#define XMC_UA 4 /* Unclassified */ -#define XMC_RW 5 /* Read/write data */ -#define XMC_GL 6 /* Global linkage */ -#define XMC_XO 7 /* Extended operation */ -#define XMC_SV 8 /* Supervisor call descriptor */ -#define XMC_BS 9 /* BSS class */ -#define XMC_DS 10 /* Function descriptor csect */ -#define XMC_UC 11 /* Unnamed FORTRAN comon */ -#define XMC_TI 12 /* Reserved */ -#define XMC_TB 13 /* Reserved */ -#define XMC_TC0 15 /* TOC anchor */ -#define XMC_TD 16 /* Scalar data entry in TOC */ +#define XMC_PR 0 /* Program code */ +#define XMC_RO 1 /* Read-only constant */ +#define XMC_DB 2 /* Debug dictionary */ +#define XMC_TC 3 /* TOC entry */ +#define XMC_UA 4 /* Unclassified */ +#define XMC_RW 5 /* Read/write data */ +#define XMC_GL 6 /* Global linkage */ +#define XMC_XO 7 /* Extended operation */ +#define XMC_SV 8 /* Supervisor call descriptor */ +#define XMC_BS 9 /* BSS class */ +#define XMC_DS 10 /* Function descriptor csect */ +#define XMC_UC 11 /* Unnamed FORTRAN comon */ +#define XMC_TI 12 /* Reserved */ +#define XMC_TB 13 /* Reserved */ +#define XMC_TC0 15 /* TOC anchor */ +#define XMC_TD 16 /* Scalar data entry in TOC */ /* * RELOCATION DIRECTIVES */ -typedef struct COFF_reloc -{ - long r_vaddr; /* Virtual address of item */ - long r_symndx; /* Symbol index in the symtab */ +typedef struct COFF_reloc { + long r_vaddr; /* Virtual address of item */ + long r_symndx; /* Symbol index in the symtab */ #if defined(__powerpc__) - union - { - unsigned short _r_type; /* old style coff relocation type */ - struct - { - char _r_rsize; /* sign and reloc bit len */ - char _r_rtype; /* toc relocation type */ + union { + unsigned short _r_type; /* old style coff relocation type */ + struct { + char _r_rsize; /* sign and reloc bit len */ + char _r_rtype; /* toc relocation type */ } _r_r; - } _r; -#define r_otype _r._r_type /* old style reloc - original name */ + } _r; +#define r_otype _r._r_type /* old style reloc - original name */ #define r_rsize _r._r_r._r_rsize /* extract sign and bit len */ #define r_type _r._r_r._r_rtype /* extract toc relocation type */ #else - unsigned short r_type; /* Relocation type */ + unsigned short r_type; /* Relocation type */ #endif } RELOC; @@ -222,7 +211,7 @@ typedef struct COFF_reloc #define R_REL 0x02 /* A(sym-*) Relative to self */ #define R_TOC 0x03 /* A(sym-TOC) Relative to TOC */ #define R_TRL 0x12 /* A(sym-TOC) TOC Relative indirect load. */ - /* modifiable instruction */ + /* modifiable instruction */ #define R_TRLA 0x13 /* A(sym-TOC) TOC Rel load address. modifiable inst */ #define R_GL 0x05 /* A(external TOC of sym) Global Linkage */ #define R_TCL 0x06 /* A(local TOC of sym) Local object TOC address */ diff --git a/hw/xfree86/loader/coffloader.c b/hw/xfree86/loader/coffloader.c index 7a1ef28ad..b2fbfcf14 100644 --- a/hw/xfree86/loader/coffloader.c +++ b/hw/xfree86/loader/coffloader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.18 2002/09/16 18:06:10 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.21 2003/10/15 17:40:15 dawes Exp $ */ /* * @@ -48,63 +48,66 @@ #include "coffloader.h" #include "compiler.h" -/* -#ifndef LDTEST + +#ifndef LOADERDEBUG +#define LOADERDEBUG 0 +#endif + +#if LOADERDEBUG #define COFFDEBUG ErrorF #endif -*/ /* * This structure contains all of the information about a module * that has been loaded. */ -typedef struct { - int handle; - long module; /* Id of the module used to find inter module calls */ - int fd; - loader_funcs *funcs; - FILHDR *header; /* file header */ - AOUTHDR *optheader; /* optional file header */ - unsigned short numsh; - SCNHDR *sections; /* Start address of the section table */ - int secsize; /* size of the section table */ - unsigned char **saddr;/* Start addresss of the sections table */ - unsigned char **reladdr;/* Start addresss of the relocation table */ - unsigned char *strtab; /* Start address of the string table */ - int strsize; /* size of the string table */ - unsigned char *text; /* Start address of the .text section */ - int txtndx; /* index of the .text section */ - long txtaddr; /* offset of the .text section */ - int txtsize; /* size of the .text section */ - int txtrelsize; /* size of the .rel.text section */ - unsigned char *data; /* Start address of the .data section */ - int datndx; /* index of the .data section */ - long dataddr; /* offset of the .data section */ - int datsize; /* size of the .data section */ - int datrelsize; /* size of the .rel.data section */ - unsigned char *bss; /* Start address of the .bss section */ - int bssndx; /* index of the .bss section */ - long bssaddr; /* offset of the .bss section */ - int bsssize; /* size of the .bss section */ - SYMENT *symtab; /* Start address of the .symtab section */ - int symndx; /* index of the .symtab section */ - int symsize; /* size of the .symtab section */ - unsigned char *common; /* Start address of the .common section */ - int comsize; /* size of the .common section */ - long toc; /* Offset of the TOC csect */ - unsigned char *tocaddr; /* Address of the TOC csect */ - } COFFModuleRec, *COFFModulePtr; +typedef struct { + int handle; + long module; /* Id of the module used to find inter module calls */ + int fd; + loader_funcs *funcs; + FILHDR *header; /* file header */ + AOUTHDR *optheader; /* optional file header */ + unsigned short numsh; + SCNHDR *sections; /* Start address of the section table */ + int secsize; /* size of the section table */ + unsigned char **saddr; /* Start addresss of the sections table */ + unsigned char **reladdr; /* Start addresss of the relocation table */ + unsigned char *strtab; /* Start address of the string table */ + int strsize; /* size of the string table */ + unsigned char *text; /* Start address of the .text section */ + int txtndx; /* index of the .text section */ + long txtaddr; /* offset of the .text section */ + int txtsize; /* size of the .text section */ + int txtrelsize; /* size of the .rel.text section */ + unsigned char *data; /* Start address of the .data section */ + int datndx; /* index of the .data section */ + long dataddr; /* offset of the .data section */ + int datsize; /* size of the .data section */ + int datrelsize; /* size of the .rel.data section */ + unsigned char *bss; /* Start address of the .bss section */ + int bssndx; /* index of the .bss section */ + long bssaddr; /* offset of the .bss section */ + int bsssize; /* size of the .bss section */ + SYMENT *symtab; /* Start address of the .symtab section */ + int symndx; /* index of the .symtab section */ + int symsize; /* size of the .symtab section */ + unsigned char *common; /* Start address of the .common section */ + int comsize; /* size of the .common section */ + long toc; /* Offset of the TOC csect */ + unsigned char *tocaddr; /* Address of the TOC csect */ +} COFFModuleRec, *COFFModulePtr; /* * If any relocation is unable to be satisfied, then put it on a list * to try later after more modules have been loaded. */ typedef struct _coff_reloc { - COFFModulePtr file; - RELOC *rel; - int secndx; - struct _coff_reloc *next; + COFFModulePtr file; + RELOC *rel; + int secndx; + struct _coff_reloc *next; } COFFRelocRec; /* @@ -116,10 +119,10 @@ typedef struct _coff_reloc { */ typedef struct _coff_COMMON { - SYMENT *sym; - int index; - struct _coff_COMMON *next; - } COFFCommonRec; + SYMENT *sym; + int index; + struct _coff_COMMON *next; +} COFFCommonRec; static COFFCommonPtr listCOMMON = NULL; @@ -140,36 +143,30 @@ static COFFRelocPtr COFFCollectRelocations(COFFModulePtr); * Utility Functions */ - static int -COFFhashCleanOut(voidptr, item) -void *voidptr; -itemPtr item ; +COFFhashCleanOut(void *voidptr, itemPtr item) { - COFFModulePtr module = (COFFModulePtr) voidptr; - return ( module->handle == item->handle ) ; -} + COFFModulePtr module = (COFFModulePtr) voidptr; + return (module->handle == item->handle); +} /* * Manage listResolv */ static COFFRelocPtr -COFFDelayRelocation(cofffile,secndx,rel) -COFFModulePtr cofffile; -int secndx; -RELOC *rel; +COFFDelayRelocation(COFFModulePtr cofffile, int secndx, RELOC *rel) { COFFRelocPtr reloc; if ((reloc = xf86loadermalloc(sizeof(COFFRelocRec))) == NULL) { - ErrorF( "COFFDelayRelocation() Unable to allocate memory!!!!\n" ); + ErrorF("COFFDelayRelocation() Unable to allocate memory!!!!\n"); return 0; } - reloc->file=cofffile; - reloc->secndx=secndx; - reloc->rel=rel; + reloc->file = cofffile; + reloc->secndx = secndx; + reloc->rel = rel; reloc->next = 0; return reloc; @@ -180,83 +177,80 @@ RELOC *rel; */ static COFFCommonPtr -COFFAddCOMMON(sym,index) -SYMENT *sym; -int index; +COFFAddCOMMON(SYMENT *sym, int index) { COFFCommonPtr common; if ((common = xf86loadermalloc(sizeof(COFFCommonRec))) == NULL) { - ErrorF( "COFFAddCOMMON() Unable to allocate memory!!!!\n" ); + ErrorF("COFFAddCOMMON() Unable to allocate memory!!!!\n"); return 0; } - common->sym=sym; - common->index=index; - common->next=0; + common->sym = sym; + common->index = index; + common->next = 0; return common; } static LOOKUP * -COFFCreateCOMMON(cofffile) -COFFModulePtr cofffile; +COFFCreateCOMMON(COFFModulePtr cofffile) { - int numsyms=0,size=0,l=0; - int offset=0; - LOOKUP *lookup; + int numsyms = 0, size = 0, l = 0; + int offset = 0; + LOOKUP *lookup; COFFCommonPtr common; if (listCOMMON == NULL) return NULL; - common=listCOMMON; + common = listCOMMON; for (common = listCOMMON; common; common = common->next) { /* Ensure long word alignment */ - if( common->sym->n_value != 2 - && common->sym->n_value != 1) /* But not for short and char ;-)(mr)*/ - if( common->sym->n_value%4 != 0 ) - common->sym->n_value+= 4-(common->sym->n_value%4); + if (common->sym->n_value != 2 && common->sym->n_value != 1) /* But not for short and char ;-)(mr) */ + if (common->sym->n_value % 4 != 0) + common->sym->n_value += 4 - (common->sym->n_value % 4); /* accumulate the sizes */ - size+=common->sym->n_value; + size += common->sym->n_value; numsyms++; } #ifdef COFFDEBUG COFFDEBUG("COFFCreateCOMMON() %d entries (%d bytes) of COMMON data\n", - numsyms, size ); + numsyms, size); #endif - if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) { - ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" ); - return NULL; + if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) { + ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n"); + return NULL; } - cofffile->comsize=size; - if ((cofffile->common = xf86loadercalloc(1,size)) == NULL) { - ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" ); - return NULL; + cofffile->comsize = size; + if ((cofffile->common = xf86loadercalloc(1, size)) == NULL) { + ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n"); + return NULL; } /* Traverse the common list and create a lookup table with all the * common symbols. Destroy the common list in the process. * See also ResolveSymbols. */ - while(listCOMMON) { - common=listCOMMON; - lookup[l].symName=COFFGetSymbolName(cofffile,common->index); - lookup[l].offset=(funcptr)(cofffile->common+offset); + while (listCOMMON) { + common = listCOMMON; + lookup[l].symName = COFFGetSymbolName(cofffile, common->index); + lookup[l].offset = (funcptr) (cofffile->common + offset); #ifdef COFFDEBUG - COFFDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName ); + COFFDEBUG("Adding %p %s\n", (void *)lookup[l].offset, + lookup[l].symName); #endif - listCOMMON=common->next; - offset+=common->sym->n_value; - xf86loaderfree(common); - l++; + listCOMMON = common->next; + offset += common->sym->n_value; + xf86loaderfree(common); + l++; } /* listCOMMON == NULL */ - lookup[l].symName=NULL; /* Terminate the list */ + lookup[l].symName = NULL; /* Terminate the list */ return lookup; } @@ -268,68 +262,62 @@ COFFModulePtr cofffile; * Get symbol name */ static char * -COFFGetSymbolName(cofffile, index) -COFFModulePtr cofffile; -int index; +COFFGetSymbolName(COFFModulePtr cofffile, int index) { - char *name; - SYMENT *sym; + char *name; + SYMENT *sym; - sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(index*SYMESZ)); + sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (index * SYMESZ)); #ifdef COFFDEBUG - COFFDEBUG("COFFGetSymbolName(%x,%x) %x",cofffile, index, sym->n_zeroes ); + COFFDEBUG("COFFGetSymbolName(%p,%x) %lx", (void *)cofffile, index, + sym->n_zeroes); #endif name = xf86loadermalloc(sym->n_zeroes ? SYMNMLEN + 1 - : strlen((const char *)&cofffile->strtab[(int)sym->n_offset-4]) + 1); + : strlen((const char *)&cofffile-> + strtab[(int)sym->n_offset - 4]) + 1); if (!name) FatalError("COFFGetSymbolName: Out of memory\n"); - if( sym->n_zeroes ) - { - strncpy(name,sym->n_name,SYMNMLEN); - name[SYMNMLEN]='\000'; - } - else { - strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset-4]); - } + if (sym->n_zeroes) { + strncpy(name, sym->n_name, SYMNMLEN); + name[SYMNMLEN] = '\000'; + } else { + strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset - 4]); + } #ifdef COFFDEBUG - COFFDEBUG(" %s\n", name ); + COFFDEBUG(" %s\n", name); #endif return name; } static SYMENT * -COFFGetSymbol(file, index) -COFFModulePtr file; -int index; +COFFGetSymbol(COFFModulePtr file, int index) { - return (SYMENT *)(((unsigned char *)file->symtab)+(index*SYMESZ)); + return (SYMENT *) (((unsigned char *)file->symtab) + (index * SYMESZ)); } static unsigned char * -COFFGetSymbolValue(cofffile, index) -COFFModulePtr cofffile; -int index; +COFFGetSymbolValue(COFFModulePtr cofffile, int index) { - unsigned char *symval=0; /* value of the indicated symbol */ + unsigned char *symval = 0; /* value of the indicated symbol */ itemPtr symbol; /* name/value of symbol */ - char *symname; + char *symname; - symname=COFFGetSymbolName(cofffile, index); + symname = COFFGetSymbolName(cofffile, index); #ifdef COFFDEBUG - COFFDEBUG("COFFGetSymbolValue() for %s=", symname ); + COFFDEBUG("COFFGetSymbolValue() for %s=", symname); #endif symbol = LoaderHashFind(symname); - if( symbol ) - symval=(unsigned char *)symbol->address; + if (symbol) + symval = (unsigned char *)symbol->address; #ifdef COFFDEBUG - COFFDEBUG("%x\n", symval ); + COFFDEBUG("%p\n", symval); #endif xf86loaderfree(symname); @@ -343,22 +331,20 @@ int index; * same module as the calling function. */ static unsigned char * -COFFGetSymbolGlinkValue(cofffile, index) -COFFModulePtr cofffile; -int index; +COFFGetSymbolGlinkValue(COFFModulePtr cofffile, int index) { - unsigned char *symval=0; /* value of the indicated symbol */ + unsigned char *symval = 0; /* value of the indicated symbol */ itemPtr symbol; /* name/value of symbol */ - char *name; + char *name; - name=COFFGetSymbolName(cofffile, index); + name = COFFGetSymbolName(cofffile, index); #ifdef COFFDEBUG - COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name ); + COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name); #endif - symbol = LoaderHashFind(name+1); /* Eat the '.' so we get the - Function descriptor instead */ + symbol = LoaderHashFind(name + 1); /* Eat the '.' so we get the + * Function descriptor instead */ /* Here we are building up a glink function that will change the TOC * pointer before calling a function that resides in a different module. @@ -373,26 +359,27 @@ int index; 7 00000018 4e800420 bctr # branch to it */ - if( symbol ) { - symval=(unsigned char *)&symbol->code.glink; + if (symbol) { + symval = (unsigned char *)&symbol->code.glink; #ifdef COFFDEBUG - COFFDEBUG("%x\n", symval ); - COFFDEBUG("glink_%s=%x\n", name,symval ); -#endif - symbol->code.glink[ 0]=0x3d80; /* lis r12 */ - symbol->code.glink[ 1]=((unsigned long)symbol->address&0xffff0000)>>16; - symbol->code.glink[ 2]=0x618c; /* ori r12 */ - symbol->code.glink[ 3]=((unsigned long)symbol->address&0x0000ffff); - symbol->code.glink[ 4]=0x9041; /* st r2,20(r1) */ - symbol->code.glink[ 5]=0x0014; - symbol->code.glink[ 6]=0x804c; /* l r2,0(r12) */ - symbol->code.glink[ 7]=0x0000; - symbol->code.glink[ 8]=0x7c49; /* mtctr r2 */ - symbol->code.glink[ 9]=0x03a6; - symbol->code.glink[10]=0x804c; /* l r2,4(r12) */ - symbol->code.glink[11]=0x0004; - symbol->code.glink[12]=0x4e80; /* bctr */ - symbol->code.glink[13]=0x0420; + COFFDEBUG("%x\n", symval); + COFFDEBUG("glink_%s=%x\n", name, symval); +#endif + symbol->code.glink[0] = 0x3d80; /* lis r12 */ + symbol->code.glink[1] = + ((unsigned long)symbol->address & 0xffff0000) >> 16; + symbol->code.glink[2] = 0x618c; /* ori r12 */ + symbol->code.glink[3] = ((unsigned long)symbol->address & 0x0000ffff); + symbol->code.glink[4] = 0x9041; /* st r2,20(r1) */ + symbol->code.glink[5] = 0x0014; + symbol->code.glink[6] = 0x804c; /* l r2,0(r12) */ + symbol->code.glink[7] = 0x0000; + symbol->code.glink[8] = 0x7c49; /* mtctr r2 */ + symbol->code.glink[9] = 0x03a6; + symbol->code.glink[10] = 0x804c; /* l r2,4(r12) */ + symbol->code.glink[11] = 0x0004; + symbol->code.glink[12] = 0x4e80; /* bctr */ + symbol->code.glink[13] = 0x0420; ppc_flush_icache(&symbol->code.glink[0]); ppc_flush_icache(&symbol->code.glink[12]); } @@ -406,17 +393,15 @@ int index; * Fix all of the relocation for the given section. */ static COFFRelocPtr -COFF_RelocateEntry(cofffile, secndx, rel) -COFFModulePtr cofffile; -int secndx; /* index of the target section */ -RELOC *rel; +COFF_RelocateEntry(COFFModulePtr cofffile, int secndx, RELOC *rel) { - SYMENT *symbol; /* value of the indicated symbol */ + SYMENT *symbol; /* value of the indicated symbol */ unsigned long *dest32; /* address of the place being modified */ + #if defined(__powerpc__) unsigned short *dest16; /* address of the place being modified */ - itemPtr symitem; /* symbol structure from has table */ - char *name; + itemPtr symitem; /* symbol structure from has table */ + char *name; #endif unsigned char *symval; /* value of the indicated symbol */ @@ -431,386 +416,401 @@ RELOC *rel; */ #ifdef COFFDEBUG - COFFDEBUG("%x %d %o ", - rel->r_vaddr,rel->r_symndx,rel->r_type ); + COFFDEBUG("%lx %ld %o ", (unsigned long)rel->r_vaddr, + rel->r_symndx, rel->r_type); #if defined(__powerpc__) COFFDEBUG("[%x %x %x] ", - RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel)); + RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel)); #endif #endif - symbol=COFFGetSymbol(cofffile,rel->r_symndx); + symbol = COFFGetSymbol(cofffile, rel->r_symndx); #ifdef COFFDEBUG - COFFDEBUG("%d %x %d-%d\n", symbol->n_sclass, symbol->n_value, symbol->n_scnum, secndx ); + COFFDEBUG("%d %lx %d-%d\n", symbol->n_sclass, symbol->n_value, + symbol->n_scnum, secndx); #endif /* * Check to see if the relocation offset is part of the .text segment. * If not, we must change the offset to be relative to the .data section * which is NOT contiguous. - */ - switch(secndx+1) { /* change the bias */ + */ + switch (secndx + 1) { /* change the bias */ case N_TEXT: - if( (long)rel->r_vaddr < cofffile->txtaddr || - (long)rel->r_vaddr > (long)(cofffile->txtaddr+cofffile->txtsize) ) { - FatalError("Relocation against N_TEXT not in .text section\n"); + if ((long)rel->r_vaddr < cofffile->txtaddr || + (long)rel->r_vaddr > + (long)(cofffile->txtaddr + cofffile->txtsize)) { + FatalError("Relocation against N_TEXT not in .text section\n"); } - dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+ - ((unsigned char *)rel->r_vaddr-cofffile->txtaddr)); + dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) + + ((unsigned char *)rel->r_vaddr - + cofffile->txtaddr)); break; case N_DATA: - if( (long)rel->r_vaddr < cofffile->dataddr || - (long)rel->r_vaddr > (long)(cofffile->dataddr+cofffile->datsize) ) { - FatalError("Relocation against N_DATA not in .data section\n"); + if ((long)rel->r_vaddr < cofffile->dataddr || + (long)rel->r_vaddr > + (long)(cofffile->dataddr + cofffile->datsize)) { + FatalError("Relocation against N_DATA not in .data section\n"); } - dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+ - ((unsigned char *)rel->r_vaddr-cofffile->dataddr)); + dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) + + ((unsigned char *)rel->r_vaddr - + cofffile->dataddr)); break; case N_BSS: - if( (long)rel->r_vaddr < cofffile->bssaddr || - (long)rel->r_vaddr > (long)(cofffile->bssaddr+cofffile->bsssize) ) { - FatalError("Relocation against N_TEXT not in .bss section\n"); + if ((long)rel->r_vaddr < cofffile->bssaddr || + (long)rel->r_vaddr > + (long)(cofffile->bssaddr + cofffile->bsssize)) { + FatalError("Relocation against N_TEXT not in .bss section\n"); } - dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+ - ((unsigned char *)rel->r_vaddr-cofffile->bssaddr)); + dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) + + ((unsigned char *)rel->r_vaddr - + cofffile->bssaddr)); break; default: - FatalError("Relocation against unknown section %d\n", secndx ); + FatalError("Relocation against unknown section %d\n", secndx); } - if( symbol->n_sclass == 0 ) - { - symval=(unsigned char *)(symbol->n_value+(*dest32)-symbol->n_type); + if (symbol->n_sclass == 0) { + symval = (unsigned char *)(symbol->n_value + (*dest32) - + symbol->n_type); #ifdef COFFDEBUG - COFFDEBUG( "symbol->n_sclass==0\n" ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); + COFFDEBUG("symbol->n_sclass==0\n"); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); #endif - *dest32=(unsigned long)symval; - return 0; - } + *dest32 = (unsigned long)symval; + return 0; + } - switch( rel->r_type ) - { + switch (rel->r_type) { #if defined(i386) - case R_DIR32: - symval=COFFGetSymbolValue(cofffile, rel->r_symndx); - if( symval ) { + case R_DIR32: + symval = COFFGetSymbolValue(cofffile, rel->r_symndx); + if (symval) { #ifdef COFFDEBUG - char *namestr; - COFFDEBUG( "R_DIR32 %s\n", - namestr=COFFGetSymbolName(cofffile,rel->r_symndx) ); - xf86loaderfree(namestr); - COFFDEBUG( "txtsize=%x\t", cofffile->txtsize ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value); - } else { - switch( symbol->n_scnum ) { - case N_UNDEF: + char *namestr; + + COFFDEBUG("R_DIR32 %s\n", + namestr = COFFGetSymbolName(cofffile, rel->r_symndx)); + xf86loaderfree(namestr); + COFFDEBUG("txtsize=%x\t", cofffile->txtsize); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); +#endif + *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value); + } else { + switch (symbol->n_scnum) { + case N_UNDEF: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_UNDEF\n" ); + COFFDEBUG("R_DIR32 N_UNDEF\n"); #endif - return COFFDelayRelocation(cofffile,secndx,rel); - case N_ABS: + return COFFDelayRelocation(cofffile, secndx, rel); + case N_ABS: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_ABS\n" ); + COFFDEBUG("R_DIR32 N_ABS\n"); #endif - return 0; - case N_DEBUG: + return 0; + case N_DEBUG: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_DEBUG\n" ); + COFFDEBUG("R_DIR32 N_DEBUG\n"); #endif - return 0; - case N_COMMENT: + return 0; + case N_COMMENT: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_COMMENT\n" ); + COFFDEBUG("R_DIR32 N_COMMENT\n"); #endif - return 0; - case N_TEXT: + return 0; + case N_TEXT: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_TEXT\n" ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - (unsigned long)(cofffile->saddr[N_TEXT-1])); - break; - case N_DATA: + COFFDEBUG("R_DIR32 N_TEXT\n"); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + (unsigned long)(cofffile-> + saddr[N_TEXT - 1])); + break; + case N_DATA: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_DATA\n" ); - COFFDEBUG( "txtsize=%x\t", cofffile->txtsize ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - ((unsigned long)(cofffile->saddr[N_DATA-1]))- - cofffile->dataddr); - break; - case N_BSS: + COFFDEBUG("R_DIR32 N_DATA\n"); + COFFDEBUG("txtsize=%x\t", cofffile->txtsize); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + ((unsigned long)(cofffile-> + saddr[N_DATA - + 1])) - + cofffile->dataddr); + break; + case N_BSS: #ifdef COFFDEBUG - COFFDEBUG( "R_DIR32 N_BSS\n" ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - (unsigned long)(cofffile->saddr[N_BSS-1])- - (cofffile->bssaddr)); - break; - default: - ErrorF("R_DIR32 with unexpected section %d\n", - symbol->n_scnum ); - } - + COFFDEBUG("R_DIR32 N_BSS\n"); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + (unsigned long)(cofffile-> + saddr[N_BSS - 1]) - + (cofffile->bssaddr)); + break; + default: + ErrorF("R_DIR32 with unexpected section %d\n", + symbol->n_scnum); } + + } #ifdef COFFDEBUG - COFFDEBUG( "*dest32=%8.8x\n", *dest32 ); + COFFDEBUG("*dest32=%8.8lx\n", *dest32); #endif + break; + case R_PCRLONG: + if (symbol->n_scnum == N_TEXT) break; - case R_PCRLONG: - if( symbol->n_scnum == N_TEXT ) - break; - symval=COFFGetSymbolValue(cofffile, rel->r_symndx); + symval = COFFGetSymbolValue(cofffile, rel->r_symndx); #ifdef COFFDEBUG - COFFDEBUG( "R_PCRLONG "); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); + COFFDEBUG("R_PCRLONG "); + COFFDEBUG("dest32=%p\t", (void *)dest32); + COFFDEBUG("symval=%p\t", symval); + COFFDEBUG("*dest32=%8.8lx\t", *dest32); #endif - if( symval == 0 ) { + if (symval == 0) { #ifdef COFFDEBUG - char *name; - COFFDEBUG( "***Unable to resolve symbol %s\n", - name=COFFGetSymbolName(cofffile,rel->r_symndx) ); - xf86loaderfree(name); + char *name; + + COFFDEBUG("***Unable to resolve symbol %s\n", + name = COFFGetSymbolName(cofffile, rel->r_symndx)); + xf86loaderfree(name); #endif - return COFFDelayRelocation(cofffile,secndx,rel); - } - *dest32=(unsigned long)(symval-((long)dest32+sizeof(long))); + return COFFDelayRelocation(cofffile, secndx, rel); + } + *dest32 = (unsigned long)(symval - ((long)dest32 + sizeof(long))); #ifdef COFFDEBUG - COFFDEBUG( "*dest32=%8.8x\n", *dest32 ); + COFFDEBUG("*dest32=%8.8lx\n", *dest32); #endif - break; - case R_ABS: - /* - * Nothing to really do here. - * Usually, a dummy relocation for .file - */ - break; + break; + case R_ABS: + /* + * Nothing to really do here. + * Usually, a dummy relocation for .file + */ + break; #endif /* i386 */ #if defined(__powerpc__) - case R_POS: - /* - * Positive Relocation - */ - if( RELOC_RLEN(*rel) != 0x1f ) - FatalError("R_POS with size != 32 bits" ); - symval=COFFGetSymbolValue(cofffile, rel->r_symndx); - if( symval ) { + case R_POS: + /* + * Positive Relocation + */ + if (RELOC_RLEN(*rel) != 0x1f) + FatalError("R_POS with size != 32 bits"); + symval = COFFGetSymbolValue(cofffile, rel->r_symndx); + if (symval) { #ifdef COFFDEBUG - COFFDEBUG( "R_POS "); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); + COFFDEBUG("R_POS "); + COFFDEBUG("dest32=%x\t", dest32); + COFFDEBUG("symval=%x\t", symval); + COFFDEBUG("*dest32=%8.8x\t", *dest32); #endif - *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value); - ppc_flush_icache(dest32); - } else { - switch( symbol->n_scnum ) { - case N_UNDEF: + *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value); + ppc_flush_icache(dest32); + } else { + switch (symbol->n_scnum) { + case N_UNDEF: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_UNDEF\n" ); + COFFDEBUG("R_POS N_UNDEF\n"); #endif - return COFFDelayRelocation(cofffile,secndx,rel); - case N_ABS: + return COFFDelayRelocation(cofffile, secndx, rel); + case N_ABS: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_ABS\n" ); + COFFDEBUG("R_POS N_ABS\n"); #endif - return 0; - case N_DEBUG: + return 0; + case N_DEBUG: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_DEBUG\n" ); + COFFDEBUG("R_POS N_DEBUG\n"); #endif - return 0; - case N_COMMENT: + return 0; + case N_COMMENT: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_COMMENT\n" ); + COFFDEBUG("R_POS N_COMMENT\n"); #endif - return 0; - case N_TEXT: + return 0; + case N_TEXT: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_TEXT\n" ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - ((unsigned long)(cofffile->saddr[N_TEXT-1]))- - cofffile->txtaddr); - ppc_flush_icache(dest32); - break; - case N_DATA: + COFFDEBUG("R_POS N_TEXT\n"); + COFFDEBUG("dest32=%x\t", dest32); + COFFDEBUG("symval=%x\t", symval); + COFFDEBUG("*dest32=%8.8x\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + ((unsigned long)(cofffile-> + saddr[N_TEXT - + 1])) - + cofffile->txtaddr); + ppc_flush_icache(dest32); + break; + case N_DATA: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_DATA\n" ); - COFFDEBUG( "txtsize=%x\t", cofffile->txtsize ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - ((unsigned long)(cofffile->saddr[N_DATA-1]))- - cofffile->dataddr); - ppc_flush_icache(dest32); - break; - case N_BSS: + COFFDEBUG("R_POS N_DATA\n"); + COFFDEBUG("txtsize=%x\t", cofffile->txtsize); + COFFDEBUG("dest32=%x\t", dest32); + COFFDEBUG("symval=%x\t", symval); + COFFDEBUG("*dest32=%8.8x\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + ((unsigned long)(cofffile-> + saddr[N_DATA - + 1])) - + cofffile->dataddr); + ppc_flush_icache(dest32); + break; + case N_BSS: #ifdef COFFDEBUG - COFFDEBUG( "R_POS N_BSS\n" ); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - *dest32=(unsigned long)((*dest32)+ - (unsigned long)(cofffile->saddr[N_BSS-1])- - (cofffile->bssaddr)); - ppc_flush_icache(dest32); - break; - default: - ErrorF("R_POS with unexpected section %d\n", - symbol->n_scnum ); - } + COFFDEBUG("R_POS N_BSS\n"); + COFFDEBUG("dest32=%x\t", dest32); + COFFDEBUG("symval=%x\t", symval); + COFFDEBUG("*dest32=%8.8x\t", *dest32); +#endif + *dest32 = (unsigned long)((*dest32) + + (unsigned long)(cofffile-> + saddr[N_BSS - 1]) - + (cofffile->bssaddr)); + ppc_flush_icache(dest32); + break; + default: + ErrorF("R_POS with unexpected section %d\n", symbol->n_scnum); } + } #ifdef COFFDEBUG - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); - COFFDEBUG( "\n" ); + COFFDEBUG("*dest32=%8.8x\t", *dest32); + COFFDEBUG("\n"); #endif - break; - case R_TOC: - /* - * Relative to TOC - */ - { - dest16=(unsigned short *)dest32; - if( RELOC_RLEN(*rel) != 0x0f ) - FatalError("R_TOC with size != 16 bits" ); + break; + case R_TOC: + /* + * Relative to TOC + */ + { + dest16 = (unsigned short *)dest32; + if (RELOC_RLEN(*rel) != 0x0f) + FatalError("R_TOC with size != 16 bits"); #ifdef COFFDEBUG - COFFDEBUG( "R_TOC "); - COFFDEBUG( "dest16=%x\t", dest16 ); - COFFDEBUG( "symbol=%x\t", symbol ); - COFFDEBUG( "symbol->n_value=%x\t", symbol->n_value ); - COFFDEBUG( "cofffile->toc=%x\t", cofffile->toc ); - COFFDEBUG( "*dest16=%8.8x\t", *dest16 ); -#endif - *dest16=(unsigned long)((symbol->n_value-cofffile->toc)); + COFFDEBUG("R_TOC "); + COFFDEBUG("dest16=%x\t", dest16); + COFFDEBUG("symbol=%x\t", symbol); + COFFDEBUG("symbol->n_value=%x\t", symbol->n_value); + COFFDEBUG("cofffile->toc=%x\t", cofffile->toc); + COFFDEBUG("*dest16=%8.8x\t", *dest16); +#endif + *dest16 = (unsigned long)((symbol->n_value - cofffile->toc)); ppc_flush_icache(dest16); - } + } #ifdef COFFDEBUG - COFFDEBUG( "*dest16=%8.8x\t", *dest16 ); - COFFDEBUG( "\n" ); + COFFDEBUG("*dest16=%8.8x\t", *dest16); + COFFDEBUG("\n"); #endif - break; - case R_BR: - /* - * Branch relative to self, non-modifiable - */ - - if( RELOC_RLEN(*rel) != 0x19 ) - FatalError("R_BR with size != 24 bits" ); - name = COFFGetSymbolName(cofffile, rel->r_symndx); + break; + case R_BR: + /* + * Branch relative to self, non-modifiable + */ + + if (RELOC_RLEN(*rel) != 0x19) + FatalError("R_BR with size != 24 bits"); + name = COFFGetSymbolName(cofffile, rel->r_symndx); + symitem = LoaderHashFind(name); + if (symitem == 0) { + name++; symitem = LoaderHashFind(name); - if( symitem == 0 ) { - name++; - symitem = LoaderHashFind(name); - } - if( symitem && cofffile->module != symitem->module ) { + } + if (symitem && cofffile->module != symitem->module) { #ifdef COFFDEBUG - COFFDEBUG("Symbol module %d != file module %d\n", - symitem->module, cofffile->module ); + COFFDEBUG("Symbol module %d != file module %d\n", + symitem->module, cofffile->module); #endif - symval=COFFGetSymbolGlinkValue(cofffile, rel->r_symndx); - } - else - symval=COFFGetSymbolValue(cofffile, rel->r_symndx); - if( symval == 0 ) { + symval = COFFGetSymbolGlinkValue(cofffile, rel->r_symndx); + } else + symval = COFFGetSymbolValue(cofffile, rel->r_symndx); + if (symval == 0) { #ifdef COFFDEBUG - char *name; - COFFDEBUG( "***Unable to resolve symbol %s\n", - name=COFFGetSymbolName(cofffile,rel->r_symndx) ); - xf86loaderfree(name); + char *name; + + COFFDEBUG("***Unable to resolve symbol %s\n", + name = COFFGetSymbolName(cofffile, rel->r_symndx)); + xf86loaderfree(name); #endif - return COFFDelayRelocation(cofffile,secndx,rel); - } + return COFFDelayRelocation(cofffile, secndx, rel); + } #ifdef COFFDEBUG - COFFDEBUG( "R_BR "); - COFFDEBUG( "dest32=%x\t", dest32 ); - COFFDEBUG( "symval=%x\t", symval ); - COFFDEBUG( "*dest32=%8.8x\t", *dest32 ); -#endif - { - unsigned long val; - val=((unsigned long)symval-(unsigned long)dest32); + COFFDEBUG("R_BR "); + COFFDEBUG("dest32=%x\t", dest32); + COFFDEBUG("symval=%x\t", symval); + COFFDEBUG("*dest32=%8.8x\t", *dest32); +#endif + { + unsigned long val; + + val = ((unsigned long)symval - (unsigned long)dest32); #ifdef COFFDEBUG - COFFDEBUG( "val=%8.8x\n", val ); + COFFDEBUG("val=%8.8x\n", val); #endif - val = val>>2; - if( (val & 0x3f000000) != 0x3f000000 && - (val & 0x3f000000) != 0x00000000 ) { - FatalError( "R_BR offset %x too large\n", val<<2 ); - break; - } - val &= 0x00ffffff; + val = val >> 2; + if ((val & 0x3f000000) != 0x3f000000 && + (val & 0x3f000000) != 0x00000000) { + FatalError("R_BR offset %x too large\n", val << 2); + break; + } + val &= 0x00ffffff; #ifdef COFFDEBUG - COFFDEBUG( "val=%8.8x\n", val ); -#endif - /* - * The address part contains the offset to the beginning - * of the .text section. Disreguard this since we have - * calculated the correct offset already. - */ - (*dest32)=((*dest32)&0xfc000003)|(val<<2); + COFFDEBUG("val=%8.8x\n", val); +#endif + /* + * The address part contains the offset to the beginning + * of the .text section. Disreguard this since we have + * calculated the correct offset already. + */ + (*dest32) = ((*dest32) & 0xfc000003) | (val << 2); #ifdef COFFDEBUG - COFFDEBUG( "*dest32=%8.8x\n", *dest32 ); + COFFDEBUG("*dest32=%8.8x\n", *dest32); #endif - if( cofffile->module != symitem->module ) { - (*++dest32)=0x80410014; /* lwz r2,20(r1) */ - } - ppc_flush_icache(--dest32); + if (cofffile->module != symitem->module) { + (*++dest32) = 0x80410014; /* lwz r2,20(r1) */ } + ppc_flush_icache(--dest32); + } - break; + break; #endif /* __powerpc__ */ - default: - ErrorF( - "COFF_RelocateEntry() Unsupported relocation type %o\n", - rel->r_type ); - break; - } + default: + ErrorF("COFF_RelocateEntry() Unsupported relocation type %o\n", + rel->r_type); + break; + } return 0; } static COFFRelocPtr -COFFCollectRelocations(cofffile) -COFFModulePtr cofffile; +COFFCollectRelocations(COFFModulePtr cofffile) { - unsigned short i,j; - RELOC *rel; - SCNHDR *sec; + unsigned short i, j; + RELOC *rel; + SCNHDR *sec; COFFRelocPtr reloc_head = NULL; COFFRelocPtr tmp; - for(i=0; i<cofffile->numsh; i++ ) { - if( cofffile->saddr[i] == NULL ) - continue; /* Section not loaded!! */ - sec=&(cofffile->sections[i]); - for(j=0;j<sec->s_nreloc;j++) { - rel=(RELOC *)(cofffile->reladdr[i]+(j*RELSZ)); - tmp = COFFDelayRelocation(cofffile,i,rel); + for (i = 0; i < cofffile->numsh; i++) { + if (cofffile->saddr[i] == NULL) + continue; /* Section not loaded!! */ + sec = &(cofffile->sections[i]); + for (j = 0; j < sec->s_nreloc; j++) { + rel = (RELOC *) (cofffile->reladdr[i] + (j * RELSZ)); + tmp = COFFDelayRelocation(cofffile, i, rel); tmp->next = reloc_head; reloc_head = tmp; } @@ -826,199 +826,191 @@ COFFModulePtr cofffile; */ static LOOKUP * -COFF_GetSymbols(cofffile) -COFFModulePtr cofffile; +COFF_GetSymbols(COFFModulePtr cofffile) { - SYMENT *sym; - AUXENT *aux=NULL; - int i, l, numsyms; - LOOKUP *lookup, *lookup_common, *p; - char *symname; + SYMENT *sym; + AUXENT *aux = NULL; + int i, l, numsyms; + LOOKUP *lookup, *lookup_common, *p; + char *symname; /* * Load the symbols into memory */ - numsyms=cofffile->header->f_nsyms; + numsyms = cofffile->header->f_nsyms; #ifdef COFFDEBUG - COFFDEBUG("COFF_GetSymbols(): %d symbols\n", numsyms ); + COFFDEBUG("COFF_GetSymbols(): %d symbols\n", numsyms); #endif - cofffile->symsize=(numsyms*SYMESZ); - cofffile->symtab=(SYMENT *)_LoaderFileToMem(cofffile->fd,cofffile->header->f_symptr, - (numsyms*SYMESZ),"symbols"); + cofffile->symsize = (numsyms * SYMESZ); + cofffile->symtab = + (SYMENT *) _LoaderFileToMem(cofffile->fd, + cofffile->header->f_symptr, + (numsyms * SYMESZ), "symbols"); - if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) + if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) return NULL; - for(i=0,l=0; i<numsyms; i++) - { - sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(i*SYMESZ)); - symname=COFFGetSymbolName(cofffile,i); - if( sym->n_numaux > 0 ) - aux=(AUXENT *)(((unsigned char *)cofffile->symtab)+((i+1)*SYMESZ)); - else - aux=NULL; + for (i = 0, l = 0; i < numsyms; i++) { + sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (i * SYMESZ)); + symname = COFFGetSymbolName(cofffile, i); + if (sym->n_numaux > 0) + aux = (AUXENT *) (((unsigned char *)cofffile->symtab) + + ((i + 1) * SYMESZ)); + else + aux = NULL; #ifdef COFFDEBUG - COFFDEBUG("\t%d %d %x %x %d %d %s\n", - i, sym->n_scnum, sym->n_value, sym->n_type, - sym->n_sclass, sym->n_numaux, symname ); - if( aux ) - COFFDEBUG("aux=\t%d %x %x %x %x %x %x\n", - aux->x_scnlen, aux->x_parmhash, aux->x_snhash, - aux->x_smtyp, aux->x_smclas, aux->x_stab, - aux->x_snstab ); -#endif - i+=sym->n_numaux; - /* - * check for TOC csect before discarding C_HIDEXT below - */ - if( aux && aux->x_smclas == XMC_TC0 ) { - if( sym->n_scnum != N_DATA ) - FatalError("TOC not in N_DATA section"); - cofffile->toc=sym->n_value; - cofffile->tocaddr=(cofffile->saddr[sym->n_scnum-1]+ - sym->n_value-(cofffile->dataddr)); + COFFDEBUG("\t%d %d %lx %x %d %d %s\n", + i, sym->n_scnum, sym->n_value, sym->n_type, + sym->n_sclass, sym->n_numaux, symname); + if (aux) + COFFDEBUG("aux=\t%ld %lx %x %x %x %lx %x\n", + aux->x_scnlen, aux->x_parmhash, aux->x_snhash, + aux->x_smtyp, aux->x_smclas, aux->x_stab, + aux->x_snstab); +#endif + i += sym->n_numaux; + /* + * check for TOC csect before discarding C_HIDEXT below + */ + if (aux && aux->x_smclas == XMC_TC0) { + if (sym->n_scnum != N_DATA) + FatalError("TOC not in N_DATA section"); + cofffile->toc = sym->n_value; + cofffile->tocaddr = (cofffile->saddr[sym->n_scnum - 1] + + sym->n_value - (cofffile->dataddr)); #ifdef COFFDEBUG - COFFDEBUG("TOC=%x\n", cofffile->toc ); - COFFDEBUG("TOCaddr=%x\n", cofffile->tocaddr ); + COFFDEBUG("TOC=%lx\n", cofffile->toc); + COFFDEBUG("TOCaddr=%p\n", cofffile->tocaddr); #endif - continue; - } - if( sym->n_sclass == C_HIDEXT ) { + continue; + } + if (sym->n_sclass == C_HIDEXT) { /* && aux && !(aux->x_smclas == XMC_DS && aux->x_smtyp == XTY_SD) ) ) { */ #ifdef COFFDEBUG - COFFDEBUG("Skipping C_HIDEXT class symbol %s\n", symname ); + COFFDEBUG("Skipping C_HIDEXT class symbol %s\n", symname); #endif - continue; - } - switch( sym->n_scnum ) - { - case N_UNDEF: - if( sym->n_value != 0 ) { - char *name; - COFFCommonPtr tmp; - - name = COFFGetSymbolName(cofffile,i); + continue; + } + switch (sym->n_scnum) { + case N_UNDEF: + if (sym->n_value != 0) { + char *name; + COFFCommonPtr tmp; + + name = COFFGetSymbolName(cofffile, i); #ifdef COFFDEBUG - COFFDEBUG("Adding COMMON space for %s\n", name); -#endif - if(!LoaderHashFind(name)) { - tmp = COFFAddCOMMON(sym,i); - if (tmp) { - tmp->next = listCOMMON; - listCOMMON = tmp; - } - } - xf86loaderfree(name); + COFFDEBUG("Adding COMMON space for %s\n", name); +#endif + if (!LoaderHashFind(name)) { + tmp = COFFAddCOMMON(sym, i); + if (tmp) { + tmp->next = listCOMMON; + listCOMMON = tmp; } - xf86loaderfree(symname); - break; - case N_ABS: - case N_DEBUG: - case N_COMMENT: + } + xf86loaderfree(name); + } + xf86loaderfree(symname); + break; + case N_ABS: + case N_DEBUG: + case N_COMMENT: #ifdef COFFDEBUG - COFFDEBUG("Freeing %s, section %d\n", - symname, sym->n_scnum ); -#endif - xf86loaderfree(symname); - break; - case N_TEXT: - if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) - && cofffile->saddr[sym->n_scnum-1]) { - lookup[l].symName=symname; - lookup[l].offset=(funcptr) - (cofffile->saddr[sym->n_scnum-1]+ - sym->n_value-cofffile->txtaddr); + COFFDEBUG("Freeing %s, section %d\n", symname, sym->n_scnum); +#endif + xf86loaderfree(symname); + break; + case N_TEXT: + if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) + && cofffile->saddr[sym->n_scnum - 1]) { + lookup[l].symName = symname; + lookup[l].offset = (funcptr) + (cofffile->saddr[sym->n_scnum - 1] + + sym->n_value - cofffile->txtaddr); #ifdef COFFDEBUG - COFFDEBUG("Adding %x %s\n", - lookup[l].offset, lookup[l].symName ); + COFFDEBUG("Adding %p %s\n", + (void *)lookup[l].offset, lookup[l].symName); #endif - l++; - } - else { + l++; + } else { #ifdef COFFDEBUG - COFFDEBUG( "TEXT Section not loaded %d\n", - sym->n_scnum-1 ); + COFFDEBUG("TEXT Section not loaded %d\n", sym->n_scnum - 1); #endif - xf86loaderfree(symname); - } - break; - case N_DATA: - /* - * Note: COFF expects .data to be contiguous with - * .data, so that offsets for .data are relative to - * .text. We need to adjust for this, and make them - * relative to .data so that the relocation can be - * properly applied. This is needed becasue we allocate - * .data seperately from .text. - */ - if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) - && cofffile->saddr[sym->n_scnum-1]) { - lookup[l].symName=symname; - lookup[l].offset=(funcptr) - (cofffile->saddr[sym->n_scnum-1]+ - sym->n_value-cofffile->dataddr); + xf86loaderfree(symname); + } + break; + case N_DATA: + /* + * Note: COFF expects .data to be contiguous with + * .data, so that offsets for .data are relative to + * .text. We need to adjust for this, and make them + * relative to .data so that the relocation can be + * properly applied. This is needed becasue we allocate + * .data seperately from .text. + */ + if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) + && cofffile->saddr[sym->n_scnum - 1]) { + lookup[l].symName = symname; + lookup[l].offset = (funcptr) + (cofffile->saddr[sym->n_scnum - 1] + + sym->n_value - cofffile->dataddr); #ifdef COFFDEBUG - COFFDEBUG("Adding %x %s\n", - lookup[l].offset, lookup[l].symName ); + COFFDEBUG("Adding %p %s\n", + (void *)lookup[l].offset, lookup[l].symName); #endif - l++; - } - else { + l++; + } else { #ifdef COFFDEBUG - COFFDEBUG( "DATA Section not loaded %d\n", - sym->n_scnum-1 ); + COFFDEBUG("DATA Section not loaded %d\n", sym->n_scnum - 1); #endif - xf86loaderfree(symname); - } - break; - case N_BSS: - /* - * Note: COFF expects .bss to be contiguous with - * .data, so that offsets for .bss are relative to - * .text. We need to adjust for this, and make them - * relative to .bss so that the relocation can be - * properly applied. This is needed becasue we allocate - * .bss seperately from .text and .data. - */ - if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) - && cofffile->saddr[sym->n_scnum-1]) { - lookup[l].symName=symname; - lookup[l].offset=(funcptr) - (cofffile->saddr[sym->n_scnum-1]+ - sym->n_value-cofffile->bssaddr); + xf86loaderfree(symname); + } + break; + case N_BSS: + /* + * Note: COFF expects .bss to be contiguous with + * .data, so that offsets for .bss are relative to + * .text. We need to adjust for this, and make them + * relative to .bss so that the relocation can be + * properly applied. This is needed becasue we allocate + * .bss seperately from .text and .data. + */ + if ((sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT) + && cofffile->saddr[sym->n_scnum - 1]) { + lookup[l].symName = symname; + lookup[l].offset = (funcptr) + (cofffile->saddr[sym->n_scnum - 1] + + sym->n_value - cofffile->bssaddr); #ifdef COFFDEBUG - COFFDEBUG("Adding %x %s\n", - lookup[l].offset, lookup[l].symName ); + COFFDEBUG("Adding %p %s\n", + (void *)lookup[l].offset, lookup[l].symName); #endif - l++; - } - else { + l++; + } else { #ifdef COFFDEBUG - COFFDEBUG( "BSS Section not loaded %d\n", - sym->n_scnum-1 ); + COFFDEBUG("BSS Section not loaded %d\n", sym->n_scnum - 1); #endif - xf86loaderfree(symname); - } - break; - default: - ErrorF("Unknown Section number %d\n", sym->n_scnum ); - xf86loaderfree(symname); - break; - } + xf86loaderfree(symname); + } + break; + default: + ErrorF("Unknown Section number %d\n", sym->n_scnum); + xf86loaderfree(symname); + break; } + } - lookup[l].symName=NULL; /* Terminate the list */ + lookup[l].symName = NULL; /* Terminate the list */ lookup_common = COFFCreateCOMMON(cofffile); if (lookup_common) { - for (i = 0, p = lookup_common; p->symName; i++, p++) - ; - memcpy(&(lookup[l]), lookup_common, i * sizeof (LOOKUP)); + for (i = 0, p = lookup_common; p->symName; i++, p++) ; + memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP)); xf86loaderfree(lookup_common); l += i; @@ -1030,10 +1022,11 @@ COFFModulePtr cofffile; */ for (i = 0, p = lookup; p->symName; i++, p++) { while (p->symName && (!strcmp(lookup[i].symName, ".text") - || !strcmp(lookup[i].symName, ".data") - || !strcmp(lookup[i].symName, ".bss") + || !strcmp(lookup[i].symName, ".data") + || !strcmp(lookup[i].symName, ".bss") )) { - memmove(&(lookup[i]), &(lookup[i+1]), (l-- - i) * sizeof (LOOKUP)); + memmove(&(lookup[i]), &(lookup[i + 1]), + (l-- - i) * sizeof(LOOKUP)); } } @@ -1052,94 +1045,95 @@ COFFModulePtr cofffile; * Do the work required to load each section into memory. */ static void -COFFCollectSections(cofffile) -COFFModulePtr cofffile; +COFFCollectSections(COFFModulePtr cofffile) { - unsigned short i; + unsigned short i; /* * Find and identify all of the Sections */ #ifdef COFFDEBUG - COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh ); + COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh); #endif - for( i=0; i<cofffile->numsh; i++) { + for (i = 0; i < cofffile->numsh; i++) { #ifdef COFFDEBUG - COFFDEBUG("%d %s\n", i, cofffile->sections[i].s_name ); + COFFDEBUG("%d %s\n", i, cofffile->sections[i].s_name); #endif /* .text */ - if( strcmp(cofffile->sections[i].s_name, - ".text" ) == 0 ) { - cofffile->text=_LoaderFileToMem(cofffile->fd, - SecOffset(i),SecSize(i),".text"); - cofffile->saddr[i]=cofffile->text; - cofffile->txtndx=i; - cofffile->txtaddr=SecAddr(i); - cofffile->txtsize=SecSize(i); - cofffile->txtrelsize=RelSize(i); - cofffile->reladdr[i]=_LoaderFileToMem(cofffile->fd, - RelOffset(i), RelSize(i),".rel.text"); + if (strcmp(cofffile->sections[i].s_name, ".text") == 0) { + cofffile->text = _LoaderFileToMem(cofffile->fd, + SecOffset(i), SecSize(i), + ".text"); + cofffile->saddr[i] = cofffile->text; + cofffile->txtndx = i; + cofffile->txtaddr = SecAddr(i); + cofffile->txtsize = SecSize(i); + cofffile->txtrelsize = RelSize(i); + cofffile->reladdr[i] = _LoaderFileToMem(cofffile->fd, + RelOffset(i), RelSize(i), + ".rel.text"); #ifdef COFFDEBUG - COFFDEBUG(".text starts at %x (%x bytes)\n", cofffile->text, cofffile->txtsize ); + COFFDEBUG(".text starts at %p (%x bytes)\n", cofffile->text, + cofffile->txtsize); #endif continue; } /* .data */ - if( strcmp(cofffile->sections[i].s_name, - ".data" ) == 0 ) { - cofffile->data=_LoaderFileToMem(cofffile->fd, - SecOffset(i),SecSize(i),".data"); - cofffile->saddr[i]=cofffile->data; - cofffile->datndx=i; - cofffile->dataddr=SecAddr(i); - cofffile->datsize=SecSize(i); - cofffile->datrelsize=RelSize(i); - cofffile->reladdr[i]=_LoaderFileToMem(cofffile->fd, - RelOffset(i), RelSize(i),".rel.data"); + if (strcmp(cofffile->sections[i].s_name, ".data") == 0) { + cofffile->data = _LoaderFileToMem(cofffile->fd, + SecOffset(i), SecSize(i), + ".data"); + cofffile->saddr[i] = cofffile->data; + cofffile->datndx = i; + cofffile->dataddr = SecAddr(i); + cofffile->datsize = SecSize(i); + cofffile->datrelsize = RelSize(i); + cofffile->reladdr[i] = _LoaderFileToMem(cofffile->fd, + RelOffset(i), RelSize(i), + ".rel.data"); #ifdef COFFDEBUG - COFFDEBUG(".data starts at %x (%x bytes)\n", cofffile->data, cofffile->datsize ); + COFFDEBUG(".data starts at %p (%x bytes)\n", cofffile->data, + cofffile->datsize); #endif continue; } /* .bss */ - if( strcmp(cofffile->sections[i].s_name, - ".bss" ) == 0 ) { - if( SecSize(i) ) - cofffile->bss=xf86loadercalloc(1,SecSize(i)); + if (strcmp(cofffile->sections[i].s_name, ".bss") == 0) { + if (SecSize(i)) + cofffile->bss = xf86loadercalloc(1, SecSize(i)); else - cofffile->bss=NULL; - cofffile->saddr[i]=cofffile->bss; - cofffile->bssndx=i; - cofffile->bssaddr=SecAddr(i); - cofffile->bsssize=SecSize(i); + cofffile->bss = NULL; + cofffile->saddr[i] = cofffile->bss; + cofffile->bssndx = i; + cofffile->bssaddr = SecAddr(i); + cofffile->bsssize = SecSize(i); #ifdef COFFDEBUG - COFFDEBUG(".bss starts at %x (%x bytes)\n", cofffile->bss, cofffile->bsssize ); + COFFDEBUG(".bss starts at %p (%x bytes)\n", cofffile->bss, + cofffile->bsssize); #endif continue; } /* .comment */ - if( strncmp(cofffile->sections[i].s_name, - ".comment",strlen(".comment") ) == 0 ) { + if (strncmp(cofffile->sections[i].s_name, + ".comment", strlen(".comment")) == 0) { continue; } /* .stab */ - if( strcmp(cofffile->sections[i].s_name, - ".stab" ) == 0 ) { + if (strcmp(cofffile->sections[i].s_name, ".stab") == 0) { continue; } /* .stabstr */ - if( strcmp(cofffile->sections[i].s_name, - ".stabstr" ) == 0 ) { + if (strcmp(cofffile->sections[i].s_name, ".stabstr") == 0) { continue; } /* .stab.* */ - if( strncmp(cofffile->sections[i].s_name, - ".stab.", strlen(".stab.") ) == 0 ) { + if (strncmp(cofffile->sections[i].s_name, + ".stab.", strlen(".stab.")) == 0) { continue; } - ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name ); + ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name); } } @@ -1147,52 +1141,54 @@ COFFModulePtr cofffile; * Public API for the COFF implementation of the loader. */ void * -COFFLoadModule(modrec, cofffd, ppLookup) -loaderPtr modrec; -int cofffd; -LOOKUP **ppLookup; +COFFLoadModule(loaderPtr modrec, int cofffd, LOOKUP **ppLookup) { - COFFModulePtr cofffile; + COFFModulePtr cofffile; FILHDR *header; - int stroffset; /* offset of string table */ + int stroffset; /* offset of string table */ COFFRelocPtr coff_reloc, tail; - void *v; + void *v; #ifdef COFFDEBUG - COFFDEBUG("COFFLoadModule(%s,%x,%x)\n",modrec->name,modrec->handle,cofffd); + COFFDEBUG("COFFLoadModule(%s,%x,%x)\n", modrec->name, modrec->handle, + cofffd); #endif - if ((cofffile = xf86loadercalloc(1,sizeof(COFFModuleRec))) == NULL) { - ErrorF( "Unable to allocate COFFModuleRec\n" ); + if ((cofffile = xf86loadercalloc(1, sizeof(COFFModuleRec))) == NULL) { + ErrorF("Unable to allocate COFFModuleRec\n"); return NULL; } - cofffile->handle=modrec->handle; - cofffile->module=modrec->module; - cofffile->fd=cofffd; - v=cofffile->funcs=modrec->funcs; + cofffile->handle = modrec->handle; + cofffile->module = modrec->module; + cofffile->fd = cofffd; + v = cofffile->funcs = modrec->funcs; /* * Get the COFF header */ - cofffile->header=(FILHDR *)_LoaderFileToMem(cofffd,0,sizeof(FILHDR),"header"); - header=(FILHDR *)cofffile->header; + cofffile->header = + (FILHDR *) _LoaderFileToMem(cofffd, 0, sizeof(FILHDR), "header"); + header = (FILHDR *) cofffile->header; - if( header->f_symptr == 0 || header->f_nsyms == 0 ) { + if (header->f_symptr == 0 || header->f_nsyms == 0) { ErrorF("No symbols found in module\n"); - _LoaderFreeFileMem(header,sizeof(FILHDR)); + _LoaderFreeFileMem(header, sizeof(FILHDR)); xf86loaderfree(cofffile); return NULL; } /* * Get the section table */ - cofffile->numsh=header->f_nscns; - cofffile->secsize=(header->f_nscns*SCNHSZ); - cofffile->sections=(SCNHDR *)_LoaderFileToMem(cofffd,FILHSZ+header->f_opthdr, - cofffile->secsize, "sections"); - cofffile->saddr=xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *)); - cofffile->reladdr=xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *)); + cofffile->numsh = header->f_nscns; + cofffile->secsize = (header->f_nscns * SCNHSZ); + cofffile->sections = + (SCNHDR *) _LoaderFileToMem(cofffd, FILHSZ + header->f_opthdr, + cofffile->secsize, "sections"); + cofffile->saddr = + xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *)); + cofffile->reladdr = + xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *)); /* * Load the optional header if we need it ????? @@ -1206,13 +1202,14 @@ LOOKUP **ppLookup; /* * load the string table (must be done before we process symbols). */ - stroffset=header->f_symptr+(header->f_nsyms*SYMESZ); + stroffset = header->f_symptr + (header->f_nsyms * SYMESZ); - _LoaderFileRead(cofffd,stroffset,&(cofffile->strsize),sizeof(int)); + _LoaderFileRead(cofffd, stroffset, &(cofffile->strsize), sizeof(int)); - stroffset+=4; /* Move past the size */ - cofffile->strsize-=sizeof(int); /* size includes itself, so reduce by 4 */ - cofffile->strtab=_LoaderFileToMem(cofffd,stroffset,cofffile->strsize,"strings"); + stroffset += 4; /* Move past the size */ + cofffile->strsize -= sizeof(int); /* size includes itself, so reduce by 4 */ + cofffile->strtab = + _LoaderFileToMem(cofffd, stroffset, cofffile->strsize, "strings"); /* * add symbols @@ -1224,8 +1221,7 @@ LOOKUP **ppLookup; */ coff_reloc = COFFCollectRelocations(cofffile); if (coff_reloc) { - for (tail = coff_reloc; tail->next; tail = tail->next) - ; + for (tail = coff_reloc; tail->next; tail = tail->next) ; tail->next = _LoaderGetRelocations(v)->coff_reloc; _LoaderGetRelocations(v)->coff_reloc = coff_reloc; } @@ -1234,8 +1230,7 @@ LOOKUP **ppLookup; } void -COFFResolveSymbols(mod) -void *mod; +COFFResolveSymbols(void *mod) { COFFRelocPtr newlist, p, tmp; @@ -1243,7 +1238,7 @@ void *mod; * which we failed to relocate. Destroy the old list in the process. */ newlist = 0; - for (p = _LoaderGetRelocations(mod)->coff_reloc; p; ) { + for (p = _LoaderGetRelocations(mod)->coff_reloc; p;) { tmp = COFF_RelocateEntry(p->file, p->secndx, p->rel); if (tmp) { /* Failed to relocate. Keep it in the list. */ @@ -1258,53 +1253,51 @@ void *mod; } int -COFFCheckForUnresolved( mod) -void *mod; +COFFCheckForUnresolved(void *mod) { - char *name; + char *name; COFFRelocPtr crel; int flag, fatalsym = 0; if ((crel = _LoaderGetRelocations(mod)->coff_reloc) == NULL) return 0; - while( crel ) - { + while (crel) { name = COFFGetSymbolName(crel->file, crel->rel->r_symndx); - flag = _LoaderHandleUnresolved(name, - _LoaderHandleToName(crel->file->handle)); - if (flag) fatalsym = 1; + flag = _LoaderHandleUnresolved(name, + _LoaderHandleToName(crel->file-> + handle)); + if (flag) + fatalsym = 1; xf86loaderfree(name); - crel=crel->next; - } + crel = crel->next; + } return fatalsym; } void -COFFUnloadModule(modptr) -void *modptr; +COFFUnloadModule(void *modptr) { - COFFModulePtr cofffile = (COFFModulePtr)modptr; - COFFRelocPtr relptr, reltptr, *brelptr; + COFFModulePtr cofffile = (COFFModulePtr) modptr; + COFFRelocPtr relptr, reltptr, *brelptr; /* * Delete any unresolved relocations */ - relptr=_LoaderGetRelocations(cofffile->funcs)->coff_reloc; - brelptr=&(_LoaderGetRelocations(cofffile->funcs)->coff_reloc); - - while(relptr) { - if( relptr->file == cofffile ) { - *brelptr=relptr->next; /* take it out of the list */ - reltptr=relptr; /* save pointer to this node */ - relptr=relptr->next; /* advance the pointer */ - xf86loaderfree(reltptr); /* free the node */ + relptr = _LoaderGetRelocations(cofffile->funcs)->coff_reloc; + brelptr = &(_LoaderGetRelocations(cofffile->funcs)->coff_reloc); + + while (relptr) { + if (relptr->file == cofffile) { + *brelptr = relptr->next; /* take it out of the list */ + reltptr = relptr; /* save pointer to this node */ + relptr = relptr->next; /* advance the pointer */ + xf86loaderfree(reltptr); /* free the node */ + } else { + brelptr = &(relptr->next); + relptr = relptr->next; /* advance the pointer */ } - else { - brelptr=&(relptr->next); - relptr=relptr->next; /* advance the pointer */ - } } /* @@ -1318,22 +1311,22 @@ void *modptr; */ #define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size)) - CheckandFree(cofffile->strtab,cofffile->strsize); - CheckandFree(cofffile->symtab,cofffile->symsize); - CheckandFree(cofffile->text,cofffile->txtsize); - CheckandFree(cofffile->reladdr[cofffile->txtndx],cofffile->txtrelsize); - CheckandFree(cofffile->data,cofffile->datsize); - CheckandFree(cofffile->reladdr[cofffile->datndx],cofffile->datrelsize); - CheckandFree(cofffile->bss,cofffile->bsssize); - if( cofffile->common ) + CheckandFree(cofffile->strtab, cofffile->strsize); + CheckandFree(cofffile->symtab, cofffile->symsize); + CheckandFree(cofffile->text, cofffile->txtsize); + CheckandFree(cofffile->reladdr[cofffile->txtndx], cofffile->txtrelsize); + CheckandFree(cofffile->data, cofffile->datsize); + CheckandFree(cofffile->reladdr[cofffile->datndx], cofffile->datrelsize); + CheckandFree(cofffile->bss, cofffile->bsssize); + if (cofffile->common) xf86loaderfree(cofffile->common); /* * Free the section table, and section pointer array */ - _LoaderFreeFileMem(cofffile->sections,cofffile->secsize); + _LoaderFreeFileMem(cofffile->sections, cofffile->secsize); xf86loaderfree(cofffile->saddr); xf86loaderfree(cofffile->reladdr); - _LoaderFreeFileMem(cofffile->header,sizeof(FILHDR)); + _LoaderFreeFileMem(cofffile->header, sizeof(FILHDR)); /* * Free the COFFModuleRec */ @@ -1345,14 +1338,14 @@ void *modptr; char * COFFAddressToSection(void *modptr, unsigned long address) { - COFFModulePtr cofffile = (COFFModulePtr)modptr; + COFFModulePtr cofffile = (COFFModulePtr) modptr; int i; - for( i=1; i<cofffile->numsh; i++) { - if( address >= (unsigned long)cofffile->saddr[i] && - address <= (unsigned long)cofffile->saddr[i]+SecSize(i) ) { - return cofffile->sections[i].s_name; - } - } -return NULL; + for (i = 1; i < cofffile->numsh; i++) { + if (address >= (unsigned long)cofffile->saddr[i] && + address <= (unsigned long)cofffile->saddr[i] + SecSize(i)) { + return cofffile->sections[i].s_name; + } + } + return NULL; } diff --git a/hw/xfree86/loader/coffloader.h b/hw/xfree86/loader/coffloader.h index 35ce4b2c5..217474671 100644 --- a/hw/xfree86/loader/coffloader.h +++ b/hw/xfree86/loader/coffloader.h @@ -21,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.3 1998/09/20 14:41:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */ #ifndef _COFFLOADER_H #define _COFFLOADER_H @@ -29,6 +29,6 @@ extern void *COFFLoadModule(loaderPtr, int, LOOKUP **); extern void COFFResolveSymbols(void *); extern int COFFCheckForUnresolved(void *); -extern char *COFFAddressToSection(void *,unsigned long); +extern char *COFFAddressToSection(void *, unsigned long); extern void COFFUnloadModule(void *); #endif /* _COFFLOADER_H */ diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c index 3c1d5b883..3808cf3e3 100644 --- a/hw/xfree86/loader/dixsym.c +++ b/hw/xfree86/loader/dixsym.c @@ -1,8 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.53 2003/01/26 16:40:42 eich Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.61 2003/11/10 18:22:35 tsi Exp $ */ /* - * * Copyright 1995-1998 by Metro Link, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -23,6 +21,32 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #undef DBMALLOC #include "sym.h" @@ -68,300 +92,309 @@ extern int NumCurrentSelections; LOOKUP dixLookupTab[] = { - /* dix */ - /* atom.c */ - SYMFUNC(MakeAtom) - SYMFUNC(ValidAtom) - /* colormap.c */ - SYMFUNC(AllocColor) - SYMFUNC(CreateColormap) - SYMFUNC(FakeAllocColor) - SYMFUNC(FakeFreeColor) - SYMFUNC(FreeColors) - SYMFUNC(StoreColors) - SYMFUNC(TellLostMap) - SYMFUNC(TellGainedMap) - SYMFUNC(QueryColors) - /* cursor.c */ - SYMFUNC(FreeCursor) - /* devices.c */ - SYMFUNC(Ones) - SYMFUNC(InitButtonClassDeviceStruct) - SYMFUNC(InitFocusClassDeviceStruct) - SYMFUNC(InitLedFeedbackClassDeviceStruct) - SYMFUNC(InitPtrFeedbackClassDeviceStruct) - SYMFUNC(InitValuatorClassDeviceStruct) - SYMFUNC(InitKeyClassDeviceStruct) - SYMFUNC(InitKeyboardDeviceStruct) - SYMFUNC(SendMappingNotify) - /* dispatch.c */ - SYMFUNC(SetInputCheck) - SYMFUNC(SendErrorToClient) - SYMFUNC(UpdateCurrentTime) - SYMFUNC(UpdateCurrentTimeIf) - SYMFUNC(ProcBadRequest) - SYMVAR(dispatchException) - SYMVAR(isItTimeToYield) - SYMVAR(ClientStateCallback) - SYMVAR(ServerGrabCallback) - SYMVAR(CurrentSelections) - SYMVAR(NumCurrentSelections) - /* dixfonts.c */ - SYMFUNC(CloseFont) - SYMFUNC(FontToXError) - SYMFUNC(LoadGlyphs) - SYMVAR(fpe_functions) - /* dixutils.c */ - SYMFUNC(AddCallback) - SYMFUNC(ClientSleep) - SYMFUNC(ClientTimeToServerTime) - SYMFUNC(ClientWakeup) - SYMFUNC(CompareTimeStamps) - SYMFUNC(CopyISOLatin1Lowered) - SYMFUNC(DeleteCallback) - SYMFUNC(LookupClient) - SYMFUNC(LookupDrawable) - SYMFUNC(LookupWindow) - SYMFUNC(NoopDDA) - SYMFUNC(QueueWorkProc) - SYMFUNC(RegisterBlockAndWakeupHandlers) - SYMFUNC(RemoveBlockAndWakeupHandlers) + /* dix */ + /* atom.c */ + SYMFUNC(MakeAtom) + SYMFUNC(ValidAtom) + /* colormap.c */ + SYMFUNC(AllocColor) + SYMFUNC(CreateColormap) + SYMFUNC(FakeAllocColor) + SYMFUNC(FakeFreeColor) + SYMFUNC(FreeColors) + SYMFUNC(StoreColors) + SYMFUNC(TellLostMap) + SYMFUNC(TellGainedMap) + SYMFUNC(QueryColors) + /* cursor.c */ + SYMFUNC(FreeCursor) + /* devices.c */ + SYMFUNC(Ones) + SYMFUNC(InitButtonClassDeviceStruct) + SYMFUNC(InitFocusClassDeviceStruct) + SYMFUNC(InitLedFeedbackClassDeviceStruct) + SYMFUNC(InitPtrFeedbackClassDeviceStruct) + SYMFUNC(InitValuatorClassDeviceStruct) + SYMFUNC(InitKeyClassDeviceStruct) + SYMFUNC(InitKeyboardDeviceStruct) + SYMFUNC(SendMappingNotify) + /* dispatch.c */ + SYMFUNC(SetInputCheck) + SYMFUNC(SendErrorToClient) + SYMFUNC(UpdateCurrentTime) + SYMFUNC(UpdateCurrentTimeIf) + SYMFUNC(ProcBadRequest) + SYMVAR(dispatchException) + SYMVAR(isItTimeToYield) + SYMVAR(ClientStateCallback) + SYMVAR(ServerGrabCallback) + SYMVAR(CurrentSelections) + SYMVAR(NumCurrentSelections) + /* dixfonts.c */ + SYMFUNC(CloseFont) + SYMFUNC(FontToXError) + SYMFUNC(LoadGlyphs) + SYMVAR(fpe_functions) + /* dixutils.c */ + SYMFUNC(AddCallback) + SYMFUNC(ClientSleep) + SYMFUNC(ClientTimeToServerTime) + SYMFUNC(ClientWakeup) + SYMFUNC(CompareTimeStamps) + SYMFUNC(CopyISOLatin1Lowered) + SYMFUNC(DeleteCallback) + SYMFUNC(LookupClient) + SYMFUNC(LookupDrawable) + SYMFUNC(LookupWindow) + SYMFUNC(NoopDDA) + SYMFUNC(QueueWorkProc) + SYMFUNC(RegisterBlockAndWakeupHandlers) + SYMFUNC(RemoveBlockAndWakeupHandlers) #ifdef XCSECURITY - SYMFUNC(SecurityLookupDrawable) - SYMFUNC(SecurityLookupWindow) + SYMFUNC(SecurityLookupDrawable) + SYMFUNC(SecurityLookupWindow) #endif - /* events.c */ - SYMFUNC(CheckCursorConfinement) - SYMFUNC(DeliverEvents) - SYMFUNC(NewCurrentScreen) - SYMFUNC(PointerConfinedToScreen) - SYMFUNC(TryClientEvents) - SYMFUNC(WriteEventsToClient) - SYMVAR(DeviceEventCallback) - SYMVAR(EventCallback) - SYMVAR(inputInfo) - SYMVAR(SetCriticalEvent) + /* events.c */ + SYMFUNC(CheckCursorConfinement) + SYMFUNC(DeliverEvents) + SYMFUNC(NewCurrentScreen) + SYMFUNC(PointerConfinedToScreen) + SYMFUNC(TryClientEvents) + SYMFUNC(WriteEventsToClient) + SYMVAR(DeviceEventCallback) + SYMVAR(EventCallback) + SYMVAR(inputInfo) + SYMVAR(SetCriticalEvent) #ifdef PANORAMIX - SYMVAR(XineramaGetCursorScreen) + SYMVAR(XineramaGetCursorScreen) #endif - /* property.c */ - SYMFUNC(ChangeWindowProperty) - /* extension.c */ - SYMFUNC(AddExtension) - SYMFUNC(AddExtensionAlias) - SYMFUNC(CheckExtension) - SYMFUNC(DeclareExtensionSecurity) - SYMFUNC(MinorOpcodeOfRequest) - SYMFUNC(StandardMinorOpcode) - /* gc.c */ - SYMFUNC(CopyGC) - SYMFUNC(CreateGC) - SYMFUNC(CreateScratchGC) - SYMFUNC(ChangeGC) - SYMFUNC(dixChangeGC) - SYMFUNC(DoChangeGC) - SYMFUNC(FreeGC) - SYMFUNC(FreeScratchGC) - SYMFUNC(GetScratchGC) - SYMFUNC(SetClipRects) - SYMFUNC(ValidateGC) - SYMFUNC(VerifyRectOrder) - SYMFUNC(SetDashes) - /* globals.c */ - SYMVAR(DPMSEnabled) - SYMVAR(DPMSCapableFlag) - SYMVAR(DPMSOffTime) - SYMVAR(DPMSPowerLevel) - SYMVAR(DPMSStandbyTime) - SYMVAR(DPMSSuspendTime) - SYMVAR(DPMSEnabledSwitch) - SYMVAR(DPMSDisabledSwitch) - SYMVAR(defaultDPMSEnabled) + /* property.c */ + SYMFUNC(ChangeWindowProperty) + /* extension.c */ + SYMFUNC(AddExtension) + SYMFUNC(AddExtensionAlias) + SYMFUNC(CheckExtension) + SYMFUNC(DeclareExtensionSecurity) + SYMFUNC(MinorOpcodeOfRequest) + SYMFUNC(StandardMinorOpcode) + /* gc.c */ + SYMFUNC(CopyGC) + SYMFUNC(CreateGC) + SYMFUNC(CreateScratchGC) + SYMFUNC(ChangeGC) + SYMFUNC(dixChangeGC) + SYMFUNC(DoChangeGC) + SYMFUNC(FreeGC) + SYMFUNC(FreeScratchGC) + SYMFUNC(GetScratchGC) + SYMFUNC(SetClipRects) + SYMFUNC(ValidateGC) + SYMFUNC(VerifyRectOrder) + SYMFUNC(SetDashes) + /* globals.c */ + SYMVAR(DPMSEnabled) + SYMVAR(DPMSCapableFlag) + SYMVAR(DPMSOffTime) + SYMVAR(DPMSPowerLevel) + SYMVAR(DPMSStandbyTime) + SYMVAR(DPMSSuspendTime) + SYMVAR(DPMSEnabledSwitch) + SYMVAR(DPMSDisabledSwitch) + SYMVAR(defaultDPMSEnabled) + SYMVAR(currentRegionScreen) + /* bigreq */ + SYMVAR(maxBigRequestSize) #ifdef XV - /* XXX These are exported from the DDX, not DIX. */ - SYMVAR(XvScreenInitProc) - SYMVAR(XvGetScreenIndexProc) - SYMVAR(XvGetRTPortProc) - SYMVAR(XvMCScreenInitProc) + /* XXX These are exported from the DDX, not DIX. */ + SYMVAR(XvScreenInitProc) + SYMVAR(XvGetScreenIndexProc) + SYMVAR(XvGetRTPortProc) + SYMVAR(XvMCScreenInitProc) +#endif + SYMVAR(ScreenSaverBlanking) + SYMVAR(WindowTable) + SYMVAR(clients) + SYMVAR(currentMaxClients) + SYMVAR(currentTime) + SYMVAR(defaultColorVisualClass) + SYMVAR(globalSerialNumber) + SYMVAR(lastDeviceEventTime) + SYMVAR(monitorResolution) + SYMVAR(permitOldBugs) + SYMVAR(screenInfo) + SYMVAR(serverClient) + SYMVAR(serverGeneration) + /* main.c */ + SYMFUNC(NotImplemented) + /* pixmap.c */ + SYMFUNC(AllocatePixmap) + SYMFUNC(GetScratchPixmapHeader) + SYMFUNC(FreeScratchPixmapHeader) + SYMVAR(PixmapWidthPaddingInfo) + /* privates.c */ + SYMFUNC(AllocateClientPrivate) + SYMFUNC(AllocateClientPrivateIndex) + SYMFUNC(AllocateGCPrivate) + SYMFUNC(AllocateGCPrivateIndex) + SYMFUNC(AllocateWindowPrivate) + SYMFUNC(AllocateWindowPrivateIndex) + SYMFUNC(AllocateScreenPrivateIndex) + SYMFUNC(AllocateColormapPrivateIndex) +#ifdef PIXPRIV + SYMFUNC(AllocatePixmapPrivateIndex) + SYMFUNC(AllocatePixmapPrivate) #endif - SYMVAR(ScreenSaverBlanking) - SYMVAR(WindowTable) - SYMVAR(clients) - SYMVAR(currentMaxClients) - SYMVAR(currentTime) - SYMVAR(defaultColorVisualClass) - SYMVAR(globalSerialNumber) - SYMVAR(lastDeviceEventTime) - SYMVAR(monitorResolution) - SYMVAR(permitOldBugs) - SYMVAR(screenInfo) - SYMVAR(serverClient) - SYMVAR(serverGeneration) - /* main.c */ - SYMFUNC(NotImplemented) - /* pixmap.c */ - SYMFUNC(AllocatePixmap) - SYMFUNC(GetScratchPixmapHeader) - SYMFUNC(FreeScratchPixmapHeader) - SYMVAR(PixmapWidthPaddingInfo) - /* privates.c */ - SYMFUNC(AllocateClientPrivate) - SYMFUNC(AllocateClientPrivateIndex) - SYMFUNC(AllocateGCPrivate) - SYMFUNC(AllocateGCPrivateIndex) - SYMFUNC(AllocateWindowPrivate) - SYMFUNC(AllocateWindowPrivateIndex) - SYMFUNC(AllocateScreenPrivateIndex) - SYMFUNC(AllocateColormapPrivateIndex) - /* resource.c */ - SYMFUNC(AddResource) - SYMFUNC(ChangeResourceValue) - SYMFUNC(CreateNewResourceClass) - SYMFUNC(CreateNewResourceType) - SYMFUNC(FakeClientID) - SYMFUNC(FreeResource) - SYMFUNC(FreeResourceByType) - SYMFUNC(GetXIDList) - SYMFUNC(GetXIDRange) - SYMFUNC(LookupIDByType) - SYMFUNC(LookupIDByClass) - SYMFUNC(LegalNewID) + /* resource.c */ + SYMFUNC(AddResource) + SYMFUNC(ChangeResourceValue) + SYMFUNC(CreateNewResourceClass) + SYMFUNC(CreateNewResourceType) + SYMFUNC(FakeClientID) + SYMFUNC(FreeResource) + SYMFUNC(FreeResourceByType) + SYMFUNC(GetXIDList) + SYMFUNC(GetXIDRange) + SYMFUNC(LookupIDByType) + SYMFUNC(LookupIDByClass) + SYMFUNC(LegalNewID) #ifdef XCSECURITY - SYMFUNC(SecurityLookupIDByClass) - SYMFUNC(SecurityLookupIDByType) + SYMFUNC(SecurityLookupIDByClass) + SYMFUNC(SecurityLookupIDByType) #endif - SYMFUNC(FindClientResourcesByType) - SYMFUNC(FindAllClientResources) - SYMVAR(lastResourceType) - SYMVAR(TypeMask) + SYMFUNC(FindClientResourcesByType) + SYMFUNC(FindAllClientResources) + SYMVAR(lastResourceType) + SYMVAR(TypeMask) #ifdef RES - SYMFUNC(RegisterResourceName) - SYMVAR(ResourceNames) + SYMFUNC(RegisterResourceName) + SYMVAR(ResourceNames) #endif - /* swaprep.c */ - SYMFUNC(CopySwap32Write) - SYMFUNC(Swap32Write) - SYMFUNC(SwapConnSetupInfo) - SYMFUNC(SwapConnSetupPrefix) - SYMFUNC(SwapShorts) - SYMFUNC(SwapLongs) - /* swapreq.c */ - SYMFUNC(SwapColorItem) - /* tables.c */ - SYMVAR(EventSwapVector) - SYMVAR(ReplySwapVector) - SYMVAR(ProcVector) - /* window.c */ - SYMFUNC(ChangeWindowAttributes) - SYMFUNC(CheckWindowOptionalNeed) - SYMFUNC(CreateUnclippedWinSize) - SYMFUNC(CreateWindow) - SYMFUNC(FindWindowWithOptional) - SYMFUNC(GravityTranslate) - SYMFUNC(MakeWindowOptional) - SYMFUNC(MapWindow) - SYMFUNC(MoveWindowInStack) - SYMFUNC(NotClippedByChildren) - SYMFUNC(ResizeChildrenWinSize) - SYMFUNC(SaveScreens) - SYMFUNC(SendVisibilityNotify) - SYMFUNC(SetWinSize) - SYMFUNC(SetBorderSize) - SYMFUNC(TraverseTree) - SYMFUNC(UnmapWindow) - SYMFUNC(WalkTree) - SYMFUNC(WindowsRestructured) - SYMVAR(deltaSaveUndersViewable) - SYMVAR(numSaveUndersViewable) - SYMVAR(savedScreenInfo) - SYMVAR(screenIsSaved) + /* swaprep.c */ + SYMFUNC(CopySwap32Write) + SYMFUNC(Swap32Write) + SYMFUNC(SwapConnSetupInfo) + SYMFUNC(SwapConnSetupPrefix) + SYMFUNC(SwapShorts) + SYMFUNC(SwapLongs) + /* swapreq.c */ + SYMFUNC(SwapColorItem) + /* tables.c */ + SYMVAR(EventSwapVector) + SYMVAR(ReplySwapVector) + SYMVAR(ProcVector) + /* window.c */ + SYMFUNC(ChangeWindowAttributes) + SYMFUNC(CheckWindowOptionalNeed) + SYMFUNC(CreateUnclippedWinSize) + SYMFUNC(CreateWindow) + SYMFUNC(FindWindowWithOptional) + SYMFUNC(GravityTranslate) + SYMFUNC(MakeWindowOptional) + SYMFUNC(MapWindow) + SYMFUNC(MoveWindowInStack) + SYMFUNC(NotClippedByChildren) + SYMFUNC(ResizeChildrenWinSize) + SYMFUNC(SaveScreens) + SYMFUNC(SendVisibilityNotify) + SYMFUNC(SetWinSize) + SYMFUNC(SetBorderSize) + SYMFUNC(TraverseTree) + SYMFUNC(UnmapWindow) + SYMFUNC(WalkTree) + SYMFUNC(WindowsRestructured) + SYMVAR(deltaSaveUndersViewable) + SYMVAR(numSaveUndersViewable) + SYMVAR(savedScreenInfo) + SYMVAR(screenIsSaved) - /*os/ */ - /* access.c */ - SYMFUNC(LocalClient) - /* util.c */ - SYMFUNC(Error) - SYMFUNC(VErrorF) - SYMFUNC(ErrorF) - SYMFUNC(FatalError) - SYMFUNC(Xstrdup) - SYMFUNC(XNFstrdup) - SYMVAR(Must_have_memory) - /* xalloc.c */ - SYMFUNC(XNFalloc) - SYMFUNC(XNFcalloc) - SYMFUNC(XNFrealloc) - SYMFUNC(Xalloc) - SYMFUNC(Xcalloc) - SYMFUNC(Xfree) - SYMFUNC(Xrealloc) - /* WaitFor.c */ - SYMFUNC(ScreenSaverTime) - SYMFUNC(TimerFree) - SYMFUNC(TimerSet) - SYMFUNC(TimerCancel) - /* io.c */ - SYMFUNC(WriteToClient) - SYMFUNC(SetCriticalOutputPending) - SYMVAR(FlushCallback) - SYMVAR(ReplyCallback) - SYMVAR(SkippedRequestsCallback) - SYMFUNC(ResetCurrentRequest) - /* connection.c */ - SYMFUNC(IgnoreClient) - SYMFUNC(AttendClient) - SYMFUNC(AddEnabledDevice) - SYMFUNC(RemoveEnabledDevice) - SYMFUNC(MakeClientGrabPervious) - SYMFUNC(MakeClientGrabImpervious) - SYMVAR(GrabInProgress) - /* utils.c */ - SYMFUNC(AdjustWaitForDelay) - SYMVAR(noTestExtensions) + /*os/ */ + /* access.c */ + SYMFUNC(LocalClient) + /* utils.c */ + SYMFUNC(Xstrdup) + SYMFUNC(XNFstrdup) + SYMVAR(Must_have_memory) + SYMFUNC(AdjustWaitForDelay) + SYMVAR(noTestExtensions) + SYMFUNC(GiveUp) + /* log.c */ + SYMFUNC(LogVWrite) + SYMFUNC(LogWrite) + SYMFUNC(LogVMessageVerb) + SYMFUNC(LogMessageVerb) + SYMFUNC(LogMessage) + SYMFUNC(FatalError) + SYMFUNC(VErrorF) + SYMFUNC(ErrorF) + SYMFUNC(Error) + /* xalloc.c */ + SYMFUNC(XNFalloc) + SYMFUNC(XNFcalloc) + SYMFUNC(XNFrealloc) + SYMFUNC(Xalloc) + SYMFUNC(Xcalloc) + SYMFUNC(Xfree) + SYMFUNC(Xrealloc) + /* WaitFor.c */ + SYMFUNC(ScreenSaverTime) + SYMFUNC(TimerFree) + SYMFUNC(TimerSet) + SYMFUNC(TimerCancel) + /* io.c */ + SYMFUNC(WriteToClient) + SYMFUNC(SetCriticalOutputPending) + SYMVAR(FlushCallback) + SYMVAR(ReplyCallback) + SYMVAR(SkippedRequestsCallback) + SYMFUNC(ResetCurrentRequest) + /* connection.c */ + SYMFUNC(IgnoreClient) + SYMFUNC(AttendClient) + SYMFUNC(AddEnabledDevice) + SYMFUNC(RemoveEnabledDevice) + SYMFUNC(MakeClientGrabPervious) + SYMFUNC(MakeClientGrabImpervious) + SYMVAR(GrabInProgress) - /* devices.c */ - SYMFUNC(InitPointerDeviceStruct) - SYMFUNC(LookupKeyboardDevice) - SYMFUNC(LookupPointerDevice) + /* devices.c */ + SYMFUNC(InitPointerDeviceStruct) + SYMFUNC(LookupKeyboardDevice) + SYMFUNC(LookupPointerDevice) #ifdef XKB - /* xkb/xkbInit.c */ - SYMFUNC(XkbInitKeyboardDeviceStruct) - SYMFUNC(XkbSetRulesDflts) - SYMVAR(noXkbExtension) + /* xkb/xkbInit.c */ + SYMFUNC(XkbInitKeyboardDeviceStruct) + SYMFUNC(XkbSetRulesDflts) + SYMVAR(noXkbExtension) #endif #ifdef XINPUT - /* Xi */ - /* exevents.c */ - SYMFUNC(InitValuatorAxisStruct) - SYMFUNC(InitProximityClassDeviceStruct) - /* extinit.c */ - SYMFUNC(AssignTypeAndName) + /* Xi */ + /* exevents.c */ + SYMFUNC(InitValuatorAxisStruct) + SYMFUNC(InitProximityClassDeviceStruct) + /* extinit.c */ + SYMFUNC(AssignTypeAndName) #endif - /* xf86DGA.c */ - /* XXX This is exported from the DDX, not DIX. */ - SYMVAR(XDGAEventBase) + /* xf86DGA.c */ + /* XXX This is exported from the DDX, not DIX. */ + SYMVAR(XDGAEventBase) - /* librender.a */ + /* librender.a */ #ifdef RENDER - SYMFUNC(PictureInit) - SYMFUNC(miPictureInit) - SYMFUNC(miComputeCompositeRegion) - SYMFUNC(miGlyphs) - SYMFUNC(miCompositeRects) - SYMVAR(PictureScreenPrivateIndex) - SYMFUNC(PictureTransformPoint) - SYMFUNC(PictureAddFilter) - SYMFUNC(PictureSetFilterAlias) - SYMFUNC(PictureGetSubpixelOrder) - SYMFUNC(PictureSetSubpixelOrder) + SYMFUNC(PictureInit) + SYMFUNC(miPictureInit) + SYMFUNC(miComputeCompositeRegion) + SYMFUNC(miGlyphs) + SYMFUNC(miCompositeRects) + SYMVAR(PictureScreenPrivateIndex) + SYMFUNC(PictureTransformPoint) + SYMFUNC(PictureAddFilter) + SYMFUNC(PictureSetFilterAlias) + SYMFUNC(PictureGetSubpixelOrder) + SYMFUNC(PictureSetSubpixelOrder) #endif - /* os/utils.c */ - SYMFUNC(GiveUp) - - { 0, 0 }, - + {0, 0} }; diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c index bf4c8c078..9d3011caf 100644 --- a/hw/xfree86/loader/dlloader.c +++ b/hw/xfree86/loader/dlloader.c @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.11 2000/08/23 22:10:14 tsi Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.13 2003/10/15 16:29:02 dawes Exp $ */ /* * @@ -100,13 +99,13 @@ DLFindSymbol(const char *name) n = xf86loadermalloc(strlen(name) + 2); sprintf(n, "_%s", name); #endif - - (void)dlerror(); /* Clear out any previous error */ + + (void)dlerror(); /* Clear out any previous error */ for (l = dlModuleList; l != NULL; l = l->next) { #ifdef NEED_UNDERSCORE_FOR_DLLSYM - p = dlsym(l->module->dlhandle, n); + p = dlsym(l->module->dlhandle, n); #else - p = dlsym(l->module->dlhandle, name); + p = dlsym(l->module->dlhandle, name); #endif if (dlerror() == NULL) { #ifdef NEED_UNDERSCORE_FOR_DLLSYM @@ -115,10 +114,10 @@ DLFindSymbol(const char *name) return p; } } -#ifdef NEED_UNDERSCORE_FOR_DLLSYM +#ifdef NEED_UNDERSCORE_FOR_DLLSYM xf86loaderfree(n); #endif - + return NULL; } @@ -126,12 +125,12 @@ DLFindSymbol(const char *name) * public interface */ void * -DLLoadModule(loaderPtr modrec, int fd, LOOKUP **ppLookup) +DLLoadModule(loaderPtr modrec, int fd, LOOKUP ** ppLookup) { DLModulePtr dlfile; DLModuleList *l; - if ((dlfile=xf86loadercalloc(1,sizeof(DLModuleRec)))==NULL) { + if ((dlfile = xf86loadercalloc(1, sizeof(DLModuleRec))) == NULL) { ErrorF("Unable to allocate DLModuleRec\n"); return NULL; } @@ -167,7 +166,7 @@ DLCheckForUnresolved(void *mod) void DLUnloadModule(void *modptr) { - DLModulePtr dlfile = (DLModulePtr)modptr; + DLModulePtr dlfile = (DLModulePtr) modptr; DLModuleList *l, *p; /* remove it from dlModuleList */ diff --git a/hw/xfree86/loader/elf.h b/hw/xfree86/loader/elf.h index ad072c199..91130e63d 100644 --- a/hw/xfree86/loader/elf.h +++ b/hw/xfree86/loader/elf.h @@ -1,19 +1,18 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.15 2002/10/30 17:50:19 alanh Exp $ */ - - -typedef unsigned int Elf32_Addr; -typedef unsigned short Elf32_Half; -typedef unsigned int Elf32_Off; -typedef long Elf32_Sword; -typedef unsigned int Elf32_Word; - -typedef unsigned long Elf64_Addr; -typedef unsigned short Elf64_Half; -typedef unsigned long Elf64_Off; -typedef int Elf64_Sword; -typedef unsigned int Elf64_Word; -typedef unsigned long Elf64_Xword; -typedef long Elf64_Sxword; +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.17 2003/10/15 16:29:02 dawes Exp $ */ + +typedef unsigned int Elf32_Addr; +typedef unsigned short Elf32_Half; +typedef unsigned int Elf32_Off; +typedef long Elf32_Sword; +typedef unsigned int Elf32_Word; + +typedef unsigned long Elf64_Addr; +typedef unsigned short Elf64_Half; +typedef unsigned long Elf64_Off; +typedef int Elf64_Sword; +typedef unsigned int Elf64_Word; +typedef unsigned long Elf64_Xword; +typedef long Elf64_Sxword; /* These constants are for the segment types stored in the image headers */ #define PT_NULL 0 @@ -42,7 +41,7 @@ typedef long Elf64_Sxword; #define EM_386 3 #define EM_68K 4 #define EM_88K 5 -#define EM_486 6 /* Perhaps disused */ +#define EM_486 6 /* Perhaps disused */ #define EM_860 7 #define EM_MIPS 8 #define EM_MIPS_RS4_BE 10 @@ -101,23 +100,23 @@ typedef long Elf64_Sxword; #define ELF64_ST_TYPE(x) ELF32_ST_TYPE (x) typedef struct dynamic32 { - Elf32_Sword d_tag; - union{ - Elf32_Sword d_val; - Elf32_Addr d_ptr; - } d_un; + Elf32_Sword d_tag; + union { + Elf32_Sword d_val; + Elf32_Addr d_ptr; + } d_un; } Elf32_Dyn; typedef struct dynamic64 { - Elf64_Sxword d_tag; - union{ - Elf64_Xword d_val; - Elf64_Addr d_ptr; - } d_un; + Elf64_Sxword d_tag; + union { + Elf64_Xword d_val; + Elf64_Addr d_ptr; + } d_un; } Elf64_Dyn; #ifndef QNX4 -extern Elf32_Dyn _DYNAMIC []; +extern Elf32_Dyn _DYNAMIC[]; #endif /* The following are used with relocations */ @@ -141,7 +140,7 @@ extern Elf32_Dyn _DYNAMIC []; #define R_386_GOTPC 10 #define R_386_NUM 11 -/* x86_64 Relocation Types */ +/* AMD64 Relocation Types */ #define R_X86_64_NONE 0 #define R_X86_64_64 1 #define R_X86_64_PC32 2 @@ -221,29 +220,29 @@ extern Elf32_Dyn _DYNAMIC []; #define R_SPARC_NUM 56 /* m68k Relocation Types */ -#define R_68K_NONE 0 /* No reloc */ -#define R_68K_32 1 /* Direct 32 bit */ -#define R_68K_16 2 /* Direct 16 bit */ -#define R_68K_8 3 /* Direct 8 bit */ -#define R_68K_PC32 4 /* PC relative 32 bit */ -#define R_68K_PC16 5 /* PC relative 16 bit */ -#define R_68K_PC8 6 /* PC relative 8 bit */ -#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ -#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ -#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ -#define R_68K_GOT32O 10 /* 32 bit GOT offset */ -#define R_68K_GOT16O 11 /* 16 bit GOT offset */ -#define R_68K_GOT8O 12 /* 8 bit GOT offset */ -#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ -#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ -#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ -#define R_68K_PLT32O 16 /* 32 bit PLT offset */ -#define R_68K_PLT16O 17 /* 16 bit PLT offset */ -#define R_68K_PLT8O 18 /* 8 bit PLT offset */ -#define R_68K_COPY 19 /* Copy symbol at runtime */ -#define R_68K_GLOB_DAT 20 /* Create GOT entry */ -#define R_68K_JMP_SLOT 21 /* Create PLT entry */ -#define R_68K_RELATIVE 22 /* Adjust by program base */ +#define R_68K_NONE 0 /* No reloc */ +#define R_68K_32 1 /* Direct 32 bit */ +#define R_68K_16 2 /* Direct 16 bit */ +#define R_68K_8 3 /* Direct 8 bit */ +#define R_68K_PC32 4 /* PC relative 32 bit */ +#define R_68K_PC16 5 /* PC relative 16 bit */ +#define R_68K_PC8 6 /* PC relative 8 bit */ +#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ +#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ +#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ +#define R_68K_GOT32O 10 /* 32 bit GOT offset */ +#define R_68K_GOT16O 11 /* 16 bit GOT offset */ +#define R_68K_GOT8O 12 /* 8 bit GOT offset */ +#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ +#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ +#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ +#define R_68K_PLT32O 16 /* 32 bit PLT offset */ +#define R_68K_PLT16O 17 /* 16 bit PLT offset */ +#define R_68K_PLT8O 18 /* 8 bit PLT offset */ +#define R_68K_COPY 19 /* Copy symbol at runtime */ +#define R_68K_GLOB_DAT 20 /* Create GOT entry */ +#define R_68K_JMP_SLOT 21 /* Create PLT entry */ +#define R_68K_RELATIVE 22 /* Adjust by program base */ /* Alpha Relocation Types */ #define R_ALPHA_NONE 0 /* No reloc */ @@ -495,79 +494,79 @@ extern Elf32_Dyn _DYNAMIC []; #define R_ARM_RBASE 255 typedef struct elf32_rel { - Elf32_Addr r_offset; - Elf32_Word r_info; + Elf32_Addr r_offset; + Elf32_Word r_info; } Elf32_Rel; typedef struct elf64_rel { - Elf64_Addr r_offset; - Elf64_Xword r_info; + Elf64_Addr r_offset; + Elf64_Xword r_info; } Elf64_Rel; -typedef struct elf32_rela{ - Elf32_Addr r_offset; - Elf32_Word r_info; - Elf32_Sword r_addend; +typedef struct elf32_rela { + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; } Elf32_Rela; -typedef struct elf64_rela{ - Elf64_Addr r_offset; - Elf64_Xword r_info; - Elf64_Sxword r_addend; +typedef struct elf64_rela { + Elf64_Addr r_offset; + Elf64_Xword r_info; + Elf64_Sxword r_addend; } Elf64_Rela; -typedef struct elf32_sym{ - Elf32_Word st_name; - Elf32_Addr st_value; - Elf32_Word st_size; - unsigned char st_info; - unsigned char st_other; - Elf32_Half st_shndx; +typedef struct elf32_sym { + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Half st_shndx; } Elf32_Sym; -typedef struct elf64_sym{ - Elf64_Word st_name; - unsigned char st_info; - unsigned char st_other; - Elf64_Half st_shndx; - Elf64_Addr st_value; - Elf64_Xword st_size; +typedef struct elf64_sym { + Elf64_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf64_Half st_shndx; + Elf64_Addr st_value; + Elf64_Xword st_size; } Elf64_Sym; #define EI_NIDENT 16 -typedef struct elf32hdr{ - unsigned char e_ident[EI_NIDENT]; - Elf32_Half e_type; - Elf32_Half e_machine; - Elf32_Word e_version; - Elf32_Addr e_entry; /* Entry point */ - Elf32_Off e_phoff; - Elf32_Off e_shoff; - Elf32_Word e_flags; - Elf32_Half e_ehsize; - Elf32_Half e_phentsize; - Elf32_Half e_phnum; - Elf32_Half e_shentsize; - Elf32_Half e_shnum; - Elf32_Half e_shstrndx; +typedef struct elf32hdr { + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; /* Entry point */ + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; } Elf32_Ehdr; typedef struct elf64hdr { - unsigned char e_ident[EI_NIDENT]; - Elf64_Half e_type; - Elf64_Half e_machine; - Elf64_Word e_version; - Elf64_Addr e_entry; - Elf64_Off e_phoff; - Elf64_Off e_shoff; - Elf64_Word e_flags; - Elf64_Half e_ehsize; - Elf64_Half e_phentsize; - Elf64_Half e_phnum; - Elf64_Half e_shentsize; - Elf64_Half e_shnum; - Elf64_Half e_shstrndx; + unsigned char e_ident[EI_NIDENT]; + Elf64_Half e_type; + Elf64_Half e_machine; + Elf64_Word e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Word e_flags; + Elf64_Half e_ehsize; + Elf64_Half e_phentsize; + Elf64_Half e_phnum; + Elf64_Half e_shentsize; + Elf64_Half e_shnum; + Elf64_Half e_shstrndx; } Elf64_Ehdr; /* These constants define the permissions on sections in the program @@ -576,27 +575,26 @@ typedef struct elf64hdr { #define PF_W 0x2 #define PF_X 0x1 -typedef struct elf_phdr{ - Elf32_Word p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - Elf32_Word p_filesz; - Elf32_Word p_memsz; - Elf32_Word p_flags; - Elf32_Word p_align; +typedef struct elf_phdr { + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; } Elf32_Phdr; -typedef struct -{ - Elf64_Word p_type; - Elf64_Word p_flags; - Elf64_Off p_offset; - Elf64_Addr p_vaddr; - Elf64_Addr p_paddr; - Elf64_Xword p_filesz; - Elf64_Xword p_memsz; - Elf64_Xword p_align; +typedef struct { + Elf64_Word p_type; + Elf64_Word p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Xword p_filesz; + Elf64_Xword p_memsz; + Elf64_Xword p_align; } Elf64_Phdr; /* sh_type */ @@ -618,7 +616,7 @@ typedef struct #define SHT_LOUSER 0x80000000 #define SHT_HIUSER 0xffffffff -#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ +#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ /* sh_flags */ #define SHF_WRITE 0x1 @@ -634,35 +632,34 @@ typedef struct #define SHN_ABS 0xfff1 #define SHN_COMMON 0xfff2 #define SHN_HIRESERVE 0xffff - + typedef struct { - Elf32_Word sh_name; - Elf32_Word sh_type; - Elf32_Word sh_flags; - Elf32_Addr sh_addr; - Elf32_Off sh_offset; - Elf32_Word sh_size; - Elf32_Word sh_link; - Elf32_Word sh_info; - Elf32_Word sh_addralign; - Elf32_Word sh_entsize; + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; } Elf32_Shdr; -typedef struct -{ - Elf64_Word sh_name; - Elf64_Word sh_type; - Elf64_Xword sh_flags; - Elf64_Addr sh_addr; - Elf64_Off sh_offset; - Elf64_Xword sh_size; - Elf64_Word sh_link; - Elf64_Word sh_info; - Elf64_Xword sh_addralign; - Elf64_Xword sh_entsize; +typedef struct { + Elf64_Word sh_name; + Elf64_Word sh_type; + Elf64_Xword sh_flags; + Elf64_Addr sh_addr; + Elf64_Off sh_offset; + Elf64_Xword sh_size; + Elf64_Word sh_link; + Elf64_Word sh_info; + Elf64_Xword sh_addralign; + Elf64_Xword sh_entsize; } Elf64_Shdr; -#define EI_MAG0 0 /* e_ident[] indexes */ +#define EI_MAG0 0 /* e_ident[] indexes */ #define EI_MAG1 1 #define EI_MAG2 2 #define EI_MAG3 3 @@ -671,7 +668,7 @@ typedef struct #define EI_VERSION 6 #define EI_PAD 7 -#define ELFMAG0 0x7f /* EI_MAG */ +#define ELFMAG0 0x7f /* EI_MAG */ #define ELFMAG1 'E' #define ELFMAG2 'L' #define ELFMAG3 'F' @@ -681,16 +678,16 @@ typedef struct #define ELFDLMAG 3 #define ELFDLOFF 16 -#define ELFCLASSNONE 0 /* EI_CLASS */ +#define ELFCLASSNONE 0 /* EI_CLASS */ #define ELFCLASS32 1 #define ELFCLASS64 2 #define ELFCLASSNUM 3 -#define ELFDATANONE 0 /* e_ident[EI_DATA] */ +#define ELFDATANONE 0 /* e_ident[EI_DATA] */ #define ELFDATA2LSB 1 #define ELFDATA2MSB 2 -#define EV_NONE 0 /* e_version, EI_VERSION */ +#define EV_NONE 0 /* e_version, EI_VERSION */ #define EV_CURRENT 1 #define EV_NUM 2 @@ -702,9 +699,9 @@ typedef struct /* Note header in a PT_NOTE section */ typedef struct elf_note { - Elf32_Word n_namesz; /* Name size */ - Elf32_Word n_descsz; /* Content size */ - Elf32_Word n_type; /* Content type */ + Elf32_Word n_namesz; /* Name size */ + Elf32_Word n_descsz; /* Content size */ + Elf32_Word n_type; /* Content type */ } Elf32_Nhdr; #define ELF_START_MMAP 0x80000000 diff --git a/hw/xfree86/loader/elfloader.c b/hw/xfree86/loader/elfloader.c index 822a50efa..5ab8af62d 100644 --- a/hw/xfree86/loader/elfloader.c +++ b/hw/xfree86/loader/elfloader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.49 2003/01/24 17:26:35 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.62 2003/11/06 18:38:13 tsi Exp $ */ /* * @@ -23,7 +23,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ #include <sys/types.h> +#ifndef __UNIXOS2__ #include <sys/mman.h> +#endif #include <unistd.h> #include <stdlib.h> #ifdef __QNX__ @@ -52,13 +54,75 @@ #include "compiler.h" -#undef LDTEST +#ifndef LOADERDEBUG +#define LOADERDEBUG 0 +#endif -/* -#ifndef LDTEST +#if LOADERDEBUG # define ELFDEBUG ErrorF #endif -*/ + +#if defined(__ia64__) + +/* + * R_IA64_LTOFF22X and R_IA64_LDXMOV are relocation optimizations for + * IA64. Conforming implementations must recognize them and may either + * implement the optimization or may fallback to previous + * non-optimized behavior by treating R_IA64_LTOFF22X as a + * R_IA64_LTOFF22 and ignoring R_IA64_LDXMOV. The + * IA64_LDX_OPTIMIZATION conditional controls the fallback behavior, + * if defined the optimizations are performed. + * + * To implement the optimization we want to change is the sequence on + * the left to that on the right, without regard to any intervening + * instructions: + * + * 1) addl t1=@ltoff(var),gp ==> addl t1=@gprel(var),gp + * 2) ld8 t2=[t1] ==> mov t2=t1 + * 3) ld8 loc0=[t2] ==> ld8 loc0=[t2] + * + * The relocations that match the above instructions are: + * + * 1) R_IA64_LTOFF22 ==> R_IA64_LTOFF22X + * 2) -- ==> R_IA64_LDXMOV + * 3) -- ==> -- + * + * First lets look at left hand column to understand the original + * mechanism. The virtual address of a symbol is stored in the GOT, + * when that symbol is referenced the following sequence occurs, + * instruction 1 loads the address of the GOT entry containing the + * virtural address of the symbol into t1. Instruction 2 loads the + * virtual address of the symbol into t2 by dereferencing t1. Finally + * the symbol is loaded in instruction 3 by dereferencing its virtual + * address in t2. + * + * The optimization that LTOFF22X/LDXMOV introduces is based on the + * observation we are doing an extra load (instruction 2) if we can + * generate the virtual address for the symbol without doing a lookup in + * the GOT. This is possible if the virtual address of the symbol can be + * computed via GP relative addressing. In other words the virtual + * address of the symbol is a fixed offset from the GP. This fixed offset + * must be within the limits of the signed 22 bit immediate offset in the + * ld8 instruction, otherwise the original indirect GOT lookup must be + * performed (LTOFF22). + * + * If we can use GP relative addressing for the symbol then the + * instruction that loaded the virtual address of the symbol into t2 must + * also be patched, hence the introduction of the LDXMOV relocation. The + * LDXMOV essentially turns the GOT lookup into a no-op by changing the + * ld8 into a register move that preserves the register location of the + * symbol's virtual address (e.g. t2). + * + * The important point to recognize when implementing the LTOFF22X/LDXMOV + * optimization is that relocations are interdependent, the LDXMOV is + * only applied if the LTOFF22X is applied. It is also worth noting that + * there is no relationship between LDXMOV relocations and LTOFF22X in + * the ELF relocation section other than they share the same + * symbol+addend value. + */ + +#define IA64_LDX_OPTIMIZATION 1 +#endif #ifndef UseMMAP # if defined (__ia64__) || defined (__sparc__) @@ -73,7 +137,7 @@ # if !defined(linux) # error No MAP_ANON? # endif -# if !defined (__x86_64__) +# if !defined (__AMD64__) || !defined(__linux__) # define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON) # else # define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_32BIT) @@ -91,7 +155,7 @@ #if defined (__alpha__) || \ defined (__ia64__) || \ - defined (__x86_64__) || \ + defined (__AMD64__) || \ (defined (__sparc__) && \ (defined (__arch64__) || \ defined (__sparcv9))) @@ -105,6 +169,7 @@ typedef Elf64_Half Elf_Half; typedef Elf64_Off Elf_Off; typedef Elf64_Sword Elf_Sword; typedef Elf64_Word Elf_Word; + #define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_TYPE ELF64_ST_TYPE #define ELF_R_SYM ELF64_R_SYM @@ -117,17 +182,17 @@ typedef Elf64_Word Elf_Word; * */ typedef struct _elf_GOT_Entry { - Elf_Rela *rel; - int offset; - struct _elf_GOT_Entry *next; + Elf_Rela *rel; + int offset; + struct _elf_GOT_Entry *next; } ELFGotEntryRec, *ELFGotEntryPtr; typedef struct _elf_GOT { - unsigned int size; - unsigned int nuses; - unsigned char *freeptr; - struct _elf_GOT *next; - unsigned char section[1]; + unsigned int size; + unsigned int nuses; + unsigned char *freeptr; + struct _elf_GOT *next; + unsigned char section[1]; } ELFGotRec, *ELFGotPtr; # ifdef MergeSectionAlloc @@ -141,10 +206,10 @@ static ELFGotPtr ELFSharedGOTs; * have already been added to the PLT. */ typedef struct _elf_PLT_Entry { - Elf_Rela *rel; - int offset; - int gotoffset; - struct _elf_PLT_Entry *next; + Elf_Rela *rel; + int offset; + int gotoffset; + struct _elf_PLT_Entry *next; } ELFPltEntryRec, *ELFPltEntryPtr; /* @@ -152,10 +217,10 @@ typedef struct _elf_PLT_Entry { * of entries that have already been added to the OPD. */ typedef struct _elf_OPD { - LOOKUP *l; - int index; - int offset; - struct _elf_OPD *next; + LOOKUP *l; + int index; + int offset; + struct _elf_OPD *next; } ELFOpdRec, *ELFOpdPtr; # endif @@ -170,6 +235,7 @@ typedef Elf32_Half Elf_Half; typedef Elf32_Off Elf_Off; typedef Elf32_Sword Elf_Sword; typedef Elf32_Word Elf_Word; + #define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_TYPE ELF32_ST_TYPE #define ELF_R_SYM ELF32_R_SYM @@ -181,10 +247,10 @@ typedef Elf32_Word Elf_Word; defined(__alpha__) || \ defined(__sparc__) || \ defined(__ia64__) || \ - defined(__x86_64__) + defined(__AMD64__) typedef Elf_Rela Elf_Rel_t; #else -typedef Elf_Rel Elf_Rel_t; +typedef Elf_Rel Elf_Rel_t; #endif typedef struct { @@ -203,57 +269,57 @@ typedef struct { * that has been loaded. */ -typedef struct { - int handle; - int module; - int fd; - loader_funcs *funcs; - Elf_Ehdr *header;/* file header */ - int numsh; - Elf_Shdr *sections;/* Address of the section header table */ - int secsize; /* size of the section table */ - unsigned char **saddr;/* Start addresss of the section pointer table */ - unsigned char *shstraddr; /* Start address of the section header string table */ - int shstrndx; /* index of the section header string table */ - int shstrsize; /* size of the section header string table */ +typedef struct { + int handle; + int module; + int fd; + loader_funcs *funcs; + Elf_Ehdr *header; /* file header */ + int numsh; + Elf_Shdr *sections; /* Address of the section header table */ + int secsize; /* size of the section table */ + unsigned char **saddr; /* Start addresss of the section pointer table */ + unsigned char *shstraddr; /* Start address of the section header string table */ + int shstrndx; /* index of the section header string table */ + int shstrsize; /* size of the section header string table */ #if defined(__alpha__) || defined(__ia64__) - unsigned char *got; /* Start address of the .got section */ - ELFGotEntryPtr got_entries; /* List of entries in the .got section */ - int gotndx; /* index of the .got section */ - int gotsize; /* actual size of the .got section */ - ELFGotPtr shared_got; /* Pointer to ELFGotRec if shared */ -#endif /*(__alpha__) || (__ia64__)*/ + unsigned char *got; /* Start address of the .got section */ + ELFGotEntryPtr got_entries; /* List of entries in the .got section */ + int gotndx; /* index of the .got section */ + int gotsize; /* actual size of the .got section */ + ELFGotPtr shared_got; /* Pointer to ELFGotRec if shared */ +#endif /*(__alpha__) || (__ia64__) */ #if defined(__ia64__) - ELFOpdPtr opd_entries; /* List of entries in the .opd section */ - unsigned char *plt; /* Start address of the .plt section */ - ELFPltEntryPtr plt_entries; /* List of entries in the .plt section */ - int pltndx; /* index of the .plt section */ - int pltsize; /* size of the .plt section */ + ELFOpdPtr opd_entries; /* List of entries in the .opd section */ + unsigned char *plt; /* Start address of the .plt section */ + ELFPltEntryPtr plt_entries; /* List of entries in the .plt section */ + int pltndx; /* index of the .plt section */ + int pltsize; /* size of the .plt section */ #endif /*__ia64__*/ - Elf_Sym *symtab; /* Start address of the .symtab section */ - int symndx; /* index of the .symtab section */ - unsigned char *common; /* Start address of the SHN_COMMON space */ - int comsize; /* size of the SHN_COMMON space */ - - unsigned char *base; /* Alloced address of section block */ - unsigned long baseptr; /* Pointer to next free space in base */ - int basesize; /* Size of that allocation */ - unsigned char *straddr; /* Start address of the string table */ - int strndx; /* index of the string table */ - int strsize; /* size of the string table */ - LoadSection *lsection; - int lsectidx; -} ELFModuleRec, *ELFModulePtr; + Elf_Sym *symtab; /* Start address of the .symtab section */ + int symndx; /* index of the .symtab section */ + unsigned char *common; /* Start address of the SHN_COMMON space */ + int comsize; /* size of the SHN_COMMON space */ + + unsigned char *base; /* Alloced address of section block */ + unsigned long baseptr; /* Pointer to next free space in base */ + int basesize; /* Size of that allocation */ + unsigned char *straddr; /* Start address of the string table */ + int strndx; /* index of the string table */ + int strsize; /* size of the string table */ + LoadSection *lsection; + int lsectidx; +} ELFModuleRec, *ELFModulePtr; /* * If a relocation is unable to be satisfied, then put it on a list * to try later after more modules have been loaded. */ typedef struct _elf_reloc { - Elf_Rel_t *rel; - ELFModulePtr file; - Elf_Word secn; - struct _elf_reloc *next; + Elf_Rel_t *rel; + ELFModulePtr file; + Elf_Word secn; + struct _elf_reloc *next; } ELFRelocRec; /* @@ -263,11 +329,11 @@ typedef struct _elf_reloc { * are done. */ typedef struct _elf_COMMON { - Elf_Sym *sym; - struct _elf_COMMON *next; + Elf_Sym *sym; + struct _elf_COMMON *next; } ELFCommonRec; -static ELFCommonPtr listCOMMON=NULL; +static ELFCommonPtr listCOMMON = NULL; /* Prototypes for static functions */ static int ELFhashCleanOut(void *, itemPtr); @@ -277,14 +343,16 @@ static char *ElfGetSectionName(ELFModulePtr, int); static ELFRelocPtr ElfDelayRelocation(ELFModulePtr, Elf_Word, Elf_Rel_t *); static ELFCommonPtr ElfAddCOMMON(Elf_Sym *); static int ElfCOMMONSize(void); -static int ElfCreateCOMMON(ELFModulePtr,LOOKUP *); +static int ElfCreateCOMMON(ELFModulePtr, LOOKUP *); static char *ElfGetSymbolNameIndex(ELFModulePtr, int, int); static char *ElfGetSymbolName(ELFModulePtr, int); static Elf_Addr ElfGetSymbolValue(ELFModulePtr, int); -static ELFRelocPtr Elf_RelocateEntry(ELFModulePtr, Elf_Word, Elf_Rel_t *, int); +static ELFRelocPtr Elf_RelocateEntry(ELFModulePtr, Elf_Word, Elf_Rel_t *, + int); static ELFRelocPtr ELFCollectRelocations(ELFModulePtr, int); static LOOKUP *ELF_GetSymbols(ELFModulePtr, unsigned short **); static void ELFCollectSections(ELFModulePtr, int, int *, int *); + #if defined(__alpha__) || defined(__ia64__) static void ElfAddGOT(ELFModulePtr, Elf_Rel_t *); static int ELFCreateGOT(ELFModulePtr, int); @@ -296,21 +364,19 @@ static void ElfAddPLT(ELFModulePtr, Elf_Rel_t *); static void ELFCreatePLT(ELFModulePtr); enum ia64_operand { IA64_OPND_IMM22, - IA64_OPND_TGT25C + IA64_OPND_TGT25C, + IA64_OPND_LDXMOV }; static void IA64InstallReloc(unsigned long *, int, enum ia64_operand, long); #endif /*__ia64__*/ #ifdef MergeSectionAlloc static void * -ELFLoaderSectToMem(elffile, align, offset, size, label) -ELFModulePtr elffile; -int align; -unsigned long offset; -int size; -char *label; +ELFLoaderSectToMem(ELFModulePtr elffile, int align, unsigned long offset, + int size, char *label) { void *ret; + elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1); ret = (void *)elffile->baseptr; _LoaderFileRead(elffile->fd, offset, ret, size); @@ -319,17 +385,15 @@ char *label; } static void * -ELFLoaderSectCalloc(elffile, align, size) -ELFModulePtr elffile; -int align; -int size; +ELFLoaderSectCalloc(ELFModulePtr elffile, int align, int size) { void *ret; + elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1); ret = (void *)elffile->baseptr; elffile->baseptr += size; #ifndef DoMMAPedMerge - memset(ret, 0, size); /* mmap() does this for us */ + memset(ret, 0, size); /* mmap() does this for us */ #endif return ret; } @@ -343,13 +407,11 @@ _LoaderFileToMem((elffile)->fd,offset,size,label) * Utility Functions */ - static int -ELFhashCleanOut(voidptr, item) -void *voidptr; -itemPtr item ; +ELFhashCleanOut(void *voidptr, itemPtr item) { ELFModulePtr module = (ELFModulePtr) voidptr; + return (module->handle == item->handle); } @@ -357,31 +419,29 @@ itemPtr item ; * Manage listResolv */ static ELFRelocPtr -ElfDelayRelocation(elffile, secn, rel) -ELFModulePtr elffile; -Elf_Word secn; -Elf_Rel_t *rel; +ElfDelayRelocation(ELFModulePtr elffile, Elf_Word secn, Elf_Rel_t *rel) { - ELFRelocPtr reloc; + ELFRelocPtr reloc; if ((reloc = xf86loadermalloc(sizeof(ELFRelocRec))) == NULL) { - ErrorF( "ElfDelayRelocation() Unable to allocate memory!!!!\n" ); + ErrorF("ElfDelayRelocation() Unable to allocate memory!!!!\n"); return 0; } - reloc->file=elffile; - reloc->secn=secn; - reloc->rel=rel; - reloc->next=0; + reloc->file = elffile; + reloc->secn = secn; + reloc->rel = rel; + reloc->next = 0; #ifdef ELFDEBUG - ELFDEBUG("ElfDelayRelocation %lx: file %lx, sec %d," + ELFDEBUG("ElfDelayRelocation %p: file %p, sec %d," " r_offset 0x%lx, r_info 0x%x", - reloc, elffile, secn, rel->r_offset, rel->r_info); + (void *)reloc, (void *)elffile, secn, + (unsigned long)rel->r_offset, rel->r_info); # if defined(__powerpc__) || \ defined(__mc68000__) || \ defined(__alpha__) || \ defined(__sparc__) || \ defined(__ia64__) || \ - defined(__x86_64__) + defined(__AMD64__) ELFDEBUG(", r_addend 0x%lx", rel->r_addend); # endif ELFDEBUG("\n"); @@ -393,162 +453,146 @@ Elf_Rel_t *rel; * Manage listCOMMON */ static ELFCommonPtr -ElfAddCOMMON(sym) -Elf_Sym *sym; +ElfAddCOMMON(Elf_Sym *sym) { ELFCommonPtr common; if ((common = xf86loadermalloc(sizeof(ELFCommonRec))) == NULL) { - ErrorF( "ElfAddCOMMON() Unable to allocate memory!!!!\n" ); + ErrorF("ElfAddCOMMON() Unable to allocate memory!!!!\n"); return 0; } - common->sym=sym; - common->next=0; + common->sym = sym; + common->next = 0; return common; } static int ElfCOMMONSize(void) { - int size=0; + int size = 0; ELFCommonPtr common; for (common = listCOMMON; common; common = common->next) { - size+=common->sym->st_size; + size += common->sym->st_size; #if defined(__alpha__) || \ defined(__ia64__) || \ - defined(__x86_64__) || \ + defined(__AMD64__) || \ (defined(__sparc__) && \ (defined(__arch64__) || \ defined(__sparcv9))) - size = (size+7)&~0x7; + size = (size + 7) & ~0x7; #endif } return size; } static int -ElfCreateCOMMON(elffile,pLookup) -ELFModulePtr elffile; -LOOKUP *pLookup; +ElfCreateCOMMON(ELFModulePtr elffile, LOOKUP *pLookup) { - int numsyms=0,size=0,l=0; - int offset=0,firstcommon=0; + int numsyms = 0, size = 0, l = 0; + int offset = 0, firstcommon = 0; ELFCommonPtr common; if (listCOMMON == NULL) return TRUE; for (common = listCOMMON; common; common = common->next) { - size+=common->sym->st_size; + size += common->sym->st_size; #if defined(__alpha__) || \ defined(__ia64__) || \ - defined(__x86_64__) || \ + defined(__AMD64__) || \ (defined(__sparc__) && \ (defined(__arch64__) || \ defined(__sparcv9))) - size = (size+7)&~0x7; + size = (size + 7) & ~0x7; #endif numsyms++; } #ifdef ELFDEBUG ELFDEBUG("ElfCreateCOMMON() %d entries (%d bytes) of COMMON data\n", - numsyms, size ); + numsyms, size); #endif - elffile->comsize=size; - if((elffile->common = ELFLoaderSectCalloc(elffile,8,size)) == NULL) { - ErrorF( "ElfCreateCOMMON() Unable to allocate memory!!!!\n" ); + elffile->comsize = size; + if ((elffile->common = ELFLoaderSectCalloc(elffile, 8, size)) == NULL) { + ErrorF("ElfCreateCOMMON() Unable to allocate memory!!!!\n"); return FALSE; } - if (DebuggerPresent) - { - ldrCommons = xf86loadermalloc(numsyms*sizeof(LDRCommon)); + if (DebuggerPresent) { + ldrCommons = xf86loadermalloc(numsyms * sizeof(LDRCommon)); nCommons = numsyms; } - for (l = 0; pLookup[l].symName; l++) - ; - firstcommon=l; - + for (l = 0; pLookup[l].symName; l++) ; + firstcommon = l; + /* Traverse the common list and create a lookup table with all the * common symbols. Destroy the common list in the process. * See also ResolveSymbols. */ - while(listCOMMON) { - common=listCOMMON; + while (listCOMMON) { + common = listCOMMON; /* this is xstrdup because is should be more efficient. it is freed * with xf86loaderfree */ pLookup[l].symName = - xf86loaderstrdup(ElfGetString(elffile,common->sym->st_name)); - pLookup[l].offset = (funcptr)(elffile->common + offset); + xf86loaderstrdup(ElfGetString(elffile, common->sym->st_name)); + pLookup[l].offset = (funcptr) (elffile->common + offset); #ifdef ELFDEBUG - ELFDEBUG("Adding common %lx %s\n", - pLookup[l].offset, pLookup[l].symName); + ELFDEBUG("Adding common %p %s\n", + (void *)pLookup[l].offset, pLookup[l].symName); #endif - + /* Record the symbol address for gdb */ - if (DebuggerPresent && ldrCommons) - { - ldrCommons[l-firstcommon].addr = (void *)pLookup[l].offset; - ldrCommons[l-firstcommon].name = pLookup[l].symName; - ldrCommons[l-firstcommon].namelen = strlen(pLookup[l].symName); + if (DebuggerPresent && ldrCommons) { + ldrCommons[l - firstcommon].addr = (void *)pLookup[l].offset; + ldrCommons[l - firstcommon].name = pLookup[l].symName; + ldrCommons[l - firstcommon].namelen = strlen(pLookup[l].symName); } - listCOMMON=common->next; - offset+=common->sym->st_size; + listCOMMON = common->next; + offset += common->sym->st_size; #if defined(__alpha__) || \ defined(__ia64__) || \ - defined(__x86_64__) || \ + defined(__AMD64__) || \ (defined(__sparc__) && \ (defined(__arch64__) || \ defined(__sparcv9))) - offset = (offset+7)&~0x7; + offset = (offset + 7) & ~0x7; #endif xf86loaderfree(common); l++; } /* listCOMMON == 0 */ - pLookup[l].symName=NULL; /* Terminate the list. */ + pLookup[l].symName = NULL; /* Terminate the list. */ return TRUE; } - /* * String Table */ static char * -ElfGetStringIndex(file, offset, index) -ELFModulePtr file; -int offset; -int index; +ElfGetStringIndex(ELFModulePtr file, int offset, int index) { - if( !offset || !index ) - return ""; + if (!offset || !index) + return ""; - return (char *)(file->saddr[index]+offset); + return (char *)(file->saddr[index] + offset); } static char * -ElfGetString(file, offset) -ELFModulePtr file; -int offset; +ElfGetString(ELFModulePtr file, int offset) { - return ElfGetStringIndex( file, offset, file->strndx ); + return ElfGetStringIndex(file, offset, file->strndx); } static char * -ElfGetSectionName(file, offset) -ELFModulePtr file; -int offset; +ElfGetSectionName(ELFModulePtr file, int offset) { - return (char *)(file->shstraddr+offset); + return (char *)(file->shstraddr + offset); } - - /* * Symbol Table */ @@ -557,113 +601,105 @@ int offset; * Get symbol name */ static char * -ElfGetSymbolNameIndex(elffile, index, secndx) -ELFModulePtr elffile; -int index; -int secndx; +ElfGetSymbolNameIndex(ELFModulePtr elffile, int index, int secndx) { - Elf_Sym *syms; + Elf_Sym *syms; #ifdef ELFDEBUG - ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ",index, secndx ); + ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ", index, secndx); #endif - syms=(Elf_Sym *)elffile->saddr[secndx]; + syms = (Elf_Sym *) elffile->saddr[secndx]; #ifdef ELFDEBUG - ELFDEBUG("%s ",ElfGetString(elffile, syms[index].st_name)); - ELFDEBUG("%x %x ",ELF_ST_BIND(syms[index].st_info), + ELFDEBUG("%s ", ElfGetString(elffile, syms[index].st_name)); + ELFDEBUG("%x %x ", ELF_ST_BIND(syms[index].st_info), ELF_ST_TYPE(syms[index].st_info)); - ELFDEBUG("%lx\n",syms[index].st_value); + ELFDEBUG("%lx\n", (unsigned long)syms[index].st_value); #endif - return ElfGetString(elffile,syms[index].st_name ); + return ElfGetString(elffile, syms[index].st_name); } static char * -ElfGetSymbolName(elffile, index) -ELFModulePtr elffile; -int index; +ElfGetSymbolName(ELFModulePtr elffile, int index) { return ElfGetSymbolNameIndex(elffile, index, elffile->symndx); } static Elf_Addr -ElfGetSymbolValue(elffile, index) -ELFModulePtr elffile; -int index; +ElfGetSymbolValue(ELFModulePtr elffile, int index) { - Elf_Sym *syms; - Elf_Addr symval=0; /* value of the indicated symbol */ - char *symname = NULL; /* name of symbol in relocation */ - itemPtr symbol = NULL; /* name/value of symbol */ + Elf_Sym *syms; + Elf_Addr symval = 0; /* value of the indicated symbol */ + char *symname = NULL; /* name of symbol in relocation */ + itemPtr symbol = NULL; /* name/value of symbol */ - syms=(Elf_Sym *)elffile->saddr[elffile->symndx]; + syms = (Elf_Sym *) elffile->saddr[elffile->symndx]; - switch( ELF_ST_TYPE(syms[index].st_info) ) - { - case STT_NOTYPE: - case STT_OBJECT: - case STT_FUNC: - switch( ELF_ST_BIND(syms[index].st_info) ) - { - case STB_LOCAL: - symval=(Elf_Addr)( - elffile->saddr[syms[index].st_shndx]+ - syms[index].st_value); + switch (ELF_ST_TYPE(syms[index].st_info)) { + case STT_NOTYPE: + case STT_OBJECT: + case STT_FUNC: + switch (ELF_ST_BIND(syms[index].st_info)) { + case STB_LOCAL: + symval = (Elf_Addr) (elffile->saddr[syms[index].st_shndx] + + syms[index].st_value); #ifdef __ia64__ - if( ELF_ST_TYPE(syms[index].st_info) == STT_FUNC ) { - ELFOpdPtr opdent; - for (opdent = elffile->opd_entries; opdent; opdent = opdent->next) - if (opdent->index == index) - break; - if(opdent) { - ((unsigned long *)(elffile->got+opdent->offset))[0] = symval; - ((unsigned long *)(elffile->got+opdent->offset))[1] = (long)elffile->got; - symval = (Elf_Addr)(elffile->got+opdent->offset); - } - } -#endif - break; - case STB_GLOBAL: - case STB_WEAK: /* STB_WEAK seems like a hack to cover for - some other problem */ - symname= - ElfGetString(elffile,syms[index].st_name); - symbol = LoaderHashFind(symname); - if( symbol == 0 ) { - return 0; - } - symval=(Elf_Addr)symbol->address; - break; - default: - symval=0; - ErrorF( - "ElfGetSymbolValue(), unhandled symbol scope %x\n", - ELF_ST_BIND(syms[index].st_info) ); - break; + if (ELF_ST_TYPE(syms[index].st_info) == STT_FUNC) { + ELFOpdPtr opdent; + + for (opdent = elffile->opd_entries; opdent; + opdent = opdent->next) + if (opdent->index == index) + break; + if (opdent) { + ((unsigned long *)(elffile->got + opdent->offset))[0] = + symval; + ((unsigned long *)(elffile->got + opdent->offset))[1] = + (long)elffile->got; + symval = (Elf_Addr) (elffile->got + opdent->offset); } -#ifdef ELFDEBUG - ELFDEBUG( "%lx\t", symbol ); - ELFDEBUG( "%lx\t", symval ); - ELFDEBUG( "%s\n", symname ? symname : "NULL"); + } #endif break; - case STT_SECTION: - symval=(Elf_Addr)elffile->saddr[syms[index].st_shndx]; -#ifdef ELFDEBUG - ELFDEBUG( "ST_SECTION %lx\n", symval ); -#endif + case STB_GLOBAL: + case STB_WEAK: /* STB_WEAK seems like a hack to cover for + * some other problem */ + symname = ElfGetString(elffile, syms[index].st_name); + symbol = LoaderHashFind(symname); + if (symbol == 0) { + return 0; + } + symval = (Elf_Addr) symbol->address; break; - case STT_FILE: - case STT_LOPROC: - case STT_HIPROC: default: - symval=0; - ErrorF( "ElfGetSymbolValue(), unhandled symbol type %x\n", - ELF_ST_TYPE(syms[index].st_info) ); + symval = 0; + ErrorF("ElfGetSymbolValue(), unhandled symbol scope %x\n", + ELF_ST_BIND(syms[index].st_info)); break; } +#ifdef ELFDEBUG + ELFDEBUG("%p\t", (void *)symbol); + ELFDEBUG("%lx\t", (unsigned long)symval); + ELFDEBUG("%s\n", symname ? symname : "NULL"); +#endif + break; + case STT_SECTION: + symval = (Elf_Addr) elffile->saddr[syms[index].st_shndx]; +#ifdef ELFDEBUG + ELFDEBUG("ST_SECTION %lx\n", (unsigned long)symval); +#endif + break; + case STT_FILE: + case STT_LOPROC: + case STT_HIPROC: + default: + symval = 0; + ErrorF("ElfGetSymbolValue(), unhandled symbol type %x\n", + ELF_ST_TYPE(syms[index].st_info)); + break; + } return symval; } @@ -676,30 +712,25 @@ int index; * will be within a 24 bit offset (non-PIC code). */ static Elf_Addr -ElfGetPltAddr(elffile, index) -ELFModulePtr elffile; -int index; +ElfGetPltAddr(ELFModulePtr elffile, int index) { - Elf_Sym *syms; - Elf_Addr symval=0; /* value of the indicated symbol */ + Elf_Sym *syms; + Elf_Addr symval = 0; /* value of the indicated symbol */ char *symname = NULL; /* name of symbol in relocation */ itemPtr symbol; /* name/value of symbol */ - syms=(Elf_Sym *)elffile->saddr[elffile->symndx]; + syms = (Elf_Sym *) elffile->saddr[elffile->symndx]; - switch( ELF_ST_TYPE(syms[index].st_info) ) - { - case STT_NOTYPE: - case STT_OBJECT: - case STT_FUNC: - switch( ELF_ST_BIND(syms[index].st_info) ) - { - case STB_GLOBAL: - symname= - ElfGetString(elffile,syms[index].st_name); - symbol=LoaderHashFind(symname); - if( symbol == 0 ) - return 0; + switch (ELF_ST_TYPE(syms[index].st_info)) { + case STT_NOTYPE: + case STT_OBJECT: + case STT_FUNC: + switch (ELF_ST_BIND(syms[index].st_info)) { + case STB_GLOBAL: + symname = ElfGetString(elffile, syms[index].st_name); + symbol = LoaderHashFind(symname); + if (symbol == 0) + return 0; /* * Here we are building up a pseudo Plt function that can make a call to * a function that has an offset greater than 24 bits. The following code @@ -715,43 +746,43 @@ int index; */ - symbol->code.plt[0]=0x3d80; /* lis r12 */ - symbol->code.plt[1]=(((Elf_Addr)symbol->address)&0xffff0000)>>16; - symbol->code.plt[2]=0x618c; /* ori r12,r12 */ - symbol->code.plt[3]=(((Elf_Addr)symbol->address)&0xffff); - symbol->code.plt[4]=0x7d89; /* mtcr r12 */ - symbol->code.plt[5]=0x03a6; - symbol->code.plt[6]=0x4e80; /* bctr */ - symbol->code.plt[7]=0x0420; - symbol->address=(char *)&symbol->code.plt[0]; - symval=(Elf_Addr)symbol->address; - ppc_flush_icache(&symbol->code.plt[0]); - ppc_flush_icache(&symbol->code.plt[6]); - break; - default: - symval=0; - ErrorF( - "ElfGetPltAddr(), unhandled symbol scope %x\n", - ELF_ST_BIND(syms[index].st_info) ); - break; - } -# ifdef ELFDEBUG - ELFDEBUG( "ElfGetPlt: symbol=%lx\t", symbol ); - ELFDEBUG( "newval=%lx\t", symval ); - ELFDEBUG( "name=\"%s\"\n", symname ? symname : "NULL"); -# endif + symbol->code.plt[0] = 0x3d80; /* lis r12 */ + symbol->code.plt[1] = + (((Elf_Addr) symbol->address) & 0xffff0000) >> 16; + symbol->code.plt[2] = 0x618c; /* ori r12,r12 */ + symbol->code.plt[3] = (((Elf_Addr) symbol->address) & 0xffff); + symbol->code.plt[4] = 0x7d89; /* mtcr r12 */ + symbol->code.plt[5] = 0x03a6; + symbol->code.plt[6] = 0x4e80; /* bctr */ + symbol->code.plt[7] = 0x0420; + symbol->address = (char *)&symbol->code.plt[0]; + symval = (Elf_Addr) symbol->address; + ppc_flush_icache(&symbol->code.plt[0]); + ppc_flush_icache(&symbol->code.plt[6]); break; - case STT_SECTION: - case STT_FILE: - case STT_LOPROC: - case STT_HIPROC: default: - symval=0; - ErrorF( "ElfGetPltAddr(), Unexpected symbol type %x", - ELF_ST_TYPE(syms[index].st_info) ); - ErrorF( "for a Plt request\n" ); + symval = 0; + ErrorF("ElfGetPltAddr(), unhandled symbol scope %x\n", + ELF_ST_BIND(syms[index].st_info)); break; } +# ifdef ELFDEBUG + ELFDEBUG("ElfGetPlt: symbol=%lx\t", symbol); + ELFDEBUG("newval=%lx\t", symval); + ELFDEBUG("name=\"%s\"\n", symname ? symname : "NULL"); +# endif + break; + case STT_SECTION: + case STT_FILE: + case STT_LOPROC: + case STT_HIPROC: + default: + symval = 0; + ErrorF("ElfGetPltAddr(), Unexpected symbol type %x", + ELF_ST_TYPE(syms[index].st_info)); + ErrorF("for a Plt request\n"); + break; + } return symval; } #endif /* __powerpc__ */ @@ -761,34 +792,33 @@ int index; * Manage GOT Entries */ static void -ElfAddGOT(elffile,rel) -ELFModulePtr elffile; -Elf_Rel_t *rel; +ElfAddGOT(ELFModulePtr elffile, Elf_Rel_t *rel) { ELFGotEntryPtr gotent; # ifdef ELFDEBUG { - Elf_Sym *sym; - - sym=(Elf_Sym *)&(elffile->symtab[ELF_R_SYM(rel->r_info)]); - if( sym->st_name) { - ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - } - else - ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n", - ElfGetSectionName(elffile,elffile->sections[sym->st_shndx].sh_name)); + Elf_Sym *sym; + + sym = (Elf_Sym *) & (elffile->symtab[ELF_R_SYM(rel->r_info)]); + if (sym->st_name) { + ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + } else + ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n", + ElfGetSectionName(elffile, + elffile->sections[sym->st_shndx]. + sh_name)); } # endif - for (gotent=elffile->got_entries;gotent;gotent=gotent->next) { - if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) && - gotent->rel->r_addend == rel->r_addend ) - break; + for (gotent = elffile->got_entries; gotent; gotent = gotent->next) { + if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) && + gotent->rel->r_addend == rel->r_addend) + break; } - if( gotent ) { + if (gotent) { # ifdef ELFDEBUG ELFDEBUG("Entry already present in GOT\n"); # endif @@ -796,25 +826,22 @@ Elf_Rel_t *rel; } if ((gotent = xf86loadermalloc(sizeof(ELFGotEntryRec))) == NULL) { - ErrorF( "ElfAddGOT() Unable to allocate memory!!!!\n" ); + ErrorF("ElfAddGOT() Unable to allocate memory!!!!\n"); return; } - # ifdef ELFDEBUG - ELFDEBUG("Entry added with offset %x\n",elffile->gotsize); + ELFDEBUG("Entry added with offset %x\n", elffile->gotsize); # endif - gotent->rel=rel; - gotent->offset=elffile->gotsize; - gotent->next=elffile->got_entries; - elffile->got_entries=gotent; - elffile->gotsize+=8; + gotent->rel = rel; + gotent->offset = elffile->gotsize; + gotent->next = elffile->got_entries; + elffile->got_entries = gotent; + elffile->gotsize += 8; return; } static int -ELFCreateGOT(elffile, maxalign) -ELFModulePtr elffile; -int maxalign; +ELFCreateGOT(ELFModulePtr elffile, int maxalign) { # ifdef MergeSectionAlloc ELFGotPtr gots; @@ -825,18 +852,19 @@ int maxalign; * XXX: Is it REALLY needed to ensure GOT's are non-null? */ # ifdef ELFDEBUG - ELFDEBUG( "ELFCreateGOT: %x entries in the GOT\n", elffile->gotsize/8 ); + ELFDEBUG("ELFCreateGOT: %x entries in the GOT\n", elffile->gotsize / 8); /* * Hmmm. Someone is getting here without any got entries, but they * may still have R_ALPHA_GPDISP relocations against the got. */ - if( elffile->gotsize == 0 ) - ELFDEBUG( "Module %s doesn't have any GOT entries!\n", - _LoaderModuleToName(elffile->module) ); + if (elffile->gotsize == 0) + ELFDEBUG("Module %s doesn't have any GOT entries!\n", + _LoaderModuleToName(elffile->module)); # endif - if( elffile->gotsize == 0 ) elffile->gotsize=8; - elffile->sections[elffile->gotndx].sh_size=elffile->gotsize; + if (elffile->gotsize == 0) + elffile->gotsize = 8; + elffile->sections[elffile->gotndx].sh_size = elffile->gotsize; gotsize = elffile->gotsize; # ifdef MergeSectionAlloc @@ -853,7 +881,8 @@ int maxalign; if (gots->section + gots->size - elffile->base >= GOTDistance) continue; } else { - if (elffile->base + elffile->basesize - gots->section >= GOTDistance) + if (elffile->base + elffile->basesize - gots->section >= + GOTDistance) continue; } elffile->got = gots->freeptr; @@ -861,20 +890,19 @@ int maxalign; gots->freeptr = gots->freeptr + elffile->gotsize; gots->nuses++; # ifdef ELFDEBUG - ELFDEBUG( "ELFCreateGOT: GOT address %lx in shared GOT, nuses %d\n", - elffile->got, gots->nuses ); + ELFDEBUG("ELFCreateGOT: GOT address %lx in shared GOT, nuses %d\n", + elffile->got, gots->nuses); # endif return TRUE; } gotsize += 16383 + sizeof(ELFGotRec); -# endif /*MergeSectionAlloc*/ +# endif /*MergeSectionAlloc */ if ((elffile->got = xf86loadermalloc(gotsize)) == NULL) { - ErrorF( "ELFCreateGOT() Unable to allocate memory!!!!\n" ); + ErrorF("ELFCreateGOT() Unable to allocate memory!!!!\n"); return FALSE; } - # ifdef MergeSectionAlloc if (elffile->got > elffile->base) { if (elffile->got + elffile->gotsize - elffile->base >= GOTDistance) @@ -890,7 +918,7 @@ int maxalign; elffile->basesize += 8 + elffile->gotsize; elffile->base = xf86loaderrealloc(elffile->base, elffile->basesize); if (elffile->base == NULL) { - ErrorF( "ELFCreateGOT() Unable to reallocate memory!!!!\n" ); + ErrorF("ELFCreateGOT() Unable to reallocate memory!!!!\n"); return FALSE; } # if defined(linux) && defined(__ia64__) || defined(__OpenBSD__) @@ -898,29 +926,36 @@ int maxalign; unsigned long page_size = getpagesize(); unsigned long round; - round = (unsigned long)elffile->base & (page_size-1); - mprotect(elffile->base - round, (elffile->basesize+round+page_size-1) & ~(page_size-1), - PROT_READ|PROT_WRITE|PROT_EXEC); + round = (unsigned long)elffile->base & (page_size - 1); + mprotect(elffile->base - round, + (elffile->basesize + round + page_size - + 1) & ~(page_size - 1), + PROT_READ | PROT_WRITE | PROT_EXEC); } # endif # else { int oldbasesize = elffile->basesize; + elffile->basesize += 8 + elffile->gotsize; MMAP_ALIGN(elffile->basesize); - elffile->base = mremap(elffile->base,oldbasesize, - elffile->basesize,MREMAP_MAYMOVE); + elffile->base = mremap(elffile->base, oldbasesize, + elffile->basesize, MREMAP_MAYMOVE); if (elffile->base == NULL) { - ErrorF( "ELFCreateGOT() Unable to remap memory!!!!\n" ); + ErrorF("ELFCreateGOT() Unable to remap memory!!!!\n"); return FALSE; } } # endif - elffile->baseptr = ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1); - elffile->got = (unsigned char *)((long)(elffile->base + elffile->basesize - elffile->gotsize) & ~7); + elffile->baseptr = + ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1); + elffile->got = + (unsigned char + *)((long)(elffile->base + elffile->basesize - + elffile->gotsize) & ~7); } else { - gots = (ELFGotPtr)elffile->got; + gots = (ELFGotPtr) elffile->got; elffile->got = gots->section; gots->size = gotsize - sizeof(ELFGotRec) + 1; gots->nuses = 1; @@ -929,28 +964,26 @@ int maxalign; ELFSharedGOTs = gots; elffile->shared_got = gots; # ifdef ELFDEBUG - ELFDEBUG( "ELFCreateGOT: Created a shareable GOT with size %d\n", gots->size); + ELFDEBUG("ELFCreateGOT: Created a shareable GOT with size %d\n", + gots->size); # endif } -# endif/*MergeSectionAlloc*/ +# endif /*MergeSectionAlloc */ # ifdef ELFDEBUG - ELFDEBUG( "ELFCreateGOT: GOT address %lx\n", elffile->got ); + ELFDEBUG("ELFCreateGOT: GOT address %lx\n", elffile->got); # endif return TRUE; } -#endif /* defined(__alpha__) || defined(__ia64__)*/ +#endif /* defined(__alpha__) || defined(__ia64__) */ #if defined(__ia64__) /* * Manage OPD Entries */ static void -ElfAddOPD(elffile,index,l) -ELFModulePtr elffile; -int index; -LOOKUP *l; +ElfAddOPD(ELFModulePtr elffile, int index, LOOKUP *l) { ELFOpdPtr opdent; @@ -961,37 +994,37 @@ LOOKUP *l; } if ((opdent = xf86loadermalloc(sizeof(ELFOpdRec))) == NULL) { - ErrorF( "ElfAddOPD() Unable to allocate memory!!!!\n" ); + ErrorF("ElfAddOPD() Unable to allocate memory!!!!\n"); return; } - # ifdef ELFDEBUG - ELFDEBUG("OPD Entry %d added with offset %x\n",index,elffile->gotsize); -# endif - opdent->l=l; - opdent->index=index; - opdent->offset=elffile->gotsize; - opdent->next=elffile->opd_entries; - elffile->opd_entries=opdent; - elffile->gotsize+=16; - return ; + ELFDEBUG("OPD Entry %d added with offset %x\n", index, elffile->gotsize); +# endif + opdent->l = l; + opdent->index = index; + opdent->offset = elffile->gotsize; + opdent->next = elffile->opd_entries; + elffile->opd_entries = opdent; + elffile->gotsize += 16; + return; } static void -ELFCreateOPD(elffile) -ELFModulePtr elffile; +ELFCreateOPD(ELFModulePtr elffile) { ELFOpdPtr opdent; if (elffile->got == NULL) - ErrorF( "ELFCreateOPD() Unallocated GOT!!!!\n" ); + ErrorF("ELFCreateOPD() Unallocated GOT!!!!\n"); for (opdent = elffile->opd_entries; opdent; opdent = opdent->next) { if (opdent->index != -1) continue; - ((unsigned long *)(elffile->got+opdent->offset))[0] = (long)opdent->l->offset; - ((unsigned long *)(elffile->got+opdent->offset))[1] = (long)elffile->got; - opdent->l->offset = (funcptr)(elffile->got+opdent->offset); + ((unsigned long *)(elffile->got + opdent->offset))[0] = + (long)opdent->l->offset; + ((unsigned long *)(elffile->got + opdent->offset))[1] = + (long)elffile->got; + opdent->l->offset = (funcptr) (elffile->got + opdent->offset); } } @@ -999,35 +1032,32 @@ ELFModulePtr elffile; * Manage PLT Entries */ static void -ElfAddPLT(elffile,rel) -ELFModulePtr elffile; -Elf_Rel_t *rel; +ElfAddPLT(ELFModulePtr elffile, Elf_Rel_t *rel) { ELFPltEntryPtr pltent; # ifdef ELFDEBUG { - Elf_Sym *sym; - - sym=(Elf_Sym *)&(elffile->symtab[ELF_R_SYM(rel->r_info)]); - if( sym->st_name) { - ELFDEBUG("ElfAddPLT: Adding PLT entry for %s\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - } - else - ErrorF("ElfAddPLT: Add PLT entry for section??\n"); + Elf_Sym *sym; + + sym = (Elf_Sym *) & (elffile->symtab[ELF_R_SYM(rel->r_info)]); + if (sym->st_name) { + ELFDEBUG("ElfAddPLT: Adding PLT entry for %s\n", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + } else + ErrorF("ElfAddPLT: Add PLT entry for section??\n"); } # endif if (rel->r_addend) ErrorF("ElfAddPLT: Add PLT entry with non-zero addend??\n"); - for (pltent=elffile->plt_entries;pltent;pltent=pltent->next) { - if ( ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info) ) - break; + for (pltent = elffile->plt_entries; pltent; pltent = pltent->next) { + if (ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info)) + break; } - if( pltent ) { + if (pltent) { # ifdef ELFDEBUG ELFDEBUG("Entry already present in PLT\n"); # endif @@ -1035,68 +1065,73 @@ Elf_Rel_t *rel; } if ((pltent = xf86loadermalloc(sizeof(ELFPltEntryRec))) == NULL) { - ErrorF( "ElfAddPLT() Unable to allocate memory!!!!\n" ); + ErrorF("ElfAddPLT() Unable to allocate memory!!!!\n"); return; } - # ifdef ELFDEBUG - ELFDEBUG("Entry added with offset %x\n",elffile->pltsize); -# endif - pltent->rel=rel; - pltent->offset=elffile->pltsize; - pltent->gotoffset=elffile->gotsize; - pltent->next=elffile->plt_entries; - elffile->plt_entries=pltent; - elffile->pltsize+=32; - elffile->gotsize+=16; - return ; + ELFDEBUG("Entry added with offset %x\n", elffile->pltsize); +# endif + pltent->rel = rel; + pltent->offset = elffile->pltsize; + pltent->gotoffset = elffile->gotsize; + pltent->next = elffile->plt_entries; + elffile->plt_entries = pltent; + elffile->pltsize += 32; + elffile->gotsize += 16; + return; } static void -ELFCreatePLT(elffile) -ELFModulePtr elffile; +ELFCreatePLT(ELFModulePtr elffile) { # ifdef ELFDEBUG - ELFDEBUG( "ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize/8 ); + ELFDEBUG("ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize / 8); # endif - if( elffile->pltsize == 0 ) return; + if (elffile->pltsize == 0) + return; - if ((elffile->plt = ELFLoaderSectCalloc(elffile,32,elffile->pltsize)) == NULL) { - ErrorF( "ELFCreatePLT() Unable to allocate memory!!!!\n" ); + if ((elffile->plt = + ELFLoaderSectCalloc(elffile, 32, elffile->pltsize)) == NULL) { + ErrorF("ELFCreatePLT() Unable to allocate memory!!!!\n"); return; } - elffile->sections[elffile->pltndx].sh_size=elffile->pltsize; + elffile->sections[elffile->pltndx].sh_size = elffile->pltsize; # ifdef ELFDEBUG - ELFDEBUG( "ELFCreatePLT: PLT address %lx\n", elffile->plt ); + ELFDEBUG("ELFCreatePLT: PLT address %lx\n", elffile->plt); # endif return; } static void -IA64InstallReloc(data128, slot, opnd, value) -unsigned long *data128; -int slot; -enum ia64_operand opnd; -long value; +IA64InstallReloc(unsigned long *data128, int slot, enum ia64_operand opnd, + long value) { unsigned long data = 0; # ifdef ELFDEBUG - ELFDEBUG( "\nIA64InstallReloc %p %d %d %016lx\n", data128, slot, opnd, value); - ELFDEBUG( "Before [%016lx%016lx]\n", data128[1], data128[0]); + ELFDEBUG("\nIA64InstallReloc %p %d %d %016lx\n", data128, slot, opnd, + value); + ELFDEBUG("Before [%016lx%016lx]\n", data128[1], data128[0]); # endif switch (slot) { - case 0: data = *data128; break; - case 1: memcpy(&data, (char *)data128 + 5, 8); break; - case 2: memcpy(&data, (char *)data128 + 10, 6); break; - default: FatalError("Unexpected slot in IA64InstallReloc()\n"); + case 0: + data = *data128; + break; + case 1: + memcpy(&data, (char *)data128 + 5, 8); + break; + case 2: + memcpy(&data, (char *)data128 + 10, 6); + break; + default: + FatalError("Unexpected slot in IA64InstallReloc()\n"); } switch (opnd) { case IA64_OPND_IMM22: data &= ~(0x3fff9fc0000UL << slot); - data |= (value & 0x7f) << (18 + slot); /* [13:19] + 5 + slot */ + data |= (value & 0x7f) << (18 + slot); /* [13:19] + 5 + slot */ data |= (value & 0xff80) << (25 + slot); /* [27:35] + 5 + slot */ data |= (value & 0x1f0000) << (11 + slot); /* [22:26] + 5 + slot */ data |= (value & 0x200000) << (20 + slot); /* [36:36] + 5 + slot */ @@ -1110,18 +1145,44 @@ long value; if (value << 39 >> 39 != value || (value & 0xf)) ErrorF("Relocation %016lx truncated to fit into TGT25C\n", value); break; +#ifdef IA64_LDX_OPTIMIZATION + case IA64_OPND_LDXMOV: + /* + * Convert "ld8 t2=[t1]" to "mov t2=t1" which is really "add t2=0,t1" + * Mask all but the r3,r1,qp fields, + * then OR in the ALU opcode = 8 into the opcode field [40:37] + * + * Mask for the r3,r1,qp bit fields [26:20][12:6][5:0] = 0x7f01fff, + * This mask negated only within the 41 bit wide instruction and + * shifted left by 5 for the bundle template is 0x3FFF01FC0000 + * + * opcode field [40:37] with a value of 8 is 0x10000000000 + * shifted left by 5 for the bundle template is 0x200000000000 + * + */ + data &= ~(0x3FFF01FC0000 << slot); + data |= (0x200000000000 << slot); + break; +#endif default: FatalError("Unhandled operand in IA64InstallReloc()\n"); } switch (slot) { - case 0: *data128 = data; break; - case 1: memcpy((char *)data128 + 5, &data, 8); break; - case 2: memcpy((char *)data128 + 10, &data, 6); break; - default: FatalError("Unexpected slot in IA64InstallReloc()\n"); + case 0: + *data128 = data; + break; + case 1: + memcpy((char *)data128 + 5, &data, 8); + break; + case 2: + memcpy((char *)data128 + 10, &data, 6); + break; + default: + FatalError("Unexpected slot in IA64InstallReloc()\n"); } ia64_flush_cache(data128); # ifdef ELFDEBUG - ELFDEBUG( "After [%016lx%016lx]\n", data128[1], data128[0]); + ELFDEBUG("After [%016lx%016lx]\n", data128[1], data128[0]); # endif } @@ -1135,13 +1196,11 @@ long value; */ static ELFRelocPtr -Elf_RelocateEntry(elffile, secn, rel, force) -ELFModulePtr elffile; -Elf_Word secn; -Elf_Rel_t *rel; -int force; +Elf_RelocateEntry(ELFModulePtr elffile, Elf_Word secn, Elf_Rel_t *rel, + int force) { unsigned char *secp = elffile->saddr[secn]; + #if !defined(__ia64__) unsigned int *dest32; /* address of the 32 bit place being modified */ #endif @@ -1150,13 +1209,14 @@ int force; #endif #if defined(__sparc__) unsigned char *dest8; /* address of the 8 bit place being modified */ + unsigned long *dest64; #endif -#if defined(__alpha__) +#if defined(__alpha__) unsigned int *dest32h; /* address of the high 32 bit place being modified */ unsigned long *dest64; unsigned short *dest16; #endif -#if defined(__x86_64__) +#if defined(__AMD64__) unsigned long *dest64; int *dest32s; #endif @@ -1167,28 +1227,29 @@ int force; Elf_Addr symval = 0; /* value of the indicated symbol */ #ifdef ELFDEBUG - ELFDEBUG( "%lx %d %d\n", rel->r_offset, - ELF_R_SYM(rel->r_info), ELF_R_TYPE(rel->r_info) ); + ELFDEBUG("%lx %d %d\n", (unsigned long)rel->r_offset, + ELF_R_SYM(rel->r_info), ELF_R_TYPE(rel->r_info)); # if defined(__powerpc__) || \ defined(__mc68000__) || \ defined(__alpha__) || \ defined(__sparc__) || \ defined(__ia64__) || \ - defined(__x86_64__) - ELFDEBUG( "%lx", rel->r_addend ); + defined(__AMD64__) + ELFDEBUG("%lx", rel->r_addend); # endif ELFDEBUG("\n"); #endif /*ELFDEBUG*/ #if defined(__alpha__) - if (ELF_R_SYM(rel->r_info) && ELF_R_TYPE(rel->r_info) != R_ALPHA_GPDISP) + if (ELF_R_SYM(rel->r_info) + && ELF_R_TYPE(rel->r_info) != R_ALPHA_GPDISP) #else - if (ELF_R_SYM(rel->r_info)) + if (ELF_R_SYM(rel->r_info)) #endif { symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info)); if (symval == 0) { if (force) { - symval = (Elf_Addr) &LoaderDefaultFunc; + symval = (Elf_Addr) & LoaderDefaultFunc; } else { #ifdef ELFDEBUG ELFDEBUG("***Unable to resolve symbol %s\n", @@ -1199,942 +1260,982 @@ int force; } } - switch( ELF_R_TYPE(rel->r_info) ) - { + switch (ELF_R_TYPE(rel->r_info)) { #if defined(i386) - case R_386_32: - dest32=(unsigned int *)(secp+rel->r_offset); + case R_386_32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_386_32\t"); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); + ELFDEBUG("R_386_32\t"); + ELFDEBUG("dest32=%p\t", (void *)dest32); + ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32); # endif - *dest32=symval+(*dest32); /* S + A */ + *dest32 = symval + (*dest32); /* S + A */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32); # endif - break; - case R_386_PC32: - dest32=(unsigned int *)(secp+rel->r_offset); + break; + case R_386_PC32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_386_PC32 %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); + ELFDEBUG("R_386_PC32 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%p\t", secp); + ELFDEBUG("symval=%lx\t", (unsigned long)symval); + ELFDEBUG("dest32=%p\t", (void *)dest32); + ELFDEBUG("*dest32=%8.8x\t", (unsigned int)*dest32); # endif - *dest32=symval+(*dest32)-(Elf_Addr)dest32; /* S + A - P */ + *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", (unsigned int)*dest32); # endif - break; + break; #endif /* i386 */ -#if defined(__x86_64__) - case R_X86_64_32: - dest32=(unsigned int *)(secp+rel->r_offset ); +#if defined(__AMD64__) + case R_X86_64_32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_X86_32\t"); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); - ELFDEBUG( "r_addend=%lx\t", rel->r_addend); + ELFDEBUG("R_X86_32\t"); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8lx\t", *dest32); + ELFDEBUG("r_addend=%lx\t", rel->r_addend); # endif - *dest32=symval + rel->r_addend + (*dest32); /* S + A */ + *dest32 = symval + rel->r_addend + (*dest32); /* S + A */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8lx\n", *dest32); # endif - break; - case R_X86_64_32S: - dest32s=(int *)(secp+rel->r_offset); + break; + case R_X86_64_32S: + dest32s = (int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_X86_64_32\t"); - ELFDEBUG( "dest32s=%x\t", dest32s ); - ELFDEBUG( "*dest32s=%8.8lx\t", *dest32s ); - ELFDEBUG( "r_addend=%lx\t", rel->r_addend); + ELFDEBUG("R_X86_64_32\t"); + ELFDEBUG("dest32s=%x\t", dest32s); + ELFDEBUG("*dest32s=%8.8lx\t", *dest32s); + ELFDEBUG("r_addend=%lx\t", rel->r_addend); # endif - *dest32s=symval + rel->r_addend + (*dest32s); /* S + A */ + *dest32s = symval + rel->r_addend + (*dest32s); /* S + A */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32s=%8.8lx\n", *dest32s ); + ELFDEBUG("*dest32s=%8.8lx\n", *dest32s); # endif - break; - case R_X86_64_PC32: - dest32=(unsigned int *)(secp+rel->r_offset); + break; + case R_X86_64_PC32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_X86_64_PC32 %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); - ELFDEBUG( "r_addend=%lx\t", rel->r_addend); + ELFDEBUG("R_X86_64_PC32 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8lx\t", *dest32); + ELFDEBUG("r_addend=%lx\t", rel->r_addend); # endif - *dest32 = symval + rel->r_addend + (*dest32)-(Elf_Addr)dest32; /* S + A - P */ + *dest32 = symval + rel->r_addend + (*dest32) - (Elf_Addr) dest32; /* S + A - P */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8lx\n", *dest32); # endif - break; - case R_X86_64_64: - dest64=(unsigned long *)(secp+rel->r_offset); + break; + case R_X86_64_64: + dest64 = (unsigned long *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_x86_64_64\t"); - ELFDEBUG( "dest64=%x\t", dest64 ); - ELFDEBUG( "*dest64=%8.8lx\t", *dest64 ); - ELFDEBUG( "r_addend=%lx\t", rel->r_addend); + ELFDEBUG("R_AMD64_64\t"); + ELFDEBUG("dest64=%x\t", dest64); + ELFDEBUG("*dest64=%8.8lx\t", *dest64); + ELFDEBUG("r_addend=%lx\t", rel->r_addend); # endif - *dest64=symval + rel->r_addend + (*dest64); /* S + A */ + *dest64 = symval + rel->r_addend + (*dest64); /* S + A */ # ifdef ELFDEBUG - ELFDEBUG( "*dest64=%8.8lx\n", *dest64 ); + ELFDEBUG("*dest64=%8.8lx\n", *dest64); # endif - break; -#endif /* __x86_64__ */ + break; +#endif /* __AMD64__ */ #if defined(__alpha__) - case R_ALPHA_NONE: - case R_ALPHA_LITUSE: - break; - - case R_ALPHA_REFQUAD: - dest64=(unsigned long *)(secp+rel->r_offset); - symval=ElfGetSymbolValue(elffile, - ELF_R_SYM(rel->r_info)); -# ifdef ELFDEBUG - ELFDEBUG( "R_ALPHA_REFQUAD\t"); - ELFDEBUG( "dest64=%lx\t", dest64 ); - ELFDEBUG( "*dest64=%8.8lx\t", *dest64 ); -# endif - *dest64=symval+rel->r_addend+(*dest64); /* S + A + P */ -# ifdef ELFDEBUG - ELFDEBUG( "*dest64=%8.8lx\n", *dest64 ); -# endif - break; - - case R_ALPHA_GPREL32: - { - dest64=(unsigned long *)(secp+rel->r_offset); - dest32=(unsigned int *)dest64; - -# ifdef ELFDEBUG - ELFDEBUG( "R_ALPHA_GPREL32 %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%lx\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); + case R_ALPHA_NONE: + case R_ALPHA_LITUSE: + break; + + case R_ALPHA_REFQUAD: + dest64 = (unsigned long *)(secp + rel->r_offset); + symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info)); +# ifdef ELFDEBUG + ELFDEBUG("R_ALPHA_REFQUAD\t"); + ELFDEBUG("dest64=%lx\t", dest64); + ELFDEBUG("*dest64=%8.8lx\t", *dest64); +# endif + *dest64 = symval + rel->r_addend + (*dest64); /* S + A + P */ +# ifdef ELFDEBUG + ELFDEBUG("*dest64=%8.8lx\n", *dest64); +# endif + break; + + case R_ALPHA_GPREL32: + { + dest64 = (unsigned long *)(secp + rel->r_offset); + dest32 = (unsigned int *)dest64; + +# ifdef ELFDEBUG + ELFDEBUG("R_ALPHA_GPREL32 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest32=%lx\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); # endif symval += rel->r_addend; - symval = ((unsigned char *)symval)-((unsigned char *)elffile->got); + symval = ((unsigned char *)symval) - + ((unsigned char *)elffile->got); # ifdef ELFDEBUG - ELFDEBUG( "symval=%lx\t", symval ); + ELFDEBUG("symval=%lx\t", symval); # endif - if( (symval&0xffffffff00000000) != 0x0000000000000000 && - (symval&0xffffffff00000000) != 0xffffffff00000000 ) { + if ((symval & 0xffffffff00000000) != 0x0000000000000000 && + (symval & 0xffffffff00000000) != 0xffffffff00000000) { FatalError("R_ALPHA_GPREL32 symval-got is too large for %s\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info))); + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); } - *dest32=symval; + *dest32 = symval; # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%x\n", *dest32 ); + ELFDEBUG("*dest32=%x\n", *dest32); # endif break; - } + } - case R_ALPHA_GPRELLOW: - { - dest64=(unsigned long *)(secp+rel->r_offset); - dest16=(unsigned short *)dest64; + case R_ALPHA_GPRELLOW: + { + dest64 = (unsigned long *)(secp + rel->r_offset); + dest16 = (unsigned short *)dest64; symval += rel->r_addend; - symval = ((unsigned char *)symval)-((unsigned char *)elffile->got); + symval = ((unsigned char *)symval) - + ((unsigned char *)elffile->got); - *dest16=symval; + *dest16 = symval; break; - } + } - case R_ALPHA_GPRELHIGH: - { - dest64=(unsigned long *)(secp+rel->r_offset); - dest16=(unsigned short *)dest64; + case R_ALPHA_GPRELHIGH: + { + dest64 = (unsigned long *)(secp + rel->r_offset); + dest16 = (unsigned short *)dest64; symval += rel->r_addend; - symval = ((unsigned char *)symval)-((unsigned char *)elffile->got); + symval = ((unsigned char *)symval) - + ((unsigned char *)elffile->got); symval = ((long)symval >> 16) + ((symval >> 15) & 1); - if( (long)symval > 0x7fff || (long)symval < -(long)0x8000 ) { - FatalError("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval); + if ((long)symval > 0x7fff || (long)symval < -(long)0x8000) { + FatalError + ("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)), + symval); } - *dest16=symval; + *dest16 = symval; break; - } + } - case R_ALPHA_LITERAL: - { + case R_ALPHA_LITERAL: + { ELFGotEntryPtr gotent; - dest32=(unsigned int *)(secp+rel->r_offset); + + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_ALPHA_LITERAL %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%lx\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); + ELFDEBUG("R_ALPHA_LITERAL %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest32=%lx\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); # endif - for (gotent=elffile->got_entries;gotent;gotent=gotent->next) { - if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) && - gotent->rel->r_addend == rel->r_addend ) - break; + for (gotent = elffile->got_entries; gotent; gotent = gotent->next) { + if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) + && gotent->rel->r_addend == rel->r_addend) + break; } /* Set the address in the GOT */ - if( gotent ) { - *(unsigned long *)(elffile->got+gotent->offset) = - symval+rel->r_addend; + if (gotent) { + *(unsigned long *)(elffile->got + gotent->offset) = + symval + rel->r_addend; # ifdef ELFDEBUG ELFDEBUG("Setting gotent[%x]=%lx\t", - gotent->offset, symval+rel->r_addend); + gotent->offset, symval + rel->r_addend); # endif if ((gotent->offset & 0xffff0000) != 0) FatalError("\nR_ALPHA_LITERAL offset %x too large\n", gotent->offset); - (*dest32)|=(gotent->offset); /* The address part is always 0 */ - } - else { + (*dest32) |= (gotent->offset); /* The address part is always 0 */ + } else { unsigned long val; - + /* S + A - P >> 2 */ - val=((symval+(rel->r_addend)-(Elf_Addr)dest32)); + val = ((symval + (rel->r_addend) - (Elf_Addr) dest32)); # ifdef ELFDEBUG - ELFDEBUG("S+A-P=%x\t",val); + ELFDEBUG("S+A-P=%x\t", val); # endif - if( (val & 0xffff0000) != 0xffff0000 && - (val & 0xffff0000) != 0x00000000 ) { + if ((val & 0xffff0000) != 0xffff0000 && + (val & 0xffff0000) != 0x00000000) { ErrorF("\nR_ALPHA_LITERAL offset %x too large\n", val); - break; + break; } val &= 0x0000ffff; - (*dest32)|=(val); /* The address part is always 0 */ + (*dest32) |= (val); /* The address part is always 0 */ } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif break; - } - - case R_ALPHA_GPDISP: - { + } + + case R_ALPHA_GPDISP: + { long offset; - dest32h=(unsigned int *)(secp+rel->r_offset); - dest32=(unsigned int *)((secp+rel->r_offset)+rel->r_addend); + dest32h = (unsigned int *)(secp + rel->r_offset); + dest32 = (unsigned int *)((secp + rel->r_offset) + rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG( "R_ALPHA_GPDISP %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "got=%lx\t", elffile->got ); - ELFDEBUG( "dest32=%lx\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); - ELFDEBUG( "dest32h=%lx\t", dest32h ); - ELFDEBUG( "*dest32h=%8.8x\t", *dest32h ); + ELFDEBUG("R_ALPHA_GPDISP %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("got=%lx\t", elffile->got); + ELFDEBUG("dest32=%lx\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); + ELFDEBUG("dest32h=%lx\t", dest32h); + ELFDEBUG("*dest32h=%8.8x\t", *dest32h); # endif if ((*dest32h >> 26) != 9 || (*dest32 >> 26) != 8) { - ErrorF( "***Bad instructions in relocating %s\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); + ErrorF("***Bad instructions in relocating %s\n", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); } symval = (*dest32h & 0xffff) << 16 | (*dest32 & 0xffff); symval = (symval ^ 0x80008000) - 0x80008000; - - offset = ((unsigned char *)elffile->got - (unsigned char *)dest32h); + + offset = ((unsigned char *)elffile->got - + (unsigned char *)dest32h); # ifdef ELFDEBUG - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "got-dest32=%lx\t", offset ); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("got-dest32=%lx\t", offset); # endif - if( (offset >= 0x7fff8000L) || (offset < -0x80000000L) ) { - FatalError( "Offset overflow for R_ALPHA_GPDISP\n"); + if ((offset >= 0x7fff8000L) || (offset < -0x80000000L)) { + FatalError("Offset overflow for R_ALPHA_GPDISP\n"); } symval += (unsigned long)offset; # ifdef ELFDEBUG - ELFDEBUG( "symval=%lx\t", symval ); + ELFDEBUG("symval=%lx\t", symval); +# endif + *dest32 = (*dest32 & 0xffff0000) | (symval & 0xffff); + *dest32h = (*dest32h & 0xffff0000) | + (((symval >> 16) + ((symval >> 15) & 1)) & 0xffff); +# ifdef ELFDEBUG + ELFDEBUG("*dest32=%8.8x\t", *dest32); + ELFDEBUG("*dest32h=%8.8x\n", *dest32h); # endif - *dest32=(*dest32&0xffff0000) | (symval&0xffff); - *dest32h=(*dest32h&0xffff0000)| - (((symval>>16)+((symval>>15)&1))&0xffff); + break; + } + + case R_ALPHA_HINT: + dest32 = (unsigned int *)((secp + rel->r_offset) + rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); - ELFDEBUG( "*dest32h=%8.8x\n", *dest32h ); + ELFDEBUG("R_ALPHA_HINT %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest32=%lx\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); # endif - break; - } - - case R_ALPHA_HINT: - dest32=(unsigned int *)((secp+rel->r_offset)+rel->r_addend); + # ifdef ELFDEBUG - ELFDEBUG( "R_ALPHA_HINT %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%lx\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); + ELFDEBUG("symval=%lx\t", symval); # endif + symval -= (Elf_Addr) (((unsigned char *)dest32) + 4); + if (symval % 4) { + ErrorF("R_ALPHA_HINT bad alignment of offset\n"); + } + symval = symval >> 2; # ifdef ELFDEBUG - ELFDEBUG( "symval=%lx\t", symval ); + ELFDEBUG("symval=%lx\t", symval); # endif - symval -= (Elf_Addr)(((unsigned char *)dest32)+4); - if (symval % 4 ) { - ErrorF( "R_ALPHA_HINT bad alignment of offset\n"); - } - symval=symval>>2; + if (symval & 0xffff8000) { # ifdef ELFDEBUG - ELFDEBUG( "symval=%lx\t", symval ); + ELFDEBUG("R_ALPHA_HINT symval too large\n"); # endif + } + + *dest32 = (*dest32 & ~0x3fff) | (symval & 0x3fff); - if( symval & 0xffff8000 ) { # ifdef ELFDEBUG - ELFDEBUG("R_ALPHA_HINT symval too large\n" ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif + break; + + case R_ALPHA_GPREL16: + { + dest64 = (unsigned long *)(secp + rel->r_offset); + dest16 = (unsigned short *)dest64; + + symval += rel->r_addend; + symval = ((unsigned char *)symval) - + ((unsigned char *)elffile->got); + if ((long)symval > 0x7fff || (long)symval < -(long)0x8000) { + FatalError + ("R_ALPHA_GPREL16 symval-got is too large for %s:%lx\n", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)), + symval); } - *dest32 = (*dest32&~0x3fff) | (symval&0x3fff); - -# ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); -# endif - break; - - case R_ALPHA_GPREL16: - { - dest64=(unsigned long *)(secp+rel->r_offset); - dest16=(unsigned short *)dest64; - - symval += rel->r_addend; - symval = ((unsigned char *)symval)-((unsigned char *)elffile->got); - if( (long)symval > 0x7fff || - (long)symval < -(long)0x8000 ) { - FatalError("R_ALPHA_GPREL16 symval-got is too large for %s:%lx\n", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval); - } - - *dest16=symval; - break; - } - + *dest16 = symval; + break; + } + #endif /* alpha */ #if defined(__mc68000__) - case R_68K_32: - dest32=(unsigned int *)(secp+rel->r_offset); + case R_68K_32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_68K_32\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_68K_32\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - /* S + A */ - val=symval+(rel->r_addend); + { + unsigned long val; + + /* S + A */ + val = symval + (rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); + ELFDEBUG("S+A=%x\t", val); # endif - *dest32=val; /* S + A */ - } + *dest32 = val; /* S + A */ + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_68K_PC32: - dest32=(unsigned int *)(secp+rel->r_offset); + break; + case R_68K_PC32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_68K_PC32\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_68K_PC32\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - /* S + A - P */ - val=symval+(rel->r_addend); - val-=*dest32; + { + unsigned long val; + + /* S + A - P */ + val = symval + (rel->r_addend); + val -= *dest32; # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); - ELFDEBUG("S+A-P=%x\t",val+(*dest32)-(Elf_Addr)dest32); + ELFDEBUG("S+A=%x\t", val); + ELFDEBUG("S+A-P=%x\t", val + (*dest32) - (Elf_Addr) dest32); # endif - *dest32=val+(*dest32)-(Elf_Addr)dest32; /* S + A - P */ - } + *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */ + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; + break; #endif /* __mc68000__ */ #if defined(__powerpc__) # if defined(PowerMAX_OS) - case R_PPC_DISP24: /* 11 */ - dest32=(unsigned long *)(secp+rel->r_offset); + case R_PPC_DISP24: /* 11 */ + dest32 = (unsigned long *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_DISP24 %s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); + ELFDEBUG("R_PPC_DISP24 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); # endif - { - unsigned long val; - - /* S + A - P >> 2 */ - val=((symval+(rel->r_addend)-(Elf_Addr)dest32)); + { + unsigned long val; + + /* S + A - P >> 2 */ + val = ((symval + (rel->r_addend) - (Elf_Addr) dest32)); # ifdef ELFDEBUG - ELFDEBUG("S+A-P=%x\t",val); + ELFDEBUG("S+A-P=%x\t", val); # endif - val = val>>2; - if( (val & 0x3f000000) != 0x3f000000 && - (val & 0x3f000000) != 0x00000000 ) { + val = val >> 2; + if ((val & 0x3f000000) != 0x3f000000 && + (val & 0x3f000000) != 0x00000000) { # ifdef ELFDEBUG - ELFDEBUG("R_PPC_DISP24 offset %x too large\n", val<<2); + ELFDEBUG("R_PPC_DISP24 offset %x too large\n", val << 2); # endif - symval = ElfGetPltAddr(elffile,ELF_R_SYM(rel->r_info)); - val=((symval+(rel->r_addend)-(Elf_Addr)dest32)); + symval = ElfGetPltAddr(elffile, ELF_R_SYM(rel->r_info)); + val = ((symval + (rel->r_addend) - (Elf_Addr) dest32)); # ifdef ELFDEBUG - ELFDEBUG("PLT offset is %x\n", val); + ELFDEBUG("PLT offset is %x\n", val); # endif - val=val>>2; - if( (val & 0x3f000000) != 0x3f000000 && - (val & 0x3f000000) != 0x00000000 ) - FatalError("R_PPC_DISP24 PLT offset %x too large\n", val<<2); - } - val &= 0x00ffffff; - (*dest32)|=(val<<2); /* The address part is always 0 */ - ppc_flush_icache(dest32); + val = val >> 2; + if ((val & 0x3f000000) != 0x3f000000 && + (val & 0x3f000000) != 0x00000000) + FatalError("R_PPC_DISP24 PLT offset %x too large\n", + val << 2); } + val &= 0x00ffffff; + (*dest32) |= (val << 2); /* The address part is always 0 */ + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_16HU: /* 31 */ - dest16=(unsigned short *)(secp+rel->r_offset); + break; + case R_PPC_16HU: /* 31 */ + dest16 = (unsigned short *)(secp + rel->r_offset); # ifdef ELFDEBUG - dest32=(unsigned long *)(dest16-1); + dest32 = (unsigned long *)(dest16 - 1); # endif # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_16HU\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest16=%x\t", dest16 ); - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_16HU\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest16=%x\t", dest16); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned short val; - /* S + A */ - val=((symval+(rel->r_addend))&0xffff0000)>>16; + { + unsigned short val; + + /* S + A */ + val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16; # ifdef ELFDEBUG - ELFDEBUG("uhi16(S+A)=%x\t",val); + ELFDEBUG("uhi16(S+A)=%x\t", val); # endif - *dest16=val; /* S + A */ - ppc_flush_icache(dest16); - } + *dest16 = val; /* S + A */ + ppc_flush_icache(dest16); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_32: /* 32 */ - dest32=(unsigned long *)(secp+rel->r_offset); + break; + case R_PPC_32: /* 32 */ + dest32 = (unsigned long *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_32\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_32\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - /* S + A */ - val=symval+(rel->r_addend); + { + unsigned long val; + + /* S + A */ + val = symval + (rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); + ELFDEBUG("S+A=%x\t", val); # endif - *dest32=val; /* S + A */ - ppc_flush_icache(dest32); - } + *dest32 = val; /* S + A */ + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_32UA: /* 33 */ - dest32=(unsigned long *)(secp+rel->r_offset); + break; + case R_PPC_32UA: /* 33 */ + dest32 = (unsigned long *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_32UA\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_32UA\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - unsigned char *dest8 = (unsigned char *)dest32; - /* S + A */ - val=symval+(rel->r_addend); + { + unsigned long val; + unsigned char *dest8 = (unsigned char *)dest32; + + /* S + A */ + val = symval + (rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); + ELFDEBUG("S+A=%x\t", val); # endif - *dest8++=(val&0xff000000)>>24; - *dest8++=(val&0x00ff0000)>>16; - *dest8++=(val&0x0000ff00)>> 8; - *dest8++=(val&0x000000ff); - ppc_flush_icache(dest32); - } + *dest8++ = (val & 0xff000000) >> 24; + *dest8++ = (val & 0x00ff0000) >> 16; + *dest8++ = (val & 0x0000ff00) >> 8; + *dest8++ = (val & 0x000000ff); + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_16H: /* 34 */ - dest16=(unsigned short *)(secp+rel->r_offset); + break; + case R_PPC_16H: /* 34 */ + dest16 = (unsigned short *)(secp + rel->r_offset); # ifdef ELFDEBUG - dest32=(unsigned long *)(dest16-1); + dest32 = (unsigned long *)(dest16 - 1); # endif # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_16H\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symbol=%s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest16=%x\t", dest16 ); - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_16H\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symbol=%s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest16=%x\t", dest16); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned short val; - unsigned short loval; - /* S + A */ - val=((symval+(rel->r_addend))&0xffff0000)>>16; - loval=(symval+(rel->r_addend))&0xffff; - if( loval & 0x8000 ) { - /* - * This is hi16(), instead of uhi16(). Because of this, - * if the lo16() will produce a negative offset, then - * we have to increment this part of the address to get - * the correct final result. - */ - val++; - } + { + unsigned short val; + unsigned short loval; + + /* S + A */ + val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16; + loval = (symval + (rel->r_addend)) & 0xffff; + if (loval & 0x8000) { + /* + * This is hi16(), instead of uhi16(). Because of this, + * if the lo16() will produce a negative offset, then + * we have to increment this part of the address to get + * the correct final result. + */ + val++; + } # ifdef ELFDEBUG - ELFDEBUG("hi16(S+A)=%x\t",val); + ELFDEBUG("hi16(S+A)=%x\t", val); # endif - *dest16=val; /* S + A */ - ppc_flush_icache(dest16); - } + *dest16 = val; /* S + A */ + ppc_flush_icache(dest16); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_16L: /* 35 */ - dest16=(unsigned short *)(secp+rel->r_offset); + break; + case R_PPC_16L: /* 35 */ + dest16 = (unsigned short *)(secp + rel->r_offset); # ifdef ELFDEBUG - dest32=(unsigned long *)(dest16-1); + dest32 = (unsigned long *)(dest16 - 1); # endif # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_16L\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest16=%x\t", dest16 ); - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_16L\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest16=%x\t", dest16); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned short val; - /* S + A */ - val=(symval+(rel->r_addend))&0xffff; + { + unsigned short val; + + /* S + A */ + val = (symval + (rel->r_addend)) & 0xffff; # ifdef ELFDEBUG - ELFDEBUG("lo16(S+A)=%x\t",val); + ELFDEBUG("lo16(S+A)=%x\t", val); # endif - *dest16=val; /* S + A */ - ppc_flush_icache(dest16); - } + *dest16 = val; /* S + A */ + ppc_flush_icache(dest16); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; + break; # else /* PowerMAX_OS */ - /* Linux PPC */ - case R_PPC_ADDR32: /* 1 */ - dest32=(unsigned int *)(secp+rel->r_offset); - symval=ElfGetSymbolValue(elffile,ELF_R_SYM(rel->r_info)); + /* Linux PPC */ + case R_PPC_ADDR32: /* 1 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info)); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_ADDR32\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_ADDR32\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - /* S + A */ - val=symval+(rel->r_addend); + { + unsigned long val; + + /* S + A */ + val = symval + (rel->r_addend); # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); + ELFDEBUG("S+A=%x\t", val); # endif - *dest32=val; /* S + A */ - ppc_flush_icache(dest32); - } + *dest32 = val; /* S + A */ + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_ADDR16_LO: /* 4 */ - dest16=(unsigned short *)(secp+rel->r_offset); + break; + case R_PPC_ADDR16_LO: /* 4 */ + dest16 = (unsigned short *)(secp + rel->r_offset); # ifdef ELFDEBUG - dest32=(unsigned long *)(dest16-1); + dest32 = (unsigned long *)(dest16 - 1); # endif # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_ADDR16_LO\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest16=%x\t", dest16 ); - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); + ELFDEBUG("R_PPC_ADDR16_LO\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest16=%x\t", dest16); + ELFDEBUG("*dest16=%8.8x\t", *dest16); # endif - { - unsigned short val; - /* S + A */ - val=(symval+(rel->r_addend))&0xffff; + { + unsigned short val; + + /* S + A */ + val = (symval + (rel->r_addend)) & 0xffff; # ifdef ELFDEBUG - ELFDEBUG("lo16(S+A)=%x\t",val); + ELFDEBUG("lo16(S+A)=%x\t", val); # endif - *dest16=val; /* S + A */ - ppc_flush_icache(dest16); - } + *dest16 = val; /* S + A */ + ppc_flush_icache(dest16); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_ADDR16_HA: /* 6 */ - dest16=(unsigned short *)(secp+rel->r_offset); + break; + case R_PPC_ADDR16_HA: /* 6 */ + dest16 = (unsigned short *)(secp + rel->r_offset); # ifdef ELFDEBUG - dest32=(unsigned long *)(dest16-1); + dest32 = (unsigned long *)(dest16 - 1); # endif # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_ADDR16_HA\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest16=%x\t", dest16 ); - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); + ELFDEBUG("R_PPC_ADDR16_HA\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest16=%x\t", dest16); + ELFDEBUG("*dest16=%8.8x\t", *dest16); # endif - { - unsigned short val; - unsigned short loval; - /* S + A */ - val=((symval+(rel->r_addend))&0xffff0000)>>16; - loval=(symval+(rel->r_addend))&0xffff; - if( loval & 0x8000 ) { - /* - * This is hi16(), instead of uhi16(). Because of this, - * if the lo16() will produce a negative offset, then - * we have to increment this part of the address to get - * the correct final result. - */ - val++; - } + { + unsigned short val; + unsigned short loval; + + /* S + A */ + val = ((symval + (rel->r_addend)) & 0xffff0000) >> 16; + loval = (symval + (rel->r_addend)) & 0xffff; + if (loval & 0x8000) { + /* + * This is hi16(), instead of uhi16(). Because of this, + * if the lo16() will produce a negative offset, then + * we have to increment this part of the address to get + * the correct final result. + */ + val++; + } # ifdef ELFDEBUG - ELFDEBUG("hi16(S+A)=%x\t",val); + ELFDEBUG("hi16(S+A)=%x\t", val); # endif - *dest16=val; /* S + A */ - ppc_flush_icache(dest16); - } + *dest16 = val; /* S + A */ + ppc_flush_icache(dest16); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest16=%8.8x\t", *dest16 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest16=%8.8x\t", *dest16); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_REL24: /* 10 */ - dest32=(unsigned int *)(secp+rel->r_offset); + break; + case R_PPC_REL24: /* 10 */ + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_REL24 %s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\t", *dest32 ); + ELFDEBUG("R_PPC_REL24 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8x\t", *dest32); # endif - { - unsigned long val; - - /* S + A - P >> 2 */ - val=((symval+(rel->r_addend)-(Elf_Addr)dest32)); + { + unsigned long val; + + /* S + A - P >> 2 */ + val = ((symval + (rel->r_addend) - (Elf_Addr) dest32)); # ifdef ELFDEBUG - ELFDEBUG("S+A-P=%x\t",val); + ELFDEBUG("S+A-P=%x\t", val); # endif - val = val>>2; - if( (val & 0x3f000000) != 0x3f000000 && - (val & 0x3f000000) != 0x00000000 ) { + val = val >> 2; + if ((val & 0x3f000000) != 0x3f000000 && + (val & 0x3f000000) != 0x00000000) { # ifdef ELFDEBUG - ELFDEBUG("R_PPC_REL24 offset %x too large\n", val<<2); + ELFDEBUG("R_PPC_REL24 offset %x too large\n", val << 2); # endif - symval = ElfGetPltAddr(elffile,ELF_R_SYM(rel->r_info)); - val=((symval+(rel->r_addend)-(Elf_Addr)dest32)); + symval = ElfGetPltAddr(elffile, ELF_R_SYM(rel->r_info)); + val = ((symval + (rel->r_addend) - (Elf_Addr) dest32)); # ifdef ELFDEBUG - ELFDEBUG("PLT offset is %x\n", val); + ELFDEBUG("PLT offset is %x\n", val); # endif - val=val>>2; - if( (val & 0x3f000000) != 0x3f000000 && - (val & 0x3f000000) != 0x00000000 ) - FatalError("R_PPC_REL24 PLT offset %x too large\n", val<<2); - } - val &= 0x00ffffff; - (*dest32)|=(val<<2); /* The address part is always 0 */ - ppc_flush_icache(dest32); + val = val >> 2; + if ((val & 0x3f000000) != 0x3f000000 && + (val & 0x3f000000) != 0x00000000) + FatalError("R_PPC_REL24 PLT offset %x too large\n", + val << 2); } + val &= 0x00ffffff; + (*dest32) |= (val << 2); /* The address part is always 0 */ + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; - case R_PPC_REL32: /* 26 */ - dest32=(unsigned int *)(secp+rel->r_offset); + break; + case R_PPC_REL32: /* 26 */ + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_PPC_REL32\t" ); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%x\t", symval ); - ELFDEBUG( "r_addend=%x\t", rel->r_addend ); - ELFDEBUG( "dest32=%8.8x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("R_PPC_REL32\t"); + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%x\t", symval); + ELFDEBUG("r_addend=%x\t", rel->r_addend); + ELFDEBUG("dest32=%8.8x\t", dest32); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - { - unsigned long val; - /* S + A - P */ - val=symval+(rel->r_addend); - val-=*dest32; + { + unsigned long val; + + /* S + A - P */ + val = symval + (rel->r_addend); + val -= *dest32; # ifdef ELFDEBUG - ELFDEBUG("S+A=%x\t",val); - ELFDEBUG("S+A-P=%x\t",val+(*dest32)-(Elf_Addr)dest32); + ELFDEBUG("S+A=%x\t", val); + ELFDEBUG("S+A-P=%x\t", val + (*dest32) - (Elf_Addr) dest32); # endif - *dest32=val+(*dest32)-(Elf_Addr)dest32; /* S + A - P */ - ppc_flush_icache(dest32); - } + *dest32 = val + (*dest32) - (Elf_Addr) dest32; /* S + A - P */ + ppc_flush_icache(dest32); + } # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8x\n", *dest32 ); + ELFDEBUG("*dest32=%8.8x\n", *dest32); # endif - break; -# endif /* PowerMAX_OS */ + break; +# endif /* PowerMAX_OS */ #endif /* __powerpc__ */ #ifdef __sparc__ - case R_SPARC_NONE: /* 0 */ - break; + case R_SPARC_NONE: /* 0 */ + break; - case R_SPARC_8: /* 1 */ - dest8 = (unsigned char *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest8 = symval; - break; + case R_SPARC_8: /* 1 */ + dest8 = (unsigned char *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest8 = symval; + break; - case R_SPARC_16: /* 2 */ - dest16 = (unsigned short *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest16 = symval; - break; + case R_SPARC_16: /* 2 */ + dest16 = (unsigned short *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest16 = symval; + break; - case R_SPARC_32: /* 3 */ - case R_SPARC_GLOB_DAT: /* 20 */ - case R_SPARC_UA32: /* 23 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24); - ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16); - ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8); - ((unsigned char *)dest32)[3] = (unsigned char)(symval ); - break; + case R_SPARC_32: /* 3 */ + case R_SPARC_UA32: /* 23 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24); + ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16); + ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8); + ((unsigned char *)dest32)[3] = (unsigned char)(symval); + break; - case R_SPARC_DISP8: /* 4 */ - dest8 = (unsigned char *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest8 = (symval - (Elf32_Addr) dest8); - break; + case R_SPARC_GLOB_DAT: /* 20 */ + case R_SPARC_64: /* 32 */ + dest64 = (unsigned long *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest64 = symval; + break; - case R_SPARC_DISP16: /* 5 */ - dest16 = (unsigned short *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest16 = (symval - (Elf32_Addr) dest16); - break; + case R_SPARC_DISP8: /* 4 */ + dest8 = (unsigned char *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest8 = (symval - (Elf_Addr) dest8); + break; - case R_SPARC_DISP32: /* 6 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = (symval - (Elf32_Addr) dest32); - break; + case R_SPARC_DISP16: /* 5 */ + dest16 = (unsigned short *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest16 = (symval - (Elf_Addr) dest16); + break; - case R_SPARC_WDISP30: /* 7 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = ((*dest32 & 0xc0000000) | - ((symval - (Elf32_Addr) dest32) >> 2)); - break; + case R_SPARC_DISP32: /* 6 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest32 = (symval - (Elf_Addr) dest32); + break; - case R_SPARC_HI22: /* 9 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = (*dest32 & 0xffc00000) | (symval >> 10); - break; + case R_SPARC_WDISP30: /* 7 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest32 = ((*dest32 & 0xc0000000) | + (((symval - (Elf_Addr) dest32) >> 2) & 0x3fffffff)); + break; - case R_SPARC_LO10: /* 12 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff); - break; + case R_SPARC_HI22: /* 9 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest32 = (*dest32 & 0xffc00000) | (symval >> 10); + break; - case R_SPARC_COPY: /* 19 */ - /* Fix your code... I'd rather dish out an error here - * so people will not link together PIC and non-PIC - * code into a final driver object file. - */ - ErrorF("Elf_RelocateEntry():" - " Copy relocs not supported on Sparc.\n"); - break; + case R_SPARC_LO10: /* 12 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff); + break; - case R_SPARC_JMP_SLOT: /* 21 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - /* Before we change it the PLT entry looks like: - * - * pltent: sethi %hi(rela_plt_offset), %g1 - * b,a PLT0 - * nop - * - * We change it into: - * - * pltent: sethi %hi(rela_plt_offset), %g1 - * sethi %hi(symval), %g1 - * jmp %g1 + %lo(symval), %g0 - */ - symval += rel->r_addend; - dest32[2] = 0x81c06000 | (symval & 0x3ff); - __asm __volatile("flush %0 + 0x8" : : "r" (dest32)); - dest32[1] = 0x03000000 | (symval >> 10); - __asm __volatile("flush %0 + 0x4" : : "r" (dest32)); - break; + case R_SPARC_COPY: /* 19 */ + /* Fix your code... I'd rather dish out an error here + * so people will not link together PIC and non-PIC + * code into a final driver object file. + */ + ErrorF("Elf_RelocateEntry():" + " Copy relocs not supported on Sparc.\n"); + break; - case R_SPARC_RELATIVE: /* 22 */ - dest32 = (unsigned int *)(secp + rel->r_offset); - *dest32 += (unsigned int)secp + rel->r_addend; - break; + case R_SPARC_JMP_SLOT: /* 21 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + /* Before we change it the PLT entry looks like: + * + * pltent: sethi %hi(rela_plt_offset), %g1 + * b,a PLT0 + * nop + * + * We change it into: + * + * pltent: sethi %hi(rela_plt_offset), %g1 + * sethi %hi(symval), %g1 + * jmp %g1 + %lo(symval), %g0 + */ + symval += rel->r_addend; + dest32[2] = 0x81c06000 | (symval & 0x3ff); + __asm __volatile("flush %0 + 0x8"::"r"(dest32)); + + dest32[1] = 0x03000000 | (symval >> 10); + __asm __volatile("flush %0 + 0x4"::"r"(dest32)); + + break; + + case R_SPARC_RELATIVE: /* 22 */ + dest64 = (unsigned long *)(secp + rel->r_offset); + *dest64 = (unsigned long)secp + rel->r_addend; + break; #endif /*__sparc__*/ #ifdef __ia64__ - case R_IA64_NONE: - break; + case R_IA64_NONE: + break; - case R_IA64_LTOFF_FPTR22: - if (rel->r_addend) - FatalError("\nAddend for R_IA64_LTOFF_FPTR22 not supported\n"); + case R_IA64_LTOFF_FPTR22: + if (rel->r_addend) + FatalError("\nAddend for R_IA64_LTOFF_FPTR22 not supported\n"); # ifdef ELFDEBUG - ELFDEBUG( "opd=%016lx.%016lx\n", - ((long *)symval)[0], ((long *)symval)[1] ); + ELFDEBUG("opd=%016lx.%016lx\n", + ((long *)symval)[0], ((long *)symval)[1]); # endif - /* FALLTHROUGH */ - case R_IA64_LTOFF22: - { + /* FALLTHROUGH */ + case R_IA64_LTOFF22: +#ifndef IA64_LDX_OPTIMIZATION + case R_IA64_LTOFF22X: /* If not implementing LDXMOV optimization treat LTOFF22X as LTOFF22 */ +#endif + { ELFGotEntryPtr gotent; - dest128=(unsigned long *)(secp+(rel->r_offset&~3)); -# ifdef ELFDEBUG - ELFDEBUG( "%s %s\t", ELF_R_TYPE(rel->r_info) == R_IA64_LTOFF22 ? - "R_IA64_LTOFF22" : "R_IA64_LTOFF_FPTR22", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest128=%lx\t", dest128 ); - ELFDEBUG( "slot=%d\n", rel->r_offset & 3); - ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); -# endif - for (gotent=elffile->got_entries;gotent;gotent=gotent->next) { - if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) && - gotent->rel->r_addend == rel->r_addend ) - break; + dest128 = (unsigned long *)(secp + (rel->r_offset & ~3)); +# ifdef ELFDEBUG + ELFDEBUG("%s %s\t", ELF_R_TYPE(rel->r_info) == R_IA64_LTOFF22 ? + "R_IA64_LTOFF22" : "R_IA64_LTOFF_FPTR22", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest128=%lx\t", dest128); + ELFDEBUG("slot=%d\n", rel->r_offset & 3); + ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); +# endif + + for (gotent = elffile->got_entries; gotent; gotent = gotent->next) { + if (ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) + && gotent->rel->r_addend == rel->r_addend) + break; } /* Set the address in the GOT */ - if( gotent ) { - *(unsigned long *)(elffile->got+gotent->offset) = - symval+rel->r_addend; + if (gotent) { + *(unsigned long *)(elffile->got + gotent->offset) = + symval + rel->r_addend; # ifdef ELFDEBUG ELFDEBUG("Setting gotent[%x]=%lx\n", - gotent->offset, symval+rel->r_addend); + gotent->offset, symval + rel->r_addend); # endif if ((gotent->offset & 0xffe00000) != 0) FatalError("\nR_IA64_LTOFF22 offset %x too large\n", gotent->offset); - IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22, gotent->offset); - } - else + IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22, + gotent->offset); + } else FatalError("\nCould not find GOT entry\n"); - } - break; + } + break; - case R_IA64_PCREL21B: - { + case R_IA64_PCREL21B: + { ELFPltEntryPtr pltent; - dest128=(unsigned long *)(secp+(rel->r_offset&~3)); + + dest128 = (unsigned long *)(secp + (rel->r_offset & ~3)); # ifdef ELFDEBUG - ELFDEBUG( "R_IA64_PCREL21B %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "opd=%lx.%lx\t", ((long *)symval)[0], ((long *)symval)[1]); - ELFDEBUG( "dest128=%lx\t", dest128 ); - ELFDEBUG( "slot=%d\n", rel->r_offset & 3); - ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); + ELFDEBUG("R_IA64_PCREL21B %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("opd=%lx.%lx\t", ((long *)symval)[0], + ((long *)symval)[1]); + ELFDEBUG("dest128=%lx\t", dest128); + ELFDEBUG("slot=%d\n", rel->r_offset & 3); + ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); # endif if (rel->r_addend) FatalError("\nAddend for PCREL21B not supported\n"); if (((long *)symval)[1] == (long)elffile->got - && (((unsigned long)dest128 - ((unsigned long *)symval)[0]) + 0x2000000 < 0x4000000)) { + && (((unsigned long)dest128 - ((unsigned long *)symval)[0]) + + 0x2000000 < 0x4000000)) { /* We can save the travel through PLT */ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C, - ((unsigned long *)symval)[0] - (unsigned long)dest128); + ((unsigned long *)symval)[0] - + (unsigned long)dest128); break; } - for (pltent=elffile->plt_entries;pltent;pltent=pltent->next) { - if ( ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info) && - pltent->rel->r_addend == rel->r_addend ) - break; + for (pltent = elffile->plt_entries; pltent; pltent = pltent->next) { + if (ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info) + && pltent->rel->r_addend == rel->r_addend) + break; } /* Set the address in the PLT */ if (pltent == NULL) FatalError("\nCould not find PLT entry\n"); else { - unsigned long *p = (unsigned long *)(elffile->plt+pltent->offset); - unsigned long r = (unsigned long)symval - (unsigned long)elffile->got; + unsigned long *p = + (unsigned long *)(elffile->plt + pltent->offset); + unsigned long r = + (unsigned long)symval - (unsigned long)elffile->got; if (r + 0x200000 >= 0x400000) { - /* Too far from gp to use the official function descriptor, - * so we have to make a local one. - */ - r = pltent->gotoffset; - memcpy(elffile->got+r, (char *)symval, 16); + /* Too far from gp to use the official function descriptor, + * so we have to make a local one. + */ + r = pltent->gotoffset; + memcpy(elffile->got + r, (char *)symval, 16); } /* [MMI] addl r15=NNN,r1;; ld8 r16=[r15],8; mov r14=r1;; */ @@ -2147,162 +2248,262 @@ int force; IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C, (unsigned long)p - (unsigned long)dest128); } - } - break; + } + break; + + case R_IA64_FPTR64LSB: + dest64 = (unsigned long *)(secp + rel->r_offset); +# ifdef ELFDEBUG + ELFDEBUG("R_IA64_FPTR64LSB %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest64=%lx\t", dest64); + ELFDEBUG("opd=%016lx.%016lx\n", ((long *)symval)[0], + ((long *)symval)[1]); +# endif + + if (rel->r_addend) + FatalError("\nAddend not supported for R_IA64_FPTR64LSB\n"); + *dest64 = symval; + ia64_flush_cache(dest64); + break; + + case R_IA64_DIR64LSB: + dest64 = (unsigned long *)(secp + rel->r_offset); +# ifdef ELFDEBUG + ELFDEBUG("R_IA64_DIR64LSB %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest64=%lx\n", dest64); +# endif + *dest64 = symval + rel->r_addend; + ia64_flush_cache(dest64); + break; + + case R_IA64_PCREL64LSB: + dest64 = (unsigned long *)(secp + rel->r_offset); +#ifdef ELFDEBUG + ELFDEBUG("R_IA64_PCREL64LSB %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest64=%lx\n", dest64); +#endif + *dest64 = symval + rel->r_addend - (unsigned long)dest64; + break; + + case R_IA64_GPREL22: + dest128 = (unsigned long *)(secp + (rel->r_offset & ~3)); +# ifdef ELFDEBUG + ELFDEBUG("R_IA64_GPREL22 %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest128=%lx\t", dest128); + ELFDEBUG("slot=%d\n", rel->r_offset & 3); + ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); +# endif + IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22, + symval + rel->r_addend - (long)elffile->got); + break; + +#ifdef IA64_LDX_OPTIMIZATION + case R_IA64_LTOFF22X: + { + ELFGotEntryPtr gotent; + long gp_offset = symval + rel->r_addend - (long)elffile->got; + + dest128 = (unsigned long *)(secp + (rel->r_offset & ~3)); - case R_IA64_FPTR64LSB: - dest64=(unsigned long *)(secp+rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_IA64_FPTR64LSB %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest64=%lx\t", dest64 ); - ELFDEBUG( "opd=%016lx.%016lx\n", ((long *)symval)[0], ((long *)symval)[1] ); + ELFDEBUG("R_IA64_LTOFF22X %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest128=%lx\t", dest128); + ELFDEBUG("slot=%d\n", rel->r_offset & 3); # endif - if (rel->r_addend) - FatalError("\nAddend not supported for R_IA64_FPTR64LSB\n"); - *dest64 = symval; - ia64_flush_cache(dest64); - break; + if (gp_offset << 42 >> 42 != gp_offset) { + /* Offset is too large for LTOFF22X, + * fallback to using GOT lookup, e.g. LTOFF22. + * Note: LDXMOV will fail the same test and will be ignored. */ - case R_IA64_DIR64LSB: - dest64=(unsigned long *)(secp+rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_IA64_DIR64LSB %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest64=%lx\n", dest64 ); + ELFDEBUG("gp_offset=%ld too large, using GOT instead (LTOFF22)\n", gp_offset); # endif - *dest64 = symval + rel->r_addend; - ia64_flush_cache(dest64); - break; - case R_IA64_PCREL64LSB: - dest64=(unsigned long *)(secp+rel->r_offset); -#ifdef ELFDEBUG - ELFDEBUG( "R_IA64_PCREL64LSB %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest64=%lx\n", dest64 ); -#endif - *dest64 = symval + rel->r_addend - (unsigned long)dest64; - break; + for (gotent = elffile->got_entries; gotent; + gotent = gotent->next) { + if (ELF_R_SYM(gotent->rel->r_info) == + ELF_R_SYM(rel->r_info) + && gotent->rel->r_addend == rel->r_addend) + break; + } - case R_IA64_GPREL22: - dest128=(unsigned long *)(secp+(rel->r_offset&~3)); + /* Set the address in the GOT */ + if (gotent) { + *(unsigned long *)(elffile->got + gotent->offset) = + symval + rel->r_addend; +# ifdef ELFDEBUG + ELFDEBUG("Setting gotent[%x]=%lx\n", gotent->offset, + symval + rel->r_addend); +# endif + if ((gotent->offset & 0xffe00000) != 0) + FatalError("\nR_IA64_LTOFF22 offset %x too large\n", + gotent->offset); + } else { + FatalError("\nCould not find GOT entry\n"); + } + gp_offset = gotent->offset; /* Use GOT lookup */ + } else { # ifdef ELFDEBUG - ELFDEBUG( "R_IA64_GPREL22 %s\t", - ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); - ELFDEBUG( "secp=%lx\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest128=%lx\t", dest128 ); - ELFDEBUG( "slot=%d\n", rel->r_offset & 3); - ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); + ELFDEBUG("using gp_offset=%ld (LTOFF22X)", gp_offset); # endif + } IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22, - symval + rel->r_addend - (long)elffile->got); - break; + gp_offset); + } + break; +#endif + + case R_IA64_LDXMOV: +# ifdef ELFDEBUG + ELFDEBUG("R_IA64_LDXMOV %s\t", + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); +# endif + +#ifdef IA64_LDX_OPTIMIZATION + { + long gp_offset = symval + rel->r_addend - (long)elffile->got; + + dest128 = (unsigned long *)(secp + (rel->r_offset & ~3)); + + if (gp_offset << 42 >> 42 != gp_offset) { + /* Offset is too large for LTOFF22X, ignore this relocation */ +# ifdef ELFDEBUG + ELFDEBUG("offset = %ld too large, ignoring\n", gp_offset); +# endif + } else { + +# ifdef ELFDEBUG + ELFDEBUG("secp=%lx\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest128=%lx\t", dest128); + ELFDEBUG("slot=%d\n", rel->r_offset & 3); + ELFDEBUG("offset=%ld\n", gp_offset); + ELFDEBUG("*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]); +# endif + + IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_LDXMOV, + 0); + } + } +#endif + break; #endif /*__ia64__*/ #if defined(__arm__) - case R_ARM_ABS32: - dest32=(unsigned int *)(secp+rel->r_offset); + case R_ARM_ABS32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - ELFDEBUG( "R_ARM_ABS32\t"); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); + ELFDEBUG("R_ARM_ABS32\t"); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8lx\t", *dest32); # endif - *dest32=symval+(*dest32); /* S + A */ + *dest32 = symval + (*dest32); /* S + A */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8lx\n", *dest32); # endif - break; + break; - case R_ARM_REL32: - dest32=(unsigned int *)(secp+rel->r_offset); + case R_ARM_REL32: + dest32 = (unsigned int *)(secp + rel->r_offset); # ifdef ELFDEBUG - { + { char *namestr; - ELFDEBUG( "R_ARM_REL32 %s\t", - namestr=ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) ); + + ELFDEBUG("R_ARM_REL32 %s\t", + namestr = + ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info))); xf86loaderfree(namestr); - ELFDEBUG( "secp=%x\t", secp ); - ELFDEBUG( "symval=%lx\t", symval ); - ELFDEBUG( "dest32=%x\t", dest32 ); - ELFDEBUG( "*dest32=%8.8lx\t", *dest32 ); - } + ELFDEBUG("secp=%x\t", secp); + ELFDEBUG("symval=%lx\t", symval); + ELFDEBUG("dest32=%x\t", dest32); + ELFDEBUG("*dest32=%8.8lx\t", *dest32); + } # endif - *dest32=symval+(*dest32)-(Elf_Addr)dest32; /* S + A - P */ + *dest32 = symval + (*dest32) - (Elf_Addr) dest32; /* S + A - P */ # ifdef ELFDEBUG - ELFDEBUG( "*dest32=%8.8lx\n", *dest32 ); + ELFDEBUG("*dest32=%8.8lx\n", *dest32); # endif - break; + break; - case R_ARM_PC24: - { + case R_ARM_PC24: + { unsigned long val; - dest32=(unsigned int *)(secp+rel->r_offset); + + dest32 = (unsigned int *)(secp + rel->r_offset); val = (*dest32 & 0x00ffffff) << 2; - val = symval - (unsigned long)dest32 + val; - val >>= 2; - *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff); + val = symval - (unsigned long)dest32 + val; + val >>= 2; + *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff); #ifdef NOTYET arm_flush_cache(dest32); #endif - } - break; + } + break; #endif /* (__arm__) */ - default: - ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n", - ELF_R_TYPE(rel->r_info)); - break; - } + default: + ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n", + (int)ELF_R_TYPE(rel->r_info)); + break; + } return 0; } static ELFRelocPtr ELFCollectRelocations(elffile, index) -ELFModulePtr elffile; -int index; /* The section to use as relocation data */ + ELFModulePtr elffile; + int index; /* The section to use as relocation data */ { - int i, numrel; - Elf_Shdr *sect=&(elffile->sections[index]); - Elf_Rel_t *rel=(Elf_Rel_t *)elffile->saddr[index]; - Elf_Sym *syms; + int i, numrel; + Elf_Shdr *sect = &(elffile->sections[index]); + Elf_Rel_t *rel = (Elf_Rel_t *) elffile->saddr[index]; ELFRelocPtr reloc_head = NULL; ELFRelocPtr tmp; - syms = (Elf_Sym *) elffile->saddr[elffile->symndx]; + numrel = sect->sh_size / sect->sh_entsize; - numrel=sect->sh_size/sect->sh_entsize; - - for(i=0; i<numrel; i++ ) { + for (i = 0; i < numrel; i++) { #if defined(__alpha__) - if( ELF_R_TYPE(rel[i].r_info) == R_ALPHA_LITERAL) { - ElfAddGOT(elffile,&rel[i]); - } + if (ELF_R_TYPE(rel[i].r_info) == R_ALPHA_LITERAL) { + ElfAddGOT(elffile, &rel[i]); + } #endif #if defined(__ia64__) if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF22 + || ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF22X || ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22) { - ElfAddGOT(elffile,&rel[i]); + ElfAddGOT(elffile, &rel[i]); } if (ELF_R_TYPE(rel[i].r_info) == R_IA64_PCREL21B) { - ElfAddPLT(elffile,&rel[i]); + ElfAddPLT(elffile, &rel[i]); } if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22 || ELF_R_TYPE(rel[i].r_info) == R_IA64_FPTR64LSB) { - if (ELF_ST_BIND(syms[ELF_R_SYM(rel[i].r_info)].st_info) == STB_LOCAL) { + Elf_Sym *syms = (Elf_Sym *) elffile->saddr[elffile->symndx]; + + if (ELF_ST_BIND(syms[ELF_R_SYM(rel[i].r_info)].st_info) == + STB_LOCAL) { ElfAddOPD(elffile, ELF_R_SYM(rel[i].r_info), NULL); } } @@ -2322,110 +2523,109 @@ int index; /* The section to use as relocation data */ */ static LOOKUP * -ELF_GetSymbols(elffile, psecttable) -ELFModulePtr elffile; -unsigned short **psecttable; +ELF_GetSymbols(ELFModulePtr elffile, unsigned short **psecttable) { - Elf_Sym *syms; - Elf_Shdr *sect; - int i, l, numsyms; - LOOKUP *lookup, *p; + Elf_Sym *syms; + Elf_Shdr *sect; + int i, l, numsyms; + LOOKUP *lookup, *p; ELFCommonPtr tmp; unsigned short *secttable; - syms=elffile->symtab; - sect=&(elffile->sections[elffile->symndx]); - numsyms=sect->sh_size/sect->sh_entsize; + syms = elffile->symtab; + sect = &(elffile->sections[elffile->symndx]); + numsyms = sect->sh_size / sect->sh_entsize; - if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) + if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) return 0; - if ((secttable = xf86loadercalloc(sizeof(unsigned short),(numsyms+1))) == NULL) { + if ((secttable = + xf86loadercalloc(sizeof(unsigned short), (numsyms + 1))) == NULL) { xf86loaderfree(lookup); return 0; } *psecttable = secttable; - for(i=0,l=0; i<numsyms; i++) - { + for (i = 0, l = 0; i < numsyms; i++) { #ifdef ELFDEBUG - ELFDEBUG("value=%lx\tsize=%lx\tBIND=%x\tTYPE=%x\tndx=%x\t%s\n", - syms[i].st_value,syms[i].st_size, - ELF_ST_BIND(syms[i].st_info),ELF_ST_TYPE(syms[i].st_info), - syms[i].st_shndx,ElfGetString(elffile,syms[i].st_name) ); + ELFDEBUG("value=%lx\tsize=%lx\tBIND=%x\tTYPE=%x\tndx=%x\t%s\n", + (unsigned long)syms[i].st_value, + (unsigned long)syms[i].st_size, + ELF_ST_BIND(syms[i].st_info), ELF_ST_TYPE(syms[i].st_info), + syms[i].st_shndx, ElfGetString(elffile, syms[i].st_name)); #endif - if( ELF_ST_BIND(syms[i].st_info) == STB_LOCAL ) - /* Don't add static symbols to the symbol table */ - continue; + if (ELF_ST_BIND(syms[i].st_info) == STB_LOCAL) + /* Don't add static symbols to the symbol table */ + continue; - switch( ELF_ST_TYPE(syms[i].st_info) ) - { - case STT_OBJECT: - case STT_FUNC: - case STT_SECTION: - case STT_NOTYPE: - switch(syms[i].st_shndx) - { - case SHN_ABS: - ErrorF("ELF_GetSymbols() Don't know how to handle SHN_ABS\n" ); - break; - case SHN_COMMON: + switch (ELF_ST_TYPE(syms[i].st_info)) { + case STT_OBJECT: + case STT_FUNC: + case STT_SECTION: + case STT_NOTYPE: + switch (syms[i].st_shndx) { + case SHN_ABS: + ErrorF("ELF_GetSymbols() Don't know how to handle SHN_ABS\n"); + break; + case SHN_COMMON: #ifdef ELFDEBUG - ELFDEBUG("Adding COMMON space for %s\n", - ElfGetString(elffile,syms[i].st_name) ); -#endif - if (!LoaderHashFind(ElfGetString(elffile, - syms[i].st_name))) { - tmp = ElfAddCOMMON(&(syms[i])); - if (tmp) { - tmp->next = listCOMMON; - listCOMMON = tmp; - } - } - break; - case SHN_UNDEF: - /* - * UNDEF will get resolved later, so the value - * doesn't really matter here. - */ - /* since we don't know the value don't advertise the symbol */ - break; - default: - lookup[l].symName=xf86loaderstrdup(ElfGetString(elffile,syms[i].st_name)); - lookup[l].offset=(funcptr)syms[i].st_value; - secttable[l] = syms[i].st_shndx; + ELFDEBUG("Adding COMMON space for %s\n", + ElfGetString(elffile, syms[i].st_name)); +#endif + if (!LoaderHashFind(ElfGetString(elffile, syms[i].st_name))) { + tmp = ElfAddCOMMON(&(syms[i])); + if (tmp) { + tmp->next = listCOMMON; + listCOMMON = tmp; + } + } + break; + case SHN_UNDEF: + /* + * UNDEF will get resolved later, so the value + * doesn't really matter here. + */ + /* since we don't know the value don't advertise the symbol */ + break; + default: + lookup[l].symName = + xf86loaderstrdup(ElfGetString + (elffile, syms[i].st_name)); + lookup[l].offset = (funcptr) syms[i].st_value; + secttable[l] = syms[i].st_shndx; #ifdef ELFDEBUG - ELFDEBUG("Adding symbol %lx(%d) %s\n", - lookup[l].offset, secttable[l], lookup[l].symName ); + ELFDEBUG("Adding symbol %lx(%d) %s\n", + (unsigned long)lookup[l].offset, secttable[l], + lookup[l].symName); #endif #ifdef __ia64__ - if ( ELF_ST_TYPE(syms[i].st_info) == STT_FUNC ) { - ElfAddOPD(elffile, -1, &lookup[l]); - } + if (ELF_ST_TYPE(syms[i].st_info) == STT_FUNC) { + ElfAddOPD(elffile, -1, &lookup[l]); + } #endif - l++; - break; - } - break; - case STT_FILE: - case STT_LOPROC: - case STT_HIPROC: - /* Skip this type */ + l++; + break; + } + break; + case STT_FILE: + case STT_LOPROC: + case STT_HIPROC: + /* Skip this type */ #ifdef ELFDEBUG - ELFDEBUG("Skipping TYPE %d %s\n", - ELF_ST_TYPE(syms[i].st_info), - ElfGetString(elffile,syms[i].st_name)); + ELFDEBUG("Skipping TYPE %d %s\n", + ELF_ST_TYPE(syms[i].st_info), + ElfGetString(elffile, syms[i].st_name)); #endif - break; - default: - ErrorF("ELF_GetSymbols(): Unepected symbol type %d\n", - ELF_ST_TYPE(syms[i].st_info) ); - break; - } + break; + default: + ErrorF("ELF_GetSymbols(): Unepected symbol type %d\n", + ELF_ST_TYPE(syms[i].st_info)); + break; } + } - lookup[l].symName=NULL; /* Terminate the list */ + lookup[l].symName = NULL; /* Terminate the list */ /* * Remove the ELF symbols that will show up in every object module. @@ -2436,8 +2636,10 @@ unsigned short **psecttable; || !strcmp(lookup[i].symName, ".bss") || !strcmp(lookup[i].symName, ".comment") || !strcmp(lookup[i].symName, ".note") - ) { - memmove(&(lookup[i]), &(lookup[i+1]), (l-- - i) * sizeof (LOOKUP)); + ) { + memmove(&(lookup[i]), &(lookup[i + 1]), (l - i) * sizeof(LOOKUP)); + memmove(&(secttable[i]), &(secttable[i + 1]), + (l-- - i) * sizeof(unsigned short)); } } return lookup; @@ -2466,105 +2668,106 @@ unsigned short **psecttable; * Do the work required to load each section into memory. */ static void -ELFCollectSections(elffile,pass,totalsize,maxalign) -ELFModulePtr elffile; -int pass; -int *totalsize; -int *maxalign; +ELFCollectSections(ELFModulePtr elffile, int pass, int *totalsize, + int *maxalign) { - int i; + int i; int j; + /* * Find and identify all of the Sections */ j = elffile->lsectidx; - for( i=1; i<elffile->numsh; i++) { + for (i = 1; i < elffile->numsh; i++) { int flags = 0; char *name = ElfGetSectionName(elffile, elffile->sections[i].sh_name); #if defined(__alpha__) || defined(__ia64__) - if (!strcmp(name,".got") /*Isn't there a more generic way to do this?*/ + if (!strcmp(name, ".got") /*Isn't there a more generic way to do this? */ # if defined(__ia64__) - || !strcmp(name,".plt") || !strcmp(name, ".IA_64.unwind_info") + || !strcmp(name, ".plt") || !strcmp(name, ".IA_64.unwind_info") # endif - ) continue; + ) + continue; #endif switch (SecType(i)) { case SHT_STRTAB: - if (!strcmp(name,".shstrtab")) /* already loaded */ + if (!strcmp(name, ".shstrtab")) /* already loaded */ continue; - if (!strcmp(name,".stabstr")) /* ignore debug info */ + if (!strcmp(name, ".stabstr")) /* ignore debug info */ continue; case SHT_SYMTAB: - if (pass) continue; + if (pass) + continue; flags = LOADED_SECTION; flags |= RELOC_SECTION; break; case SHT_REL: case SHT_RELA: - if (pass) continue; - if (! (SecFlags(SecInfo(i)) & SHF_ALLOC)) - continue; + if (pass) + continue; + if (!(SecFlags(SecInfo(i)) & SHF_ALLOC)) + continue; #ifdef __ia64__ if (SecType(SecInfo(i)) == SHT_IA_64_UNWIND) - continue; + continue; #endif - flags = LOADED_SECTION; - flags |= RELOC_SECTION; - break; + flags = LOADED_SECTION; + flags |= RELOC_SECTION; + break; case SHT_PROGBITS: flags |= LOADED_SECTION; case SHT_NOBITS: - if (! (elffile->sections[i].sh_flags & SHF_ALLOC)) + if (!(elffile->sections[i].sh_flags & SHF_ALLOC)) continue; AdjustSize(i); break; default: #ifdef ELFDEBUG if (pass) - ELFDEBUG("ELF: Not loading %s\n",name); + ELFDEBUG("ELF: Not loading %s\n", name); #endif continue; } - + elffile->lsection = xf86loaderrealloc(elffile->lsection, - (j + 1) * sizeof (LoadSection)); + (j + 1) * sizeof(LoadSection)); if (!(flags & RELOC_SECTION)) { - if (flags & LOADED_SECTION) { - elffile->lsection[j].saddr /* sect. contains data */ - = ELFLoaderSectToMem(elffile,SecAlign(i),SecOffset(i), - SecSize(i), name); + if (flags & LOADED_SECTION) { + elffile->lsection[j].saddr /* sect. contains data */ + = ELFLoaderSectToMem(elffile, SecAlign(i), + SecOffset(i), SecSize(i), name); } else { - if( SecSize(i) ) - elffile->lsection[j].saddr - = ELFLoaderSectCalloc(elffile,SecAlign(i), - SecSize(i)); - else + if (SecSize(i)) + elffile->lsection[j].saddr + = ELFLoaderSectCalloc(elffile, SecAlign(i), + SecSize(i)); + else elffile->lsection[j].saddr = NULL; } } else { elffile->lsection[j].saddr = - (Elf_Sym *)_LoaderFileToMem(elffile->fd,SecOffset(i), - SecSize(i),name); + (Elf_Sym *) _LoaderFileToMem(elffile->fd, SecOffset(i), + SecSize(i), name); } - elffile->saddr[i]=elffile->lsection[j].saddr; + elffile->saddr[i] = elffile->lsection[j].saddr; #ifdef ELFDEBUG - ELFDEBUG("%s starts at %lx size: %lx\n", - name, elffile->saddr[i], SecSize(i)); -#endif - elffile->lsection[j].name= name; + ELFDEBUG("%s starts at %p size: %lx\n", + name, elffile->saddr[i], (unsigned long)SecSize(i)); +#endif + elffile->lsection[j].name = name; elffile->lsection[j].ndx = i; - elffile->lsection[j].size=SecSize(i); - elffile->lsection[j].flags=flags; + elffile->lsection[j].size = SecSize(i); + elffile->lsection[j].flags = flags; switch (SecType(i)) { #ifdef __OpenBSD__ case SHT_PROGBITS: - mprotect(elffile->lsection[j].saddr, SecSize(i), - PROT_READ|PROT_WRITE|PROT_EXEC); + mprotect(elffile->lsection[j].saddr, SecSize(i), + PROT_READ | PROT_WRITE | PROT_EXEC); break; #endif case SHT_SYMTAB: - elffile->symtab = (Elf_Sym *)elffile->saddr[i]; + elffile->symtab = (Elf_Sym *) elffile->saddr[i]; elffile->symndx = i; break; case SHT_STRTAB: @@ -2583,20 +2786,17 @@ int *maxalign; * Public API for the ELF implementation of the loader. */ void * -ELFLoadModule(modrec, elffd, ppLookup) -loaderPtr modrec; -int elffd; -LOOKUP **ppLookup; +ELFLoadModule(loaderPtr modrec, int elffd, LOOKUP **ppLookup) { ELFModulePtr elffile; - Elf_Ehdr *header; - ELFRelocPtr elf_reloc, tail; - void *v; + Elf_Ehdr *header; + ELFRelocPtr elf_reloc, tail; + void *v; LDRModulePtr elfmod; - int totalsize, maxalign, i; + int totalsize, maxalign, i; unsigned short *secttable; - LOOKUP *pLookup; - + LOOKUP *pLookup; + ldrCommons = 0; nCommons = 0; @@ -2604,72 +2804,77 @@ LOOKUP **ppLookup; ELFDEBUG("Loading %s %s\n", modrec->name, modrec->cname); #endif if ((elffile = xf86loadercalloc(1, sizeof(ELFModuleRec))) == NULL) { - ErrorF( "Unable to allocate ELFModuleRec\n" ); + ErrorF("Unable to allocate ELFModuleRec\n"); return NULL; } - elffile->handle=modrec->handle; - elffile->module=modrec->module; - elffile->fd=elffd; - v=elffile->funcs=modrec->funcs; + elffile->handle = modrec->handle; + elffile->module = modrec->module; + elffile->fd = elffd; + v = elffile->funcs = modrec->funcs; /* * Get the ELF header */ - elffile->header= - (Elf_Ehdr*)_LoaderFileToMem(elffd, 0, sizeof(Elf_Ehdr), "header"); - header=(Elf_Ehdr *)elffile->header; + elffile->header = + (Elf_Ehdr *) _LoaderFileToMem(elffd, 0, sizeof(Elf_Ehdr), + "header"); + header = (Elf_Ehdr *) elffile->header; /* * Get the section table */ - elffile->numsh=header->e_shnum; - elffile->secsize=(header->e_shentsize * header->e_shnum); - elffile->sections= - (Elf_Shdr *)_LoaderFileToMem(elffd, header->e_shoff, elffile->secsize, - "sections"); + elffile->numsh = header->e_shnum; + elffile->secsize = (header->e_shentsize * header->e_shnum); + elffile->sections = + (Elf_Shdr *) _LoaderFileToMem(elffd, header->e_shoff, + elffile->secsize, "sections"); #if defined(__alpha__) || defined(__ia64__) /* * Need to allocate space for the .got section which will be * fabricated later */ - elffile->gotndx=header->e_shnum; + elffile->gotndx = header->e_shnum; header->e_shnum++; # if defined(__ia64__) - elffile->pltndx=header->e_shnum; + elffile->pltndx = header->e_shnum; header->e_shnum++; # endif - elffile->numsh=header->e_shnum; - elffile->secsize=(header->e_shentsize*header->e_shnum); - elffile->sections=xf86loaderrealloc(elffile->sections,elffile->secsize); -#endif /*defined(__alpha__) || defined(__ia64__)*/ - elffile->saddr=xf86loadercalloc(elffile->numsh, sizeof(unsigned char *)); + elffile->numsh = header->e_shnum; + elffile->secsize = (header->e_shentsize * header->e_shnum); + elffile->sections = + xf86loaderrealloc(elffile->sections, elffile->secsize); +#endif /*defined(__alpha__) || defined(__ia64__) */ + elffile->saddr = + xf86loadercalloc(elffile->numsh, sizeof(unsigned char *)); #if defined(__alpha__) || defined(__ia64__) /* * Manually fill in the entry for the .got section so ELFCollectSections() * will be able to find it. */ - elffile->sections[elffile->gotndx].sh_name=SecSize(header->e_shstrndx)+1; - elffile->sections[elffile->gotndx].sh_type=SHT_PROGBITS; - elffile->sections[elffile->gotndx].sh_flags=SHF_WRITE|SHF_ALLOC; - elffile->sections[elffile->gotndx].sh_size=0; - elffile->sections[elffile->gotndx].sh_addralign=8; + elffile->sections[elffile->gotndx].sh_name = + SecSize(header->e_shstrndx) + 1; + elffile->sections[elffile->gotndx].sh_type = SHT_PROGBITS; + elffile->sections[elffile->gotndx].sh_flags = SHF_WRITE | SHF_ALLOC; + elffile->sections[elffile->gotndx].sh_size = 0; + elffile->sections[elffile->gotndx].sh_addralign = 8; /* Add room to copy ".got", and maintain alignment */ - SecSize(header->e_shstrndx)+=8; + SecSize(header->e_shstrndx) += 8; #endif #if defined(__ia64__) /* * Manually fill in the entry for the .plt section so ELFCollectSections() * will be able to find it. */ - elffile->sections[elffile->pltndx].sh_name=SecSize(header->e_shstrndx)+1; - elffile->sections[elffile->pltndx].sh_type=SHT_PROGBITS; - elffile->sections[elffile->pltndx].sh_flags=SHF_EXECINSTR|SHF_ALLOC; - elffile->sections[elffile->pltndx].sh_size=0; - elffile->sections[elffile->pltndx].sh_addralign=32; + elffile->sections[elffile->pltndx].sh_name = + SecSize(header->e_shstrndx) + 1; + elffile->sections[elffile->pltndx].sh_type = SHT_PROGBITS; + elffile->sections[elffile->pltndx].sh_flags = SHF_EXECINSTR | SHF_ALLOC; + elffile->sections[elffile->pltndx].sh_size = 0; + elffile->sections[elffile->pltndx].sh_addralign = 32; /* Add room to copy ".plt", and maintain alignment */ - SecSize(header->e_shstrndx)+=32; + SecSize(header->e_shstrndx) += 32; #endif /* @@ -2677,22 +2882,22 @@ LOOKUP **ppLookup; */ elffile->shstrsize = SecSize(header->e_shstrndx); elffile->shstraddr = - _LoaderFileToMem(elffd, SecOffset(header->e_shstrndx), - SecSize(header->e_shstrndx), ".shstrtab"); + _LoaderFileToMem(elffd, SecOffset(header->e_shstrndx), + SecSize(header->e_shstrndx), ".shstrtab"); elffile->shstrndx = header->e_shstrndx; #if defined(__alpha__) || defined(__ia64__) /* * Add the string for the .got section */ - strcpy((char*)(elffile->shstraddr+elffile->sections[elffile->gotndx].sh_name), - ".got"); + strcpy((char *)(elffile->shstraddr + + elffile->sections[elffile->gotndx].sh_name), ".got"); #endif #if defined(__ia64__) /* * Add the string for the .plt section */ - strcpy((char*)(elffile->shstraddr+elffile->sections[elffile->pltndx].sh_name), - ".plt"); + strcpy((char *)(elffile->shstraddr + + elffile->sections[elffile->pltndx].sh_name), ".plt"); #endif /* @@ -2701,12 +2906,12 @@ LOOKUP **ppLookup; totalsize = 0; maxalign = 0; ELFCollectSections(elffile, 0, &totalsize, &maxalign); - if( elffile->straddr == NULL || elffile->strsize == 0 ) { + if (elffile->straddr == NULL || elffile->strsize == 0) { #if 0 ErrorF("No symbols found in this module\n"); #endif ELFUnloadModule(elffile); - return (void *) -1L; + return (void *)-1L; } /* * add symbols @@ -2724,10 +2929,9 @@ LOOKUP **ppLookup; default: continue; } - elf_reloc = ELFCollectRelocations(elffile,elffile->lsection[i].ndx); + elf_reloc = ELFCollectRelocations(elffile, elffile->lsection[i].ndx); if (elf_reloc) { - for (tail = elf_reloc; tail->next; tail = tail->next) - ; + for (tail = elf_reloc; tail->next; tail = tail->next) ; tail->next = _LoaderGetRelocations(v)->elf_reloc; _LoaderGetRelocations(v)->elf_reloc = elf_reloc; } @@ -2747,11 +2951,11 @@ LOOKUP **ppLookup; #ifdef MergeSectionAlloc elffile->basesize = totalsize + maxalign; - + # if !defined(DoMMAPedMerge) elffile->base = xf86loadermalloc(elffile->basesize); if (elffile->base == NULL) { - ErrorF( "Unable to allocate ELF sections\n" ); + ErrorF("Unable to allocate ELF sections\n"); return NULL; } # if defined(linux) && defined(__ia64__) || defined(__OpenBSD__) @@ -2759,25 +2963,28 @@ LOOKUP **ppLookup; unsigned long page_size = getpagesize(); unsigned long round; - round = (unsigned long)elffile->base & (page_size-1); - mprotect(elffile->base - round, (elffile->basesize+round+page_size-1) & ~(page_size-1), - PROT_READ|PROT_WRITE|PROT_EXEC); + round = (unsigned long)elffile->base & (page_size - 1); + mprotect(elffile->base - round, + (elffile->basesize + round + page_size - 1) & ~(page_size - + 1), + PROT_READ | PROT_WRITE | PROT_EXEC); } # endif -# else +# else MMAP_ALIGN(elffile->basesize); - elffile->base = mmap( 0,elffile->basesize,MMAP_PROT,MMAP_FLAGS,-1, - (off_t)0); + elffile->base = mmap(0, elffile->basesize, MMAP_PROT, MMAP_FLAGS, -1, + (off_t) 0); if (elffile->base == NULL) { - ErrorF( "Unable to mmap ELF sections\n" ); + ErrorF("Unable to mmap ELF sections\n"); return NULL; } # endif - elffile->baseptr = ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1); + elffile->baseptr = + ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1); #endif #if defined(__alpha__) || defined(__ia64__) - if (! ELFCreateGOT(elffile, maxalign)) + if (!ELFCreateGOT(elffile, maxalign)) return NULL; #endif #if defined(__ia64__) @@ -2788,10 +2995,12 @@ LOOKUP **ppLookup; for (i = 0; pLookup[i].symName; i++) if (secttable[i]) { - pLookup[i].offset = (funcptr)((long)pLookup[i].offset + (long)elffile->saddr[secttable[i]]); + pLookup[i].offset = + (funcptr) ((long)pLookup[i].offset + + (long)elffile->saddr[secttable[i]]); #ifdef ELFDEBUG - ELFDEBUG("Finalizing symbol %lx %s\n", - pLookup[i].offset, pLookup[i].symName); + ELFDEBUG("Finalizing symbol %p %s\n", + (void *)pLookup[i].offset, pLookup[i].symName); #endif } xf86loaderfree(secttable); @@ -2800,24 +3009,25 @@ LOOKUP **ppLookup; ELFCreateOPD(elffile); #endif - if (! ElfCreateCOMMON(elffile, *ppLookup)) + if (!ElfCreateCOMMON(elffile, *ppLookup)) return NULL; /* Record info for gdb - if we can't allocate the loader record fail - silently (the user will find out soon enough that there's no VM left */ + * silently (the user will find out soon enough that there's no VM left */ if ((elfmod = xf86loadercalloc(1, sizeof(LDRModuleRec))) != NULL) { elfmod->name = strdup(modrec->name); elfmod->namelen = strlen(modrec->name); elfmod->version = 1; - for (i=0; i < elffile->lsectidx;i++) { + for (i = 0; i < elffile->lsectidx; i++) { char *name = elffile->lsection[i].name; - if (!strcmp(name,".text")) + + if (!strcmp(name, ".text")) elfmod->text = elffile->lsection[i].saddr; - else if (!strcmp(name,".data")) + else if (!strcmp(name, ".data")) elfmod->data = elffile->lsection[i].saddr; - else if (!strcmp(name,".rodata")) + else if (!strcmp(name, ".rodata")) elfmod->rodata = elffile->lsection[i].saddr; - else if (!strcmp(name,".bss")) + else if (!strcmp(name, ".bss")) elfmod->bss = elffile->lsection[i].saddr; } elfmod->next = ModList; @@ -2833,8 +3043,7 @@ LOOKUP **ppLookup; } void -ELFResolveSymbols(mod) -void *mod; +ELFResolveSymbols(void *mod) { ELFRelocPtr newlist, p, tmp; @@ -2842,10 +3051,12 @@ void *mod; * which we failed to relocate. Destroy the old list in the process. */ newlist = 0; - for (p = _LoaderGetRelocations(mod)->elf_reloc; p; ) { + for (p = _LoaderGetRelocations(mod)->elf_reloc; p;) { #ifdef ELFDEBUG - ErrorF("ResolveSymbols: file %lx, sec %d, r_offset 0x%x, r_info 0x%lx\n", - p->file, p->secn, p->rel->r_offset, p->rel->r_info); + ELFDEBUG("ResolveSymbols: " + "file %p, sec %d, r_offset 0x%x, r_info 0x%p\n", + (void *)p->file, p->secn, p->rel->r_offset, + (void *)p->rel->r_info); #endif tmp = Elf_RelocateEntry(p->file, p->secn, p->rel, FALSE); if (tmp) { @@ -2857,57 +3068,56 @@ void *mod; p = p->next; xf86loaderfree(tmp); } - _LoaderGetRelocations(mod)->elf_reloc=newlist; + _LoaderGetRelocations(mod)->elf_reloc = newlist; } int -ELFCheckForUnresolved(mod) -void *mod; +ELFCheckForUnresolved(void *mod) { - ELFRelocPtr erel; - char *name; - int flag, fatalsym=0; + ELFRelocPtr erel; + char *name; + int flag, fatalsym = 0; if ((erel = _LoaderGetRelocations(mod)->elf_reloc) == NULL) return 0; - while( erel ) { + while (erel) { Elf_RelocateEntry(erel->file, erel->secn, erel->rel, TRUE); name = ElfGetSymbolName(erel->file, ELF_R_SYM(erel->rel->r_info)); - flag = _LoaderHandleUnresolved( - name, _LoaderHandleToName(erel->file->handle)); - if(flag) fatalsym = 1; - erel=erel->next; + flag = _LoaderHandleUnresolved(name, + _LoaderHandleToName(erel->file-> + handle)); + if (flag) + fatalsym = 1; + erel = erel->next; } return fatalsym; } void -ELFUnloadModule(modptr) -void *modptr; +ELFUnloadModule(void *modptr) { - ELFModulePtr elffile = (ELFModulePtr)modptr; - ELFRelocPtr relptr, reltptr, *brelptr; + ELFModulePtr elffile = (ELFModulePtr) modptr; + ELFRelocPtr relptr, reltptr, *brelptr; int i; - + /* * Delete any unresolved relocations */ - relptr=_LoaderGetRelocations(elffile->funcs)->elf_reloc; - brelptr=&(_LoaderGetRelocations(elffile->funcs)->elf_reloc); + relptr = _LoaderGetRelocations(elffile->funcs)->elf_reloc; + brelptr = &(_LoaderGetRelocations(elffile->funcs)->elf_reloc); - while(relptr) { - if( relptr->file == elffile ) { - *brelptr=relptr->next; /* take it out of the list */ - reltptr=relptr; /* save pointer to this node */ - relptr=relptr->next; /* advance the pointer */ - xf86loaderfree(reltptr); /* free the node */ + while (relptr) { + if (relptr->file == elffile) { + *brelptr = relptr->next; /* take it out of the list */ + reltptr = relptr; /* save pointer to this node */ + relptr = relptr->next; /* advance the pointer */ + xf86loaderfree(reltptr); /* free the node */ + } else { + brelptr = &(relptr->next); + relptr = relptr->next; /* advance the pointer */ } - else { - brelptr=&(relptr->next); - relptr=relptr->next; /* advance the pointer */ - } } /* @@ -2921,18 +3131,19 @@ void *modptr; */ #if !defined (DoMMAPedMerge) # define CheckandFree(ptr,size) if(ptr) xf86loaderfree(ptr) -#else +#else # define CheckandFree(ptr,size) if (ptr) munmap(ptr,size) #endif #define CheckandFreeFile(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size)) #ifdef MergeSectionAlloc - CheckandFree(elffile->base,elffile->basesize); + CheckandFree(elffile->base, elffile->basesize); # if defined(__alpha__) || defined(__ia64__) if (elffile->shared_got) { elffile->shared_got->nuses--; if (!elffile->shared_got->nuses) { ELFGotPtr *pgot = &ELFSharedGOTs; + while (*pgot && *pgot != elffile->shared_got) pgot = &(*pgot)->next; if (*pgot) @@ -2941,19 +3152,20 @@ void *modptr; } } # endif -#else /*MergeSectionAlloc*/ - CheckandFree(elffile->common,elffile->comsize); +#else /*MergeSectionAlloc */ + CheckandFree(elffile->common, elffile->comsize); # if defined(__alpha__) || defined(__ia64__) - CheckandFree(elffile->got,elffile->gotsize); + CheckandFree(elffile->got, elffile->gotsize); # endif # if defined(__ia64__) - CheckandFree(elffile->plt,elffile->pltsize); + CheckandFree(elffile->plt, elffile->pltsize); # endif #endif #if defined(__alpha__) || defined(__ia64__) { ELFGotEntryPtr gotent; - while((gotent = elffile->got_entries)) { + + while ((gotent = elffile->got_entries)) { elffile->got_entries = gotent->next; xf86loaderfree(gotent); } @@ -2962,6 +3174,7 @@ void *modptr; #if defined(__ia64__) { ELFPltEntryPtr pltent; + while ((pltent = elffile->plt_entries)) { elffile->plt_entries = pltent->next; xf86loaderfree(pltent); @@ -2969,6 +3182,7 @@ void *modptr; } { ELFOpdPtr opdent; + while ((opdent = elffile->opd_entries)) { elffile->opd_entries = opdent->next; xf86loaderfree(opdent); @@ -2994,12 +3208,11 @@ void *modptr; /* * Free the section table, section pointer array, and section names */ - _LoaderFreeFileMem(elffile->sections,elffile->secsize); + _LoaderFreeFileMem(elffile->sections, elffile->secsize); xf86loaderfree(elffile->saddr); - _LoaderFreeFileMem(elffile->header,sizeof(Elf_Ehdr)); - _LoaderFreeFileMem(elffile->shstraddr,elffile->shstrsize); - - + _LoaderFreeFileMem(elffile->header, sizeof(Elf_Ehdr)); + _LoaderFreeFileMem(elffile->shstraddr, elffile->shstrsize); + /* * Free the ELFModuleRec */ @@ -3011,14 +3224,14 @@ void *modptr; char * ELFAddressToSection(void *modptr, unsigned long address) { - ELFModulePtr elffile = (ELFModulePtr)modptr; + ELFModulePtr elffile = (ELFModulePtr) modptr; int i; - for( i=1; i<elffile->numsh; i++) { - if( address >= (unsigned long)elffile->saddr[i] && - address <= (unsigned long)elffile->saddr[i]+SecSize(i) ) { - return ElfGetSectionName(elffile, elffile->sections[i].sh_name); - } + for (i = 1; i < elffile->numsh; i++) { + if (address >= (unsigned long)elffile->saddr[i] && + address <= (unsigned long)elffile->saddr[i] + SecSize(i)) { + return ElfGetSectionName(elffile, elffile->sections[i].sh_name); } + } return NULL; } diff --git a/hw/xfree86/loader/elfloader.h b/hw/xfree86/loader/elfloader.h index cbd5f118a..e4693411b 100644 --- a/hw/xfree86/loader/elfloader.h +++ b/hw/xfree86/loader/elfloader.h @@ -21,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.3 1998/09/20 14:41:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.4 2003/10/15 16:29:03 dawes Exp $ */ #ifndef _ELFLOADER_H #define _ELFLOADER_H @@ -29,6 +29,6 @@ extern void *ELFLoadModule(loaderPtr, int, LOOKUP **); extern void ELFResolveSymbols(void *); extern int ELFCheckForUnresolved(void *); -extern char *ELFAddressToSection(void *,unsigned long); +extern char *ELFAddressToSection(void *, unsigned long); extern void ELFUnloadModule(void *); #endif /* _ELFLOADER_h */ diff --git a/hw/xfree86/loader/extsym.c b/hw/xfree86/loader/extsym.c index 62a5ea98a..8da5089bc 100644 --- a/hw/xfree86/loader/extsym.c +++ b/hw/xfree86/loader/extsym.c @@ -1,8 +1,8 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.6 2001/11/17 16:05:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.9 2003/10/15 16:29:03 dawes Exp $ */ /* * - * Copyright 1999 by The XFree86 Project, Inc. + * Copyright 1999-2003 by The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -42,38 +42,39 @@ extern RESTYPE ShmSegType, ShmPixType; extern Bool noPanoramiXExtension; extern int PanoramiXNumScreens; extern PanoramiXData *panoramiXdataPtr; +extern XID *PanoramiXVisualTable; extern unsigned long XRT_WINDOW; extern unsigned long XRT_PIXMAP; extern unsigned long XRT_GC; extern unsigned long XRT_COLORMAP; extern unsigned long XRC_DRAWABLE; -extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void)); +extern Bool XineramaRegisterConnectionBlockCallback(void (*func) (void)); extern int XineramaDeleteResource(pointer, XID); #endif LOOKUP extLookupTab[] = { - SYMFUNC(ClientSleepUntil) + SYMFUNC(ClientSleepUntil) #ifdef HAS_SHM - SYMVAR(ShmCompletionCode) - SYMVAR(BadShmSegCode) - SYMVAR(ShmSegType) + SYMVAR(ShmCompletionCode) + SYMVAR(BadShmSegCode) + SYMVAR(ShmSegType) #endif #ifdef PANORAMIX - SYMFUNC(XineramaRegisterConnectionBlockCallback) - SYMFUNC(XineramaDeleteResource) - SYMVAR(noPanoramiXExtension) - SYMVAR(PanoramiXNumScreens) - SYMVAR(panoramiXdataPtr) - SYMVAR(XRT_WINDOW) - SYMVAR(XRT_PIXMAP) - SYMVAR(XRT_GC) - SYMVAR(XRT_COLORMAP) - SYMVAR(XRC_DRAWABLE) + SYMFUNC(XineramaRegisterConnectionBlockCallback) + SYMFUNC(XineramaDeleteResource) + SYMVAR(noPanoramiXExtension) + SYMVAR(PanoramiXNumScreens) + SYMVAR(panoramiXdataPtr) + SYMVAR(PanoramiXVisualTable) + SYMVAR(XRT_WINDOW) + SYMVAR(XRT_PIXMAP) + SYMVAR(XRT_GC) + SYMVAR(XRT_COLORMAP) + SYMVAR(XRC_DRAWABLE) #endif - { 0, 0 }, - + {0, 0} }; diff --git a/hw/xfree86/loader/fontsym.c b/hw/xfree86/loader/fontsym.c index 50def63ea..d91a2e216 100644 --- a/hw/xfree86/loader/fontsym.c +++ b/hw/xfree86/loader/fontsym.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.11 2002/12/09 17:30:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.13 2003/10/15 16:29:04 dawes Exp $ */ +/* + * Copyright (c) 1998-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "font.h" #include "sym.h" @@ -16,64 +42,63 @@ LOOKUP fontLookupTab[] = { - SYMFUNC(TwoByteSwap) - SYMFUNC(FourByteSwap) - SYMFUNC(FontCouldBeTerminal) - SYMFUNC(BufFileRead) - SYMFUNC(BufFileWrite) - SYMFUNC(CheckFSFormat) - SYMFUNC(FontFileOpen) - SYMFUNC(FontFilePriorityRegisterRenderer) - SYMFUNC(FontFileRegisterRenderer) - SYMFUNC(FontParseXLFDName) - SYMFUNC(FontFileCloseFont) - SYMFUNC(FontFileOpenBitmap) - SYMFUNC(FontFileCompleteXLFD) - SYMFUNC(FontFileCountDashes) - SYMFUNC(FontFileFindNameInDir) - SYMFUNC(FontFileClose) - SYMFUNC(FontComputeInfoAccelerators) - SYMFUNC(FontDefaultFormat) - SYMFUNC(NameForAtom) - SYMFUNC(BitOrderInvert) - SYMFUNC(FontFileMatchRenderer) - SYMFUNC(RepadBitmap) - SYMFUNC(FontEncName) - SYMFUNC(FontEncRecode) - SYMFUNC(FontEncFind) - SYMFUNC(FontMapFind) - SYMFUNC(FontEncMapFind) - SYMFUNC(FontEncFromXLFD) - SYMFUNC(FontEncDirectory) - SYMFUNC(FontMapReverse) - SYMFUNC(FontMapReverseFree) - SYMFUNC(CreateFontRec) - SYMFUNC(DestroyFontRec) - SYMFUNC(GetGlyphs) - SYMFUNC(QueryGlyphExtents) - - SYMVAR(FontFileBitmapSources) + SYMFUNC(TwoByteSwap) + SYMFUNC(FourByteSwap) + SYMFUNC(FontCouldBeTerminal) + SYMFUNC(BufFileRead) + SYMFUNC(BufFileWrite) + SYMFUNC(CheckFSFormat) + SYMFUNC(FontFileOpen) + SYMFUNC(FontFilePriorityRegisterRenderer) + SYMFUNC(FontFileRegisterRenderer) + SYMFUNC(FontParseXLFDName) + SYMFUNC(FontFileCloseFont) + SYMFUNC(FontFileOpenBitmap) + SYMFUNC(FontFileCompleteXLFD) + SYMFUNC(FontFileCountDashes) + SYMFUNC(FontFileFindNameInDir) + SYMFUNC(FontFileClose) + SYMFUNC(FontComputeInfoAccelerators) + SYMFUNC(FontDefaultFormat) + SYMFUNC(NameForAtom) + SYMFUNC(BitOrderInvert) + SYMFUNC(FontFileMatchRenderer) + SYMFUNC(RepadBitmap) + SYMFUNC(FontEncName) + SYMFUNC(FontEncRecode) + SYMFUNC(FontEncFind) + SYMFUNC(FontMapFind) + SYMFUNC(FontEncMapFind) + SYMFUNC(FontEncFromXLFD) + SYMFUNC(FontEncDirectory) + SYMFUNC(FontMapReverse) + SYMFUNC(FontMapReverseFree) + SYMFUNC(CreateFontRec) + SYMFUNC(DestroyFontRec) + SYMFUNC(GetGlyphs) + SYMFUNC(QueryGlyphExtents) + + SYMVAR(FontFileBitmapSources) #ifdef FONTENC_COMPATIBILITY - /* Obsolete backwards compatibility symbols -- fontencc.c */ - SYMFUNC(font_encoding_from_xlfd) - SYMFUNC(font_encoding_find) - SYMFUNC(font_encoding_recode) - SYMFUNC(font_encoding_name) - SYMFUNC(identifyEncodingFile) + /* Obsolete backwards compatibility symbols -- fontencc.c */ + SYMFUNC(font_encoding_from_xlfd) + SYMFUNC(font_encoding_find) + SYMFUNC(font_encoding_recode) + SYMFUNC(font_encoding_name) + SYMFUNC(identifyEncodingFile) #endif - /* fontcache.c */ - SYMFUNC(FontCacheGetSettings) - SYMFUNC(FontCacheGetStatistics) - SYMFUNC(FontCacheChangeSettings) - SYMFUNC(FontCacheOpenCache) - SYMFUNC(FontCacheCloseCache) - SYMFUNC(FontCacheSearchEntry) - SYMFUNC(FontCacheGetEntry) - SYMFUNC(FontCacheInsertEntry) - SYMFUNC(FontCacheGetBitmap) - - { 0, 0 }, + /* fontcache.c */ + SYMFUNC(FontCacheGetSettings) + SYMFUNC(FontCacheGetStatistics) + SYMFUNC(FontCacheChangeSettings) + SYMFUNC(FontCacheOpenCache) + SYMFUNC(FontCacheCloseCache) + SYMFUNC(FontCacheSearchEntry) + SYMFUNC(FontCacheGetEntry) + SYMFUNC(FontCacheInsertEntry) + SYMFUNC(FontCacheGetBitmap) + {0, 0} }; diff --git a/hw/xfree86/loader/hash.c b/hw/xfree86/loader/hash.c index 22996f217..f8ddd45a4 100644 --- a/hw/xfree86/loader/hash.c +++ b/hw/xfree86/loader/hash.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.19 2001/07/25 15:05:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.24 2003/11/17 22:20:40 dawes Exp $ */ /* * @@ -42,58 +42,54 @@ /* Prototypes for static functions. */ static unsigned int hashFunc(const char *); static itemPtr LoaderHashFindNearest( -#if NeedFunctionPrototypes -unsigned long -#endif -); + unsigned long + ); -static itemPtr LoaderhashTable[ HASHSIZE ] ; +static itemPtr LoaderhashTable[HASHSIZE]; #ifdef DEBUG -static int hashhits[ HASHSIZE ] ; +static int hashhits[HASHSIZE]; void DumpHashHits(void) { - int i; - int depth=0; - int dev=0; + int i; + int depth = 0; + int dev = 0; - for(i=0;i<HASHSIZE;i++) { - ErrorF("hashhits[%d]=%d\n", i, hashhits[i] ); + for (i = 0; i < HASHSIZE; i++) { + ErrorF("hashhits[%d]=%d\n", i, hashhits[i]); depth += hashhits[i]; } depth /= HASHSIZE; - ErrorF("Average hash depth=%d\n", depth ); + ErrorF("Average hash depth=%d\n", depth); - for(i=0;i<HASHSIZE;i++) { - if( hashhits[i] < depth ) - dev += depth-hashhits[i]; + for (i = 0; i < HASHSIZE; i++) { + if (hashhits[i] < depth) + dev += depth - hashhits[i]; else - dev += hashhits[i]-depth; + dev += hashhits[i] - depth; } - dev /=HASHSIZE; - ErrorF("Average hash deviation=%d\n", dev ); + dev /= HASHSIZE; + ErrorF("Average hash deviation=%d\n", dev); } #endif - static unsigned int -hashFunc(string) -const char *string; +hashFunc(const char *string) { - int i=0; + int i = 0; - while ( i < 10 && string[i] ) - i ++ ; + while (i < 10 && string[i]) + i++; - if ( i < 5 ) { + if (i < 5) { #ifdef DEBUG hashhits[i]++; #endif - return i ; + return i; } /* @@ -111,29 +107,25 @@ const char *string; } void -LoaderHashAdd( entry ) - itemPtr entry ; +LoaderHashAdd(itemPtr entry) { - int bucket = hashFunc( entry->name ) ; - itemPtr oentry; + int bucket = hashFunc(entry->name); + itemPtr oentry; - if ((oentry = LoaderHashFind(entry->name)) != NULL) + if ((oentry = LoaderHashFind(entry->name)) != NULL) LoaderDuplicateSymbol(entry->name, oentry->handle); - entry->next = LoaderhashTable[ bucket ] ; - LoaderhashTable[ bucket ] = entry ; - return; + entry->next = LoaderhashTable[bucket]; + LoaderhashTable[bucket] = entry; + return; } void -LoaderAddSymbols(handle, module, list) -int handle; -int module; -LOOKUP *list ; +LoaderAddSymbols(int handle, int module, LOOKUP *list) { - LOOKUP *l = list, *exports = NULL; - itemPtr i, exportsItem = NULL; - char *modname; + LOOKUP *l = list, *exports = NULL; + itemPtr i, exportsItem = NULL; + char *modname; if (!list) return; @@ -148,7 +140,7 @@ LOOKUP *list ; char *exportname; exportname = xf86loadermalloc(strlen("ExportedSymbols") + - strlen(modname) + 1); + strlen(modname) + 1); if (exportname) { sprintf(exportname, "%sExportedSymbols", modname); while (l->symName) { @@ -160,6 +152,7 @@ LOOKUP *list ; } l++; } + xf86loaderfree(exportname); } } @@ -167,13 +160,13 @@ LOOKUP *list ; * Allocate the exports list item first. */ if (exports) { - exportsItem = xf86loadermalloc( sizeof( itemRec )) ; - exportsItem->name = exports->symName ; - exportsItem->address = (char *) exports->offset ; - exportsItem->handle = handle ; - exportsItem->module = module ; + exportsItem = xf86loadermalloc(sizeof(itemRec)); + exportsItem->name = exports->symName; + exportsItem->address = (char *)exports->offset; + exportsItem->handle = handle; + exportsItem->module = module; exportsItem->exports = NULL; - LoaderHashAdd( exportsItem ); + LoaderHashAdd(exportsItem); } /* @@ -181,107 +174,106 @@ LOOKUP *list ; * reference to the export list, if present. */ l = list; - while ( l->symName ) { + while (l->symName) { if (l != exports) { - i = xf86loadermalloc( sizeof( itemRec )) ; - i->name = l->symName ; - i->address = (char *) l->offset ; - i->handle = handle ; - i->module = module ; + i = xf86loadermalloc(sizeof(itemRec)); + i->name = l->symName; + i->address = (char *)l->offset; + i->handle = handle; + i->module = module; i->exports = exportsItem; - LoaderHashAdd( i ); + LoaderHashAdd(i); } - l ++ ; + l++; } } itemPtr -LoaderHashDelete(string) -const char *string; +LoaderHashDelete(const char *string) { - int bucket = hashFunc( string ) ; - itemPtr entry; - itemPtr *entry2; - - entry = LoaderhashTable[ bucket ] ; - entry2= &(LoaderhashTable[ bucket ]); - while ( entry ) { - if (! strcmp( entry->name, string )) { - *entry2=entry->next; - xf86loaderfree(entry->name); - xf86loaderfree( entry ) ; - return 0 ; + int bucket = hashFunc(string); + itemPtr entry; + itemPtr *entry2; + + entry = LoaderhashTable[bucket]; + entry2 = &(LoaderhashTable[bucket]); + while (entry) { + if (!strcmp(entry->name, string)) { + *entry2 = entry->next; + xf86loaderfree(entry->name); + xf86loaderfree(entry); + return 0; + } + entry2 = &(entry->next); + entry = entry->next; } - entry2 = &(entry->next) ; - entry = entry->next ; - } - return 0 ; + return 0; } itemPtr -LoaderHashFind(string) -const char *string; +LoaderHashFind(const char *string) { - int bucket = hashFunc( string ) ; - itemPtr entry ; - entry = LoaderhashTable[ bucket ] ; - while ( entry ) { - if (!strcmp(entry->name, string)) { - return entry; - } - entry = entry->next; + int bucket = hashFunc(string); + itemPtr entry; + + entry = LoaderhashTable[bucket]; + while (entry) { + if (!strcmp(entry->name, string)) { + return entry; } + entry = entry->next; + } return 0; } static itemPtr -LoaderHashFindNearest(address) -unsigned long address; +LoaderHashFindNearest(unsigned long address) { - int i ; - itemPtr entry, best_entry = 0 ; - long best_difference = MAXINT; - - for ( i = 0 ; i < HASHSIZE ; i ++ ) { - entry = LoaderhashTable[ i ] ; - while ( entry ) { - long difference = (long) address - (long) entry->address ; - if ( difference >= 0 ) { - if ( best_entry ) { - if ( difference < best_difference ) { - best_entry = entry ; - best_difference = difference ; - } - } - else { - best_entry = entry ; - best_difference = difference ; + int i; + itemPtr entry, best_entry = 0; + long best_difference = MAXINT; + + for (i = 0; i < HASHSIZE; i++) { + entry = LoaderhashTable[i]; + while (entry) { + long difference = (long)address - (long)entry->address; + + if (difference >= 0) { + if (best_entry) { + if (difference < best_difference) { + best_entry = entry; + best_difference = difference; + } + } else { + best_entry = entry; + best_difference = difference; + } + } + entry = entry->next; } - } - entry = entry->next ; } - } - return best_entry ; + return best_entry; } void -LoaderPrintSymbol(address) -unsigned long address; +LoaderPrintSymbol(unsigned long address) { - itemPtr entry; - entry=LoaderHashFindNearest(address); + itemPtr entry; + + entry = LoaderHashFindNearest(address); if (entry) { const char *module, *section; + #if defined(__alpha__) || defined(__ia64__) - ErrorF("0x%016lx %s+%lx\n", entry->address, entry->name, - address - (unsigned long) entry->address); + ErrorF("0x%016lx %s+%lx\n", (unsigned long)entry->address, + entry->name, address - (unsigned long)entry->address); #else - ErrorF("0x%x %s+%x\n", entry->address, entry->name, - address - (unsigned long) entry->address); + ErrorF("0x%lx %s+%lx\n", (unsigned long)entry->address, entry->name, + address - (unsigned long)entry->address); #endif - if ( _LoaderAddressToSection(address, &module, §ion) ) - ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section ); + if (_LoaderAddressToSection(address, &module, §ion)) + ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n", module, section); } else { ErrorF("(null)\n"); } @@ -292,73 +284,70 @@ LoaderPrintItem(itemPtr pItem) { if (pItem) { const char *module, *section; + #if defined(__alpha__) || defined(__ia64__) - ErrorF("0x%016lx %s\n", pItem->address, pItem->name); + ErrorF("0x%016lx %s\n", (unsigned long)pItem->address, pItem->name); #else - ErrorF("0x%lx %s\n", pItem->address, pItem->name); + ErrorF("0x%lx %s\n", (unsigned long)pItem->address, pItem->name); #endif - if ( _LoaderAddressToSection((unsigned long)pItem->address, - &module, §ion) ) - ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section ); + if (_LoaderAddressToSection((unsigned long)pItem->address, + &module, §ion)) + ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n", module, section); } else ErrorF("(null)\n"); } - + void -LoaderPrintAddress(symbol) -const char *symbol; +LoaderPrintAddress(const char *symbol) { - itemPtr entry; + itemPtr entry; + entry = LoaderHashFind(symbol); LoaderPrintItem(entry); } void -LoaderHashTraverse(card, fnp) - void *card; - int (*fnp)(void *, itemPtr); +LoaderHashTraverse(void *card, int (*fnp)(void *, itemPtr)) { - int i ; - itemPtr entry, last_entry = 0 ; - - for ( i = 0 ; i < HASHSIZE ; i ++ ) { - last_entry = 0 ; - entry = LoaderhashTable[ i ] ; - while ( entry ) { - if (( * fnp )( card, entry )) { - if ( last_entry ) { - last_entry->next = entry->next ; - xf86loaderfree( entry->name ) ; - xf86loaderfree( entry ) ; - entry = last_entry->next ; - } - else { - LoaderhashTable[ i ] = entry->next ; - xf86loaderfree( entry->name ) ; - xf86loaderfree( entry ) ; - entry = LoaderhashTable[ i ] ; + int i; + itemPtr entry, last_entry = 0; + + for (i = 0; i < HASHSIZE; i++) { + last_entry = 0; + entry = LoaderhashTable[i]; + while (entry) { + if ((*fnp) (card, entry)) { + if (last_entry) { + last_entry->next = entry->next; + xf86loaderfree(entry->name); + xf86loaderfree(entry); + entry = last_entry->next; + } else { + LoaderhashTable[i] = entry->next; + xf86loaderfree(entry->name); + xf86loaderfree(entry); + entry = LoaderhashTable[i]; + } + } else { + last_entry = entry; + entry = entry->next; + } } - } - else { - last_entry = entry ; - entry = entry->next ; - } } - } } void LoaderDumpSymbols() { - itemPtr entry; - int j; - - for (j=0; j<HASHSIZE; j++) { - entry = LoaderhashTable[j]; - while (entry) { - LoaderPrintItem(entry); - entry = entry->next; - } + itemPtr entry; + int j; + + for (j = 0; j < HASHSIZE; j++) { + entry = LoaderhashTable[j]; + while (entry) { + LoaderPrintItem(entry); + entry = entry->next; } - + } + } diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index e09fa50b0..39ba510a1 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -1,7 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.63 2002/11/25 14:05:03 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.71 2003/11/06 18:38:13 tsi Exp $ */ /* - * * Copyright 1995-1998 by Metro Link, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -22,6 +21,33 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -35,7 +61,7 @@ #include <string.h> #if defined(linux) && \ (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \ - || defined(__x86_64__)) + || defined(__AMD64__)) #include <malloc.h> #endif #include <stdarg.h> @@ -73,7 +99,7 @@ int check_unresolved_sema = 0; #endif #ifdef __UNIXOS2__ -void * os2ldcalloc(size_t,size_t); +void *os2ldcalloc(size_t, size_t); #endif #ifdef HANDLE_IN_HASH_ENTRY @@ -84,11 +110,11 @@ void * os2ldcalloc(size_t,size_t); #define MAX_HANDLE 256 #define HANDLE_FREE 0 #define HANDLE_USED 1 -static char freeHandles[MAX_HANDLE] ; -static int refCount[MAX_HANDLE] ; +static char freeHandles[MAX_HANDLE]; +static int refCount[MAX_HANDLE]; #endif -#if defined(__sparc__) && defined(__GNUC__) +#if defined(__sparc__) && defined(__GNUC__) && !defined(__FreeBSD__) # define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func }, # if !defined(__OpenBSD__) # define SYMFUNCDOT89(func) { "." #func, (funcptr)&func ## _sparcv89 }, @@ -108,24 +134,25 @@ DEFFUNCDOT(div) DEFFUNCDOT(udiv) #ifdef linux static LOOKUP SparcV89LookupTab[] = { - SYMFUNCDOT89(rem) - SYMFUNCDOT89(urem) - SYMFUNCDOT89(mul) - SYMFUNCDOT89(umul) - SYMFUNCDOT89(div) - SYMFUNCDOT89(udiv) - { 0, 0 } + SYMFUNCDOT89(rem) + SYMFUNCDOT89(urem) + SYMFUNCDOT89(mul) + SYMFUNCDOT89(umul) + SYMFUNCDOT89(div) + SYMFUNCDOT89(udiv) + {0, 0} }; #endif static LOOKUP SparcLookupTab[] = { - SYMFUNCDOT(rem) - SYMFUNCDOT(urem) - SYMFUNCDOT(mul) - SYMFUNCDOT(umul) - SYMFUNCDOT(div) - SYMFUNCDOT(udiv) - { 0, 0 } + SYMFUNCDOT(rem) + SYMFUNCDOT(urem) + SYMFUNCDOT(mul) + SYMFUNCDOT(umul) + SYMFUNCDOT(div) + SYMFUNCDOT(udiv) + {0, 0} }; + #ifdef linux #if defined(__GNUC__) && defined(__GLIBC__) #define HWCAP_SPARC_MULDIV 8 @@ -138,29 +165,32 @@ sparcUseHWMulDiv(void) FILE *f; char buffer[1024]; char *p; + #if defined(__GNUC__) && defined(__GLIBC__) unsigned long *hwcap; + __asm(".weak _dl_hwcap"); - + hwcap = &_dl_hwcap; - __asm("" : "=r" (hwcap) : "0" (hwcap)); + __asm("": "=r"(hwcap):"0"(hwcap)); if (hwcap) { - if (*hwcap & HWCAP_SPARC_MULDIV) - return 1; - else - return 0; + if (*hwcap & HWCAP_SPARC_MULDIV) + return 1; + else + return 0; } #endif - f = fopen("/proc/cpuinfo","r"); - if (!f) return 0; + f = fopen("/proc/cpuinfo", "r"); + if (!f) + return 0; while (fgets(buffer, 1024, f) != NULL) { - if (!strncmp (buffer, "type", 4)) { - p = strstr (buffer, "sun4"); - if (p && (p[4] == 'u' || p[4] == 'd' || p[4] == 'm')) { - fclose(f); - return 1; - } - } + if (!strncmp(buffer, "type", 4)) { + p = strstr(buffer, "sun4"); + if (p && (p[4] == 'u' || p[4] == 'd' || p[4] == 'm')) { + fclose(f); + return 1; + } + } } fclose(f); return 0; @@ -191,8 +221,8 @@ LDRCommonPtr ldrCommons; int nCommons; typedef struct { - int num; - const char ** list; + int num; + const char **list; } symlist; /* @@ -210,119 +240,127 @@ static int fatalReqSym = 0; static int _GetModuleType(int, long); static loaderPtr _LoaderListPush(void); static loaderPtr _LoaderListPop(int); -/*ARGSUSED*/ -static void ARCHIVEResolveSymbols(void *unused) {} -/*ARGSUSED*/ -static int ARCHIVECheckForUnresolved(void *v) { return 0; } -/*ARGSUSED*/ -static char *ARCHIVEAddressToSection(void *modptr, unsigned long address) -{ return NULL; } -/*ARGSUSED*/ -static void ARCHIVEUnload(void *unused2) {} + /*ARGSUSED*/ static void +ARCHIVEResolveSymbols(void *unused) +{ +} + /*ARGSUSED*/ static int +ARCHIVECheckForUnresolved(void *v) +{ + return 0; +} + /*ARGSUSED*/ static char * +ARCHIVEAddressToSection(void *modptr, unsigned long address) +{ + return NULL; +} + /*ARGSUSED*/ static void +ARCHIVEUnload(void *unused2) +{ +} /* * Array containing entry points for different formats. */ static loader_funcs funcs[] = { - /* LD_ARCHIVE */ - {ARCHIVELoadModule, - ARCHIVEResolveSymbols, - ARCHIVECheckForUnresolved, - ARCHIVEAddressToSection, - ARCHIVEUnload, {0,0,0,0,0}}, - /* LD_ELFOBJECT */ - {ELFLoadModule, - ELFResolveSymbols, - ELFCheckForUnresolved, - ELFAddressToSection, - ELFUnloadModule, {0,0,0,0,0}}, - /* LD_COFFOBJECT */ - {COFFLoadModule, - COFFResolveSymbols, - COFFCheckForUnresolved, - COFFAddressToSection, - COFFUnloadModule, {0,0,0,0,0}}, - /* LD_XCOFFOBJECT */ - {COFFLoadModule, - COFFResolveSymbols, - COFFCheckForUnresolved, - COFFAddressToSection, - COFFUnloadModule, {0,0,0,0,0}}, - /* LD_AOUTOBJECT */ - {AOUTLoadModule, - AOUTResolveSymbols, - AOUTCheckForUnresolved, - AOUTAddressToSection, - AOUTUnloadModule, {0,0,0,0,0}}, - /* LD_AOUTDLOBJECT */ + /* LD_ARCHIVE */ + {ARCHIVELoadModule, + ARCHIVEResolveSymbols, + ARCHIVECheckForUnresolved, + ARCHIVEAddressToSection, + ARCHIVEUnload, {0, 0, 0, 0, 0}}, + /* LD_ELFOBJECT */ + {ELFLoadModule, + ELFResolveSymbols, + ELFCheckForUnresolved, + ELFAddressToSection, + ELFUnloadModule, {0, 0, 0, 0, 0}}, + /* LD_COFFOBJECT */ + {COFFLoadModule, + COFFResolveSymbols, + COFFCheckForUnresolved, + COFFAddressToSection, + COFFUnloadModule, {0, 0, 0, 0, 0}}, + /* LD_XCOFFOBJECT */ + {COFFLoadModule, + COFFResolveSymbols, + COFFCheckForUnresolved, + COFFAddressToSection, + COFFUnloadModule, {0, 0, 0, 0, 0}}, + /* LD_AOUTOBJECT */ + {AOUTLoadModule, + AOUTResolveSymbols, + AOUTCheckForUnresolved, + AOUTAddressToSection, + AOUTUnloadModule, {0, 0, 0, 0, 0}}, + /* LD_AOUTDLOBJECT */ #ifdef DLOPEN_SUPPORT - {DLLoadModule, - DLResolveSymbols, - DLCheckForUnresolved, - ARCHIVEAddressToSection, - DLUnloadModule, {0,0,0,0,0}}, + {DLLoadModule, + DLResolveSymbols, + DLCheckForUnresolved, + ARCHIVEAddressToSection, + DLUnloadModule, {0, 0, 0, 0, 0}}, #else - {AOUTLoadModule, - AOUTResolveSymbols, - AOUTCheckForUnresolved, - AOUTAddressToSection, - AOUTUnloadModule, {0,0,0,0,0}}, + {AOUTLoadModule, + AOUTResolveSymbols, + AOUTCheckForUnresolved, + AOUTAddressToSection, + AOUTUnloadModule, {0, 0, 0, 0, 0}}, #endif - /* LD_ELFDLOBJECT */ + /* LD_ELFDLOBJECT */ #ifdef DLOPEN_SUPPORT - {DLLoadModule, - DLResolveSymbols, - DLCheckForUnresolved, - ARCHIVEAddressToSection, - DLUnloadModule, {0,0,0,0,0}}, + {DLLoadModule, + DLResolveSymbols, + DLCheckForUnresolved, + ARCHIVEAddressToSection, + DLUnloadModule, {0, 0, 0, 0, 0}}, #else - {ELFLoadModule, - ELFResolveSymbols, - ELFCheckForUnresolved, - ELFAddressToSection, - ELFUnloadModule, {0,0,0,0,0}}, + {ELFLoadModule, + ELFResolveSymbols, + ELFCheckForUnresolved, + ELFAddressToSection, + ELFUnloadModule, {0, 0, 0, 0, 0}}, #endif - }; - -int numloaders=sizeof(funcs)/sizeof(loader_funcs); +}; +int numloaders = sizeof(funcs) / sizeof(loader_funcs); void LoaderInit(void) { const char *osname = NULL; - LoaderAddSymbols(-1, -1, miLookupTab ) ; - LoaderAddSymbols(-1, -1, xfree86LookupTab ) ; - LoaderAddSymbols(-1, -1, dixLookupTab ) ; - LoaderAddSymbols(-1, -1, fontLookupTab ) ; - LoaderAddSymbols(-1, -1, extLookupTab ); -#ifdef __sparc__ + LoaderAddSymbols(-1, -1, miLookupTab); + LoaderAddSymbols(-1, -1, xfree86LookupTab); + LoaderAddSymbols(-1, -1, dixLookupTab); + LoaderAddSymbols(-1, -1, fontLookupTab); + LoaderAddSymbols(-1, -1, extLookupTab); +#if defined(__sparc__) && !defined(__FreeBSD__) #ifdef linux if (sparcUseHWMulDiv()) - LoaderAddSymbols(-1, -1, SparcV89LookupTab ) ; + LoaderAddSymbols(-1, -1, SparcV89LookupTab); else #endif - LoaderAddSymbols(-1, -1, SparcLookupTab ) ; -#endif + LoaderAddSymbols(-1, -1, SparcLookupTab); +#endif xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n"); xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC, - GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion), - GET_ABI_MINOR(LoaderVersionInfo.ansicVersion)); + GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion), + GET_ABI_MINOR(LoaderVersionInfo.ansicVersion)); xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV, - GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion), - GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion)); + GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion), + GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion)); xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT, - GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion), - GET_ABI_MINOR(LoaderVersionInfo.xinputVersion)); + GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion), + GET_ABI_MINOR(LoaderVersionInfo.xinputVersion)); xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION, - GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), - GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); + GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion), + GET_ABI_MINOR(LoaderVersionInfo.extensionVersion)); xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_FONT, - GET_ABI_MAJOR(LoaderVersionInfo.fontVersion), - GET_ABI_MINOR(LoaderVersionInfo.fontVersion)); + GET_ABI_MAJOR(LoaderVersionInfo.fontVersion), + GET_ABI_MINOR(LoaderVersionInfo.fontVersion)); LoaderGetOS(&osname, NULL, NULL, NULL); if (osname) @@ -330,13 +368,13 @@ LoaderInit(void) #if defined(linux) && \ (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \ - || ( defined __x86_64__ && ! defined UseMMAP && ! defined DoMMAPedMerge)) + || ( defined __AMD64__ && ! defined UseMMAP && ! defined DoMMAPedMerge)) /* * The glibc malloc uses mmap for large allocations anyway. This breaks * some relocation types because the offset overflow. See loader.h for more * details. We need to turn off this behavior here. */ - mallopt(M_MMAP_MAX,0); + mallopt(M_MMAP_MAX, 0); #endif } @@ -350,84 +388,83 @@ LoaderInit(void) static int _GetModuleType(int fd, long offset) { - unsigned char buf[256]; /* long enough for the largest magic type */ + unsigned char buf[256]; /* long enough for the largest magic type */ - if( read(fd,buf,sizeof(buf)) < 0 ) { + if (read(fd, buf, sizeof(buf)) < 0) { return -1; } - #ifdef DEBUG - ErrorF("Checking module type %10s\n", buf ); - ErrorF("Checking module type %x %x %x %x\n", buf[0], buf[1], buf[2], buf[3] ); + ErrorF("Checking module type %10s\n", buf); + ErrorF("Checking module type %x %x %x %x\n", buf[0], buf[1], buf[2], + buf[3]); #endif - lseek(fd,offset,SEEK_SET); + lseek(fd, offset, SEEK_SET); - if (strncmp((char *) buf, ARMAG, SARMAG) == 0) { + if (strncmp((char *)buf, ARMAG, SARMAG) == 0) { return LD_ARCHIVE; } - #if defined(AIAMAG) /* LynxOS PPC style archives */ - if (strncmp((char *) buf, AIAMAG, SAIAMAG) == 0) { + if (strncmp((char *)buf, AIAMAG, SAIAMAG) == 0) { return LD_ARCHIVE; } #endif - if (strncmp((char *) buf, ELFMAG, SELFMAG) == 0) { - if( *((Elf32_Half *)(buf + ELFDLOFF)) == ELFDLMAG ) { + if (strncmp((char *)buf, ELFMAG, SELFMAG) == 0) { + if (*((Elf32_Half *) (buf + ELFDLOFF)) == ELFDLMAG) { return LD_ELFDLOBJECT; } else { return LD_ELFOBJECT; } } - if( buf[0] == 0x4c && buf[1] == 0x01 ) { + if (buf[0] == 0x4c && buf[1] == 0x01) { /* I386MAGIC */ return LD_COFFOBJECT; } - if( buf[0] == 0x01 && buf[1] == 0xdf ) { + if (buf[0] == 0x01 && buf[1] == 0xdf) { /* XCOFFMAGIC */ return LD_COFFOBJECT; - } - if( buf[0] == 0x0d && buf[1] == 0x01 ) { + } + if (buf[0] == 0x0d && buf[1] == 0x01) { /* ZCOFFMAGIC (LynxOS) */ return LD_COFFOBJECT; } - if( buf[0] == 0x00 && buf[1] == 0x86 && buf[2] == 0x01 && buf[3] == 0x07) { - /* AOUTMAGIC */ - return LD_AOUTOBJECT; + if (buf[0] == 0x00 && buf[1] == 0x86 && buf[2] == 0x01 && buf[3] == 0x07) { + /* AOUTMAGIC */ + return LD_AOUTOBJECT; } - if (buf[0] == 0x07 && buf[1] == 0x01 && (buf[2] == 0x64 || buf[2] == 0x86)) - { - /* AOUTMAGIC, (Linux OMAGIC, old impure format, also used by OS/2 */ - return LD_AOUTOBJECT; + if (buf[0] == 0x07 && buf[1] == 0x01 + && (buf[2] == 0x64 || buf[2] == 0x86)) { + /* AOUTMAGIC, (Linux OMAGIC, old impure format, also used by OS/2 */ + return LD_AOUTOBJECT; } - if (buf[0] == 0x07 && buf[1] == 0x01 && buf[2] == 0x00 && buf[3] == 0x00) - { - /* AOUTMAGIC, BSDI */ - return LD_AOUTOBJECT; + if (buf[0] == 0x07 && buf[1] == 0x01 && buf[2] == 0x00 && buf[3] == 0x00) { + /* AOUTMAGIC, BSDI */ + return LD_AOUTOBJECT; } - if ((buf[0] == 0xc0 && buf[1] == 0x86) || /* big endian form */ - (buf[3] == 0xc0 && buf[2] == 0x86)) { /* little endian form */ - /* i386 shared object */ - return LD_AOUTDLOBJECT; + if ((buf[0] == 0xc0 && buf[1] == 0x86) || /* big endian form */ + (buf[3] == 0xc0 && buf[2] == 0x86)) { /* little endian form */ + /* i386 shared object */ + return LD_AOUTDLOBJECT; } return LD_UNKNOWN; } +static int offsetbias = 0; /* offset into archive */ -static int offsetbias=0; /* offset into archive */ /* * _LoaderFileToMem() loads the contents of a file into memory using * the most efficient method for a platform. */ void * -_LoaderFileToMem(int fd, unsigned long offset,int size, char *label) +_LoaderFileToMem(int fd, unsigned long offset, int size, char *label) { #ifdef UseMMAP - unsigned long ret; + unsigned long ret; + # ifdef MmapPageAlign unsigned long pagesize; unsigned long new_size; @@ -437,7 +474,8 @@ _LoaderFileToMem(int fd, unsigned long offset,int size, char *label) # define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC) # ifdef DEBUGMEM - ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)",fd,offset,offsetbias,size,label); + ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size, + label); # endif # ifdef MmapPageAlign pagesize = getpagesize(); @@ -446,81 +484,84 @@ _LoaderFileToMem(int fd, unsigned long offset,int size, char *label) new_off = (offset + offsetbias) / pagesize; new_off *= pagesize; new_off_bias = (offset + offsetbias) - new_off; - if ((new_off_bias + size) > new_size) new_size += pagesize; - ret = (unsigned long) mmap(0,new_size,MMAP_PROT,MAP_PRIVATE -# ifdef __x86_64__ - | MAP_32BIT + if ((new_off_bias + size) > new_size) + new_size += pagesize; + ret = (unsigned long)mmap(0, new_size, MMAP_PROT, MAP_PRIVATE +# ifdef __AMD64__ + | MAP_32BIT # endif - , - fd,new_off); - if(ret == -1) - FatalError("mmap() failed: %s\n", strerror(errno) ); + , fd, new_off); + if (ret == -1) + FatalError("mmap() failed: %s\n", strerror(errno)); return (void *)(ret + new_off_bias); # else - ret = (unsigned long) mmap(0,size,MMAP_PROT,MAP_PRIVATE -# ifdef __x86_64__ - | MAP_32BIT + ret = (unsigned long)mmap(0, size, MMAP_PROT, MAP_PRIVATE +# ifdef __AMD64__ + | MAP_32BIT # endif - , - fd,offset + offsetbias); - if(ret == -1) - FatalError("mmap() failed: %s\n", strerror(errno) ); + , fd, offset + offsetbias); + if (ret == -1) + FatalError("mmap() failed: %s\n", strerror(errno)); return (void *)ret; # endif #else char *ptr; # ifdef DEBUGMEM - ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)",fd,offset,offsetbias,size,label); + ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)", fd, offset, offsetbias, size, + label); # endif - if(size == 0){ + if (size == 0) { # ifdef DEBUGMEM - ErrorF("=NULL\n",ptr); + ErrorF("=NULL\n", ptr); # endif return NULL; } - # ifndef __UNIXOS2__ - if( (ptr=xf86loadercalloc(size,1)) == NULL ) - FatalError("_LoaderFileToMem() malloc failed\n" ); + if ((ptr = xf86loadercalloc(size, 1)) == NULL) + FatalError("_LoaderFileToMem() malloc failed\n"); # else - if( (ptr=os2ldcalloc(size,1)) == NULL ) - FatalError("_LoaderFileToMem() malloc failed\n" ); + if ((ptr = os2ldcalloc(size, 1)) == NULL) + FatalError("_LoaderFileToMem() malloc failed\n"); # endif # if defined(linux) && defined(__ia64__) { unsigned long page_size = getpagesize(); unsigned long round; - round = (unsigned long)ptr & (page_size-1); - mprotect(ptr - round, (size+round+page_size-1) & ~(page_size-1), - PROT_READ|PROT_WRITE|PROT_EXEC); + round = (unsigned long)ptr & (page_size - 1); + mprotect(ptr - round, + (size + round + page_size - 1) & ~(page_size - 1), + PROT_READ | PROT_WRITE | PROT_EXEC); } # endif - if(lseek(fd,offset+offsetbias,SEEK_SET)<0) - FatalError("\n_LoaderFileToMem() lseek() failed: %s\n",strerror(errno)); + if (lseek(fd, offset + offsetbias, SEEK_SET) < 0) + FatalError("\n_LoaderFileToMem() lseek() failed: %s\n", + strerror(errno)); - if(read(fd,ptr,size)!=size) - FatalError("\n_LoaderFileToMem() read() failed: %s\n",strerror(errno)); + if (read(fd, ptr, size) != size) + FatalError("\n_LoaderFileToMem() read() failed: %s\n", + strerror(errno)); # if (defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__)) \ - && defined(__powerpc__) + && defined(__powerpc__) /* * Keep the instruction cache in sync with changes in the * main memory. */ - { - int i; - for (i = 0; i < size; i += 16) - ppc_flush_icache(ptr+i); - ppc_flush_icache(ptr+size-1); - } + { + int i; + + for (i = 0; i < size; i += 16) + ppc_flush_icache(ptr + i); + ppc_flush_icache(ptr + size - 1); + } # endif # ifdef DEBUGMEM - ErrorF("=%lx\n",ptr); + ErrorF("=%lx\n", ptr); # endif return (void *)ptr; @@ -535,25 +576,26 @@ _LoaderFreeFileMem(void *addr, int size) { #if defined (UseMMAP) && defined (MmapPageAlign) unsigned long pagesize = getpagesize(); - memType i_addr = (memType)addr; + memType i_addr = (memType) addr; unsigned long new_size; #endif #ifdef DEBUGMEM - ErrorF("_LoaderFreeFileMem(%x,%d)\n",addr,size); + ErrorF("_LoaderFreeFileMem(%x,%d)\n", addr, size); #endif #ifdef UseMMAP # if defined (MmapPageAlign) - i_addr /= pagesize; - i_addr *= pagesize; + i_addr /= pagesize; + i_addr *= pagesize; new_size = (size + pagesize - 1) / pagesize; new_size *= pagesize; - if (((memType)addr - i_addr + size) > new_size) new_size += pagesize; - munmap((void *)i_addr,new_size); + if (((memType) addr - i_addr + size) > new_size) + new_size += pagesize; + munmap((void *)i_addr, new_size); # else - munmap((void *)addr,size); + munmap((void *)addr, size); # endif #else - if(size == 0) + if (size == 0) return; xf86loaderfree(addr); @@ -565,43 +607,44 @@ _LoaderFreeFileMem(void *addr, int size) int _LoaderFileRead(int fd, unsigned int offset, void *buf, int size) { - if(lseek(fd,offset+offsetbias,SEEK_SET)<0) - FatalError("_LoaderFileRead() lseek() failed: %s\n", strerror(errno) ); + if (lseek(fd, offset + offsetbias, SEEK_SET) < 0) + FatalError("_LoaderFileRead() lseek() failed: %s\n", strerror(errno)); - if(read(fd,buf,size)!=size) - FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno) ); + if (read(fd, buf, size) != size) + FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno)); return size; } -static loaderPtr listHead = (loaderPtr) 0 ; +static loaderPtr listHead = (loaderPtr) 0; static loaderPtr _LoaderListPush() { - loaderPtr item = xf86loadercalloc(1, sizeof (struct _loader)); - item->next = listHead ; - listHead = item; + loaderPtr item = xf86loadercalloc(1, sizeof(struct _loader)); - return item; + item->next = listHead; + listHead = item; + + return item; } static loaderPtr _LoaderListPop(int handle) { - loaderPtr item=listHead; - loaderPtr *bptr=&listHead; /* pointer to previous node */ + loaderPtr item = listHead; + loaderPtr *bptr = &listHead; /* pointer to previous node */ - while(item) { - if( item->handle == handle ) { - *bptr=item->next; /* remove this from the list */ + while (item) { + if (item->handle == handle) { + *bptr = item->next; /* remove this from the list */ return item; - } - bptr=&(item->next); - item=item->next; } + bptr = &(item->next); + item = item->next; + } - return 0; + return 0; } /* @@ -612,30 +655,30 @@ _LoaderListPop(int handle) char * _LoaderHandleToName(int handle) { - loaderPtr item=listHead; - loaderPtr aritem=NULL; - loaderPtr lastitem=NULL; + loaderPtr item = listHead; + loaderPtr aritem = NULL; + loaderPtr lastitem = NULL; - if ( handle < 0 ) { + if (handle < 0) { return "(built-in)"; - } - while(item) { - if( item->handle == handle ) { - if( strchr(item->name,':') == NULL ) - aritem=item; + } + while (item) { + if (item->handle == handle) { + if (strchr(item->name, ':') == NULL) + aritem = item; else - lastitem=item; - } - item=item->next; + lastitem = item; } + item = item->next; + } - if( aritem ) - return aritem->name; + if (aritem) + return aritem->name; - if( lastitem ) - return lastitem->name; + if (lastitem) + return lastitem->name; - return 0; + return 0; } /* @@ -646,23 +689,23 @@ _LoaderHandleToName(int handle) char * _LoaderHandleToCanonicalName(int handle) { - loaderPtr item=listHead; - loaderPtr lastitem=NULL; + loaderPtr item = listHead; + loaderPtr lastitem = NULL; - if ( handle < 0 ) { + if (handle < 0) { return "(built-in)"; - } - while(item) { - if( item->handle == handle ) { - lastitem=item; + } + while (item) { + if (item->handle == handle) { + lastitem = item; } - item=item->next; - } + item = item->next; + } - if( lastitem ) - return lastitem->cname; + if (lastitem) + return lastitem->cname; - return NULL; + return NULL; } /* @@ -673,30 +716,30 @@ _LoaderHandleToCanonicalName(int handle) char * _LoaderModuleToName(int module) { - loaderPtr item=listHead; - loaderPtr aritem=NULL; - loaderPtr lastitem=NULL; + loaderPtr item = listHead; + loaderPtr aritem = NULL; + loaderPtr lastitem = NULL; - if ( module < 0 ) { + if (module < 0) { return "(built-in)"; - } - while(item) { - if( item->module == module ) { - if( strchr(item->name,':') == NULL ) - aritem=item; + } + while (item) { + if (item->module == module) { + if (strchr(item->name, ':') == NULL) + aritem = item; else - lastitem=item; + lastitem = item; } - item=item->next; - } + item = item->next; + } - if( aritem ) - return aritem->name; + if (aritem) + return aritem->name; - if( lastitem ) - return lastitem->name; + if (lastitem) + return lastitem->name; - return 0; + return 0; } /* @@ -705,28 +748,28 @@ _LoaderModuleToName(int module) */ int _LoaderAddressToSection(const unsigned long address, const char **module, - const char ** section) + const char **section) { - loaderPtr item=listHead; + loaderPtr item = listHead; - while(item) { - if( (*section=item->funcs->AddressToSection(item->private, address)) != NULL ) { - *module=_LoaderModuleToName(item->module); - return 1; + while (item) { + if ((*section = + item->funcs->AddressToSection(item->private, address)) != NULL) { + *module = _LoaderModuleToName(item->module); + return 1; } - item=item->next; - } + item = item->next; + } - return 0; + return 0; } - /* * Add a list of symbols to the referenced list. */ static void -AppendSymbol(symlist *list, const char *sym) +AppendSymbol(symlist * list, const char *sym) { list->list = xnfrealloc(list->list, (list->num + 1) * sizeof(char **)); list->list[list->num] = sym; @@ -734,7 +777,7 @@ AppendSymbol(symlist *list, const char *sym) } static void -AppendSymList(symlist *list, const char **syms) +AppendSymList(symlist * list, const char **syms) { while (*syms) { AppendSymbol(list, *syms); @@ -743,7 +786,7 @@ AppendSymList(symlist *list, const char **syms) } static int -SymInList(symlist *list, char *sym) +SymInList(symlist * list, char *sym) { int i; @@ -760,12 +803,12 @@ LoaderVRefSymbols(const char *sym0, va_list args) const char *s; if (sym0 == NULL) - return; + return; s = sym0; do { - AppendSymbol(&refList, s); - s = va_arg(args, const char *); + AppendSymbol(&refList, s); + s = va_arg(args, const char *); } while (s != NULL); } @@ -877,112 +920,110 @@ _LoaderHandleUnresolved(char *symbol, char *module) symbol, module); } } - return(fatalsym); + return (fatalsym); } /* * Handle an archive. */ void * -ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup) +ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP ** ppLookup) { loaderPtr tmp = NULL; void *ret = NULL; - unsigned char magic[SARMAG]; - struct ar_hdr hdr; + unsigned char magic[SARMAG]; + struct ar_hdr hdr; + #if defined(__powerpc__) && defined(Lynx) - struct fl_hdr fhdr; - char name[255]; - int namlen; + struct fl_hdr fhdr; + char name[255]; + int namlen; #endif - unsigned int size; - unsigned int offset; - int arnamesize, modnamesize; - char *slash, *longname; - char *nametable = NULL; - int nametablelen = 0; + unsigned int size; + unsigned int offset; + int arnamesize, modnamesize; + char *slash, *longname; + char *nametable = NULL; + int nametablelen = 0; LOOKUP *lookup_ret, *p; - LOOKUP *myLookup = NULL; /* Does realloc behave if ptr == 0? */ + LOOKUP *myLookup = NULL; /* Does realloc behave if ptr == 0? */ int modtype; int i; int numsyms = 0; - int resetoff; /* lookup_ret = xf86loadermalloc(sizeof (LOOKUP *)); */ - arnamesize=strlen(modrec->name); + arnamesize = strlen(modrec->name); #if !(defined(__powerpc__) && defined(Lynx)) - read(arfd,magic,SARMAG); + read(arfd, magic, SARMAG); - if(strncmp((const char *)magic,ARMAG,SARMAG) != 0 ) { - ErrorF("ARCHIVELoadModule: wrong magic!!\n" ); + if (strncmp((const char *)magic, ARMAG, SARMAG) != 0) { + ErrorF("ARCHIVELoadModule: wrong magic!!\n"); return NULL; } - resetoff=SARMAG; #else - read(arfd,&fhdr,FL_HSZ); + read(arfd, &fhdr, FL_HSZ); - if(strncmp(fhdr.fl_magic,AIAMAG,SAIAMAG) != 0 ) { - ErrorF("ARCHIVELoadModule: wrong magic!!\n" ); + if (strncmp(fhdr.fl_magic, AIAMAG, SAIAMAG) != 0) { + ErrorF("ARCHIVELoadModule: wrong magic!!\n"); return NULL; } - resetoff=FL_HSZ; #endif /* __powerpc__ && Lynx */ #ifdef DEBUGAR - ErrorF("Looking for archive members starting at offset %o\n", offset ); + ErrorF("Looking for archive members starting at offset %o\n", offset); #endif - while( read(arfd,&hdr,sizeof(struct ar_hdr)) ) { + while (read(arfd, &hdr, sizeof(struct ar_hdr))) { longname = NULL; - sscanf(hdr.ar_size,"%d",&size); + sscanf(hdr.ar_size, "%u", &size); #if defined(__powerpc__) && defined(Lynx) - sscanf(hdr.ar_namlen,"%d",&namlen); - name[0]=hdr.ar_name[0]; - name[1]=hdr.ar_name[1]; - read(arfd,&name[2],namlen); - name[namlen]='\0'; - offset=lseek(arfd,0,SEEK_CUR); - if( offset&0x1 ) /* odd value */ - offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */ + sscanf(hdr.ar_namlen, "%d", &namlen); + name[0] = hdr.ar_name[0]; + name[1] = hdr.ar_name[1]; + read(arfd, &name[2], namlen); + name[namlen] = '\0'; + offset = lseek(arfd, 0, SEEK_CUR); + if (offset & 0x1) /* odd value */ + offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */ #endif - offset=lseek(arfd,0,SEEK_CUR); + offset = lseek(arfd, 0, SEEK_CUR); /* Check for a Symbol Table */ - if( (hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') || + if ((hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') || #if defined(__powerpc__) && defined(Lynx) namlen == 0 || #endif - strncmp(hdr.ar_name, "__.SYMDEF", 9) == 0 ) { + strncmp(hdr.ar_name, "__.SYMDEF", 9) == 0) { /* If the file name is NULL, then it is a symbol table */ #ifdef DEBUGAR ErrorF("Symbol Table Member '%16.16s', size %d, offset %d\n", - hdr.ar_name, size, offset ); - ErrorF("Symbol table size %d\n", size ); + hdr.ar_name, size, offset); + ErrorF("Symbol table size %d\n", size); #endif - offset=lseek(arfd,offset+size,SEEK_SET); - if( offset&0x1 ) /* odd value */ - offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */ + offset = lseek(arfd, offset + size, SEEK_SET); + if (offset & 0x1) /* odd value */ + offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */ continue; } /* Check for a String Table */ - if( hdr.ar_name[0] == '/' && hdr.ar_name[1] == '/') { + if (hdr.ar_name[0] == '/' && hdr.ar_name[1] == '/') { /* If the file name is '/', then it is a string table */ #ifdef DEBUGAR ErrorF("String Table Member '%16.16s', size %d, offset %d\n", - hdr.ar_name, size, offset ); - ErrorF("String table size %d\n", size ); + hdr.ar_name, size, offset); + ErrorF("String table size %d\n", size); #endif nametablelen = size; - nametable=(char *)xf86loadermalloc(nametablelen); + nametable = (char *)xf86loadermalloc(nametablelen); read(arfd, nametable, size); - offset=lseek(arfd,0,SEEK_CUR); + offset = lseek(arfd, 0, SEEK_CUR); /* offset=lseek(arfd,offset+size,SEEK_SET); */ - if( offset&0x1 ) /* odd value */ - offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */ + if (offset & 0x1) /* odd value */ + offset = lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */ continue; } @@ -990,50 +1031,50 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup) /* SYS V r4 style long member name */ int nameoffset = atol(&hdr.ar_name[1]); char *membername; + if (!nametable) { - ErrorF( "Missing string table whilst processing %s\n", - modrec->name ) ; + ErrorF("Missing string table whilst processing %s\n", + modrec->name); offsetbias = 0; return NULL; } if (nameoffset > nametablelen) { - ErrorF( "Invalid string table offset (%s) whilst processing %s\n", - hdr.ar_name, modrec->name ) ; + ErrorF("Invalid string table offset (%s) whilst processing %s\n", hdr.ar_name, modrec->name); offsetbias = 0; xf86loaderfree(nametable); return NULL; } membername = nametable + nameoffset; - slash=strchr(membername,'/'); + slash = strchr(membername, '/'); if (slash) *slash = '\0'; longname = xf86loadermalloc(arnamesize + strlen(membername) + 2); - strcpy(longname,modrec->name); - strcat(longname,":"); - strcat(longname,membername); + strcpy(longname, modrec->name); + strcat(longname, ":"); + strcat(longname, membername); } else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1' && hdr.ar_name[2] == '/') { /* BSD 4.4 style long member name */ - if (sscanf(hdr.ar_name+3, "%d", &modnamesize) != 1) { + if (sscanf(hdr.ar_name + 3, "%d", &modnamesize) != 1) { ErrorF("Bad archive member %s\n", hdr.ar_name); offsetbias = 0; return NULL; } /* allocate space for fully qualified name */ longname = xf86loadermalloc(arnamesize + modnamesize + 2); - strcpy(longname,modrec->name); - strcat(longname,":"); - i = read(arfd, longname+modnamesize+1, modnamesize); + strcpy(longname, modrec->name); + strcat(longname, ":"); + i = read(arfd, longname + modnamesize + 1, modnamesize); if (i != modnamesize) { - ErrorF("Bad archive member %d\n", hdr.ar_name); + ErrorF("Bad archive member %s\n", hdr.ar_name); xf86loaderfree(longname); offsetbias = 0; return NULL; - } + } longname[i] = '\0'; offset += i; size -= i; - } else { + } else { /* Regular archive member */ #ifdef DEBUGAR ErrorF("Member '%16.16s', size %d, offset %x\n", @@ -1042,87 +1083,85 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup) #else name, #endif - size, offset ); + size, offset); #endif - slash=strchr(hdr.ar_name,'/'); + slash = strchr(hdr.ar_name, '/'); if (slash == NULL) { /* BSD format without trailing slash */ - slash = strchr(hdr.ar_name,' '); - } + slash = strchr(hdr.ar_name, ' '); + } /* SM: Make sure we do not overwrite other parts of struct */ - - if((slash - hdr.ar_name) > sizeof(hdr.ar_name)) - slash = hdr.ar_name + sizeof(hdr.ar_name) -1; - *slash='\000'; + + if ((slash - hdr.ar_name) > sizeof(hdr.ar_name)) + slash = hdr.ar_name + sizeof(hdr.ar_name) - 1; + *slash = '\000'; } - if( (modtype=_GetModuleType(arfd,offset)) < 0 ) { - ErrorF( "%s is an unrecognized module type\n", hdr.ar_name ) ; - offsetbias=0; + if ((modtype = _GetModuleType(arfd, offset)) < 0) { + ErrorF("%s is an unrecognized module type\n", hdr.ar_name); + offsetbias = 0; if (nametable) xf86loaderfree(nametable); return NULL; } - tmp=_LoaderListPush(); + tmp = _LoaderListPush(); tmp->handle = modrec->handle; tmp->module = moduleseq++; tmp->cname = xf86loadermalloc(strlen(modrec->cname) + 1); strcpy(tmp->cname, modrec->cname); - tmp->funcs=&funcs[modtype]; + tmp->funcs = &funcs[modtype]; if (longname == NULL) { - modnamesize=strlen(hdr.ar_name); - tmp->name=(char *)xf86loadermalloc(arnamesize+modnamesize+2 ); - strcpy(tmp->name,modrec->name); - strcat(tmp->name,":"); - strcat(tmp->name,hdr.ar_name); - + modnamesize = strlen(hdr.ar_name); + tmp->name = + (char *)xf86loadermalloc(arnamesize + modnamesize + 2); + strcpy(tmp->name, modrec->name); + strcat(tmp->name, ":"); + strcat(tmp->name, hdr.ar_name); + } else { tmp->name = longname; } - offsetbias=offset; + offsetbias = offset; - if((tmp->private = funcs[modtype].LoadModule(tmp, arfd, - &lookup_ret)) - == NULL) { - ErrorF( "Failed to load %s\n", hdr.ar_name ) ; - offsetbias=0; + if ((tmp->private = funcs[modtype].LoadModule(tmp, arfd, &lookup_ret)) + == NULL) { + ErrorF("Failed to load %s\n", hdr.ar_name); + offsetbias = 0; if (nametable) xf86loaderfree(nametable); return NULL; } - offset=lseek(arfd,offset+size,SEEK_SET); - if( offset&0x1 ) /* odd value */ - lseek(arfd,1,SEEK_CUR); /* make it an even boundary */ + offset = lseek(arfd, offset + size, SEEK_SET); + if (offset & 0x1) /* odd value */ + lseek(arfd, 1, SEEK_CUR); /* make it an even boundary */ - if (tmp->private == (void *) -1L) { + if (tmp->private == (void *)-1L) { ErrorF("Skipping \"%s\": No symbols found\n", tmp->name); continue; - } - else + } else ret = tmp->private; /* Add the lookup table returned from funcs.LoadModule to the * one we're going to return. */ - for (i = 0, p = lookup_ret; p && p->symName; i++, p++) - ; + for (i = 0, p = lookup_ret; p && p->symName; i++, p++) ; if (i) { myLookup = xf86loaderrealloc(myLookup, (numsyms + i + 1) - * sizeof (LOOKUP)); + * sizeof(LOOKUP)); if (!myLookup) - continue; /* Oh well! */ + continue; /* Oh well! */ - memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof (LOOKUP)); + memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof(LOOKUP)); numsyms += i; myLookup[numsyms].symName = 0; } xf86loaderfree(lookup_ret); } /* xf86loaderfree(lookup_ret); */ - offsetbias=0; + offsetbias = 0; *ppLookup = myLookup; if (nametable) @@ -1141,9 +1180,9 @@ ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup) LoaderRelocPtr _LoaderGetRelocations(void *mod) { - loader_funcs *formatrec = (loader_funcs *)mod; + loader_funcs *formatrec = (loader_funcs *) mod; - return &(formatrec->pRelocs); + return &(formatrec->pRelocs); } /* @@ -1154,13 +1193,13 @@ int LoaderOpen(const char *module, const char *cname, int handle, int *errmaj, int *errmin, int *wasLoaded) { - loaderPtr tmp ; - int new_handle, modtype ; + loaderPtr tmp; + int new_handle, modtype; int fd; LOOKUP *pLookup; #if defined(DEBUG) - ErrorF("LoaderOpen(%s)\n", module ); + ErrorF("LoaderOpen(%s)\n", module); #endif /* @@ -1171,26 +1210,26 @@ LoaderOpen(const char *module, const char *cname, int handle, */ if (handle >= 0) { tmp = listHead; - while ( tmp ) { + while (tmp) { #ifdef DEBUGLIST - ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module,module,&(tmp->name), - tmp->name,tmp->name ); + ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module, module, + &(tmp->name), tmp->name, tmp->name); #endif - if ( ! strcmp( module, tmp->name )) { + if (!strcmp(module, tmp->name)) { refCount[tmp->handle]++; if (wasLoaded) *wasLoaded = 1; xf86MsgVerb(X_INFO, 2, "Reloading %s\n", module); return tmp->handle; } - tmp = tmp->next ; + tmp = tmp->next; } } /* * OK, it's a new one. Add it. */ - xf86Msg(X_INFO, "Loading %s\n", module ) ; + xf86Msg(X_INFO, "Loading %s\n", module); if (wasLoaded) *wasLoaded = 0; @@ -1198,54 +1237,62 @@ LoaderOpen(const char *module, const char *cname, int handle, * Find a free handle. */ new_handle = 1; - while ( freeHandles[new_handle] && new_handle < MAX_HANDLE ) - new_handle ++ ; - - if ( new_handle == MAX_HANDLE ) { - xf86Msg(X_ERROR, "Out of loader space\n" ) ; /* XXX */ - if(errmaj) *errmaj = LDR_NOSPACE; - if(errmin) *errmin = LDR_NOSPACE; - return -1 ; + while (freeHandles[new_handle] && new_handle < MAX_HANDLE) + new_handle++; + + if (new_handle == MAX_HANDLE) { + xf86Msg(X_ERROR, "Out of loader space\n"); /* XXX */ + if (errmaj) + *errmaj = LDR_NOSPACE; + if (errmin) + *errmin = LDR_NOSPACE; + return -1; } - freeHandles[new_handle] = HANDLE_USED ; + freeHandles[new_handle] = HANDLE_USED; refCount[new_handle] = 1; - if( (fd=open(module, O_RDONLY)) < 0 ) { - xf86Msg(X_ERROR, "Unable to open %s\n", module ); - freeHandles[new_handle] = HANDLE_FREE ; - if(errmaj) *errmaj = LDR_NOMODOPEN; - if(errmin) *errmin = errno; - return -1 ; + if ((fd = open(module, O_RDONLY)) < 0) { + xf86Msg(X_ERROR, "Unable to open %s\n", module); + freeHandles[new_handle] = HANDLE_FREE; + if (errmaj) + *errmaj = LDR_NOMODOPEN; + if (errmin) + *errmin = errno; + return -1; } - if( (modtype=_GetModuleType(fd,0)) < 0 ) { - xf86Msg(X_ERROR, "%s is an unrecognized module type\n", module ) ; - freeHandles[new_handle] = HANDLE_FREE ; - if(errmaj) *errmaj = LDR_UNKTYPE; - if(errmin) *errmin = LDR_UNKTYPE; + if ((modtype = _GetModuleType(fd, 0)) < 0) { + xf86Msg(X_ERROR, "%s is an unrecognized module type\n", module); + freeHandles[new_handle] = HANDLE_FREE; + if (errmaj) + *errmaj = LDR_UNKTYPE; + if (errmin) + *errmin = LDR_UNKTYPE; return -1; } - tmp=_LoaderListPush(); + tmp = _LoaderListPush(); tmp->name = xf86loadermalloc(strlen(module) + 1); strcpy(tmp->name, module); tmp->cname = xf86loadermalloc(strlen(cname) + 1); strcpy(tmp->cname, cname); tmp->handle = new_handle; tmp->module = moduleseq++; - tmp->funcs=&funcs[modtype]; + tmp->funcs = &funcs[modtype]; - if((tmp->private = funcs[modtype].LoadModule(tmp,fd, &pLookup)) == NULL) { - xf86Msg(X_ERROR, "Failed to load %s\n", module ) ; + if ((tmp->private = funcs[modtype].LoadModule(tmp, fd, &pLookup)) == NULL) { + xf86Msg(X_ERROR, "Failed to load %s\n", module); _LoaderListPop(new_handle); - freeHandles[new_handle] = HANDLE_FREE ; - if(errmaj) *errmaj = LDR_NOLOAD; - if(errmin) *errmin = LDR_NOLOAD; + freeHandles[new_handle] = HANDLE_FREE; + if (errmaj) + *errmaj = LDR_NOLOAD; + if (errmin) + *errmin = LDR_NOLOAD; return -1; } - if (tmp->private != (void *) -1L) { + if (tmp->private != (void *)-1L) { LoaderAddSymbols(new_handle, tmp->module, pLookup); xf86loaderfree(pLookup); } @@ -1273,16 +1320,17 @@ LoaderSymbol(const char *sym) { int i; itemPtr item = NULL; + for (i = 0; i < numloaders; i++) funcs[i].ResolveSymbols(&funcs[i]); item = (itemPtr) LoaderHashFind(sym); - if ( item ) - return item->address ; + if (item) + return item->address; else #ifdef DLOPEN_SUPPORT - return(DLFindSymbol(sym)); + return (DLFindSymbol(sym)); #else return NULL; #endif @@ -1292,36 +1340,37 @@ int LoaderResolveSymbols(void) { int i; - for(i=0;i<numloaders;i++) + + for (i = 0; i < numloaders; i++) funcs[i].ResolveSymbols(&funcs[i]); return 0; } int -LoaderCheckUnresolved(int delay_flag ) +LoaderCheckUnresolved(int delay_flag) { - int i,ret=0; - LoaderResolveOptions delayFlag = delay_flag; + int i, ret = 0; + LoaderResolveOptions delayFlag = (LoaderResolveOptions)delay_flag; - LoaderResolveSymbols(); + LoaderResolveSymbols(); - if (delayFlag == LD_RESOLV_NOW) { - if (check_unresolved_sema > 0) - check_unresolved_sema--; - else - xf86Msg(X_WARNING, "LoaderCheckUnresolved: not enough " - "MAGIC_DONT_CHECK_UNRESOLVED\n"); - } + if (delayFlag == LD_RESOLV_NOW) { + if (check_unresolved_sema > 0) + check_unresolved_sema--; + else + xf86Msg(X_WARNING, "LoaderCheckUnresolved: not enough " + "MAGIC_DONT_CHECK_UNRESOLVED\n"); + } - if (!check_unresolved_sema || delayFlag == LD_RESOLV_FORCE) - for(i=0;i<numloaders;i++) - if (funcs[i].CheckForUnresolved(&funcs[i])) - ret=1; + if (!check_unresolved_sema || delayFlag == LD_RESOLV_FORCE) + for (i = 0; i < numloaders; i++) + if (funcs[i].CheckForUnresolved(&funcs[i])) + ret = 1; - if (fatalReqSym) - FatalError("Some required symbols were unresolved\n"); + if (fatalReqSym) + FatalError("Some required symbols were unresolved\n"); - return ret; + return ret; } void xf86LoaderTrap(void); @@ -1334,59 +1383,60 @@ xf86LoaderTrap(void) void LoaderDefaultFunc(void) { - ErrorF("\n\n\tThis should not happen!\n" - "\tAn unresolved function was called!\n"); + ErrorF("\n\n\tThis should not happen!\n" + "\tAn unresolved function was called!\n"); - xf86LoaderTrap(); - - FatalError("\n"); + xf86LoaderTrap(); + + FatalError("\n"); } int LoaderUnload(int handle) { - loaderRec fakeHead ; - loaderPtr tmp = & fakeHead ; + loaderRec fakeHead; + loaderPtr tmp = &fakeHead; - if ( handle < 0 || handle > MAX_HANDLE ) + if (handle < 0 || handle > MAX_HANDLE) return -1; - /* - * check the reference count, only free it if it goes to zero - */ - if (--refCount[handle]) + /* + * check the reference count, only free it if it goes to zero + */ + if (--refCount[handle]) return 0; - /* - * find the loaderRecs associated with this handle. - */ - - while( (tmp=_LoaderListPop(handle)) != NULL ) { - if( strchr(tmp->name,':') == NULL ) { - /* It is not a member of an archive */ - xf86Msg(X_INFO, "Unloading %s\n", tmp->name ) ; + /* + * find the loaderRecs associated with this handle. + */ + + while ((tmp = _LoaderListPop(handle)) != NULL) { + if (strchr(tmp->name, ':') == NULL) { + /* It is not a member of an archive */ + xf86Msg(X_INFO, "Unloading %s\n", tmp->name); } tmp->funcs->LoaderUnload(tmp->private); xf86loaderfree(tmp->name); xf86loaderfree(tmp->cname); xf86loaderfree(tmp); - } - - freeHandles[handle] = HANDLE_FREE ; + } + + freeHandles[handle] = HANDLE_FREE; -return 0; + return 0; } void LoaderDuplicateSymbol(const char *symbol, const int handle) { ErrorF("Duplicate symbol %s in %s\n", symbol, - listHead ? listHead->name : "(built-in)"); + listHead ? listHead->name : "(built-in)"); ErrorF("Also defined in %s\n", _LoaderHandleToName(handle)); FatalError("Module load failure\n"); } /* GDB Sync function */ -void _loader_debug_state() +void +_loader_debug_state() { } @@ -1395,18 +1445,17 @@ unsigned long LoaderOptions = 0; void LoaderResetOptions(void) { - LoaderOptions = 0; + LoaderOptions = 0; } void LoaderSetOptions(unsigned long opts) { - LoaderOptions |= opts; + LoaderOptions |= opts; } void LoaderClearOptions(unsigned long opts) { - LoaderOptions &= ~opts; + LoaderOptions &= ~opts; } - diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h index a814544b8..f48aadb02 100644 --- a/hw/xfree86/loader/loader.h +++ b/hw/xfree86/loader/loader.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.25 2001/02/22 23:17:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.28 2003/11/06 18:38:14 tsi Exp $ */ /* * @@ -22,6 +22,33 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1997-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #ifndef _LOADER_H #define _LOADER_H @@ -30,18 +57,14 @@ #if defined(Lynx) && defined(sun) #define const /**/ #endif - #if (defined(__i386__) || defined(__ix86)) && !defined(i386) #define i386 #endif - #include <X11/Xosdefs.h> #include <X11/Xfuncproto.h> #include <X11/Xmd.h> - /* For LOOKUP definition */ #include "sym.h" - #define LD_UNKNOWN -1 #define LD_ARCHIVE 0 #define LD_ELFOBJECT 1 @@ -50,12 +73,9 @@ #define LD_AOUTOBJECT 4 #define LD_AOUTDLOBJECT 5 #define LD_ELFDLOBJECT 6 - #define LD_PROCESSED_ARCHIVE -1 - /* #define UNINIT_SECTION */ #define HANDLE_IN_HASH_ENTRY - /* * COFF Section nmumbers */ @@ -63,18 +83,15 @@ #define N_DATA 2 #define N_BSS 3 #define N_COMMENT 4 - #define TestFree(a) if (a) { xfree (a); a = NULL; } - #define HASHDIV 10 #define HASHSIZE (1<<HASHDIV) - -typedef struct _elf_reloc *ELFRelocPtr; -typedef struct _elf_COMMON *ELFCommonPtr; -typedef struct _coff_reloc *COFFRelocPtr; +typedef struct _elf_reloc *ELFRelocPtr; +typedef struct _elf_COMMON *ELFCommonPtr; +typedef struct _coff_reloc *COFFRelocPtr; typedef struct _coff_COMMON *COFFCommonPtr; -typedef struct AOUT_RELOC *AOUTRelocPtr; -typedef struct AOUT_COMMON *AOUTCommonPtr; +typedef struct AOUT_RELOC *AOUTRelocPtr; +typedef struct AOUT_COMMON *AOUTCommonPtr; typedef struct _LoaderReloc { int modtype; @@ -86,52 +103,52 @@ typedef struct _LoaderReloc { typedef struct _loader_item *itemPtr; typedef struct _loader_item { - char *name ; - void *address ; - itemPtr next ; - int handle ; - int module ; - itemPtr exports; + char *name; + void *address; + itemPtr next; + int handle; + int module; + itemPtr exports; #if defined(__powerpc__) - /* - * PowerPC file formats require special routines in some circumstances - * to assist in the linking process. See the specific loader for - * more details. - */ - union { - unsigned short plt[8]; /* ELF */ - unsigned short glink[14]; /* XCOFF */ - } code ; + /* + * PowerPC file formats require special routines in some circumstances + * to assist in the linking process. See the specific loader for + * more details. + */ + union { + unsigned short plt[8]; /* ELF */ + unsigned short glink[14]; /* XCOFF */ + } code; #endif - } itemRec ; +} itemRec; /* The following structures provide an interface to GDB (note that GDB has copies of the definitions - if you change anything here make sure that the changes are also made to GDB */ -typedef struct { - char *name; /* Name of this symbol */ - unsigned int namelen; /* Name of this module */ - void *addr; /* Start address of the .text section */ +typedef struct { + char *name; /* Name of this symbol */ + unsigned int namelen; /* Name of this module */ + void *addr; /* Start address of the .text section */ } LDRCommon, *LDRCommonPtr; -typedef struct x_LDRModuleRec{ - unsigned int version; /* Version of this struct */ - char *name; /* Name of this module */ - unsigned int namelen; /* Length of name */ - void *text; /* Start address of the .text section */ - void *data; /* Start address of the .data section */ - void *rodata; /* Start address of the .rodata section */ - void *bss; /* Start address of the .bss section */ - LDRCommonPtr commons; /* List of commmon symbols */ - int commonslen; /* Number of common symbols */ - struct x_LDRModuleRec *next; /* Next module record in chain */ +typedef struct x_LDRModuleRec { + unsigned int version; /* Version of this struct */ + char *name; /* Name of this module */ + unsigned int namelen; /* Length of name */ + void *text; /* Start address of the .text section */ + void *data; /* Start address of the .data section */ + void *rodata; /* Start address of the .rodata section */ + void *bss; /* Start address of the .bss section */ + LDRCommonPtr commons; /* List of commmon symbols */ + int commonslen; /* Number of common symbols */ + struct x_LDRModuleRec *next; /* Next module record in chain */ } LDRModuleRec, *LDRModulePtr; -extern char DebuggerPresent; -extern LDRModulePtr ModList; -extern LDRCommonPtr ldrCommons; -extern int nCommons; +extern char DebuggerPresent; +extern LDRModulePtr ModList; +extern LDRCommonPtr ldrCommons; +extern int nCommons; /* * The loader uses loader specific alloc/calloc/free functions that @@ -172,41 +189,41 @@ typedef struct _loader *loaderPtr; * _loader_funcs hold the entry points for a module format. */ -typedef void * (*LoadModuleProcPtr)(loaderPtr modrec, int fd, LOOKUP **); -typedef void (*ResolveSymbolsProcPtr)(void *); -typedef int (*CheckForUnresolvedProcPtr)(void *); -typedef char * (*AddressToSectionProcPtr)(void *, unsigned long); -typedef void (*LoaderUnloadProcPtr)(void *); +typedef void *(*LoadModuleProcPtr) (loaderPtr modrec, int fd, LOOKUP **); +typedef void (*ResolveSymbolsProcPtr) (void *); +typedef int (*CheckForUnresolvedProcPtr) (void *); +typedef char *(*AddressToSectionProcPtr) (void *, unsigned long); +typedef void (*LoaderUnloadProcPtr) (void *); typedef struct _loader_funcs { - LoadModuleProcPtr LoadModule; - ResolveSymbolsProcPtr ResolveSymbols; - CheckForUnresolvedProcPtr CheckForUnresolved; - AddressToSectionProcPtr AddressToSection; - LoaderUnloadProcPtr LoaderUnload; - LoaderRelocRec pRelocs; /* type specific relocations */ + LoadModuleProcPtr LoadModule; + ResolveSymbolsProcPtr ResolveSymbols; + CheckForUnresolvedProcPtr CheckForUnresolved; + AddressToSectionProcPtr AddressToSection; + LoaderUnloadProcPtr LoaderUnload; + LoaderRelocRec pRelocs; /* type specific relocations */ } loader_funcs; /* Each module loaded has a loaderRec */ typedef struct _loader { - int handle; /* Unique id used to remove symbols from - this module when it is unloaded */ - int module; /* Unique id to identify compilation units */ - char *name; - char *cname; - void *private; /* format specific data */ - loader_funcs *funcs; /* funcs for operating on this module */ - loaderPtr next; + int handle; /* Unique id used to remove symbols from + * this module when it is unloaded */ + int module; /* Unique id to identify compilation units */ + char *name; + char *cname; + void *private; /* format specific data */ + loader_funcs *funcs; /* funcs for operating on this module */ + loaderPtr next; } loaderRec; /* Compiled-in version information */ typedef struct { - INT32 xf86Version; - INT32 ansicVersion; - INT32 videodrvVersion; - INT32 xinputVersion; - INT32 extensionVersion; - INT32 fontVersion; + int xf86Version; + int ansicVersion; + int videodrvVersion; + int xinputVersion; + int extensionVersion; + int fontVersion; } ModuleVersions; extern ModuleVersions LoaderVersionInfo; @@ -217,6 +234,7 @@ extern unsigned long LoaderOptions; void LoaderAddSymbols(int, int, LOOKUP *); void LoaderDefaultFunc(void); void LoaderDuplicateSymbol(const char *, const int); + #if 0 void LoaderFixups(void); #endif @@ -232,7 +250,8 @@ void LoaderPrintItem(itemPtr); void LoaderPrintSymbol(unsigned long); void LoaderDumpSymbols(void); char *_LoaderModuleToName(int); -int _LoaderAddressToSection(const unsigned long, const char **, const char **); +int _LoaderAddressToSection(const unsigned long, const char **, + const char **); int LoaderOpen(const char *, const char *, int, int *, int *, int *); int LoaderHandleOpen(int); @@ -251,8 +270,8 @@ LoaderRelocPtr _LoaderGetRelocations(void *); /* * object to name lookup routines */ -char * _LoaderHandleToName(int handle); -char * _LoaderHandleToCanonicalName(int handle); +char *_LoaderHandleToName(int handle); +char *_LoaderHandleToCanonicalName(int handle); /* * Entry points for the different loader types diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h index ff6c64b07..d2779812f 100644 --- a/hw/xfree86/loader/loaderProcs.h +++ b/hw/xfree86/loader/loaderProcs.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.19 2002/07/30 18:36:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.21 2003/10/15 16:29:04 dawes Exp $ */ /* * @@ -22,6 +22,32 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1997-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _LOADERPROCS_H #define _LOADERPROCS_H @@ -31,24 +57,23 @@ #include "fontmod.h" typedef struct module_desc { - struct module_desc *child; - struct module_desc *sib; - struct module_desc *parent; - struct module_desc *demand_next; - char *name; - char *filename; - char *identifier; - XID client_id; - int in_use; - int handle; - ModuleSetupProc SetupProc; - ModuleTearDownProc TearDownProc; - void *TearDownData; /* returned from SetupProc */ - const char *path; - const XF86ModuleVersionInfo *VersionInfo; + struct module_desc *child; + struct module_desc *sib; + struct module_desc *parent; + struct module_desc *demand_next; + char *name; + char *filename; + char *identifier; + XID client_id; + int in_use; + int handle; + ModuleSetupProc SetupProc; + ModuleTearDownProc TearDownProc; + void *TearDownData; /* returned from SetupProc */ + const char *path; + const XF86ModuleVersionInfo *VersionInfo; } ModuleDesc, *ModuleDescPtr; - /* * Extenal API for the loader */ @@ -64,17 +89,16 @@ ModuleDescPtr LoadSubModule(ModuleDescPtr, const char *, const char **, const char **, pointer, const XF86ModReqInfo *, int *, int *); ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); -void LoadFont (FontModule *); -void UnloadModule (ModuleDescPtr); -void UnloadSubModule (ModuleDescPtr); -void UnloadDriver (ModuleDescPtr); -void FreeModuleDesc (ModuleDescPtr mod); -ModuleDescPtr NewModuleDesc (const char *); -ModuleDescPtr AddSibling (ModuleDescPtr head, ModuleDescPtr new); +void LoadFont(FontModule *); +void UnloadModule(ModuleDescPtr); +void UnloadSubModule(ModuleDescPtr); +void UnloadDriver(ModuleDescPtr); +void FreeModuleDesc(ModuleDescPtr mod); +ModuleDescPtr NewModuleDesc(const char *); +ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new); void LoaderSetPath(const char *path); void LoaderSortExtensions(void); - void LoaderVReqSymLists(const char **, va_list args); void LoaderVReqSymbols(const char *, va_list args); void LoaderVRefSymLists(const char **, va_list args); @@ -92,5 +116,4 @@ void LoaderClearOptions(unsigned long); /* Options for LoaderSetOptions */ #define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001 - #endif /* _LOADERPROCS_H */ diff --git a/hw/xfree86/loader/loadext.c b/hw/xfree86/loader/loadext.c index 206c8296a..ffc98b243 100644 --- a/hw/xfree86/loader/loadext.c +++ b/hw/xfree86/loader/loadext.c @@ -1,6 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadext.c,v 1.6 2000/02/08 17:19:19 dawes Exp $ */ - -/* Copyright 2000 by The XFree86 Project, Inc */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadext.c,v 1.8 2003/10/15 16:29:04 dawes Exp $ */ +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Maybe this file belongs elsewhere? */ @@ -12,58 +36,56 @@ ExtensionModule *ExtensionModuleList = NULL; static int numExtensionModules = 0; - static ExtensionModule * NewExtensionModule(void) { - ExtensionModule *save = ExtensionModuleList; - int n; - - /* Sanity check */ - if (!ExtensionModuleList) - numExtensionModules = 0; - - n = numExtensionModules + 1; - ExtensionModuleList = xrealloc(ExtensionModuleList, - (n + 1) * sizeof(ExtensionModule)); - if (ExtensionModuleList == NULL) { - ExtensionModuleList = save; - return NULL; - } else { - numExtensionModules++; - ExtensionModuleList[numExtensionModules].name = NULL; - return ExtensionModuleList + (numExtensionModules - 1); - } + ExtensionModule *save = ExtensionModuleList; + int n; + + /* Sanity check */ + if (!ExtensionModuleList) + numExtensionModules = 0; + + n = numExtensionModules + 1; + ExtensionModuleList = xrealloc(ExtensionModuleList, + (n + 1) * sizeof(ExtensionModule)); + if (ExtensionModuleList == NULL) { + ExtensionModuleList = save; + return NULL; + } else { + numExtensionModules++; + ExtensionModuleList[numExtensionModules].name = NULL; + return ExtensionModuleList + (numExtensionModules - 1); + } } void -LoadExtension(ExtensionModule *e, Bool builtin) +LoadExtension(ExtensionModule * e, Bool builtin) { - ExtensionModule *newext; + ExtensionModule *newext; - if (e == NULL || e->name == NULL) - return; + if (e == NULL || e->name == NULL) + return; - if (!(newext = NewExtensionModule())) - return; + if (!(newext = NewExtensionModule())) + return; - if (builtin) - xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n", - e->name); - else - xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name); + if (builtin) + xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n", + e->name); + else + xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name); - newext->name = e->name; - newext->initFunc = e->initFunc; - newext->disablePtr = e->disablePtr; - newext->setupFunc = e->setupFunc; - newext->initDependencies = e->initDependencies; + newext->name = e->name; + newext->initFunc = e->initFunc; + newext->disablePtr = e->disablePtr; + newext->setupFunc = e->setupFunc; + newext->initDependencies = e->initDependencies; - if (e->setupFunc != NULL) - e->setupFunc(); + if (e->setupFunc != NULL) + e->setupFunc(); } - /* * Sort ExtensionModuleList according to the initialisation order * dependencies. The code for this is taken from BSD's tsort, @@ -105,21 +127,20 @@ LoadExtension(ExtensionModule *e, Bool builtin) * SUCH DAMAGE. */ - -#define NF_MARK 0x1 /* marker for cycle detection */ -#define NF_ACYCLIC 0x2 /* this node is cycle free */ -#define NF_NODEST 0x4 /* Unreachable */ +#define NF_MARK 0x1 /* marker for cycle detection */ +#define NF_ACYCLIC 0x2 /* this node is cycle free */ +#define NF_NODEST 0x4 /* Unreachable */ typedef struct node_str NODE; struct node_str { - NODE **n_prevp; /* pointer to previous node's n_next */ - NODE *n_next; /* next node in graph */ - NODE **n_arcs; /* array of arcs to other nodes */ - int n_narcs; /* number of arcs in n_arcs[] */ - int n_arcsize; /* size of n_arcs[] array */ - int n_refcnt; /* # of arcs pointing to this node */ - int n_flags; /* NF_* */ - const char *n_name; /* name of this node */ + NODE **n_prevp; /* pointer to previous node's n_next */ + NODE *n_next; /* next node in graph */ + NODE **n_arcs; /* array of arcs to other nodes */ + int n_narcs; /* number of arcs in n_arcs[] */ + int n_arcsize; /* size of n_arcs[] array */ + int n_refcnt; /* # of arcs pointing to this node */ + int n_flags; /* NF_* */ + const char *n_name; /* name of this node */ }; static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL; @@ -130,32 +151,31 @@ static NODE *sorted = NULL, *last = NULL; static NODE * get_node(const char *name) { - NODE *n; + NODE *n; - for (n = graph; n && n->n_name && strcmp(n->n_name, name); n = n->n_next) - ; - if (n) - return (n); + for (n = graph; n && n->n_name && strcmp(n->n_name, name); + n = n->n_next) ; + if (n) + return (n); - n = xnfalloc(sizeof(NODE)); + n = xnfalloc(sizeof(NODE)); - n->n_narcs = 0; - n->n_arcsize = 0; - n->n_arcs = NULL; - n->n_refcnt = 0; - n->n_flags = 0; - n->n_name = name; + n->n_narcs = 0; + n->n_arcsize = 0; + n->n_arcs = NULL; + n->n_refcnt = 0; + n->n_flags = 0; + n->n_name = name; - /* Add to linked list. */ - if ((n->n_next = graph) != NULL) - graph->n_prevp = &n->n_next; - n->n_prevp = &graph; - graph = n; + /* Add to linked list. */ + if ((n->n_next = graph) != NULL) + graph->n_prevp = &n->n_next; + n->n_prevp = &graph; + graph = n; - return (n); + return (n); } - /* * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in * the graph, then add them. @@ -163,35 +183,35 @@ get_node(const char *name) static void add_arc(const char *s1, const char *s2) { - NODE *n1; - NODE *n2; - int bsize, i; - - n1 = get_node(s1); - - if (!strcmp(s1, s2)) - return; - - n2 = get_node(s2); - - /* - * Check if this arc is already here. - */ - for (i = 0; i < n1->n_narcs; i++) - if (n1->n_arcs[i] == n2) - return; - /* - * Add it. - */ - if (n1->n_narcs == n1->n_arcsize) { - if (!n1->n_arcsize) - n1->n_arcsize = 10; - bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2; - n1->n_arcs = xnfrealloc(n1->n_arcs, bsize); - n1->n_arcsize = bsize / sizeof(*n1->n_arcs); - } - n1->n_arcs[n1->n_narcs++] = n2; - ++n2->n_refcnt; + NODE *n1; + NODE *n2; + int bsize, i; + + n1 = get_node(s1); + + if (!strcmp(s1, s2)) + return; + + n2 = get_node(s2); + + /* + * Check if this arc is already here. + */ + for (i = 0; i < n1->n_narcs; i++) + if (n1->n_arcs[i] == n2) + return; + /* + * Add it. + */ + if (n1->n_narcs == n1->n_arcsize) { + if (!n1->n_arcsize) + n1->n_arcsize = 10; + bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2; + n1->n_arcs = xnfrealloc(n1->n_arcs, bsize); + n1->n_arcsize = bsize / sizeof(*n1->n_arcs); + } + n1->n_arcs[n1->n_narcs++] = n2; + ++n2->n_refcnt; } /* @@ -200,220 +220,214 @@ add_arc(const char *s1, const char *s2) static void clear_cycle(void) { - NODE *n; + NODE *n; - for (n = graph; n != NULL; n = n->n_next) - n->n_flags &= ~NF_NODEST; + for (n = graph; n != NULL; n = n->n_next) + n->n_flags &= ~NF_NODEST; } /* print node and remove from graph (does not actually free node) */ static void -remove_node(NODE *n) +remove_node(NODE * n) { - NODE **np; - NODE *newnode; - int i; + NODE **np; + NODE *newnode; + int i; #ifdef DEBUG - ErrorF("%s\n", n->n_name); + ErrorF("%s\n", n->n_name); #endif - newnode = xnfalloc(sizeof(NODE)); - memcpy(newnode, n, sizeof(NODE)); - if (last) - last->n_next = newnode; - else - sorted = newnode; - last = newnode; - newnode->n_next = NULL; - - for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++) - --(*np)->n_refcnt; - n->n_narcs = 0; - *n->n_prevp = n->n_next; - if (n->n_next) - n->n_next->n_prevp = n->n_prevp; + newnode = xnfalloc(sizeof(NODE)); + memcpy(newnode, n, sizeof(NODE)); + if (last) + last->n_next = newnode; + else + sorted = newnode; + last = newnode; + newnode->n_next = NULL; + + for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++) + --(*np)->n_refcnt; + n->n_narcs = 0; + *n->n_prevp = n->n_next; + if (n->n_next) + n->n_next->n_prevp = n->n_prevp; } - static void -free_nodes(NODE *nodelist) +free_nodes(NODE * nodelist) { - NODE *n, *nextnode; + NODE *n, *nextnode; - for (n = nodelist; n;) { - nextnode = n->n_next; - xfree(n); - n = nextnode; - } + for (n = nodelist; n;) { + nextnode = n->n_next; + xfree(n); + n = nextnode; + } } - /* look for the longest? cycle from node from to node to. */ static int -find_cycle(NODE *from, NODE *to, int longest_len, int depth) +find_cycle(NODE * from, NODE * to, int longest_len, int depth) { - NODE **np; - int i, len; - - /* - * avoid infinite loops and ignore portions of the graph known - * to be acyclic - */ - if (from->n_flags & (NF_NODEST|NF_MARK|NF_ACYCLIC)) - return (0); - from->n_flags |= NF_MARK; - - for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) { - cycle_buf[depth] = *np; - if (*np == to) { - if (depth + 1 > longest_len) { - longest_len = depth + 1; - memcpy((char *)longest_cycle, - (char *)cycle_buf, - longest_len * sizeof(NODE *)); - } - } else { - if ((*np)->n_flags & (NF_MARK|NF_ACYCLIC|NF_NODEST)) - continue; - len = find_cycle(*np, to, longest_len, depth + 1); + NODE **np; + int i, len; + + /* + * avoid infinite loops and ignore portions of the graph known + * to be acyclic + */ + if (from->n_flags & (NF_NODEST | NF_MARK | NF_ACYCLIC)) + return (0); + from->n_flags |= NF_MARK; + + for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) { + cycle_buf[depth] = *np; + if (*np == to) { + if (depth + 1 > longest_len) { + longest_len = depth + 1; + memcpy((char *)longest_cycle, + (char *)cycle_buf, longest_len * sizeof(NODE *)); + } + } else { + if ((*np)->n_flags & (NF_MARK | NF_ACYCLIC | NF_NODEST)) + continue; + len = find_cycle(*np, to, longest_len, depth + 1); #ifdef DEBUG - ErrorF("%*s %s->%s %d\n", depth, "", - from->n_name, to->n_name, len); + ErrorF("%*s %s->%s %d\n", depth, "", + from->n_name, to->n_name, len); #endif - if (len == 0) - (*np)->n_flags |= NF_NODEST; + if (len == 0) + (*np)->n_flags |= NF_NODEST; - if (len > longest_len) - longest_len = len; + if (len > longest_len) + longest_len = len; - if (len > 0 && !longest) - break; - } + if (len > 0 && !longest) + break; } - from->n_flags &= ~NF_MARK; - return (longest_len); + } + from->n_flags &= ~NF_MARK; + return (longest_len); } - /* do topological sort on graph */ static void tsort(void) { - NODE *n, *next; - int cnt, i; - - while (graph != NULL) { - /* - * Keep getting rid of simple cases until there are none left, - * if there are any nodes still in the graph, then there is - * a cycle in it. - */ - do { - for (cnt = 0, n = graph; n != NULL; n = next) { - next = n->n_next; - if (n->n_refcnt == 0) { - remove_node(n); - ++cnt; - } - } - } while (graph != NULL && cnt); - - if (graph == NULL) - break; - - if (!cycle_buf) { - /* - * Allocate space for two cycle logs - one to be used - * as scratch space, the other to save the longest - * cycle. - */ - for (cnt = 0, n = graph; n != NULL; n = n->n_next) - ++cnt; - cycle_buf = xnfalloc(sizeof(NODE *) * cnt); - longest_cycle = xnfalloc(sizeof(NODE *) * cnt); - if (cycle_buf == NULL || longest_cycle == NULL) - return; + NODE *n, *next; + int cnt, i; + + while (graph != NULL) { + /* + * Keep getting rid of simple cases until there are none left, + * if there are any nodes still in the graph, then there is + * a cycle in it. + */ + do { + for (cnt = 0, n = graph; n != NULL; n = next) { + next = n->n_next; + if (n->n_refcnt == 0) { + remove_node(n); + ++cnt; } - for (n = graph; n != NULL; n = n->n_next) - if (!(n->n_flags & NF_ACYCLIC)) { - if ((cnt = find_cycle(n, n, 0, 0))) { - ErrorF("tsort: cycle in data"); - for (i = 0; i < cnt; i++) - ErrorF("%s", - longest_cycle[i]->n_name); - remove_node(n); - clear_cycle(); - break; - } else { - /* to avoid further checks */ - n->n_flags |= NF_ACYCLIC; - clear_cycle(); - } - } - - if (n == NULL) - ErrorF("tsort: internal error -- could not find cycle"); + } + } while (graph != NULL && cnt); + + if (graph == NULL) + break; + + if (!cycle_buf) { + /* + * Allocate space for two cycle logs - one to be used + * as scratch space, the other to save the longest + * cycle. + */ + for (cnt = 0, n = graph; n != NULL; n = n->n_next) + ++cnt; + cycle_buf = xnfalloc(sizeof(NODE *) * cnt); + longest_cycle = xnfalloc(sizeof(NODE *) * cnt); + if (cycle_buf == NULL || longest_cycle == NULL) + return; } - if (cycle_buf) - xfree(cycle_buf); - if (longest_cycle) - xfree(longest_cycle); - if (graph) - free_nodes(graph); + for (n = graph; n != NULL; n = n->n_next) + if (!(n->n_flags & NF_ACYCLIC)) { + if ((cnt = find_cycle(n, n, 0, 0))) { + ErrorF("tsort: cycle in data"); + for (i = 0; i < cnt; i++) + ErrorF("%s", longest_cycle[i]->n_name); + remove_node(n); + clear_cycle(); + break; + } else { + /* to avoid further checks */ + n->n_flags |= NF_ACYCLIC; + clear_cycle(); + } + } + + if (n == NULL) + ErrorF("tsort: internal error -- could not find cycle"); + } + if (cycle_buf) + xfree(cycle_buf); + if (longest_cycle) + xfree(longest_cycle); + if (graph) + free_nodes(graph); } void LoaderSortExtensions() { - int i, j; - ExtensionModule *ext, *newList; - NODE *node; - - graph = NULL; - longest = 0; - sorted = NULL; - last = NULL; - cycle_buf = NULL; - longest_cycle = NULL; - - /* - * Parse list and build the graph. Enter them in reverse order - * because tsort() will reverse those that have no depedencies. - */ - for (i = numExtensionModules - 1; i >= 0; i--) { - ext = &ExtensionModuleList[i]; - add_arc(ext->name, ext->name); + int i, j; + ExtensionModule *ext, *newList; + NODE *node; + + graph = NULL; + longest = 0; + sorted = NULL; + last = NULL; + cycle_buf = NULL; + longest_cycle = NULL; + + /* + * Parse list and build the graph. Enter them in reverse order + * because tsort() will reverse those that have no depedencies. + */ + for (i = numExtensionModules - 1; i >= 0; i--) { + ext = &ExtensionModuleList[i]; + add_arc(ext->name, ext->name); #ifdef DEBUG - ErrorF("Extension %s:\n", ext->name); + ErrorF("Extension %s:\n", ext->name); #endif - if (ext->initDependencies) - for (j = 0; ext->initDependencies[j]; j++) { - add_arc(ext->initDependencies[j], ext->name); + if (ext->initDependencies) + for (j = 0; ext->initDependencies[j]; j++) { + add_arc(ext->initDependencies[j], ext->name); #ifdef DEBUG - ErrorF("\t%s\n", ext->initDependencies[j]); + ErrorF("\t%s\n", ext->initDependencies[j]); #endif - } - } - tsort(); - newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule)); - i = 0; - for (node = sorted; node; node = node->n_next) { - for (j = 0; j < numExtensionModules; j++) - if (!strcmp(node->n_name, ExtensionModuleList[j].name)) - break; - if (j != numExtensionModules) - newList[i++] = ExtensionModuleList[j]; - } - if (sorted) - free_nodes(sorted); - newList[i].name = NULL; - xfree(ExtensionModuleList); - ExtensionModuleList = newList; + } + } + tsort(); + newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule)); + i = 0; + for (node = sorted; node; node = node->n_next) { + for (j = 0; j < numExtensionModules; j++) + if (!strcmp(node->n_name, ExtensionModuleList[j].name)) + break; + if (j != numExtensionModules) + newList[i++] = ExtensionModuleList[j]; + } + if (sorted) + free_nodes(sorted); + newList[i].name = NULL; + xfree(ExtensionModuleList); + ExtensionModuleList = newList; #ifdef DEBUG - for (i = 0; ExtensionModuleList[i].name; i++) - ErrorF("Extension %s\n", ExtensionModuleList[i].name); + for (i = 0; ExtensionModuleList[i].name; i++) + ErrorF("Extension %s\n", ExtensionModuleList[i].name); #endif } - diff --git a/hw/xfree86/loader/loadfont.c b/hw/xfree86/loader/loadfont.c index 8ab5d0d6e..6886692da 100644 --- a/hw/xfree86/loader/loadfont.c +++ b/hw/xfree86/loader/loadfont.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.2 1998/12/13 12:42:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */ +/* + * Copyright (c) 1998 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Maybe this file belongs in lib/font/fontfile/module/ ? */ @@ -10,44 +36,42 @@ FontModule *FontModuleList = NULL; static int numFontModules = 0; - static FontModule * NewFontModule(void) { - FontModule *save = FontModuleList; - int n; - - /* Sanity check */ - if (!FontModuleList) - numFontModules = 0; - - n = numFontModules + 1; - FontModuleList = xrealloc(FontModuleList, (n + 1) * sizeof(FontModule)); - if (FontModuleList == NULL) { - FontModuleList = save; - return NULL; - } else { - numFontModules++; - FontModuleList[numFontModules].name = NULL; - return FontModuleList + (numFontModules - 1); - } + FontModule *save = FontModuleList; + int n; + + /* Sanity check */ + if (!FontModuleList) + numFontModules = 0; + + n = numFontModules + 1; + FontModuleList = xrealloc(FontModuleList, (n + 1) * sizeof(FontModule)); + if (FontModuleList == NULL) { + FontModuleList = save; + return NULL; + } else { + numFontModules++; + FontModuleList[numFontModules].name = NULL; + return FontModuleList + (numFontModules - 1); + } } void -LoadFont(FontModule *f) +LoadFont(FontModule * f) { - FontModule *newfont; + FontModule *newfont; - if (f == NULL) - return; + if (f == NULL) + return; - if (!(newfont = NewFontModule())) - return; + if (!(newfont = NewFontModule())) + return; - xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name); + xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name); - newfont->name = f->name; - newfont->initFunc = f->initFunc; - newfont->module = f->module; + newfont->name = f->name; + newfont->initFunc = f->initFunc; + newfont->module = f->module; } - diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index deba80643..733f6feb1 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.68 2002/07/30 18:36:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.73 2003/11/03 05:11:51 tsi Exp $ */ /* * @@ -22,8 +22,32 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ - -/* This file is best viewed with tab stops set to 4 spaces */ +/* + * Copyright (c) 1997-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "os.h" /* For stat() and related stuff */ @@ -48,50 +72,51 @@ extern int check_unresolved_sema; typedef struct _pattern { - const char * pattern; - regex_t rex; + const char *pattern; + regex_t rex; } PatternRec, *PatternPtr; /* Prototypes for static functions */ -static char *FindModule (const char *, const char *, const char **, PatternPtr); -static Bool CheckVersion (const char *, XF86ModuleVersionInfo *, - const XF86ModReqInfo *); -static void UnloadModuleOrDriver (ModuleDescPtr mod); +static char *FindModule(const char *, const char *, const char **, + PatternPtr); +static Bool CheckVersion(const char *, XF86ModuleVersionInfo *, + const XF86ModReqInfo *); +static void UnloadModuleOrDriver(ModuleDescPtr mod); static char *LoaderGetCanonicalName(const char *, PatternPtr); static void RemoveChild(ModuleDescPtr); ModuleVersions LoaderVersionInfo = { - XF86_VERSION_CURRENT, - ABI_ANSIC_VERSION, - ABI_VIDEODRV_VERSION, - ABI_XINPUT_VERSION, - ABI_EXTENSION_VERSION, - ABI_FONT_VERSION + XF86_VERSION_CURRENT, + ABI_ANSIC_VERSION, + ABI_VIDEODRV_VERSION, + ABI_XINPUT_VERSION, + ABI_EXTENSION_VERSION, + ABI_FONT_VERSION }; #if 0 void -LoaderFixups (void) +LoaderFixups(void) { - /* Need to call LRS here because the frame buffers get loaded last, - * and the drivers depend on them. */ + /* Need to call LRS here because the frame buffers get loaded last, + * and the drivers depend on them. */ - LoaderResolveSymbols (); + LoaderResolveSymbols(); } #endif static void FreeStringList(char **paths) { - char **p; + char **p; - if (!paths) - return; + if (!paths) + return; - for (p = paths; *p; p++) - xfree(*p); + for (p = paths; *p; p++) + xfree(*p); - xfree(paths); + xfree(paths); } static char **defaultPathList = NULL; @@ -104,90 +129,89 @@ static char **defaultPathList = NULL; static char ** InitPathList(const char *path) { - char *fullpath = NULL; - char *elem = NULL; - char **list = NULL, **save = NULL; - int len; - int addslash; - int n = 0; - - if (!path) - return defaultPathList; - - fullpath = xstrdup(path); - if (!fullpath) - return NULL; - elem = strtok(fullpath, ","); - while (elem) { - /* Only allow fully specified paths */ + char *fullpath = NULL; + char *elem = NULL; + char **list = NULL, **save = NULL; + int len; + int addslash; + int n = 0; + + if (!path) + return defaultPathList; + + fullpath = xstrdup(path); + if (!fullpath) + return NULL; + elem = strtok(fullpath, ","); + while (elem) { + /* Only allow fully specified paths */ #ifndef __UNIXOS2__ - if (*elem == '/') + if (*elem == '/') #else - if (*elem == '/' || (strlen(elem) > 2 && isalpha(elem[0]) && - elem[1] == ':' && elem[2] == '/')) + if (*elem == '/' || (strlen(elem) > 2 && isalpha(elem[0]) && + elem[1] == ':' && elem[2] == '/')) #endif - { - len = strlen(elem); - addslash = (elem[len - 1] != '/'); - if (addslash) - len++; - save = list; - list = xrealloc(list, (n + 2) * sizeof(char *)); - if (!list) { - if (save) { - save[n] = NULL; - FreeStringList(save); - } - xfree(fullpath); - return NULL; - } - list[n] = xalloc(len + 1); - if (!list[n]) { - FreeStringList(list); - xfree(fullpath); - return NULL; - } - strcpy(list[n], elem); - if (addslash) { - list[n][len - 1] = '/'; - list[n][len] = '\0'; - } - n++; + { + len = strlen(elem); + addslash = (elem[len - 1] != '/'); + if (addslash) + len++; + save = list; + list = xrealloc(list, (n + 2) * sizeof(char *)); + if (!list) { + if (save) { + save[n] = NULL; + FreeStringList(save); } - elem = strtok(NULL, ","); + xfree(fullpath); + return NULL; + } + list[n] = xalloc(len + 1); + if (!list[n]) { + FreeStringList(list); + xfree(fullpath); + return NULL; + } + strcpy(list[n], elem); + if (addslash) { + list[n][len - 1] = '/'; + list[n][len] = '\0'; + } + n++; } - if (list) - list[n] = NULL; - return list; + elem = strtok(NULL, ","); + } + if (list) + list[n] = NULL; + return list; } static void FreePathList(char **pathlist) { - if (pathlist && pathlist != defaultPathList) - FreeStringList(pathlist); + if (pathlist && pathlist != defaultPathList) + FreeStringList(pathlist); } void LoaderSetPath(const char *path) { - if (!path) - return; + if (!path) + return; - defaultPathList = InitPathList(path); + defaultPathList = InitPathList(path); } /* Standard set of module subdirectories to search, in order of preference */ -static const char *stdSubdirs[] = -{ - "drivers/", - "input/", - "multimedia/", - "extensions/", - "fonts/", - "internal/", - "", - NULL +static const char *stdSubdirs[] = { + "drivers/", + "input/", + "multimedia/", + "extensions/", + "fonts/", + "internal/", + "", + NULL }; /* @@ -195,519 +219,529 @@ static const char *stdSubdirs[] = * These are regular expressions (suitable for use with POSIX regex(3)). */ static PatternRec stdPatterns[] = { - { "^lib(.*)\\.so$", }, - { "^lib(.*)\\.a$", }, - { "(.*)_drv\\.so$", }, - { "(.*)_drv\\.o$", }, - { "(.*)\\.so$", }, - { "(.*)\\.a$", }, - { "(.*)\\.o$", }, - { NULL, } + {"^lib(.*)\\.so$",}, + {"^lib(.*)\\.a$",}, + {"(.*)_drv\\.so$",}, + {"(.*)_drv\\.o$",}, + {"(.*)\\.so$",}, + {"(.*)\\.a$",}, + {"(.*)\\.o$",}, + {NULL,} }; static PatternPtr InitPatterns(const char **patternlist) { - char errmsg[80]; - int i, e; - PatternPtr patterns = NULL; - PatternPtr p = NULL; - static int firstTime = 1; - const char **s; - - if (firstTime) { - /* precompile stdPatterns */ - firstTime = 0; - for (p = stdPatterns; p->pattern; p++) - if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { - regerror(e, &p->rex, errmsg, sizeof(errmsg)); - FatalError("InitPatterns: regcomp error for `%s': %s\n", - p->pattern, errmsg); - } + char errmsg[80]; + int i, e; + PatternPtr patterns = NULL; + PatternPtr p = NULL; + static int firstTime = 1; + const char **s; + + if (firstTime) { + /* precompile stdPatterns */ + firstTime = 0; + for (p = stdPatterns; p->pattern; p++) + if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { + regerror(e, &p->rex, errmsg, sizeof(errmsg)); + FatalError("InitPatterns: regcomp error for `%s': %s\n", + p->pattern, errmsg); + } + } + + if (patternlist) { + for (i = 0, s = patternlist; *s; i++, s++) + if (*s == DEFAULT_LIST) + i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1; + patterns = xalloc((i + 1) * sizeof(PatternRec)); + if (!patterns) { + return NULL; } - - if (patternlist) { - for (i = 0, s = patternlist; *s; i++, s++) - if (*s == DEFAULT_LIST) - i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1; - patterns = xalloc((i + 1) * sizeof(PatternRec)); - if (!patterns) { - return NULL; + for (i = 0, s = patternlist; *s; i++, s++) + if (*s != DEFAULT_LIST) { + p = patterns + i; + p->pattern = *s; + if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { + regerror(e, &p->rex, errmsg, sizeof(errmsg)); + ErrorF("InitPatterns: regcomp error for `%s': %s\n", + p->pattern, errmsg); + i--; } - for (i = 0, s = patternlist; *s; i++, s++) - if (*s != DEFAULT_LIST) { - p = patterns + i; - p->pattern = *s; - if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) { - regerror(e, &p->rex, errmsg, sizeof(errmsg)); - ErrorF("InitPatterns: regcomp error for `%s': %s\n", - p->pattern, errmsg); - i--; - } - } else { - for (p = stdPatterns; p->pattern; p++, i++) - patterns[i] = *p; - if (p != stdPatterns) - i--; - } - patterns[i].pattern = NULL; - } else - patterns = stdPatterns; - return patterns; + } else { + for (p = stdPatterns; p->pattern; p++, i++) + patterns[i] = *p; + if (p != stdPatterns) + i--; + } + patterns[i].pattern = NULL; + } else + patterns = stdPatterns; + return patterns; } static void FreePatterns(PatternPtr patterns) { - if (patterns && patterns != stdPatterns) - xfree(patterns); + if (patterns && patterns != stdPatterns) + xfree(patterns); } static const char ** InitSubdirs(const char **subdirlist) { - int i; - char **subdirs = NULL; - const char **s, **stmp = NULL; + int i; + const char **tmp_subdirlist = NULL; + char **subdirs = NULL; + const char **s, **stmp = NULL; const char *osname; const char *slash; int oslen = 0, len; Bool indefault; if (subdirlist == NULL) { - subdirlist = xalloc(2 * sizeof(char *)); - if (subdirlist == NULL) - return NULL; - subdirlist[0] = DEFAULT_LIST; - subdirlist[1] = NULL; - } - + subdirlist = tmp_subdirlist = xalloc(2 * sizeof(char *)); + if (subdirlist == NULL) + return NULL; + subdirlist[0] = DEFAULT_LIST; + subdirlist[1] = NULL; + } + LoaderGetOS(&osname, NULL, NULL, NULL); oslen = strlen(osname); { - /* Count number of entries and check for invalid paths */ - for (i = 0, s = subdirlist; *s; i++, s++) { - if (*s == DEFAULT_LIST) { - i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1; - } else { - /* - * Path validity check. Don't allow absolute paths, or - * paths containing "..". To catch absolute paths on - * platforms that use driver letters, don't allow the ':' - * character to appear at all. - */ - if (**s == '/' || **s == '\\' || strchr(*s, ':') || - strstr(*s, "..")) { - xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s); - return NULL; - } - } + /* Count number of entries and check for invalid paths */ + for (i = 0, s = subdirlist; *s; i++, s++) { + if (*s == DEFAULT_LIST) { + i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1; + } else { + /* + * Path validity check. Don't allow absolute paths, or + * paths containing "..". To catch absolute paths on + * platforms that use driver letters, don't allow the ':' + * character to appear at all. + */ + if (**s == '/' || **s == '\\' || strchr(*s, ':') || + strstr(*s, "..")) { + xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s); + if (tmp_subdirlist) + xfree(tmp_subdirlist); + return NULL; } - subdirs = xalloc((i * 2 + 1) * sizeof(char *)); - if (!subdirs) - return NULL; - i = 0; - s = subdirlist; + } + } + subdirs = xalloc((i * 2 + 1) * sizeof(char *)); + if (!subdirs) { + if (tmp_subdirlist) + xfree(tmp_subdirlist); + return NULL; + } + i = 0; + s = subdirlist; + indefault = FALSE; + while (*s) { + if (*s == DEFAULT_LIST) { + /* Divert to the default list */ + indefault = TRUE; + stmp = ++s; + s = stdSubdirs; + } + len = strlen(*s); + if (**s && (*s)[len - 1] != '/') { + slash = "/"; + len++; + } else + slash = ""; + len += oslen + 2; + if (!(subdirs[i] = xalloc(len))) { + while (--i >= 0) + xfree(subdirs[i]); + xfree(subdirs); + if (tmp_subdirlist) + xfree(tmp_subdirlist); + return NULL; + } + /* tack on the OS name */ + sprintf(subdirs[i], "%s%s%s/", *s, slash, osname); + i++; + /* path as given */ + subdirs[i] = xstrdup(*s); + i++; + s++; + if (indefault && !s) { + /* revert back to the main list */ indefault = FALSE; - while (*s) { - if (*s == DEFAULT_LIST) { - /* Divert to the default list */ - indefault = TRUE; - stmp = ++s; - s = stdSubdirs; - } - len = strlen(*s); - if (**s && (*s)[len - 1] != '/') { - slash = "/"; - len++; - } else - slash = ""; - len += oslen + 2; - if (!(subdirs[i] = xalloc(len))) - return NULL; - /* tack on the OS name */ - sprintf(subdirs[i], "%s%s%s/", *s, slash, osname); - i++; - /* path as given */ - subdirs[i] = xstrdup(*s); - i++; - s++; - if (indefault && !s) { - /* revert back to the main list */ - indefault = FALSE; - s = stmp; - } - } - subdirs[i] = NULL; + s = stmp; + } } - return (const char **)subdirs; + subdirs[i] = NULL; + } + if (tmp_subdirlist) + xfree(tmp_subdirlist); + return (const char **)subdirs; } static void FreeSubdirs(const char **subdirs) { - const char **s; + const char **s; - if (subdirs) { - for (s = subdirs; *s; s++) - xfree(*s); - xfree(subdirs); - } + if (subdirs) { + for (s = subdirs; *s; s++) + xfree(*s); + xfree(subdirs); + } } static char * -FindModule (const char *module, const char *dir, const char **subdirlist, - PatternPtr patterns) +FindModule(const char *module, const char *dir, const char **subdirlist, + PatternPtr patterns) { - char buf[PATH_MAX + 1]; - char *dirpath = NULL; - char *name = NULL; - struct stat stat_buf; - int len, dirlen; - char *fp; - DIR *d; - const char **subdirs = NULL; - PatternPtr p = NULL; - const char **s; - struct dirent *dp; - regmatch_t match[2]; - - subdirs = InitSubdirs(subdirlist); - if (!subdirs) - return NULL; + char buf[PATH_MAX + 1]; + char *dirpath = NULL; + char *name = NULL; + struct stat stat_buf; + int len, dirlen; + char *fp; + DIR *d; + const char **subdirs = NULL; + PatternPtr p = NULL; + const char **s; + struct dirent *dp; + regmatch_t match[2]; + + subdirs = InitSubdirs(subdirlist); + if (!subdirs) + return NULL; #ifndef __EMX__ - dirpath = (char *)dir; + dirpath = (char *)dir; #else - dirpath = xalloc(strlen(dir) + 10); - strcpy(dirpath, (char *) __XOS2RedirRoot (dir)); + dirpath = xalloc(strlen(dir) + 10); + strcpy(dirpath, (char *)__XOS2RedirRoot(dir)); #endif - if (strlen(dirpath) > PATH_MAX) - return NULL; - /*xf86Msg(X_INFO,"OS2DIAG: FindModule: dirpath=%s\n",dirpath);*/ - - for (s = subdirs; *s; s++) { - if ((dirlen = strlen(dirpath) + strlen(*s)) > PATH_MAX) - continue; - strcpy(buf, dirpath); - strcat(buf, *s); - /*xf86Msg(X_INFO,"OS2DIAG: FindModule: buf=%s\n",buf);*/ - fp = buf + dirlen; - if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && - (d = opendir(buf))) { - if (buf[dirlen - 1] != '/') { - buf[dirlen++] = '/'; - fp++; - } - while ((dp = readdir(d))) { - if (dirlen + strlen(dp->d_name) + 1 > PATH_MAX) - continue; - strcpy(fp, dp->d_name); - if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))) - continue; - for (p = patterns; p->pattern; p++) { - if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && - match[1].rm_so != -1) { - len = match[1].rm_eo - match[1].rm_so; - if (len == strlen(module) && - strncmp(module, dp->d_name + match[1].rm_so, len) == 0) { - /*xf86Msg(X_INFO,"OS2DIAG: matching %s\n",buf);*/ - name = buf; - break; - } - } - } - if (name) - break; + if (strlen(dirpath) > PATH_MAX) + return NULL; + /*xf86Msg(X_INFO,"OS2DIAG: FindModule: dirpath=%s\n",dirpath); */ + + for (s = subdirs; *s; s++) { + if ((dirlen = strlen(dirpath) + strlen(*s)) > PATH_MAX) + continue; + strcpy(buf, dirpath); + strcat(buf, *s); + /*xf86Msg(X_INFO,"OS2DIAG: FindModule: buf=%s\n",buf); */ + fp = buf + dirlen; + if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && + (d = opendir(buf))) { + if (buf[dirlen - 1] != '/') { + buf[dirlen++] = '/'; + fp++; + } + while ((dp = readdir(d))) { + if (dirlen + strlen(dp->d_name) + 1 > PATH_MAX) + continue; + strcpy(fp, dp->d_name); + if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))) + continue; + for (p = patterns; p->pattern; p++) { + if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && + match[1].rm_so != -1) { + len = match[1].rm_eo - match[1].rm_so; + if (len == strlen(module) && + strncmp(module, dp->d_name + match[1].rm_so, + len) == 0) { + /*xf86Msg(X_INFO,"OS2DIAG: matching %s\n",buf); */ + name = buf; + break; } - closedir(d); - if (name) - break; + } } + if (name) + break; + } + closedir(d); + if (name) + break; } - FreeSubdirs(subdirs); - if (dirpath != dir) - xfree(dirpath); - - if (name) { - return xstrdup(name); - } - return NULL; + } + FreeSubdirs(subdirs); + if (dirpath != dir) + xfree(dirpath); + + if (name) { + return xstrdup(name); + } + return NULL; } char ** LoaderListDirs(const char **subdirlist, const char **patternlist) { - char buf[PATH_MAX + 1]; - char **pathlist; - char **elem; - const char **subdirs; - const char **s; - PatternPtr patterns; - PatternPtr p; - DIR *d; - struct dirent *dp; - regmatch_t match[2]; - struct stat stat_buf; - int len, dirlen; - char *fp; - char **listing = NULL; - char **save; - int n = 0; - - if (!(pathlist = InitPathList(NULL))) - return NULL; - if (!(subdirs = InitSubdirs(subdirlist))) { - FreePathList(pathlist); - return NULL; - } - if (!(patterns = InitPatterns(patternlist))) { - FreePathList(pathlist); - FreeSubdirs(subdirs); - return NULL; - } + char buf[PATH_MAX + 1]; + char **pathlist; + char **elem; + const char **subdirs; + const char **s; + PatternPtr patterns; + PatternPtr p; + DIR *d; + struct dirent *dp; + regmatch_t match[2]; + struct stat stat_buf; + int len, dirlen; + char *fp; + char **listing = NULL; + char **save; + int n = 0; + + if (!(pathlist = InitPathList(NULL))) + return NULL; + if (!(subdirs = InitSubdirs(subdirlist))) { + FreePathList(pathlist); + return NULL; + } + if (!(patterns = InitPatterns(patternlist))) { + FreePathList(pathlist); + FreeSubdirs(subdirs); + return NULL; + } - for (elem = pathlist; *elem; elem++) { - for (s = subdirs; *s; s++) { - if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX) - continue; - strcpy(buf, *elem); - strcat(buf, *s); - fp = buf + dirlen; - if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && - (d = opendir(buf))) { - if (buf[dirlen - 1] != '/') { - buf[dirlen++] = '/'; - fp++; - } - while ((dp = readdir(d))) { - if (dirlen + strlen(dp->d_name) > PATH_MAX) - continue; - strcpy(fp, dp->d_name); - if (!(stat(buf, &stat_buf) == 0 && - S_ISREG(stat_buf.st_mode))) - continue; - for (p = patterns; p->pattern; p++) { - if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && - match[1].rm_so != -1) { - len = match[1].rm_eo - match[1].rm_so; - save = listing; - listing = xrealloc(listing, - (n + 2) * sizeof(char *)); - if (!listing) { - if (save) { - save[n] = NULL; - FreeStringList(save); - } - FreePathList(pathlist); - FreeSubdirs(subdirs); - FreePatterns(patterns); - return NULL; - } - listing[n] = xalloc(len + 1); - if (!listing[n]) { - FreeStringList(listing); - FreePathList(pathlist); - FreeSubdirs(subdirs); - FreePatterns(patterns); - return NULL; - } - strncpy(listing[n], dp->d_name + match[1].rm_so, - len); - listing[n][len] = '\0'; - n++; - break; - } - } + for (elem = pathlist; *elem; elem++) { + for (s = subdirs; *s; s++) { + if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX) + continue; + strcpy(buf, *elem); + strcat(buf, *s); + fp = buf + dirlen; + if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) && + (d = opendir(buf))) { + if (buf[dirlen - 1] != '/') { + buf[dirlen++] = '/'; + fp++; + } + while ((dp = readdir(d))) { + if (dirlen + strlen(dp->d_name) > PATH_MAX) + continue; + strcpy(fp, dp->d_name); + if (!(stat(buf, &stat_buf) == 0 && + S_ISREG(stat_buf.st_mode))) + continue; + for (p = patterns; p->pattern; p++) { + if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && + match[1].rm_so != -1) { + len = match[1].rm_eo - match[1].rm_so; + save = listing; + listing = xrealloc(listing, + (n + 2) * sizeof(char *)); + if (!listing) { + if (save) { + save[n] = NULL; + FreeStringList(save); } - closedir(d); + FreePathList(pathlist); + FreeSubdirs(subdirs); + FreePatterns(patterns); + return NULL; + } + listing[n] = xalloc(len + 1); + if (!listing[n]) { + FreeStringList(listing); + FreePathList(pathlist); + FreeSubdirs(subdirs); + FreePatterns(patterns); + return NULL; + } + strncpy(listing[n], dp->d_name + match[1].rm_so, + len); + listing[n][len] = '\0'; + n++; + break; } + } } + closedir(d); + } } - if (listing) - listing[n] = NULL; - return listing; + } + if (listing) + listing[n] = NULL; + return listing; } void LoaderFreeDirList(char **list) { - FreeStringList(list); + FreeStringList(list); } - static Bool -CheckVersion (const char *module, XF86ModuleVersionInfo *data, - const XF86ModReqInfo *req) +CheckVersion(const char *module, XF86ModuleVersionInfo * data, + const XF86ModReqInfo * req) { - int vercode[4]; - char verstr[4]; - long ver = data->xf86version; - int errtype = 0; - - xf86Msg (X_INFO, "Module %s: vendor=\"%s\"\n", - data->modname ? data->modname : "UNKNOWN!", - data->vendor ? data->vendor : "UNKNOWN!"); - - if (ver > (4 << 24)) { - /* 4.0.x and earlier */ - verstr[1] = verstr[3] = 0; - verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0; - ver >>= 5; - verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0; - ver >>= 5; - vercode[2] = ver & 0x7f; - ver >>= 7; - vercode[1] = ver & 0x7f; - ver >>= 7; - vercode[0] = ver; - xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]); - if (vercode[2] != 0) - xf86ErrorF(".%d", vercode[2]); - xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2, - data->majorversion, data->minorversion, data->patchlevel); - } else { - vercode[0] = ver / 10000000; - vercode[1] = (ver / 100000) % 100; - vercode[2] = (ver / 1000) % 100; - vercode[3] = ver % 1000; - xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], - vercode[2]); - if (vercode[3] != 0) - xf86ErrorF(".%d", vercode[3]); - xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, - data->minorversion, data->patchlevel); - } + int vercode[4]; + char verstr[4]; + long ver = data->xf86version; + MessageType errtype; + + xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n", + data->modname ? data->modname : "UNKNOWN!", + data->vendor ? data->vendor : "UNKNOWN!"); + + if (ver > (4 << 24)) { + /* 4.0.x and earlier */ + verstr[1] = verstr[3] = 0; + verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0; + ver >>= 5; + verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0; + ver >>= 5; + vercode[2] = ver & 0x7f; + ver >>= 7; + vercode[1] = ver & 0x7f; + ver >>= 7; + vercode[0] = ver; + xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]); + if (vercode[2] != 0) + xf86ErrorF(".%d", vercode[2]); + xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2, + data->majorversion, data->minorversion, data->patchlevel); + } else { + vercode[0] = ver / 10000000; + vercode[1] = (ver / 100000) % 100; + vercode[2] = (ver / 1000) % 100; + vercode[3] = ver % 1000; + xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], + vercode[2]); + if (vercode[3] != 0) + xf86ErrorF(".%d", vercode[3]); + xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion, + data->minorversion, data->patchlevel); + } if (data->moduleclass) - xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass); - - ver = -1; - if (data->abiclass) { - int abimaj, abimin; - int vermaj, vermin; - - if (!strcmp(data->abiclass, ABI_CLASS_ANSIC)) - ver = LoaderVersionInfo.ansicVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_VIDEODRV)) - ver = LoaderVersionInfo.videodrvVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_XINPUT)) - ver = LoaderVersionInfo.xinputVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION)) - ver = LoaderVersionInfo.extensionVersion; - else if (!strcmp(data->abiclass, ABI_CLASS_FONT)) - ver = LoaderVersionInfo.fontVersion; - - abimaj = GET_ABI_MAJOR(data->abiversion); - abimin = GET_ABI_MINOR(data->abiversion); - xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n", - data->abiclass, abimaj, abimin); - if (ver != -1) { - vermaj = GET_ABI_MAJOR(ver); - vermin = GET_ABI_MINOR(ver); - if (abimaj != vermaj) { - if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) - errtype = X_WARNING; - else - errtype = X_ERROR; - xf86MsgVerb(errtype, 0, - "module ABI major version (%d) doesn't" - " match the server's version (%d)\n", - abimaj, vermaj); - if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) - return FALSE; - } else if (abimin > vermin) { - if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) - errtype = X_WARNING; - else - errtype = X_ERROR; - xf86MsgVerb(errtype, 0, - "module ABI minor version (%d) is " - "newer than the server's version " - "(%d)\n", abimin, vermin); - if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) - return FALSE; - } - } + xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass); + + ver = -1; + if (data->abiclass) { + int abimaj, abimin; + int vermaj, vermin; + + if (!strcmp(data->abiclass, ABI_CLASS_ANSIC)) + ver = LoaderVersionInfo.ansicVersion; + else if (!strcmp(data->abiclass, ABI_CLASS_VIDEODRV)) + ver = LoaderVersionInfo.videodrvVersion; + else if (!strcmp(data->abiclass, ABI_CLASS_XINPUT)) + ver = LoaderVersionInfo.xinputVersion; + else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION)) + ver = LoaderVersionInfo.extensionVersion; + else if (!strcmp(data->abiclass, ABI_CLASS_FONT)) + ver = LoaderVersionInfo.fontVersion; + + abimaj = GET_ABI_MAJOR(data->abiversion); + abimin = GET_ABI_MINOR(data->abiversion); + xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n", + data->abiclass, abimaj, abimin); + if (ver != -1) { + vermaj = GET_ABI_MAJOR(ver); + vermin = GET_ABI_MINOR(ver); + if (abimaj != vermaj) { + if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) + errtype = X_WARNING; + else + errtype = X_ERROR; + xf86MsgVerb(errtype, 0, + "module ABI major version (%d) doesn't" + " match the server's version (%d)\n", + abimaj, vermaj); + if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) + return FALSE; + } else if (abimin > vermin) { + if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) + errtype = X_WARNING; + else + errtype = X_ERROR; + xf86MsgVerb(errtype, 0, + "module ABI minor version (%d) is " + "newer than the server's version " + "(%d)\n", abimin, vermin); + if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)) + return FALSE; + } } - - /* Check against requirements that the caller has specified */ - if (req) { - if (req->majorversion != MAJOR_UNSPEC) { - if (data->majorversion != req->majorversion) { - xf86MsgVerb(X_WARNING, 2, "module major version (%d) " - "doesn't match required major version (%d)\n", - data->majorversion, req->majorversion); - return FALSE; - } else if (req->minorversion != MINOR_UNSPEC) { - if (data->minorversion < req->minorversion) { - xf86MsgVerb(X_WARNING, 2, "module minor version (%d) " - "is less than the required minor version (%d)\n", - data->minorversion, req->minorversion); - return FALSE; - } else if (data->minorversion == req->minorversion && - req->patchlevel != PATCH_UNSPEC) { - if (data->patchlevel < req->patchlevel) { - xf86MsgVerb(X_WARNING, 2, "module patch level (%d) " - "is less than the required patch level (%d)\n", - data->patchlevel, req->patchlevel); - return FALSE; - } - } - } - } - if (req->moduleclass) { - if (!data->moduleclass || - strcmp(req->moduleclass, data->moduleclass)) { - xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match " - "the required class (%s)\n", - data->moduleclass ? data->moduleclass : "<NONE>", - req->moduleclass); - return FALSE; - } - } else if (req->abiclass != ABI_CLASS_NONE) { - if (!data->abiclass || strcmp(req->abiclass, data->moduleclass)) { - xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the " - "required ABI class (%s)\n", - data->abiclass ? data->abiclass : "<NONE>", - req->abiclass); - return FALSE; - } - } - if ((req->abiclass != ABI_CLASS_NONE) && - req->abiversion != ABI_VERS_UNSPEC) { - int reqmaj, reqmin, maj, min; - reqmaj = GET_ABI_MAJOR(req->abiversion); - reqmin = GET_ABI_MINOR(req->abiversion); - maj = GET_ABI_MAJOR(data->abiversion); - min = GET_ABI_MINOR(data->abiversion); - if (maj != reqmaj) { - xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't " - "match the required ABI major version (%d)\n", - maj, reqmaj); - return FALSE; - } - /* XXX Maybe this should be the other way around? */ - if (min > reqmin) { - xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) " - "is new than that available (%d)\n", - min, reqmin); - return FALSE; - } + } + + /* Check against requirements that the caller has specified */ + if (req) { + if (req->majorversion != MAJOR_UNSPEC) { + if (data->majorversion != req->majorversion) { + xf86MsgVerb(X_WARNING, 2, "module major version (%d) " + "doesn't match required major version (%d)\n", + data->majorversion, req->majorversion); + return FALSE; + } else if (req->minorversion != MINOR_UNSPEC) { + if (data->minorversion < req->minorversion) { + xf86MsgVerb(X_WARNING, 2, "module minor version (%d) " + "is less than the required minor version (%d)\n", + data->minorversion, req->minorversion); + return FALSE; + } else if (data->minorversion == req->minorversion && + req->patchlevel != PATCH_UNSPEC) { + if (data->patchlevel < req->patchlevel) { + xf86MsgVerb(X_WARNING, 2, "module patch level (%d) " + "is less than the required patch level (%d)\n", + data->patchlevel, req->patchlevel); + return FALSE; + } } + } } - -#ifdef NOTYET - if (data->checksum) - { - /* verify the checksum field */ - /* TO BE DONE */ + if (req->moduleclass) { + if (!data->moduleclass || + strcmp(req->moduleclass, data->moduleclass)) { + xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match " + "the required class (%s)\n", + data->moduleclass ? data->moduleclass : "<NONE>", + req->moduleclass); + return FALSE; + } + } else if (req->abiclass != ABI_CLASS_NONE) { + if (!data->abiclass || strcmp(req->abiclass, data->moduleclass)) { + xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the " + "required ABI class (%s)\n", + data->abiclass ? data->abiclass : "<NONE>", + req->abiclass); + return FALSE; + } } - else - { - ErrorF ("\t*** Checksum field is 0 - this module is untrusted!\n"); + if ((req->abiclass != ABI_CLASS_NONE) && + req->abiversion != ABI_VERS_UNSPEC) { + int reqmaj, reqmin, maj, min; + + reqmaj = GET_ABI_MAJOR(req->abiversion); + reqmin = GET_ABI_MINOR(req->abiversion); + maj = GET_ABI_MAJOR(data->abiversion); + min = GET_ABI_MINOR(data->abiversion); + if (maj != reqmaj) { + xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't " + "match the required ABI major version (%d)\n", + maj, reqmaj); + return FALSE; + } + /* XXX Maybe this should be the other way around? */ + if (min > reqmin) { + xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) " + "is new than that available (%d)\n", min, reqmin); + return FALSE; + } } + } +#ifdef NOTYET + if (data->checksum) { + /* verify the checksum field */ + /* TO BE DONE */ + } else { + ErrorF("\t*** Checksum field is 0 - this module is untrusted!\n"); + } #endif return TRUE; } @@ -715,69 +749,69 @@ CheckVersion (const char *module, XF86ModuleVersionInfo *data, ModuleDescPtr LoadSubModule(ModuleDescPtr parent, const char *module, const char **subdirlist, const char **patternlist, - pointer options, const XF86ModReqInfo *modreq, + pointer options, const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { - ModuleDescPtr submod; + ModuleDescPtr submod; - xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module); + xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module); - /* Absolute module paths are not allowed here */ + /* Absolute module paths are not allowed here */ #ifndef __UNIXOS2__ - if (module[0] == '/') + if (module[0] == '/') #else - if (isalpha (module[0]) && module[1] == ':' && module[2] == '/') + if (isalpha(module[0]) && module[1] == ':' && module[2] == '/') #endif - { - xf86Msg(X_ERROR, - "LoadSubModule: Absolute module path not permitted: \"%s\"\n", - module); - if (errmaj) - *errmaj = LDR_BADUSAGE; - if (errmin) - *errmin = 0; - return NULL; - } - - submod = LoadModule (module, NULL, subdirlist, patternlist, options, - modreq, errmaj, errmin); - if (submod) { - parent->child = AddSibling (parent->child, submod); - submod->parent = parent; - } - return submod; + { + xf86Msg(X_ERROR, + "LoadSubModule: Absolute module path not permitted: \"%s\"\n", + module); + if (errmaj) + *errmaj = LDR_BADUSAGE; + if (errmin) + *errmin = 0; + return NULL; + } + + submod = LoadModule(module, NULL, subdirlist, patternlist, options, + modreq, errmaj, errmin); + if (submod) { + parent->child = AddSibling(parent->child, submod); + submod->parent = parent; + } + return submod; } ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) { - ModuleDescPtr ret; + ModuleDescPtr ret; - if (!mod) - return NULL; + if (!mod) + return NULL; - ret = NewModuleDesc(mod->name); - if (ret == NULL) - return NULL; + ret = NewModuleDesc(mod->name); + if (ret == NULL) + return NULL; - if (LoaderHandleOpen(mod->handle) == -1) - return NULL; + if (LoaderHandleOpen(mod->handle) == -1) + return NULL; - ret->filename = xstrdup(mod->filename); - ret->identifier = mod->identifier; - ret->client_id = mod->client_id; - ret->in_use = mod->in_use; - ret->handle = mod->handle; - ret->SetupProc = mod->SetupProc; - ret->TearDownProc = mod->TearDownProc; - ret->TearDownData = NULL; - ret->path = mod->path; - ret->child = DuplicateModule(mod->child, ret); - ret->sib = DuplicateModule(mod->sib, parent); - ret->parent = parent; - ret->VersionInfo = mod->VersionInfo; - - return ret; + ret->filename = xstrdup(mod->filename); + ret->identifier = mod->identifier; + ret->client_id = mod->client_id; + ret->in_use = mod->in_use; + ret->handle = mod->handle; + ret->SetupProc = mod->SetupProc; + ret->TearDownProc = mod->TearDownProc; + ret->TearDownData = NULL; + ret->path = mod->path; + ret->child = DuplicateModule(mod->child, ret); + ret->sib = DuplicateModule(mod->sib, parent); + ret->parent = parent; + ret->VersionInfo = mod->VersionInfo; + + return ret; } /* @@ -819,241 +853,227 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) */ ModuleDescPtr -LoadModule (const char *module, const char *path, const char **subdirlist, - const char **patternlist, pointer options, - const XF86ModReqInfo * modreq, - int *errmaj, int *errmin) +LoadModule(const char *module, const char *path, const char **subdirlist, + const char **patternlist, pointer options, + const XF86ModReqInfo * modreq, int *errmaj, int *errmin) { - XF86ModuleData *initdata = NULL; - char **pathlist = NULL; - char *found = NULL; - char *name = NULL; - char **path_elem = NULL; - char *p = NULL; - ModuleDescPtr ret = NULL; - int wasLoaded = 0; - PatternPtr patterns = NULL; - int noncanonical = 0; - char *m = NULL; - - /*xf86Msg(X_INFO,"OS2DIAG: LoadModule: %s\n",module);*/ - xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module); - - patterns = InitPatterns(patternlist); - name = LoaderGetCanonicalName(module, patterns); - noncanonical = (name && strcmp(module, name) != 0); - if (noncanonical) - { - xf86ErrorFVerb(3, " (%s)\n", name); - xf86MsgVerb(X_WARNING, 1, - "LoadModule: given non-canonical module name \"%s\"\n", - module); - m = name; - } - else - { - xf86ErrorFVerb(3, "\n"); - m = (char *)module; - } - if (!name) { - if (errmaj) - *errmaj = LDR_BADUSAGE; - if (errmin) - *errmin = 0; - goto LoadModule_fail; - } - ret = NewModuleDesc (name); - if (!ret) { - if (errmaj) - *errmaj = LDR_NOMEM; - if (errmin) - *errmin = 0; - goto LoadModule_fail; - } - - pathlist = InitPathList(path); - if (!pathlist) { - /* This could be a malloc failure too */ - if (errmaj) - *errmaj = LDR_BADUSAGE; - if (errmin) - *errmin = 1; - goto LoadModule_fail; - } - - /* - * if the module name is not a full pathname, we need to - * check the elements in the path - */ + XF86ModuleData *initdata = NULL; + char **pathlist = NULL; + char *found = NULL; + char *name = NULL; + char **path_elem = NULL; + char *p = NULL; + ModuleDescPtr ret = NULL; + int wasLoaded = 0; + PatternPtr patterns = NULL; + int noncanonical = 0; + char *m = NULL; + + /*xf86Msg(X_INFO,"OS2DIAG: LoadModule: %s\n",module); */ + xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module); + + patterns = InitPatterns(patternlist); + name = LoaderGetCanonicalName(module, patterns); + noncanonical = (name && strcmp(module, name) != 0); + if (noncanonical) { + xf86ErrorFVerb(3, " (%s)\n", name); + xf86MsgVerb(X_WARNING, 1, + "LoadModule: given non-canonical module name \"%s\"\n", + module); + m = name; + } else { + xf86ErrorFVerb(3, "\n"); + m = (char *)module; + } + if (!name) { + if (errmaj) + *errmaj = LDR_BADUSAGE; + if (errmin) + *errmin = 0; + goto LoadModule_fail; + } + ret = NewModuleDesc(name); + if (!ret) { + if (errmaj) + *errmaj = LDR_NOMEM; + if (errmin) + *errmin = 0; + goto LoadModule_fail; + } + + pathlist = InitPathList(path); + if (!pathlist) { + /* This could be a malloc failure too */ + if (errmaj) + *errmaj = LDR_BADUSAGE; + if (errmin) + *errmin = 1; + goto LoadModule_fail; + } + + /* + * if the module name is not a full pathname, we need to + * check the elements in the path + */ #ifndef __UNIXOS2__ - if (module[0] == '/') - found = xstrdup(module); + if (module[0] == '/') + found = xstrdup(module); #else - /* accept a drive name here */ - if (isalpha (module[0]) && module[1] == ':' && module[2] == '/') - found = xstrdup(module); + /* accept a drive name here */ + if (isalpha(module[0]) && module[1] == ':' && module[2] == '/') + found = xstrdup(module); #endif - path_elem = pathlist; - while (!found && *path_elem != NULL) - { - found = FindModule (m, *path_elem, subdirlist, patterns); - path_elem++; - /* - * When the module name isn't the canonical name, search for the - * former if no match was found for the latter. - */ - if (!*path_elem && m == name) - { - path_elem = pathlist; - m = (char *)module; - } - } - - /* - * did we find the module? - */ - if (!found) - { - xf86Msg (X_WARNING, "Warning, couldn't open module %s\n", - module); - if (errmaj) - *errmaj = LDR_NOENT; - if (errmin) - *errmin = 0; - goto LoadModule_fail; - } - ret->handle = LoaderOpen (found, name, 0, errmaj, errmin, &wasLoaded); - if (ret->handle < 0) - goto LoadModule_fail; - - ret->filename = xstrdup(found); - + path_elem = pathlist; + while (!found && *path_elem != NULL) { + found = FindModule(m, *path_elem, subdirlist, patterns); + path_elem++; /* - * now check if the special data object <modulename>ModuleData is - * present. + * When the module name isn't the canonical name, search for the + * former if no match was found for the latter. */ - p = xalloc (strlen (name) + strlen ("ModuleData") + 1); - if (!p) { - if (errmaj) - *errmaj = LDR_NOMEM; - if (errmin) - *errmin = 0; - goto LoadModule_fail; + if (!*path_elem && m == name) { + path_elem = pathlist; + m = (char *)module; } - strcpy (p, name); - strcat (p, "ModuleData"); - initdata = LoaderSymbol (p); - if (initdata) - { - ModuleSetupProc setup; - ModuleTearDownProc teardown; - XF86ModuleVersionInfo *vers; - - vers = initdata->vers; - setup = initdata->setup; - teardown = initdata->teardown; - - if (!wasLoaded) { - if (vers) { - if (!CheckVersion (module, vers, modreq)) { - if (errmaj) - *errmaj = LDR_MISMATCH; - if (errmin) - *errmin = 0; - goto LoadModule_fail; - } - } else { - xf86Msg(X_ERROR, - "LoadModule: Module %s does not supply" - " version information\n", module); - if (errmaj) - *errmaj = LDR_INVALID; - if (errmin) - *errmin = 0; - goto LoadModule_fail; - } + } + + /* + * did we find the module? + */ + if (!found) { + xf86Msg(X_WARNING, "Warning, couldn't open module %s\n", module); + if (errmaj) + *errmaj = LDR_NOENT; + if (errmin) + *errmin = 0; + goto LoadModule_fail; + } + ret->handle = LoaderOpen(found, name, 0, errmaj, errmin, &wasLoaded); + if (ret->handle < 0) + goto LoadModule_fail; + + ret->filename = xstrdup(found); + + /* + * now check if the special data object <modulename>ModuleData is + * present. + */ + p = xalloc(strlen(name) + strlen("ModuleData") + 1); + if (!p) { + if (errmaj) + *errmaj = LDR_NOMEM; + if (errmin) + *errmin = 0; + goto LoadModule_fail; + } + strcpy(p, name); + strcat(p, "ModuleData"); + initdata = LoaderSymbol(p); + if (initdata) { + ModuleSetupProc setup; + ModuleTearDownProc teardown; + XF86ModuleVersionInfo *vers; + + vers = initdata->vers; + setup = initdata->setup; + teardown = initdata->teardown; + + if (!wasLoaded) { + if (vers) { + if (!CheckVersion(module, vers, modreq)) { + if (errmaj) + *errmaj = LDR_MISMATCH; + if (errmin) + *errmin = 0; + goto LoadModule_fail; } - if (setup) - ret->SetupProc = setup; - if (teardown) - ret->TearDownProc = teardown; - ret->path = path; - ret->VersionInfo = vers; - } - else - { - /* No initdata is OK for external modules */ - if (options == EXTERN_MODULE) - goto LoadModule_exit; - - /* no initdata, fail the load */ - xf86Msg (X_ERROR, "LoadModule: Module %s does not have a %s " - "data object.\n", module, p); + } else { + xf86Msg(X_ERROR, + "LoadModule: Module %s does not supply" + " version information\n", module); if (errmaj) - *errmaj = LDR_INVALID; + *errmaj = LDR_INVALID; if (errmin) - *errmin = 0; + *errmin = 0; goto LoadModule_fail; + } } - if (ret->SetupProc) - { - ret->TearDownData = ret->SetupProc (ret, options, errmaj, errmin); - if (!ret->TearDownData) - { - goto LoadModule_fail; - } - } - else if (options) - { - xf86Msg (X_WARNING, "Module Options present, but no SetupProc " - "available for %s\n", module); + if (setup) + ret->SetupProc = setup; + if (teardown) + ret->TearDownProc = teardown; + ret->path = path; + ret->VersionInfo = vers; + } else { + /* No initdata is OK for external modules */ + if (options == EXTERN_MODULE) + goto LoadModule_exit; + + /* no initdata, fail the load */ + xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s " + "data object.\n", module, p); + if (errmaj) + *errmaj = LDR_INVALID; + if (errmin) + *errmin = 0; + goto LoadModule_fail; + } + if (ret->SetupProc) { + ret->TearDownData = ret->SetupProc(ret, options, errmaj, errmin); + if (!ret->TearDownData) { + goto LoadModule_fail; } - goto LoadModule_exit; + } else if (options) { + xf86Msg(X_WARNING, "Module Options present, but no SetupProc " + "available for %s\n", module); + } + goto LoadModule_exit; LoadModule_fail: - UnloadModule (ret); - ret = NULL; + UnloadModule(ret); + ret = NULL; LoadModule_exit: - FreePathList(pathlist); - FreePatterns(patterns); - TestFree (found); - TestFree (name); - TestFree (p); - - /* - * If you need to do something to keep the - * instruction cache in sync with the main - * memory before jumping to that code, you may - * do it here. - */ + FreePathList(pathlist); + FreePatterns(patterns); + TestFree(found); + TestFree(name); + TestFree(p); + + /* + * If you need to do something to keep the + * instruction cache in sync with the main + * memory before jumping to that code, you may + * do it here. + */ #ifdef __alpha__ - istream_mem_barrier(); + istream_mem_barrier(); #endif - return ret; + return ret; } ModuleDescPtr -LoadDriver (const char *module, const char *path, int handle, pointer options, - int *errmaj, int *errmin) +LoadDriver(const char *module, const char *path, int handle, pointer options, + int *errmaj, int *errmin) { -return LoadModule (module, path, NULL, NULL, options, NULL, errmaj, errmin); + return LoadModule(module, path, NULL, NULL, options, NULL, errmaj, + errmin); } void -UnloadModule (ModuleDescPtr mod) +UnloadModule(ModuleDescPtr mod) { - UnloadModuleOrDriver (mod); + UnloadModuleOrDriver(mod); } void -UnloadDriver (ModuleDescPtr mod) +UnloadDriver(ModuleDescPtr mod) { - UnloadModuleOrDriver (mod); + UnloadModuleOrDriver(mod); } static void -UnloadModuleOrDriver (ModuleDescPtr mod) +UnloadModuleOrDriver(ModuleDescPtr mod) { if (mod == NULL || mod->name == NULL) return; @@ -1061,18 +1081,18 @@ UnloadModuleOrDriver (ModuleDescPtr mod) xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name); if ((mod->TearDownProc) && (mod->TearDownData)) - mod->TearDownProc (mod->TearDownData); - LoaderUnload (mod->handle); + mod->TearDownProc(mod->TearDownData); + LoaderUnload(mod->handle); if (mod->child) - UnloadModuleOrDriver (mod->child); + UnloadModuleOrDriver(mod->child); if (mod->sib) - UnloadModuleOrDriver (mod->sib); - TestFree (mod->name); - TestFree (mod->filename); - xfree (mod); + UnloadModuleOrDriver(mod->sib); + TestFree(mod->name); + TestFree(mod->filename); + xfree(mod); #ifdef __alpha__ - istream_mem_barrier(); + istream_mem_barrier(); #endif } @@ -1085,69 +1105,67 @@ UnloadSubModule(ModuleDescPtr mod) xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name); if ((mod->TearDownProc) && (mod->TearDownData)) - mod->TearDownProc (mod->TearDownData); - LoaderUnload (mod->handle); + mod->TearDownProc(mod->TearDownData); + LoaderUnload(mod->handle); RemoveChild(mod); if (mod->child) - UnloadModuleOrDriver (mod->child); + UnloadModuleOrDriver(mod->child); - TestFree (mod->name); - TestFree (mod->filename); - xfree (mod); + TestFree(mod->name); + TestFree(mod->filename); + xfree(mod); } void -FreeModuleDesc (ModuleDescPtr head) +FreeModuleDesc(ModuleDescPtr head) { - ModuleDescPtr sibs, prev; + ModuleDescPtr sibs, prev; - /* - * only free it if it's not marked as in use. In use means that it may - * be unloaded someday, and UnloadModule or UnloadDriver will free it - */ - if (head->in_use) - return; - if (head->child) - FreeModuleDesc (head->child); - sibs = head; - while (sibs) - { - prev = sibs; - sibs = sibs->sib; - TestFree (prev->name); - xfree (prev); - } + /* + * only free it if it's not marked as in use. In use means that it may + * be unloaded someday, and UnloadModule or UnloadDriver will free it + */ + if (head->in_use) + return; + if (head->child) + FreeModuleDesc(head->child); + sibs = head; + while (sibs) { + prev = sibs; + sibs = sibs->sib; + TestFree(prev->name); + xfree(prev); + } } ModuleDescPtr -NewModuleDesc (const char *name) +NewModuleDesc(const char *name) { - ModuleDescPtr mdp = xalloc (sizeof (ModuleDesc)); - - if (mdp) - { - mdp->child = NULL; - mdp->sib = NULL; - mdp->parent = NULL; - mdp->demand_next = NULL; - mdp->name = xstrdup (name); - mdp->filename = NULL; - mdp->identifier = NULL; - mdp->client_id = 0; - mdp->in_use = 0; - mdp->handle = -1; - mdp->SetupProc = NULL; - mdp->TearDownProc = NULL; - mdp->TearDownData = NULL; - } - - return (mdp); + ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc)); + + if (mdp) { + mdp->child = NULL; + mdp->sib = NULL; + mdp->parent = NULL; + mdp->demand_next = NULL; + mdp->name = xstrdup(name); + mdp->filename = NULL; + mdp->identifier = NULL; + mdp->client_id = 0; + mdp->in_use = 0; + mdp->handle = -1; + mdp->SetupProc = NULL; + mdp->TearDownProc = NULL; + mdp->TearDownData = NULL; + } + + return (mdp); } ModuleDescPtr -AddSibling (ModuleDescPtr head, ModuleDescPtr new) +AddSibling(ModuleDescPtr head, ModuleDescPtr new) { new->sib = head; return (new); @@ -1155,142 +1173,140 @@ AddSibling (ModuleDescPtr head, ModuleDescPtr new) } static void -RemoveChild (ModuleDescPtr child) +RemoveChild(ModuleDescPtr child) { - ModuleDescPtr mdp; - ModuleDescPtr prevsib; - ModuleDescPtr parent; + ModuleDescPtr mdp; + ModuleDescPtr prevsib; + ModuleDescPtr parent; - if (!child->parent) - return; - - parent = child->parent; - if (parent->child == child) { - parent->child = child->sib; - return; - } + if (!child->parent) + return; - prevsib = parent->child; - mdp = prevsib->sib; - while (mdp && mdp != child) { - prevsib = mdp; - mdp = mdp->sib; - } - if (mdp == child) - prevsib->sib = child->sib; + parent = child->parent; + if (parent->child == child) { + parent->child = child->sib; return; + } + + prevsib = parent->child; + mdp = prevsib->sib; + while (mdp && mdp != child) { + prevsib = mdp; + mdp = mdp->sib; + } + if (mdp == child) + prevsib->sib = child->sib; + return; } void LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin) { - const char *msg; - - switch (errmaj) { - case LDR_NOERROR: - msg = "no error"; - break; - case LDR_NOMEM: - msg = "out of memory"; - break; - case LDR_NOENT: - msg = "module does not exist"; - break; - case LDR_NOSUBENT: - msg = "a required submodule could not be loaded"; - break; - case LDR_NOSPACE: - msg = "too many modules"; - break; - case LDR_NOMODOPEN: - msg = "open failed"; - break; - case LDR_UNKTYPE: - msg = "unknown module type"; - break; - case LDR_NOLOAD: - msg = "loader failed"; - break; - case LDR_ONCEONLY: - msg = "once-only module"; - break; - case LDR_NOPORTOPEN: - msg = "port open failed"; - break; - case LDR_NOHARDWARE: - msg = "no hardware found"; - break; - case LDR_MISMATCH: - msg = "module requirement mismatch"; - break; - case LDR_BADUSAGE: - msg = "invalid argument(s) to LoadModule()"; - break; - case LDR_INVALID: - msg = "invalid module"; - break; - case LDR_BADOS: - msg = "module doesn't support this OS"; - break; - case LDR_MODSPECIFIC: - msg = "module-specific error"; - break; - default: - msg = "uknown error"; - } - if (name) - xf86Msg(X_ERROR, "%s: Failed to load module \"%s\" (%s, %d)\n", - name, modname, msg, errmin); - else - xf86Msg(X_ERROR, "Failed to load module \"%s\" (%s, %d)\n", - modname, msg, errmin); + const char *msg; + + switch (errmaj) { + case LDR_NOERROR: + msg = "no error"; + break; + case LDR_NOMEM: + msg = "out of memory"; + break; + case LDR_NOENT: + msg = "module does not exist"; + break; + case LDR_NOSUBENT: + msg = "a required submodule could not be loaded"; + break; + case LDR_NOSPACE: + msg = "too many modules"; + break; + case LDR_NOMODOPEN: + msg = "open failed"; + break; + case LDR_UNKTYPE: + msg = "unknown module type"; + break; + case LDR_NOLOAD: + msg = "loader failed"; + break; + case LDR_ONCEONLY: + msg = "once-only module"; + break; + case LDR_NOPORTOPEN: + msg = "port open failed"; + break; + case LDR_NOHARDWARE: + msg = "no hardware found"; + break; + case LDR_MISMATCH: + msg = "module requirement mismatch"; + break; + case LDR_BADUSAGE: + msg = "invalid argument(s) to LoadModule()"; + break; + case LDR_INVALID: + msg = "invalid module"; + break; + case LDR_BADOS: + msg = "module doesn't support this OS"; + break; + case LDR_MODSPECIFIC: + msg = "module-specific error"; + break; + default: + msg = "uknown error"; + } + if (name) + xf86Msg(X_ERROR, "%s: Failed to load module \"%s\" (%s, %d)\n", + name, modname, msg, errmin); + else + xf86Msg(X_ERROR, "Failed to load module \"%s\" (%s, %d)\n", + modname, msg, errmin); } - /* Given a module path or file name, return the module's canonical name */ static char * LoaderGetCanonicalName(const char *modname, PatternPtr patterns) { - char *str; - const char *s; - int len; - PatternPtr p; - regmatch_t match[2]; - - /* Strip off any leading path */ - s = strrchr(modname, '/'); - if (s == NULL) - s = modname; - else - s++; - - /* Find the first regex that is matched */ - for (p = patterns; p->pattern; p++) - if (regexec(&p->rex, s, 2, match, 0) == 0 && - match[1].rm_so != -1) { - len = match[1].rm_eo - match[1].rm_so; - str = xalloc(len + 1); - if (!str) - return NULL; - strncpy(str, s + match[1].rm_so, len); - str[len] = '\0'; - return str; - } + char *str; + const char *s; + int len; + PatternPtr p; + regmatch_t match[2]; + + /* Strip off any leading path */ + s = strrchr(modname, '/'); + if (s == NULL) + s = modname; + else + s++; + + /* Find the first regex that is matched */ + for (p = patterns; p->pattern; p++) + if (regexec(&p->rex, s, 2, match, 0) == 0 && match[1].rm_so != -1) { + len = match[1].rm_eo - match[1].rm_so; + str = xalloc(len + 1); + if (!str) + return NULL; + strncpy(str, s + match[1].rm_so, len); + str[len] = '\0'; + return str; + } - /* If there is no match, return the whole name minus the leading path */ - return xstrdup(s); + /* If there is no match, return the whole name minus the leading path */ + return xstrdup(s); } /* * Return the module version information. */ unsigned long -LoaderGetModuleVersion (ModuleDescPtr mod) +LoaderGetModuleVersion(ModuleDescPtr mod) { if (!mod || !mod->VersionInfo) - return 0; + return 0; return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion, - mod->VersionInfo->minorversion, - mod->VersionInfo->patchlevel); + mod->VersionInfo->minorversion, + mod->VersionInfo->patchlevel); } diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c index 989978330..c2bf47587 100644 --- a/hw/xfree86/loader/misym.c +++ b/hw/xfree86/loader/misym.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.35 2002/09/16 18:06:11 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.38 2003/10/15 16:29:04 dawes Exp $ */ /* * @@ -22,6 +22,34 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ + +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #include "sym.h" #include "misc.h" #include "mi.h" @@ -49,132 +77,133 @@ extern miPointerSpriteFuncRec miSpritePointerFuncs; LOOKUP miLookupTab[] = { - SYMFUNC(miClearToBackground) - SYMFUNC(miSendGraphicsExpose) - SYMFUNC(miModifyPixmapHeader) - SYMFUNC(miHandleValidateExposures) - SYMFUNC(miSetShape) - SYMFUNC(miChangeBorderWidth) - SYMFUNC(miShapedWindowIn) - SYMFUNC(miRectIn) - SYMFUNC(miZeroClipLine) - SYMFUNC(miZeroDashLine) - SYMFUNC(miClearDrawable) - SYMFUNC(miPolyPoint) - SYMFUNC(miStepDash) - SYMFUNC(miEmptyBox) - SYMFUNC(miEmptyData) - SYMFUNC(miIntersect) - SYMFUNC(miRegionAppend) - SYMFUNC(miRegionCopy) - SYMFUNC(miRegionDestroy) - SYMFUNC(miRegionEmpty) - SYMFUNC(miRegionExtents) - SYMFUNC(miRegionInit) - SYMFUNC(miRegionNotEmpty) - SYMFUNC(miRegionReset) - SYMFUNC(miRegionUninit) - SYMFUNC(miRegionValidate) - SYMFUNC(miTranslateRegion) - SYMFUNC(miHandleExposures) - SYMFUNC(miPolyFillRect) - SYMFUNC(miPolyFillArc) - SYMFUNC(miImageGlyphBlt) - SYMFUNC(miPolyGlyphBlt) - SYMFUNC(miFillPolygon) - SYMFUNC(miFillConvexPoly) - SYMFUNC(miPolySegment) - SYMFUNC(miZeroLine) - SYMFUNC(miWideLine) - SYMFUNC(miWideDash) - SYMFUNC(miZeroPolyArc) - SYMFUNC(miPolyArc) - SYMFUNC(miCreateGCOps) - SYMFUNC(miDestroyGCOps) - SYMFUNC(miComputeCompositeClip) - SYMFUNC(miChangeGC) - SYMFUNC(miCopyGC) - SYMFUNC(miDestroyGC) - SYMFUNC(miChangeClip) - SYMFUNC(miDestroyClip) - SYMFUNC(miCopyClip) - SYMFUNC(miPolyRectangle) - SYMFUNC(miPolyText8) - SYMFUNC(miPolyText16) - SYMFUNC(miImageText8) - SYMFUNC(miImageText16) - SYMFUNC(miRegionCreate) - SYMFUNC(miPaintWindow) - SYMFUNC(miZeroArcSetup) - SYMFUNC(miFillArcSetup) - SYMFUNC(miFillArcSliceSetup) - SYMFUNC(miFindMaxBand) - SYMFUNC(miClipSpans) - SYMFUNC(miAllocateGCPrivateIndex) - SYMFUNC(miScreenInit) - SYMFUNC(miGetScreenPixmap) - SYMFUNC(miSetScreenPixmap) - SYMFUNC(miPointerCurrentScreen) - SYMFUNC(miRectAlloc) - SYMFUNC(miInitializeBackingStore) - SYMFUNC(miInitializeBanking) - SYMFUNC(miModifyBanking) - SYMFUNC(miCopyPlane) - SYMFUNC(miCopyArea) - SYMFUNC(miCreateScreenResources) - SYMFUNC(miGetImage) - SYMFUNC(miPutImage) - SYMFUNC(miPushPixels) - SYMFUNC(miPointerInitialize) - SYMFUNC(miPointerPosition) - SYMFUNC(miRecolorCursor) - SYMFUNC(miPointerWarpCursor) - SYMFUNC(miDCInitialize) - SYMFUNC(miRectsToRegion) - SYMFUNC(miPointInRegion) - SYMFUNC(miInverse) - SYMFUNC(miSubtract) - SYMFUNC(miUnion) - SYMFUNC(miPolyBuildEdge) - SYMFUNC(miPolyBuildPoly) - SYMFUNC(miRoundJoinClip) - SYMFUNC(miRoundCapClip) - SYMFUNC(miSetZeroLineBias) - SYMFUNC(miResolveColor) - SYMFUNC(miInitializeColormap) - SYMFUNC(miInstallColormap) - SYMFUNC(miUninstallColormap) - SYMFUNC(miListInstalledColormaps) - SYMFUNC(miExpandDirectColors) - SYMFUNC(miCreateDefColormap) - SYMFUNC(miClearVisualTypes) - SYMFUNC(miSetVisualTypes) - SYMFUNC(miSetVisualTypesAndMasks) - SYMFUNC(miGetDefaultVisualMask) - SYMFUNC(miSetPixmapDepths) - SYMFUNC(miInitVisuals) - SYMFUNC(miWindowExposures) - SYMFUNC(miSegregateChildren) - SYMFUNC(miClipNotify) - SYMFUNC(miHookInitVisuals) - SYMFUNC(miPointerAbsoluteCursor) - SYMFUNC(miPointerGetMotionEvents) - SYMFUNC(miPointerGetMotionBufferSize) - SYMFUNC(miOverlayCopyUnderlay) - SYMFUNC(miOverlaySetTransFunction) - SYMFUNC(miOverlayCollectUnderlayRegions) - SYMFUNC(miInitOverlay) - SYMFUNC(miOverlayComputeCompositeClip) - SYMFUNC(miOverlayGetPrivateClips) - SYMFUNC(miOverlaySetRootClip) - SYMVAR(miZeroLineScreenIndex) - SYMVAR(miSpritePointerFuncs) - SYMVAR(miPointerScreenIndex) - SYMVAR(miInstalledMaps) - SYMVAR(miInitVisualsProc) + SYMFUNC(miClearToBackground) + SYMFUNC(miSendGraphicsExpose) + SYMFUNC(miModifyPixmapHeader) + SYMFUNC(miHandleValidateExposures) + SYMFUNC(miSetShape) + SYMFUNC(miChangeBorderWidth) + SYMFUNC(miShapedWindowIn) + SYMFUNC(miRectIn) + SYMFUNC(miZeroClipLine) + SYMFUNC(miZeroDashLine) + SYMFUNC(miClearDrawable) + SYMFUNC(miPolyPoint) + SYMFUNC(miStepDash) + SYMFUNC(miEmptyBox) + SYMFUNC(miEmptyData) + SYMFUNC(miIntersect) + SYMFUNC(miRegionAppend) + SYMFUNC(miRegionCopy) + SYMFUNC(miRegionDestroy) + SYMFUNC(miRegionEmpty) + SYMFUNC(miRegionExtents) + SYMFUNC(miRegionInit) + SYMFUNC(miRegionNotEmpty) + SYMFUNC(miRegionEqual) + SYMFUNC(miRegionReset) + SYMFUNC(miRegionUninit) + SYMFUNC(miRegionValidate) + SYMFUNC(miTranslateRegion) + SYMFUNC(miHandleExposures) + SYMFUNC(miPolyFillRect) + SYMFUNC(miPolyFillArc) + SYMFUNC(miImageGlyphBlt) + SYMFUNC(miPolyGlyphBlt) + SYMFUNC(miFillPolygon) + SYMFUNC(miFillConvexPoly) + SYMFUNC(miPolySegment) + SYMFUNC(miZeroLine) + SYMFUNC(miWideLine) + SYMFUNC(miWideDash) + SYMFUNC(miZeroPolyArc) + SYMFUNC(miPolyArc) + SYMFUNC(miCreateGCOps) + SYMFUNC(miDestroyGCOps) + SYMFUNC(miComputeCompositeClip) + SYMFUNC(miChangeGC) + SYMFUNC(miCopyGC) + SYMFUNC(miDestroyGC) + SYMFUNC(miChangeClip) + SYMFUNC(miDestroyClip) + SYMFUNC(miCopyClip) + SYMFUNC(miPolyRectangle) + SYMFUNC(miPolyText8) + SYMFUNC(miPolyText16) + SYMFUNC(miImageText8) + SYMFUNC(miImageText16) + SYMFUNC(miRegionCreate) + SYMFUNC(miPaintWindow) + SYMFUNC(miZeroArcSetup) + SYMFUNC(miFillArcSetup) + SYMFUNC(miFillArcSliceSetup) + SYMFUNC(miFindMaxBand) + SYMFUNC(miClipSpans) + SYMFUNC(miAllocateGCPrivateIndex) + SYMFUNC(miScreenInit) + SYMFUNC(miGetScreenPixmap) + SYMFUNC(miSetScreenPixmap) + SYMFUNC(miPointerCurrentScreen) + SYMFUNC(miRectAlloc) + SYMFUNC(miInitializeBackingStore) + SYMFUNC(miInitializeBanking) + SYMFUNC(miModifyBanking) + SYMFUNC(miCopyPlane) + SYMFUNC(miCopyArea) + SYMFUNC(miCreateScreenResources) + SYMFUNC(miGetImage) + SYMFUNC(miPutImage) + SYMFUNC(miPushPixels) + SYMFUNC(miPointerInitialize) + SYMFUNC(miPointerPosition) + SYMFUNC(miRecolorCursor) + SYMFUNC(miPointerWarpCursor) + SYMFUNC(miDCInitialize) + SYMFUNC(miRectsToRegion) + SYMFUNC(miPointInRegion) + SYMFUNC(miInverse) + SYMFUNC(miSubtract) + SYMFUNC(miUnion) + SYMFUNC(miPolyBuildEdge) + SYMFUNC(miPolyBuildPoly) + SYMFUNC(miRoundJoinClip) + SYMFUNC(miRoundCapClip) + SYMFUNC(miSetZeroLineBias) + SYMFUNC(miResolveColor) + SYMFUNC(miInitializeColormap) + SYMFUNC(miInstallColormap) + SYMFUNC(miUninstallColormap) + SYMFUNC(miListInstalledColormaps) + SYMFUNC(miExpandDirectColors) + SYMFUNC(miCreateDefColormap) + SYMFUNC(miClearVisualTypes) + SYMFUNC(miSetVisualTypes) + SYMFUNC(miSetVisualTypesAndMasks) + SYMFUNC(miGetDefaultVisualMask) + SYMFUNC(miSetPixmapDepths) + SYMFUNC(miInitVisuals) + SYMFUNC(miWindowExposures) + SYMFUNC(miSegregateChildren) + SYMFUNC(miClipNotify) + SYMFUNC(miHookInitVisuals) + SYMFUNC(miPointerAbsoluteCursor) + SYMFUNC(miPointerGetMotionEvents) + SYMFUNC(miPointerGetMotionBufferSize) + SYMFUNC(miOverlayCopyUnderlay) + SYMFUNC(miOverlaySetTransFunction) + SYMFUNC(miOverlayCollectUnderlayRegions) + SYMFUNC(miInitOverlay) + SYMFUNC(miOverlayComputeCompositeClip) + SYMFUNC(miOverlayGetPrivateClips) + SYMFUNC(miOverlaySetRootClip) + SYMVAR(miZeroLineScreenIndex) + SYMVAR(miSpritePointerFuncs) + SYMVAR(miPointerScreenIndex) + SYMVAR(miInstalledMaps) + SYMVAR(miInitVisualsProc) #ifdef RENDER - SYMVAR(miGlyphExtents) + SYMVAR(miGlyphExtents) #endif - { 0, 0 }, + {0, 0} }; diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c index e2e710077..49f9c0d84 100644 --- a/hw/xfree86/loader/os.c +++ b/hw/xfree86/loader/os.c @@ -1,4 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.2 2002/05/31 18:46:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.4 2003/10/15 16:29:04 dawes Exp $ */ + +/* + * Copyright (c) 1999-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "loaderProcs.h" @@ -35,15 +62,13 @@ #define OSNAME "unknown" #endif - /* Return the OS name, and run-time OS version */ void LoaderGetOS(const char **name, int *major, int *minor, int *teeny) { - if (name) - *name = OSNAME; - - /* reporting runtime versions isn't supported yet */ -} + if (name) + *name = OSNAME; + /* reporting runtime versions isn't supported yet */ +} diff --git a/hw/xfree86/loader/sym.h b/hw/xfree86/loader/sym.h index 6ad38aa49..e937b9f08 100644 --- a/hw/xfree86/loader/sym.h +++ b/hw/xfree86/loader/sym.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.6 2000/10/24 00:06:55 anderson Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.7 2003/10/15 16:29:04 dawes Exp $ */ /* * @@ -31,11 +31,11 @@ * added to the symbol table. */ -typedef void (*funcptr)(void); +typedef void (*funcptr) (void); typedef struct { - char *symName; - funcptr offset; + char *symName; + funcptr offset; } LOOKUP; #define SYMFUNC( func ) { #func, (funcptr)&func }, diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 8e8bdadfc..b2823c2e5 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.227.2.1 2003/03/13 04:10:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.242 2003/10/27 20:51:16 herrb Exp $ */ /* * @@ -22,6 +22,32 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #define INCLUDE_DEPRECATED 1 @@ -70,12 +96,6 @@ #endif #endif -#ifdef __FreeBSD__ -/* XXX used in drmOpen(). This should change to use a less os-specific - * method. */ -int sysctlbyname(const char*, void *, size_t *, void *, size_t); -#endif - #if defined(__alpha__) # ifdef linux extern unsigned long _bus_base(void); @@ -87,7 +107,7 @@ extern unsigned int _inw(unsigned short port); extern unsigned int _inl(unsigned short port); # endif -# ifdef __FreeBSD__ +# ifdef __FreeBSD__ # include <sys/types.h> extern void outb(u_int32_t port, u_int8_t val); extern void outw(u_int32_t port, u_int16_t val); @@ -97,25 +117,38 @@ extern u_int16_t inw(u_int32_t port); extern u_int32_t inl(u_int32_t port); # endif -extern void* __divl(long, long); -extern void* __reml(long, long); -extern void* __divlu(long, long); -extern void* __remlu(long, long); -extern void* __divq(long, long); -extern void* __divqu(long, long); -extern void* __remq(long, long); -extern void* __remqu(long, long); +extern void *__divl(long, long); +extern void *__reml(long, long); +extern void *__divlu(long, long); +extern void *__remlu(long, long); +extern void *__divq(long, long); +extern void *__divqu(long, long); +extern void *__remq(long, long); +extern void *__remqu(long, long); +#endif + +#if defined(__sparc__) && defined(__FreeBSD__) +extern float _Qp_qtos(unsigned int *); +extern double _Qp_qtod(unsigned int *); +extern unsigned long long _Qp_qtoux(unsigned int *); +extern void _Qp_dtoq(unsigned int *, double); +extern void _Qp_uitoq(unsigned int *, unsigned int); #endif #if defined(__GNUC__) +#ifndef __UNIXOS2__ extern long __div64(long, long); +#endif extern long __divdf3(long, long); extern long __divdi3(long, long); extern long __divsf3(long, long); extern long __divsi3(long, long); extern long __moddi3(long, long); extern long __modsi3(long, long); + +#ifndef __UNIXOS2__ extern long __mul64(long, long); +#endif extern long __muldf3(long, long); extern long __muldi3(long, long); extern long __mulsf3(long, long); @@ -124,14 +157,19 @@ extern long __udivdi3(long, long); extern long __udivsi3(long, long); extern long __umoddi3(long, long); extern long __umodsi3(long, long); + +#ifndef __UNIXOS2__ #pragma weak __div64 +#endif #pragma weak __divdf3 #pragma weak __divdi3 #pragma weak __divsf3 #pragma weak __divsi3 #pragma weak __moddi3 #pragma weak __modsi3 +#ifndef __UNIXOS2__ #pragma weak __mul64 +#endif #pragma weak __muldf3 #pragma weak __muldi3 #pragma weak __mulsf3 @@ -199,935 +237,912 @@ extern unsigned short ldw_brx(volatile unsigned char *, int); LOOKUP xfree86LookupTab[] = { - /* Public OSlib functions */ - SYMFUNC(xf86ReadBIOS) - SYMFUNC(xf86EnableIO) - SYMFUNC(xf86DisableIO) - SYMFUNC(xf86DisableInterrupts) - SYMFUNC(xf86EnableInterrupts) - SYMFUNC(xf86LinearVidMem) - SYMFUNC(xf86CheckMTRR) - SYMFUNC(xf86MapVidMem) - SYMFUNC(xf86UnMapVidMem) - SYMFUNC(xf86MapReadSideEffects) - SYMFUNC(xf86GetPciDomain) - SYMFUNC(xf86MapDomainMemory) - SYMFUNC(xf86MapDomainIO) - SYMFUNC(xf86ReadDomainMemory) - SYMFUNC(xf86UDelay) - SYMFUNC(xf86IODelay) - SYMFUNC(xf86SlowBcopy) + /* Public OSlib functions */ + SYMFUNC(xf86ReadBIOS) + SYMFUNC(xf86EnableIO) + SYMFUNC(xf86DisableIO) + SYMFUNC(xf86DisableInterrupts) + SYMFUNC(xf86EnableInterrupts) + SYMFUNC(xf86LinearVidMem) + SYMFUNC(xf86CheckMTRR) + SYMFUNC(xf86MapVidMem) + SYMFUNC(xf86UnMapVidMem) + SYMFUNC(xf86MapReadSideEffects) + SYMFUNC(xf86GetPciDomain) + SYMFUNC(xf86MapDomainMemory) + SYMFUNC(xf86MapDomainIO) + SYMFUNC(xf86ReadDomainMemory) + SYMFUNC(xf86UDelay) + SYMFUNC(xf86IODelay) + SYMFUNC(xf86SlowBcopy) #ifdef __alpha__ - SYMFUNC(xf86SlowBCopyToBus) - SYMFUNC(xf86SlowBCopyFromBus) + SYMFUNC(xf86SlowBCopyToBus) + SYMFUNC(xf86SlowBCopyFromBus) #endif - SYMFUNC(xf86BusToMem) - SYMFUNC(xf86MemToBus) - SYMFUNC(xf86OpenSerial) - SYMFUNC(xf86SetSerial) - SYMFUNC(xf86SetSerialSpeed) - SYMFUNC(xf86ReadSerial) - SYMFUNC(xf86WriteSerial) - SYMFUNC(xf86CloseSerial) - SYMFUNC(xf86GetErrno) - SYMFUNC(xf86WaitForInput) - SYMFUNC(xf86SerialSendBreak) - SYMFUNC(xf86FlushInput) - SYMFUNC(xf86SetSerialModemState) - SYMFUNC(xf86GetSerialModemState) - SYMFUNC(xf86SerialModemSetBits) - SYMFUNC(xf86SerialModemClearBits) - SYMFUNC(xf86LoadKernelModule) - SYMFUNC(xf86OSMouseInit) - SYMFUNC(xf86OSKbdPreInit) - SYMFUNC(xf86AgpGARTSupported) - SYMFUNC(xf86GetAGPInfo) - SYMFUNC(xf86AcquireGART) - SYMFUNC(xf86ReleaseGART) - SYMFUNC(xf86AllocateGARTMemory) - SYMFUNC(xf86BindGARTMemory) - SYMFUNC(xf86UnbindGARTMemory) - SYMFUNC(xf86EnableAGP) - SYMFUNC(xf86SoundKbdBell) - SYMFUNC(xf86GARTCloseScreen) + SYMFUNC(xf86BusToMem) + SYMFUNC(xf86MemToBus) + SYMFUNC(xf86OpenSerial) + SYMFUNC(xf86SetSerial) + SYMFUNC(xf86SetSerialSpeed) + SYMFUNC(xf86ReadSerial) + SYMFUNC(xf86WriteSerial) + SYMFUNC(xf86CloseSerial) + SYMFUNC(xf86GetErrno) + SYMFUNC(xf86WaitForInput) + SYMFUNC(xf86SerialSendBreak) + SYMFUNC(xf86FlushInput) + SYMFUNC(xf86SetSerialModemState) + SYMFUNC(xf86GetSerialModemState) + SYMFUNC(xf86SerialModemSetBits) + SYMFUNC(xf86SerialModemClearBits) + SYMFUNC(xf86LoadKernelModule) + SYMFUNC(xf86OSMouseInit) + SYMFUNC(xf86OSKbdPreInit) + SYMFUNC(xf86AgpGARTSupported) + SYMFUNC(xf86GetAGPInfo) + SYMFUNC(xf86AcquireGART) + SYMFUNC(xf86ReleaseGART) + SYMFUNC(xf86AllocateGARTMemory) + SYMFUNC(xf86BindGARTMemory) + SYMFUNC(xf86UnbindGARTMemory) + SYMFUNC(xf86EnableAGP) + SYMFUNC(xf86SoundKbdBell) + SYMFUNC(xf86GARTCloseScreen) #ifdef XINPUT -/* XISB routines (Merged from Metrolink tree) */ - SYMFUNC(XisbNew) - SYMFUNC(XisbFree) - SYMFUNC(XisbRead) - SYMFUNC(XisbWrite) - SYMFUNC(XisbTrace) - SYMFUNC(XisbBlockDuration) + /* XISB routines (Merged from Metrolink tree) */ + SYMFUNC(XisbNew) + SYMFUNC(XisbFree) + SYMFUNC(XisbRead) + SYMFUNC(XisbWrite) + SYMFUNC(XisbTrace) + SYMFUNC(XisbBlockDuration) #endif - /* xf86Bus.c */ - SYMFUNC(xf86CheckPciSlot) - SYMFUNC(xf86ClaimPciSlot) - SYMFUNC(xf86GetPciVideoInfo) - SYMFUNC(xf86GetPciEntity) - SYMFUNC(xf86GetPciConfigInfo) - SYMFUNC(xf86SetPciVideo) - SYMFUNC(xf86ClaimIsaSlot) - SYMFUNC(xf86ClaimFbSlot) - SYMFUNC(xf86ClaimNoSlot) - SYMFUNC(xf86ParsePciBusString) - SYMFUNC(xf86ComparePciBusString) - SYMFUNC(xf86FormatPciBusNumber) - SYMFUNC(xf86ParseIsaBusString) - SYMFUNC(xf86EnableAccess) - SYMFUNC(xf86SetCurrentAccess) - SYMFUNC(xf86IsPrimaryPci) - SYMFUNC(xf86IsPrimaryIsa) - SYMFUNC(xf86CheckPciGAType) - SYMFUNC(xf86PrintResList) - SYMFUNC(xf86AddResToList) - SYMFUNC(xf86JoinResLists) - SYMFUNC(xf86DupResList) - SYMFUNC(xf86FreeResList) - SYMFUNC(xf86ClaimFixedResources) - SYMFUNC(xf86AddEntityToScreen) - SYMFUNC(xf86SetEntityInstanceForScreen) - SYMFUNC(xf86RemoveEntityFromScreen) - SYMFUNC(xf86GetEntityInfo) - SYMFUNC(xf86GetNumEntityInstances) - SYMFUNC(xf86GetDevFromEntity) - SYMFUNC(xf86GetPciInfoForEntity) - SYMFUNC(xf86SetEntityFuncs) - SYMFUNC(xf86DeallocateResourcesForEntity) - SYMFUNC(xf86RegisterResources) - SYMFUNC(xf86CheckPciMemBase) - SYMFUNC(xf86SetAccessFuncs) - SYMFUNC(xf86IsEntityPrimary) - SYMFUNC(xf86FixPciResource) - SYMFUNC(xf86SetOperatingState) - SYMFUNC(xf86EnterServerState) - SYMFUNC(xf86GetBlock) - SYMFUNC(xf86GetSparse) - SYMFUNC(xf86ReallocatePciResources) - SYMFUNC(xf86ChkConflict) - SYMFUNC(xf86IsPciDevPresent) - SYMFUNC(xf86FindScreenForEntity) - SYMFUNC(xf86FindPciDeviceVendor) - SYMFUNC(xf86FindPciClass) + /* xf86Bus.c */ + SYMFUNC(xf86CheckPciSlot) + SYMFUNC(xf86ClaimPciSlot) + SYMFUNC(xf86GetPciVideoInfo) + SYMFUNC(xf86GetPciEntity) + SYMFUNC(xf86GetPciConfigInfo) + SYMFUNC(xf86SetPciVideo) + SYMFUNC(xf86ClaimIsaSlot) + SYMFUNC(xf86ClaimFbSlot) + SYMFUNC(xf86ClaimNoSlot) + SYMFUNC(xf86ParsePciBusString) + SYMFUNC(xf86ComparePciBusString) + SYMFUNC(xf86FormatPciBusNumber) + SYMFUNC(xf86ParseIsaBusString) + SYMFUNC(xf86EnableAccess) + SYMFUNC(xf86SetCurrentAccess) + SYMFUNC(xf86IsPrimaryPci) + SYMFUNC(xf86IsPrimaryIsa) + SYMFUNC(xf86CheckPciGAType) + SYMFUNC(xf86PrintResList) + SYMFUNC(xf86AddResToList) + SYMFUNC(xf86JoinResLists) + SYMFUNC(xf86DupResList) + SYMFUNC(xf86FreeResList) + SYMFUNC(xf86ClaimFixedResources) + SYMFUNC(xf86AddEntityToScreen) + SYMFUNC(xf86SetEntityInstanceForScreen) + SYMFUNC(xf86RemoveEntityFromScreen) + SYMFUNC(xf86GetEntityInfo) + SYMFUNC(xf86GetNumEntityInstances) + SYMFUNC(xf86GetDevFromEntity) + SYMFUNC(xf86GetPciInfoForEntity) + SYMFUNC(xf86SetEntityFuncs) + SYMFUNC(xf86DeallocateResourcesForEntity) + SYMFUNC(xf86RegisterResources) + SYMFUNC(xf86CheckPciMemBase) + SYMFUNC(xf86SetAccessFuncs) + SYMFUNC(xf86IsEntityPrimary) + SYMFUNC(xf86FixPciResource) + SYMFUNC(xf86SetOperatingState) + SYMFUNC(xf86EnterServerState) + SYMFUNC(xf86GetBlock) + SYMFUNC(xf86GetSparse) + SYMFUNC(xf86ReallocatePciResources) + SYMFUNC(xf86ChkConflict) + SYMFUNC(xf86IsPciDevPresent) + SYMFUNC(xf86FindScreenForEntity) + SYMFUNC(xf86FindPciDeviceVendor) + SYMFUNC(xf86FindPciClass) #ifdef INCLUDE_DEPRECATED - SYMFUNC(xf86EnablePciBusMaster) + SYMFUNC(xf86EnablePciBusMaster) #endif - SYMFUNC(xf86RegisterStateChangeNotificationCallback) - SYMFUNC(xf86DeregisterStateChangeNotificationCallback) - SYMFUNC(xf86NoSharedResources) + SYMFUNC(xf86RegisterStateChangeNotificationCallback) + SYMFUNC(xf86DeregisterStateChangeNotificationCallback) + SYMFUNC(xf86NoSharedResources) #ifdef async - SYMFUNC(xf86QueueAsyncEvent) + SYMFUNC(xf86QueueAsyncEvent) #endif - /* Shared Accel Accessor Functions */ - SYMFUNC(xf86GetLastScrnFlag) - SYMFUNC(xf86SetLastScrnFlag) - SYMFUNC(xf86IsEntityShared) - SYMFUNC(xf86SetEntityShared) - SYMFUNC(xf86IsEntitySharable) - SYMFUNC(xf86SetEntitySharable) - SYMFUNC(xf86IsPrimInitDone) - SYMFUNC(xf86SetPrimInitDone) - SYMFUNC(xf86ClearPrimInitDone) - SYMFUNC(xf86AllocateEntityPrivateIndex) - SYMFUNC(xf86GetEntityPrivate) - - /* xf86Configure.c */ - SYMFUNC(xf86AddDeviceToConfigure) - - /* xf86Cursor.c */ - SYMFUNC(xf86GetPointerScreenFuncs) + /* Shared Accel Accessor Functions */ + SYMFUNC(xf86GetLastScrnFlag) + SYMFUNC(xf86SetLastScrnFlag) + SYMFUNC(xf86IsEntityShared) + SYMFUNC(xf86SetEntityShared) + SYMFUNC(xf86IsEntitySharable) + SYMFUNC(xf86SetEntitySharable) + SYMFUNC(xf86IsPrimInitDone) + SYMFUNC(xf86SetPrimInitDone) + SYMFUNC(xf86ClearPrimInitDone) + SYMFUNC(xf86AllocateEntityPrivateIndex) + SYMFUNC(xf86GetEntityPrivate) + + /* xf86Configure.c */ + SYMFUNC(xf86AddDeviceToConfigure) + + /* xf86Cursor.c */ + SYMFUNC(xf86GetPointerScreenFuncs) - /* xf86DGA.c */ - /* For drivers */ - SYMFUNC(DGAInit) - /* For extmod */ - SYMFUNC(DGAAvailable) - SYMFUNC(DGAActive) - SYMFUNC(DGASetMode) - SYMFUNC(DGASetInputMode) - SYMFUNC(DGASelectInput) - SYMFUNC(DGAGetViewportStatus) - SYMFUNC(DGASetViewport) - SYMFUNC(DGAInstallCmap) - SYMFUNC(DGASync) - SYMFUNC(DGAFillRect) - SYMFUNC(DGABlitRect) - SYMFUNC(DGABlitTransRect) - SYMFUNC(DGAGetModes) - SYMFUNC(DGAGetOldDGAMode) - SYMFUNC(DGAGetModeInfo) - SYMFUNC(DGAChangePixmapMode) - SYMFUNC(DGACreateColormap) - SYMFUNC(DGAOpenFramebuffer) - SYMFUNC(DGACloseFramebuffer) + /* xf86DGA.c */ + /* For drivers */ + SYMFUNC(DGAInit) + /* For extmod */ + SYMFUNC(DGAAvailable) + SYMFUNC(DGAActive) + SYMFUNC(DGASetMode) + SYMFUNC(DGASetInputMode) + SYMFUNC(DGASelectInput) + SYMFUNC(DGAGetViewportStatus) + SYMFUNC(DGASetViewport) + SYMFUNC(DGAInstallCmap) + SYMFUNC(DGASync) + SYMFUNC(DGAFillRect) + SYMFUNC(DGABlitRect) + SYMFUNC(DGABlitTransRect) + SYMFUNC(DGAGetModes) + SYMFUNC(DGAGetOldDGAMode) + SYMFUNC(DGAGetModeInfo) + SYMFUNC(DGAChangePixmapMode) + SYMFUNC(DGACreateColormap) + SYMFUNC(DGAOpenFramebuffer) + SYMFUNC(DGACloseFramebuffer) - /* xf86DPMS.c */ - SYMFUNC(xf86DPMSInit) + /* xf86DPMS.c */ + SYMFUNC(xf86DPMSInit) - /* xf86Events.c */ - SYMFUNC(SetTimeSinceLastInputEvent) - SYMFUNC(xf86AddInputHandler) - SYMFUNC(xf86RemoveInputHandler) - SYMFUNC(xf86DisableInputHandler) - SYMFUNC(xf86EnableInputHandler) - SYMFUNC(xf86AddEnabledDevice) - SYMFUNC(xf86RemoveEnabledDevice) - SYMFUNC(xf86InterceptSignals) - SYMFUNC(xf86EnableVTSwitch) + /* xf86Events.c */ + SYMFUNC(SetTimeSinceLastInputEvent) + SYMFUNC(xf86AddInputHandler) + SYMFUNC(xf86RemoveInputHandler) + SYMFUNC(xf86DisableInputHandler) + SYMFUNC(xf86EnableInputHandler) + SYMFUNC(xf86AddEnabledDevice) + SYMFUNC(xf86RemoveEnabledDevice) + SYMFUNC(xf86InterceptSignals) + SYMFUNC(xf86EnableVTSwitch) - /* xf86Helper.c */ - SYMFUNC(xf86AddDriver) - SYMFUNC(xf86AddInputDriver) - SYMFUNC(xf86DeleteDriver) - SYMFUNC(xf86DeleteInput) - SYMFUNC(xf86AllocateInput) - SYMFUNC(xf86AllocateScreen) - SYMFUNC(xf86DeleteScreen) - SYMFUNC(xf86AllocateScrnInfoPrivateIndex) - SYMFUNC(xf86AddPixFormat) - SYMFUNC(xf86SetDepthBpp) - SYMFUNC(xf86PrintDepthBpp) - SYMFUNC(xf86SetWeight) - SYMFUNC(xf86SetDefaultVisual) - SYMFUNC(xf86SetGamma) - SYMFUNC(xf86SetDpi) - SYMFUNC(xf86SetBlackWhitePixels) - SYMFUNC(xf86EnableDisableFBAccess) - SYMFUNC(xf86VDrvMsgVerb) - SYMFUNC(xf86DrvMsgVerb) - SYMFUNC(xf86DrvMsg) - SYMFUNC(xf86MsgVerb) - SYMFUNC(xf86Msg) - SYMFUNC(xf86ErrorFVerb) - SYMFUNC(xf86ErrorF) - SYMFUNC(xf86TokenToString) - SYMFUNC(xf86StringToToken) - SYMFUNC(xf86ShowClocks) - SYMFUNC(xf86PrintChipsets) - SYMFUNC(xf86MatchDevice) - SYMFUNC(xf86MatchPciInstances) - SYMFUNC(xf86MatchIsaInstances) - SYMFUNC(xf86GetVerbosity) - SYMFUNC(xf86GetVisualName) - SYMFUNC(xf86GetPix24) - SYMFUNC(xf86GetDepth) - SYMFUNC(xf86GetWeight) - SYMFUNC(xf86GetGamma) - SYMFUNC(xf86GetFlipPixels) - SYMFUNC(xf86GetServerName) - SYMFUNC(xf86ServerIsExiting) - SYMFUNC(xf86ServerIsOnlyDetecting) - SYMFUNC(xf86ServerIsOnlyProbing) - SYMFUNC(xf86ServerIsResetting) - SYMFUNC(xf86CaughtSignal) - SYMFUNC(xf86GetVidModeAllowNonLocal) - SYMFUNC(xf86GetVidModeEnabled) - SYMFUNC(xf86GetModInDevAllowNonLocal) - SYMFUNC(xf86GetModInDevEnabled) - SYMFUNC(xf86GetAllowMouseOpenFail) - SYMFUNC(xf86CommonSpecialKey) - SYMFUNC(xf86IsPc98) - SYMFUNC(xf86DisableRandR) - SYMFUNC(xf86GetVersion) - SYMFUNC(xf86GetModuleVersion) - SYMFUNC(xf86GetClocks) - SYMFUNC(xf86SetPriority) - SYMFUNC(xf86LoadDrvSubModule) - SYMFUNC(xf86LoadSubModule) - SYMFUNC(xf86LoadOneModule) - SYMFUNC(xf86UnloadSubModule) - SYMFUNC(xf86LoaderCheckSymbol) - SYMFUNC(xf86LoaderRefSymLists) - SYMFUNC(xf86LoaderRefSymbols) - SYMFUNC(xf86LoaderReqSymLists) - SYMFUNC(xf86LoaderReqSymbols) - SYMFUNC(xf86SetBackingStore) - SYMFUNC(xf86SetSilkenMouse) - /* SYMFUNC(xf86NewSerialNumber) */ - SYMFUNC(xf86FindXvOptions) - SYMFUNC(xf86GetOS) - SYMFUNC(xf86ConfigPciEntity) - SYMFUNC(xf86ConfigIsaEntity) - SYMFUNC(xf86ConfigFbEntity) - SYMFUNC(xf86ConfigActivePciEntity) - SYMFUNC(xf86ConfigActiveIsaEntity) - SYMFUNC(xf86ConfigPciEntityInactive) - SYMFUNC(xf86ConfigIsaEntityInactive) - SYMFUNC(xf86IsScreenPrimary) - SYMFUNC(xf86RegisterRootWindowProperty) - SYMFUNC(xf86IsUnblank) - SYMFUNC(xf86AddModuleInfo) - SYMFUNC(xf86DeleteModuleInfo) + /* xf86Helper.c */ + SYMFUNC(xf86AddDriver) + SYMFUNC(xf86AddInputDriver) + SYMFUNC(xf86DeleteDriver) + SYMFUNC(xf86DeleteInput) + SYMFUNC(xf86AllocateInput) + SYMFUNC(xf86AllocateScreen) + SYMFUNC(xf86DeleteScreen) + SYMFUNC(xf86AllocateScrnInfoPrivateIndex) + SYMFUNC(xf86AddPixFormat) + SYMFUNC(xf86SetDepthBpp) + SYMFUNC(xf86PrintDepthBpp) + SYMFUNC(xf86SetWeight) + SYMFUNC(xf86SetDefaultVisual) + SYMFUNC(xf86SetGamma) + SYMFUNC(xf86SetDpi) + SYMFUNC(xf86SetBlackWhitePixels) + SYMFUNC(xf86EnableDisableFBAccess) + SYMFUNC(xf86VDrvMsgVerb) + SYMFUNC(xf86DrvMsgVerb) + SYMFUNC(xf86DrvMsg) + SYMFUNC(xf86MsgVerb) + SYMFUNC(xf86Msg) + SYMFUNC(xf86ErrorFVerb) + SYMFUNC(xf86ErrorF) + SYMFUNC(xf86TokenToString) + SYMFUNC(xf86StringToToken) + SYMFUNC(xf86ShowClocks) + SYMFUNC(xf86PrintChipsets) + SYMFUNC(xf86MatchDevice) + SYMFUNC(xf86MatchPciInstances) + SYMFUNC(xf86MatchIsaInstances) + SYMFUNC(xf86GetVerbosity) + SYMFUNC(xf86GetVisualName) + SYMFUNC(xf86GetPix24) + SYMFUNC(xf86GetDepth) + SYMFUNC(xf86GetWeight) + SYMFUNC(xf86GetGamma) + SYMFUNC(xf86GetFlipPixels) + SYMFUNC(xf86GetServerName) + SYMFUNC(xf86ServerIsExiting) + SYMFUNC(xf86ServerIsOnlyDetecting) + SYMFUNC(xf86ServerIsOnlyProbing) + SYMFUNC(xf86ServerIsResetting) + SYMFUNC(xf86CaughtSignal) + SYMFUNC(xf86GetVidModeAllowNonLocal) + SYMFUNC(xf86GetVidModeEnabled) + SYMFUNC(xf86GetModInDevAllowNonLocal) + SYMFUNC(xf86GetModInDevEnabled) + SYMFUNC(xf86GetAllowMouseOpenFail) + SYMFUNC(xf86CommonSpecialKey) + SYMFUNC(xf86IsPc98) + SYMFUNC(xf86DisableRandR) + SYMFUNC(xf86GetVersion) + SYMFUNC(xf86GetModuleVersion) + SYMFUNC(xf86GetClocks) + SYMFUNC(xf86SetPriority) + SYMFUNC(xf86LoadDrvSubModule) + SYMFUNC(xf86LoadSubModule) + SYMFUNC(xf86LoadOneModule) + SYMFUNC(xf86UnloadSubModule) + SYMFUNC(xf86LoaderCheckSymbol) + SYMFUNC(xf86LoaderRefSymLists) + SYMFUNC(xf86LoaderRefSymbols) + SYMFUNC(xf86LoaderReqSymLists) + SYMFUNC(xf86LoaderReqSymbols) + SYMFUNC(xf86SetBackingStore) + SYMFUNC(xf86SetSilkenMouse) + /* SYMFUNC(xf86NewSerialNumber) */ + SYMFUNC(xf86FindXvOptions) + SYMFUNC(xf86GetOS) + SYMFUNC(xf86ConfigPciEntity) + SYMFUNC(xf86ConfigIsaEntity) + SYMFUNC(xf86ConfigFbEntity) + SYMFUNC(xf86ConfigActivePciEntity) + SYMFUNC(xf86ConfigActiveIsaEntity) + SYMFUNC(xf86ConfigPciEntityInactive) + SYMFUNC(xf86ConfigIsaEntityInactive) + SYMFUNC(xf86IsScreenPrimary) + SYMFUNC(xf86RegisterRootWindowProperty) + SYMFUNC(xf86IsUnblank) + SYMFUNC(xf86AddModuleInfo) + SYMFUNC(xf86DeleteModuleInfo) #if defined(__sparc__) && !defined(__OpenBSD__) - /* xf86sbusBus.c */ - SYMFUNC(xf86MatchSbusInstances) - SYMFUNC(xf86GetSbusInfoForEntity) - SYMFUNC(xf86GetEntityForSbusInfo) - SYMFUNC(xf86SbusUseBuiltinMode) - SYMFUNC(xf86MapSbusMem) - SYMFUNC(xf86UnmapSbusMem) - SYMFUNC(xf86SbusHideOsHwCursor) - SYMFUNC(xf86SbusSetOsHwCursorCmap) - SYMFUNC(xf86SbusHandleColormaps) - SYMFUNC(sparcPromInit) - SYMFUNC(sparcPromClose) - SYMFUNC(sparcPromGetProperty) - SYMFUNC(sparcPromGetBool) + /* xf86sbusBus.c */ + SYMFUNC(xf86MatchSbusInstances) + SYMFUNC(xf86GetSbusInfoForEntity) + SYMFUNC(xf86GetEntityForSbusInfo) + SYMFUNC(xf86SbusUseBuiltinMode) + SYMFUNC(xf86MapSbusMem) + SYMFUNC(xf86UnmapSbusMem) + SYMFUNC(xf86SbusHideOsHwCursor) + SYMFUNC(xf86SbusSetOsHwCursorCmap) + SYMFUNC(xf86SbusHandleColormaps) + SYMFUNC(sparcPromInit) + SYMFUNC(sparcPromClose) + SYMFUNC(sparcPromGetProperty) + SYMFUNC(sparcPromGetBool) #endif - /* xf86Init.c */ - SYMFUNC(xf86GetPixFormat) - SYMFUNC(xf86GetBppFromDepth) + /* xf86Init.c */ + SYMFUNC(xf86GetPixFormat) + SYMFUNC(xf86GetBppFromDepth) - /* xf86Mode.c */ - SYMFUNC(xf86GetNearestClock) - SYMFUNC(xf86ModeStatusToString) - SYMFUNC(xf86LookupMode) - SYMFUNC(xf86CheckModeForMonitor) - SYMFUNC(xf86InitialCheckModeForDriver) - SYMFUNC(xf86CheckModeForDriver) - SYMFUNC(xf86ValidateModes) - SYMFUNC(xf86DeleteMode) - SYMFUNC(xf86PruneDriverModes) - SYMFUNC(xf86SetCrtcForModes) - SYMFUNC(xf86PrintModes) - SYMFUNC(xf86ShowClockRanges) + /* xf86Mode.c */ + SYMFUNC(xf86GetNearestClock) + SYMFUNC(xf86ModeStatusToString) + SYMFUNC(xf86LookupMode) + SYMFUNC(xf86CheckModeForMonitor) + SYMFUNC(xf86InitialCheckModeForDriver) + SYMFUNC(xf86CheckModeForDriver) + SYMFUNC(xf86ValidateModes) + SYMFUNC(xf86DeleteMode) + SYMFUNC(xf86PruneDriverModes) + SYMFUNC(xf86SetCrtcForModes) + SYMFUNC(xf86PrintModes) + SYMFUNC(xf86ShowClockRanges) - /* xf86Option.c */ - SYMFUNC(xf86CollectOptions) - SYMFUNC(xf86CollectInputOptions) - /* Merging of XInput stuff */ - SYMFUNC(xf86AddNewOption) - SYMFUNC(xf86SetBoolOption) - SYMFUNC(xf86NewOption) - SYMFUNC(xf86NextOption) - SYMFUNC(xf86OptionListCreate) - SYMFUNC(xf86OptionListMerge) - SYMFUNC(xf86OptionListFree) - SYMFUNC(xf86OptionName) - SYMFUNC(xf86OptionValue) - SYMFUNC(xf86OptionListReport) - SYMFUNC(xf86SetIntOption) - SYMFUNC(xf86SetRealOption) - SYMFUNC(xf86SetStrOption) - SYMFUNC(xf86ReplaceIntOption) - SYMFUNC(xf86ReplaceStrOption) - SYMFUNC(xf86ReplaceBoolOption) - SYMFUNC(xf86FindOption) - SYMFUNC(xf86FindOptionValue) - SYMFUNC(xf86MarkOptionUsed) - SYMFUNC(xf86MarkOptionUsedByName) - SYMFUNC(xf86CheckIfOptionUsed) - SYMFUNC(xf86CheckIfOptionUsedByName) - SYMFUNC(xf86ShowUnusedOptions) - SYMFUNC(xf86ProcessOptions) - SYMFUNC(xf86TokenToOptinfo) - SYMFUNC(xf86TokenToOptName) - SYMFUNC(xf86IsOptionSet) - SYMFUNC(xf86GetOptValString) - SYMFUNC(xf86GetOptValInteger) - SYMFUNC(xf86GetOptValULong) - SYMFUNC(xf86GetOptValReal) - SYMFUNC(xf86GetOptValFreq) - SYMFUNC(xf86GetOptValBool) - SYMFUNC(xf86ReturnOptValBool) - SYMFUNC(xf86NameCmp) - SYMFUNC(xf86InitValuatorAxisStruct) - SYMFUNC(xf86InitValuatorDefaults) - + /* xf86Option.c */ + SYMFUNC(xf86CollectOptions) + SYMFUNC(xf86CollectInputOptions) + /* Merging of XInput stuff */ + SYMFUNC(xf86AddNewOption) + SYMFUNC(xf86NewOption) + SYMFUNC(xf86NextOption) + SYMFUNC(xf86OptionListCreate) + SYMFUNC(xf86OptionListMerge) + SYMFUNC(xf86OptionListFree) + SYMFUNC(xf86OptionName) + SYMFUNC(xf86OptionValue) + SYMFUNC(xf86OptionListReport) + SYMFUNC(xf86SetIntOption) + SYMFUNC(xf86SetRealOption) + SYMFUNC(xf86SetStrOption) + SYMFUNC(xf86SetBoolOption) + SYMFUNC(xf86CheckIntOption) + SYMFUNC(xf86CheckRealOption) + SYMFUNC(xf86CheckStrOption) + SYMFUNC(xf86CheckBoolOption) + SYMFUNC(xf86ReplaceIntOption) + SYMFUNC(xf86ReplaceRealOption) + SYMFUNC(xf86ReplaceStrOption) + SYMFUNC(xf86ReplaceBoolOption) + SYMFUNC(xf86FindOption) + SYMFUNC(xf86FindOptionValue) + SYMFUNC(xf86MarkOptionUsed) + SYMFUNC(xf86MarkOptionUsedByName) + SYMFUNC(xf86CheckIfOptionUsed) + SYMFUNC(xf86CheckIfOptionUsedByName) + SYMFUNC(xf86ShowUnusedOptions) + SYMFUNC(xf86ProcessOptions) + SYMFUNC(xf86TokenToOptinfo) + SYMFUNC(xf86TokenToOptName) + SYMFUNC(xf86IsOptionSet) + SYMFUNC(xf86GetOptValString) + SYMFUNC(xf86GetOptValInteger) + SYMFUNC(xf86GetOptValULong) + SYMFUNC(xf86GetOptValReal) + SYMFUNC(xf86GetOptValFreq) + SYMFUNC(xf86GetOptValBool) + SYMFUNC(xf86ReturnOptValBool) + SYMFUNC(xf86NameCmp) + SYMFUNC(xf86InitValuatorAxisStruct) + SYMFUNC(xf86InitValuatorDefaults) - /* xf86fbman.c */ - SYMFUNC(xf86InitFBManager) - SYMFUNC(xf86InitFBManagerArea) - SYMFUNC(xf86InitFBManagerRegion) - SYMFUNC(xf86RegisterFreeBoxCallback) - SYMFUNC(xf86FreeOffscreenArea) - SYMFUNC(xf86AllocateOffscreenArea) - SYMFUNC(xf86AllocateLinearOffscreenArea) - SYMFUNC(xf86ResizeOffscreenArea) - SYMFUNC(xf86FBManagerRunning) - SYMFUNC(xf86QueryLargestOffscreenArea) - SYMFUNC(xf86PurgeUnlockedOffscreenAreas) - SYMFUNC(xf86RegisterOffscreenManager) - SYMFUNC(xf86AllocateOffscreenLinear) - SYMFUNC(xf86ResizeOffscreenLinear) - SYMFUNC(xf86QueryLargestOffscreenLinear) - SYMFUNC(xf86FreeOffscreenLinear) + /* xf86fbman.c */ + SYMFUNC(xf86InitFBManager) + SYMFUNC(xf86InitFBManagerArea) + SYMFUNC(xf86InitFBManagerRegion) + SYMFUNC(xf86InitFBManagerLinear) + SYMFUNC(xf86RegisterFreeBoxCallback) + SYMFUNC(xf86FreeOffscreenArea) + SYMFUNC(xf86AllocateOffscreenArea) + SYMFUNC(xf86AllocateLinearOffscreenArea) + SYMFUNC(xf86ResizeOffscreenArea) + SYMFUNC(xf86FBManagerRunning) + SYMFUNC(xf86QueryLargestOffscreenArea) + SYMFUNC(xf86PurgeUnlockedOffscreenAreas) + SYMFUNC(xf86RegisterOffscreenManager) + SYMFUNC(xf86AllocateOffscreenLinear) + SYMFUNC(xf86ResizeOffscreenLinear) + SYMFUNC(xf86QueryLargestOffscreenLinear) + SYMFUNC(xf86FreeOffscreenLinear) + /* xf86cmap.c */ + SYMFUNC(xf86HandleColormaps) - /* xf86cmap.c */ - SYMFUNC(xf86HandleColormaps) + /* xf86xv.c */ + SYMFUNC(xf86XVScreenInit) + SYMFUNC(xf86XVRegisterGenericAdaptorDriver) + SYMFUNC(xf86XVListGenericAdaptors) + SYMFUNC(xf86XVRegisterOffscreenImages) + SYMFUNC(xf86XVQueryOffscreenImages) + SYMFUNC(xf86XVAllocateVideoAdaptorRec) + SYMFUNC(xf86XVFreeVideoAdaptorRec) + SYMFUNC(xf86XVFillKeyHelper) + SYMFUNC(xf86XVClipVideoHelper) + SYMFUNC(xf86XVCopyYUV12ToPacked) + SYMFUNC(xf86XVCopyPacked) - /* xf86xv.c */ - SYMFUNC(xf86XVScreenInit) - SYMFUNC(xf86XVRegisterGenericAdaptorDriver) - SYMFUNC(xf86XVListGenericAdaptors) - SYMFUNC(xf86XVRegisterOffscreenImages) - SYMFUNC(xf86XVQueryOffscreenImages) - SYMFUNC(xf86XVAllocateVideoAdaptorRec) - SYMFUNC(xf86XVFreeVideoAdaptorRec) - SYMFUNC(xf86XVFillKeyHelper) - SYMFUNC(xf86XVClipVideoHelper) + /* xf86xvmc.c */ + SYMFUNC(xf86XvMCScreenInit) + SYMFUNC(xf86XvMCCreateAdaptorRec) + SYMFUNC(xf86XvMCDestroyAdaptorRec) - /* xf86xvmc.c */ - SYMFUNC(xf86XvMCScreenInit) - - /* xf86VidMode.c */ - SYMFUNC(VidModeExtensionInit) + /* xf86VidMode.c */ + SYMFUNC(VidModeExtensionInit) #ifdef XF86VIDMODE - SYMFUNC(VidModeGetCurrentModeline) - SYMFUNC(VidModeGetFirstModeline) - SYMFUNC(VidModeGetNextModeline) - SYMFUNC(VidModeDeleteModeline) - SYMFUNC(VidModeZoomViewport) - SYMFUNC(VidModeGetViewPort) - SYMFUNC(VidModeSetViewPort) - SYMFUNC(VidModeSwitchMode) - SYMFUNC(VidModeLockZoom) - SYMFUNC(VidModeGetMonitor) - SYMFUNC(VidModeGetNumOfClocks) - SYMFUNC(VidModeGetClocks) - SYMFUNC(VidModeCheckModeForMonitor) - SYMFUNC(VidModeCheckModeForDriver) - SYMFUNC(VidModeSetCrtcForMode) - SYMFUNC(VidModeAddModeline) - SYMFUNC(VidModeGetDotClock) - SYMFUNC(VidModeGetNumOfModes) - SYMFUNC(VidModeSetGamma) - SYMFUNC(VidModeGetGamma) - SYMFUNC(VidModeCreateMode) - SYMFUNC(VidModeCopyMode) - SYMFUNC(VidModeGetModeValue) - SYMFUNC(VidModeSetModeValue) - SYMFUNC(VidModeGetMonitorValue) - SYMFUNC(VidModeSetGammaRamp) - SYMFUNC(VidModeGetGammaRamp) - SYMFUNC(VidModeGetGammaRampSize) + SYMFUNC(VidModeGetCurrentModeline) + SYMFUNC(VidModeGetFirstModeline) + SYMFUNC(VidModeGetNextModeline) + SYMFUNC(VidModeDeleteModeline) + SYMFUNC(VidModeZoomViewport) + SYMFUNC(VidModeGetViewPort) + SYMFUNC(VidModeSetViewPort) + SYMFUNC(VidModeSwitchMode) + SYMFUNC(VidModeLockZoom) + SYMFUNC(VidModeGetMonitor) + SYMFUNC(VidModeGetNumOfClocks) + SYMFUNC(VidModeGetClocks) + SYMFUNC(VidModeCheckModeForMonitor) + SYMFUNC(VidModeCheckModeForDriver) + SYMFUNC(VidModeSetCrtcForMode) + SYMFUNC(VidModeAddModeline) + SYMFUNC(VidModeGetDotClock) + SYMFUNC(VidModeGetNumOfModes) + SYMFUNC(VidModeSetGamma) + SYMFUNC(VidModeGetGamma) + SYMFUNC(VidModeCreateMode) + SYMFUNC(VidModeCopyMode) + SYMFUNC(VidModeGetModeValue) + SYMFUNC(VidModeSetModeValue) + SYMFUNC(VidModeGetMonitorValue) + SYMFUNC(VidModeSetGammaRamp) + SYMFUNC(VidModeGetGammaRamp) + SYMFUNC(VidModeGetGammaRampSize) #endif - /* xf86MiscExt.c */ + /* xf86Versions.c */ + SYMFUNC(xf86GetBuiltinInterfaceVersion) + SYMFUNC(xf86RegisterBuiltinInterfaceVersion) + + /* xf86MiscExt.c */ #ifdef XF86MISC - SYMFUNC(MiscExtGetMouseSettings) - SYMFUNC(MiscExtGetMouseValue) - SYMFUNC(MiscExtSetMouseValue) - SYMFUNC(MiscExtSetMouseDevice) - SYMFUNC(MiscExtGetKbdSettings) - SYMFUNC(MiscExtGetKbdValue) - SYMFUNC(MiscExtSetKbdValue) - SYMFUNC(MiscExtSetGrabKeysState) - SYMFUNC(MiscExtCreateStruct) - SYMFUNC(MiscExtDestroyStruct) - SYMFUNC(MiscExtApply) - SYMFUNC(MiscExtGetFilePaths) + SYMFUNC(MiscExtGetMouseSettings) + SYMFUNC(MiscExtGetMouseValue) + SYMFUNC(MiscExtSetMouseValue) + SYMFUNC(MiscExtSetMouseDevice) + SYMFUNC(MiscExtGetKbdSettings) + SYMFUNC(MiscExtGetKbdValue) + SYMFUNC(MiscExtSetKbdValue) + SYMFUNC(MiscExtSetGrabKeysState) + SYMFUNC(MiscExtCreateStruct) + SYMFUNC(MiscExtDestroyStruct) + SYMFUNC(MiscExtApply) + SYMFUNC(MiscExtGetFilePaths) + SYMFUNC(MiscExtPassMessage) #endif - /* Misc */ - SYMFUNC(GetTimeInMillis) + /* Misc */ + SYMFUNC(GetTimeInMillis) - /* xf86Xinput.c */ + /* xf86Xinput.c */ #ifdef XINPUT - SYMFUNC(xf86ProcessCommonOptions) - SYMFUNC(xf86IsCorePointer) - SYMFUNC(xf86PostMotionEvent) - SYMFUNC(xf86PostProximityEvent) - SYMFUNC(xf86PostButtonEvent) - SYMFUNC(xf86PostKeyEvent) - SYMFUNC(xf86PostKeyboardEvent) - SYMFUNC(xf86GetMotionEvents) - SYMFUNC(xf86MotionHistoryAllocate) - SYMFUNC(xf86FirstLocalDevice) - SYMFUNC(xf86eqEnqueue) + SYMFUNC(xf86ProcessCommonOptions) + SYMFUNC(xf86IsCorePointer) + SYMFUNC(xf86PostMotionEvent) + SYMFUNC(xf86PostProximityEvent) + SYMFUNC(xf86PostButtonEvent) + SYMFUNC(xf86PostKeyEvent) + SYMFUNC(xf86PostKeyboardEvent) + SYMFUNC(xf86GetMotionEvents) + SYMFUNC(xf86MotionHistoryAllocate) + SYMFUNC(xf86FirstLocalDevice) + SYMFUNC(xf86eqEnqueue) /* The following segment merged from Metrolink tree */ - SYMFUNC(xf86XInputSetScreen) - SYMFUNC(xf86ScaleAxis) - SYMFUNC(xf86XInputSetSendCoreEvents) + SYMFUNC(xf86XInputSetScreen) + SYMFUNC(xf86ScaleAxis) + SYMFUNC(xf86XInputSetSendCoreEvents) /* End merged segment */ #endif - SYMFUNC(DPMSGet) - SYMFUNC(DPMSSet) - SYMFUNC(DPMSSupported) + SYMFUNC(DPMSGet) + SYMFUNC(DPMSSet) + SYMFUNC(DPMSSupported) /* xf86Debug.c */ #ifdef BUILDDEBUG - SYMFUNC(xf86Break1) - SYMFUNC(xf86Break2) - SYMFUNC(xf86Break3) - SYMFUNC(xf86SPTimestamp) - SYMFUNC(xf86STimestamp) + SYMFUNC(xf86Break1) + SYMFUNC(xf86Break2) + SYMFUNC(xf86Break3) + SYMFUNC(xf86SPTimestamp) + SYMFUNC(xf86STimestamp) #endif - -#if 0 /* we want to move the hw stuff in a module */ - SYMFUNC(xf86dactopel) - SYMFUNC(xf86dactocomm) - SYMFUNC(xf86getdaccomm) - SYMFUNC(xf86setdaccomm) - SYMFUNC(xf86setdaccommbit) - SYMFUNC(xf86clrdaccommbit) - SYMFUNC(s3IBMRGB_Probe) - SYMFUNC(s3IBMRGB_Init) - SYMFUNC(s3InIBMRGBIndReg) - SYMFUNC(Ti3025SetClock) - SYMFUNC(Ti3026SetClock) - SYMFUNC(Ti3030SetClock) - SYMFUNC(AltICD2061SetClock) - SYMFUNC(SC11412SetClock) - SYMFUNC(ICS2595SetClock) - SYMFUNC(Att409SetClock) - SYMFUNC(Chrontel8391SetClock) - SYMFUNC(IBMRGBSetClock) - SYMFUNC(ICS5342SetClock) - SYMFUNC(S3TrioSetClock) - SYMFUNC(S3Trio64V2SetClock) - SYMFUNC(S3gendacSetClock) - SYMFUNC(STG1703SetClock) - SYMFUNC(ET6000SetClock) - SYMFUNC(S3AuroraSetClock) - SYMFUNC(commonCalcClock) - SYMFUNC(xf86writepci) - SYMFUNC(dacOutTi3026IndReg) - SYMFUNC(dacInTi3026IndReg) - SYMFUNC(s3OutIBMRGBIndReg) - SYMFUNC(CirrusFindClock) - SYMFUNC(CirrusSetClock) - SYMFUNC(STG1703getIndex) - SYMFUNC(STG1703setIndex) - SYMFUNC(STG1703magic) - SYMFUNC(gendacMNToClock) - SYMFUNC(Et4000AltICD2061SetClock) - SYMFUNC(ET4000stg1703SetClock) - SYMFUNC(ET4000gendacSetClock) -#endif - - SYMFUNC(pciFindFirst) - SYMFUNC(pciFindNext) - SYMFUNC(pciWriteByte) - SYMFUNC(pciWriteWord) - SYMFUNC(pciWriteLong) - SYMFUNC(pciReadByte) - SYMFUNC(pciReadWord) - SYMFUNC(pciReadLong) - SYMFUNC(pciSetBitsLong) - SYMFUNC(pciTag) - SYMFUNC(pciBusAddrToHostAddr) - SYMFUNC(pciHostAddrToBusAddr) - SYMFUNC(xf86MapPciMem) - SYMFUNC(xf86scanpci) - SYMFUNC(xf86ReadPciBIOS) - SYMFUNC(AllocatePixmapPrivateIndex) - SYMFUNC(AllocatePixmapPrivate) + SYMFUNC(pciFindFirst) + SYMFUNC(pciFindNext) + SYMFUNC(pciWriteByte) + SYMFUNC(pciWriteWord) + SYMFUNC(pciWriteLong) + SYMFUNC(pciReadByte) + SYMFUNC(pciReadWord) + SYMFUNC(pciReadLong) + SYMFUNC(pciSetBitsLong) + SYMFUNC(pciTag) + SYMFUNC(pciBusAddrToHostAddr) + SYMFUNC(pciHostAddrToBusAddr) + SYMFUNC(xf86MapPciMem) + SYMFUNC(xf86scanpci) + SYMFUNC(xf86ReadPciBIOS) - /* Loader functions */ - SYMFUNC(LoaderDefaultFunc) - SYMFUNC(LoadSubModule) - SYMFUNC(DuplicateModule) - SYMFUNC(LoaderErrorMsg) - SYMFUNC(LoaderCheckUnresolved) - SYMFUNC(LoadExtension) - SYMFUNC(LoadFont) - SYMFUNC(LoaderReqSymbols) - SYMFUNC(LoaderReqSymLists) - SYMFUNC(LoaderRefSymbols) - SYMFUNC(LoaderRefSymLists) - SYMFUNC(UnloadSubModule) - SYMFUNC(LoaderSymbol) - SYMFUNC(LoaderListDirs) - SYMFUNC(LoaderFreeDirList) - SYMFUNC(LoaderGetOS) + /* Loader functions */ + SYMFUNC(LoaderDefaultFunc) + SYMFUNC(LoadSubModule) + SYMFUNC(DuplicateModule) + SYMFUNC(LoaderErrorMsg) + SYMFUNC(LoaderCheckUnresolved) + SYMFUNC(LoadExtension) + SYMFUNC(LoadFont) + SYMFUNC(LoaderReqSymbols) + SYMFUNC(LoaderReqSymLists) + SYMFUNC(LoaderRefSymbols) + SYMFUNC(LoaderRefSymLists) + SYMFUNC(UnloadSubModule) + SYMFUNC(LoaderSymbol) + SYMFUNC(LoaderListDirs) + SYMFUNC(LoaderFreeDirList) + SYMFUNC(LoaderGetOS) - /* - * these here are our own interfaces to libc functions - */ - SYMFUNC(xf86abort) - SYMFUNC(xf86abs) - SYMFUNC(xf86acos) - SYMFUNC(xf86asin) - SYMFUNC(xf86atan) - SYMFUNC(xf86atan2) - SYMFUNC(xf86atof) - SYMFUNC(xf86atoi) - SYMFUNC(xf86atol) - SYMFUNC(xf86bsearch) - SYMFUNC(xf86ceil) - SYMFUNC(xf86calloc) - SYMFUNC(xf86clearerr) - SYMFUNC(xf86close) - SYMFUNC(xf86cos) - SYMFUNC(xf86exit) - SYMFUNC(xf86exp) - SYMFUNC(xf86fabs) - SYMFUNC(xf86fclose) - SYMFUNC(xf86feof) - SYMFUNC(xf86ferror) - SYMFUNC(xf86fflush) - SYMFUNC(xf86fgetc) - SYMFUNC(xf86fgetpos) - SYMFUNC(xf86fgets) - SYMFUNC(xf86finite) - SYMFUNC(xf86floor) - SYMFUNC(xf86fmod) - SYMFUNC(xf86fopen) - SYMFUNC(xf86fprintf) - SYMFUNC(xf86fputc) - SYMFUNC(xf86fputs) - SYMFUNC(xf86fread) - SYMFUNC(xf86free) - SYMFUNC(xf86freopen) - SYMFUNC(xf86frexp) - SYMFUNC(xf86fscanf) - SYMFUNC(xf86fseek) - SYMFUNC(xf86fsetpos) - SYMFUNC(xf86ftell) - SYMFUNC(xf86fwrite) - SYMFUNC(xf86getc) - SYMFUNC(xf86getenv) - SYMFUNC(xf86getpagesize) - SYMFUNC(xf86hypot) - SYMFUNC(xf86ioctl) - SYMFUNC(xf86isalnum) - SYMFUNC(xf86isalpha) - SYMFUNC(xf86iscntrl) - SYMFUNC(xf86isdigit) - SYMFUNC(xf86isgraph) - SYMFUNC(xf86islower) - SYMFUNC(xf86isprint) - SYMFUNC(xf86ispunct) - SYMFUNC(xf86isspace) - SYMFUNC(xf86isupper) - SYMFUNC(xf86isxdigit) - SYMFUNC(xf86labs) - SYMFUNC(xf86ldexp) - SYMFUNC(xf86log) - SYMFUNC(xf86log10) - SYMFUNC(xf86lseek) - SYMFUNC(xf86malloc) - SYMFUNC(xf86memchr) - SYMFUNC(xf86memcmp) - SYMFUNC(xf86memcpy) - /* - * Some compilers generate calls to memcpy to handle structure copies - * or run-time initializations. - */ - SYMFUNCALIAS("memcpy",xf86memcpy) - SYMFUNC(xf86memset) - /* - * Some compilers generate calls to memset to handle aggregate - * initializations. - */ - SYMFUNCALIAS("memset",xf86memset) - SYMFUNC(xf86memmove) - SYMFUNC(xf86mmap) - SYMFUNC(xf86modf) - SYMFUNC(xf86munmap) - SYMFUNC(xf86open) - SYMFUNC(xf86perror) - SYMFUNC(xf86pow) - SYMFUNC(xf86printf) - SYMFUNC(xf86qsort) - SYMFUNC(xf86read) - SYMFUNC(xf86realloc) - SYMFUNC(xf86remove) - SYMFUNC(xf86rename) - SYMFUNC(xf86rewind) - SYMFUNC(xf86setbuf) - SYMFUNC(xf86setvbuf) - SYMFUNC(xf86sin) - SYMFUNC(xf86snprintf) - SYMFUNC(xf86sprintf) - SYMFUNC(xf86sqrt) - SYMFUNC(xf86sscanf) - SYMFUNC(xf86strcat) - SYMFUNC(xf86strcmp) - SYMFUNC(xf86strcasecmp) - SYMFUNC(xf86strcpy) - SYMFUNC(xf86strcspn) - SYMFUNC(xf86strerror) - SYMFUNC(xf86strlen) - SYMFUNC(xf86strncasecmp) - SYMFUNC(xf86strncat) - SYMFUNC(xf86strncmp) - SYMFUNC(xf86strncpy) - SYMFUNC(xf86strpbrk) - SYMFUNC(xf86strchr) - SYMFUNC(xf86strrchr) - SYMFUNC(xf86strspn) - SYMFUNC(xf86strstr) - SYMFUNC(xf86strtod) - SYMFUNC(xf86strtok) - SYMFUNC(xf86strtol) - SYMFUNC(xf86strtoul) - SYMFUNC(xf86tan) - SYMFUNC(xf86tmpfile) - SYMFUNC(xf86tolower) - SYMFUNC(xf86toupper) - SYMFUNC(xf86ungetc) - SYMFUNC(xf86vfprintf) - SYMFUNC(xf86vsnprintf) - SYMFUNC(xf86vsprintf) - SYMFUNC(xf86write) - -/* non-ANSI C functions */ - SYMFUNC(xf86opendir) - SYMFUNC(xf86closedir) - SYMFUNC(xf86readdir) - SYMFUNC(xf86rewinddir) - SYMFUNC(xf86ffs) - SYMFUNC(xf86strdup) - SYMFUNC(xf86bzero) - SYMFUNC(xf86usleep) - SYMFUNC(xf86execl) + /* + * These are our own interfaces to libc functions. + */ + SYMFUNC(xf86abort) + SYMFUNC(xf86abs) + SYMFUNC(xf86acos) + SYMFUNC(xf86asin) + SYMFUNC(xf86atan) + SYMFUNC(xf86atan2) + SYMFUNC(xf86atof) + SYMFUNC(xf86atoi) + SYMFUNC(xf86atol) + SYMFUNC(xf86bsearch) + SYMFUNC(xf86ceil) + SYMFUNC(xf86calloc) + SYMFUNC(xf86clearerr) + SYMFUNC(xf86close) + SYMFUNC(xf86cos) + SYMFUNC(xf86exit) + SYMFUNC(xf86exp) + SYMFUNC(xf86fabs) + SYMFUNC(xf86fclose) + SYMFUNC(xf86feof) + SYMFUNC(xf86ferror) + SYMFUNC(xf86fflush) + SYMFUNC(xf86fgetc) + SYMFUNC(xf86fgetpos) + SYMFUNC(xf86fgets) + SYMFUNC(xf86finite) + SYMFUNC(xf86floor) + SYMFUNC(xf86fmod) + SYMFUNC(xf86fopen) + SYMFUNC(xf86fprintf) + SYMFUNC(xf86fputc) + SYMFUNC(xf86fputs) + SYMFUNC(xf86fread) + SYMFUNC(xf86free) + SYMFUNC(xf86freopen) + SYMFUNC(xf86frexp) + SYMFUNC(xf86fscanf) + SYMFUNC(xf86fseek) + SYMFUNC(xf86fsetpos) + SYMFUNC(xf86ftell) + SYMFUNC(xf86fwrite) + SYMFUNC(xf86getc) + SYMFUNC(xf86getenv) + SYMFUNC(xf86getpagesize) + SYMFUNC(xf86hypot) + SYMFUNC(xf86ioctl) + SYMFUNC(xf86isalnum) + SYMFUNC(xf86isalpha) + SYMFUNC(xf86iscntrl) + SYMFUNC(xf86isdigit) + SYMFUNC(xf86isgraph) + SYMFUNC(xf86islower) + SYMFUNC(xf86isprint) + SYMFUNC(xf86ispunct) + SYMFUNC(xf86isspace) + SYMFUNC(xf86isupper) + SYMFUNC(xf86isxdigit) + SYMFUNC(xf86labs) + SYMFUNC(xf86ldexp) + SYMFUNC(xf86log) + SYMFUNC(xf86log10) + SYMFUNC(xf86lseek) + SYMFUNC(xf86malloc) + SYMFUNC(xf86memchr) + SYMFUNC(xf86memcmp) + SYMFUNC(xf86memcpy) + /* + * Some compilers generate calls to memcpy to handle structure copies + * or run-time initializations. + */ + SYMFUNCALIAS("memcpy", xf86memcpy) + SYMFUNC(xf86memset) + /* + * Some compilers generate calls to memset to handle aggregate + * initializations. + */ + SYMFUNCALIAS("memset", xf86memset) + SYMFUNC(xf86memmove) + SYMFUNC(xf86mmap) + SYMFUNC(xf86modf) + SYMFUNC(xf86munmap) + SYMFUNC(xf86open) + SYMFUNC(xf86perror) + SYMFUNC(xf86pow) + SYMFUNC(xf86printf) + SYMFUNC(xf86qsort) + SYMFUNC(xf86read) + SYMFUNC(xf86realloc) + SYMFUNC(xf86remove) + SYMFUNC(xf86rename) + SYMFUNC(xf86rewind) + SYMFUNC(xf86setbuf) + SYMFUNC(xf86setvbuf) + SYMFUNC(xf86sin) + SYMFUNC(xf86snprintf) + SYMFUNC(xf86sprintf) + SYMFUNC(xf86sqrt) + SYMFUNC(xf86sscanf) + SYMFUNC(xf86strcat) + SYMFUNC(xf86strcmp) + SYMFUNC(xf86strcasecmp) + SYMFUNC(xf86strcpy) + SYMFUNC(xf86strcspn) + SYMFUNC(xf86strerror) + SYMFUNC(xf86strlcat) + SYMFUNC(xf86strlcpy) + SYMFUNC(xf86strlen) + SYMFUNC(xf86strncasecmp) + SYMFUNC(xf86strncat) + SYMFUNC(xf86strncmp) + SYMFUNC(xf86strncpy) + SYMFUNC(xf86strpbrk) + SYMFUNC(xf86strchr) + SYMFUNC(xf86strrchr) + SYMFUNC(xf86strspn) + SYMFUNC(xf86strstr) + SYMFUNC(xf86strtod) + SYMFUNC(xf86strtok) + SYMFUNC(xf86strtol) + SYMFUNC(xf86strtoul) + SYMFUNC(xf86tan) + SYMFUNC(xf86tmpfile) + SYMFUNC(xf86tolower) + SYMFUNC(xf86toupper) + SYMFUNC(xf86ungetc) + SYMFUNC(xf86vfprintf) + SYMFUNC(xf86vsnprintf) + SYMFUNC(xf86vsprintf) + SYMFUNC(xf86write) - SYMFUNC(xf86getsecs) - SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */ + /* non-ANSI C functions */ + SYMFUNC(xf86opendir) + SYMFUNC(xf86closedir) + SYMFUNC(xf86readdir) + SYMFUNC(xf86rewinddir) + SYMFUNC(xf86ffs) + SYMFUNC(xf86strdup) + SYMFUNC(xf86bzero) + SYMFUNC(xf86usleep) + SYMFUNC(xf86execl) - /* These provide for DRI support. */ - SYMFUNC(xf86stat) - SYMFUNC(xf86fstat) - SYMFUNC(xf86access) - SYMFUNC(xf86geteuid) - SYMFUNC(xf86getegid) - SYMFUNC(xf86getpid) - SYMFUNC(xf86mknod) - SYMFUNC(xf86chmod) - SYMFUNC(xf86chown) - SYMFUNC(xf86sleep) - SYMFUNC(xf86mkdir) - SYMFUNC(xf86shmget) - SYMFUNC(xf86shmat) - SYMFUNC(xf86shmdt) - SYMFUNC(xf86shmctl) + SYMFUNC(xf86getsecs) + SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */ + + /* Some of these were added for DRI support. */ + SYMFUNC(xf86stat) + SYMFUNC(xf86fstat) + SYMFUNC(xf86access) + SYMFUNC(xf86geteuid) + SYMFUNC(xf86getegid) + SYMFUNC(xf86getpid) + SYMFUNC(xf86mknod) + SYMFUNC(xf86chmod) + SYMFUNC(xf86chown) + SYMFUNC(xf86sleep) + SYMFUNC(xf86mkdir) + SYMFUNC(xf86shmget) + SYMFUNC(xf86shmat) + SYMFUNC(xf86shmdt) + SYMFUNC(xf86shmctl) #ifdef HAS_GLIBC_SIGSETJMP - SYMFUNC(xf86setjmp) - SYMFUNC(xf86setjmp0) + SYMFUNC(xf86setjmp) + SYMFUNC(xf86setjmp0) #if defined(__GLIBC__) && (__GLIBC__ >= 2) - SYMFUNCALIAS("xf86setjmp1",__sigsetjmp) + SYMFUNCALIAS("xf86setjmp1", __sigsetjmp) #else - SYMFUNC(xf86setjmp1) /* For libc5 */ + SYMFUNC(xf86setjmp1) /* For libc5 */ #endif #else - SYMFUNCALIAS("xf86setjmp",setjmp) - SYMFUNCALIAS("xf86setjmp0",setjmp) - SYMFUNC(xf86setjmp1) + SYMFUNCALIAS("xf86setjmp", setjmp) + SYMFUNCALIAS("xf86setjmp0", setjmp) + SYMFUNC(xf86setjmp1) #endif - SYMFUNCALIAS("xf86longjmp",longjmp) - SYMFUNC(xf86getjmptype) - SYMFUNC(xf86setjmp1_arg2) - SYMFUNC(xf86setjmperror) + SYMFUNCALIAS("xf86longjmp", longjmp) + SYMFUNC(xf86getjmptype) + SYMFUNC(xf86setjmp1_arg2) + SYMFUNC(xf86setjmperror) #ifdef XF86DRI - /* These may have more general uses, but - for now, they are only used by the DRI. - Loading them only when the DRI is built - may make porting (the non-DRI portions - of the X server) easier. */ - SYMFUNC(xf86InstallSIGIOHandler) - SYMFUNC(xf86RemoveSIGIOHandler) + /* + * These may have more general uses, but for now, they are only used + * by the DRI. Loading them only when the DRI is built may make porting + * (the non-DRI portions of the X server) easier. + */ + SYMFUNC(xf86InstallSIGIOHandler) + SYMFUNC(xf86RemoveSIGIOHandler) # if defined(__alpha__) && defined(linux) - SYMFUNC(_bus_base) + SYMFUNC(_bus_base) # endif #endif - SYMFUNC(xf86BlockSIGIO) - SYMFUNC(xf86UnblockSIGIO) - + SYMFUNC(xf86BlockSIGIO) + SYMFUNC(xf86UnblockSIGIO) + #if defined(__alpha__) - SYMFUNC(__divl) - SYMFUNC(__reml) - SYMFUNC(__divlu) - SYMFUNC(__remlu) - SYMFUNC(__divq) - SYMFUNC(__divqu) - SYMFUNC(__remq) - SYMFUNC(__remqu) + SYMFUNC(__divl) + SYMFUNC(__reml) + SYMFUNC(__divlu) + SYMFUNC(__remlu) + SYMFUNC(__divq) + SYMFUNC(__divqu) + SYMFUNC(__remq) + SYMFUNC(__remqu) # ifdef linux - SYMFUNC(_outw) - SYMFUNC(_outb) - SYMFUNC(_outl) - SYMFUNC(_inb) - SYMFUNC(_inw) - SYMFUNC(_inl) - SYMFUNC(_alpha_outw) - SYMFUNC(_alpha_outb) - SYMFUNC(_alpha_outl) - SYMFUNC(_alpha_inb) - SYMFUNC(_alpha_inw) - SYMFUNC(_alpha_inl) + SYMFUNC(_outw) + SYMFUNC(_outb) + SYMFUNC(_outl) + SYMFUNC(_inb) + SYMFUNC(_inw) + SYMFUNC(_inl) + SYMFUNC(_alpha_outw) + SYMFUNC(_alpha_outb) + SYMFUNC(_alpha_outl) + SYMFUNC(_alpha_inb) + SYMFUNC(_alpha_inw) + SYMFUNC(_alpha_inl) # else - SYMFUNC(outw) - SYMFUNC(outb) - SYMFUNC(outl) - SYMFUNC(inb) - SYMFUNC(inw) - SYMFUNC(inl) + SYMFUNC(outw) + SYMFUNC(outb) + SYMFUNC(outl) + SYMFUNC(inb) + SYMFUNC(inw) + SYMFUNC(inl) # endif - SYMFUNC(xf86ReadMmio32) - SYMFUNC(xf86ReadMmio16) - SYMFUNC(xf86ReadMmio8) - SYMFUNC(xf86WriteMmio32) - SYMFUNC(xf86WriteMmio16) - SYMFUNC(xf86WriteMmio8) - SYMFUNC(xf86WriteMmioNB32) - SYMFUNC(xf86WriteMmioNB16) - SYMFUNC(xf86WriteMmioNB8) + SYMFUNC(xf86ReadMmio32) + SYMFUNC(xf86ReadMmio16) + SYMFUNC(xf86ReadMmio8) + SYMFUNC(xf86WriteMmio32) + SYMFUNC(xf86WriteMmio16) + SYMFUNC(xf86WriteMmio8) + SYMFUNC(xf86WriteMmioNB32) + SYMFUNC(xf86WriteMmioNB16) + SYMFUNC(xf86WriteMmioNB8) #endif #if defined(sun) && defined(SVR4) - SYMFUNC(inb) - SYMFUNC(inw) - SYMFUNC(inl) - SYMFUNC(outb) - SYMFUNC(outw) - SYMFUNC(outl) + SYMFUNC(inb) + SYMFUNC(inw) + SYMFUNC(inl) + SYMFUNC(outb) + SYMFUNC(outw) + SYMFUNC(outl) #endif #if defined(__powerpc__) && !defined(__OpenBSD__) - SYMFUNC(inb) - SYMFUNC(inw) - SYMFUNC(inl) - SYMFUNC(outb) - SYMFUNC(outw) - SYMFUNC(outl) + SYMFUNC(inb) + SYMFUNC(inw) + SYMFUNC(inl) + SYMFUNC(outb) + SYMFUNC(outw) + SYMFUNC(outl) # if defined(NO_INLINE) || defined(Lynx) - SYMFUNC(mem_barrier) - SYMFUNC(ldl_u) - SYMFUNC(eieio) - SYMFUNC(ldl_brx) - SYMFUNC(ldw_brx) - SYMFUNC(stl_brx) - SYMFUNC(stw_brx) - SYMFUNC(ldq_u) - SYMFUNC(ldw_u) - SYMFUNC(stl_u) - SYMFUNC(stq_u) - SYMFUNC(stw_u) - SYMFUNC(write_mem_barrier) + SYMFUNC(mem_barrier) + SYMFUNC(ldl_u) + SYMFUNC(eieio) + SYMFUNC(ldl_brx) + SYMFUNC(ldw_brx) + SYMFUNC(stl_brx) + SYMFUNC(stw_brx) + SYMFUNC(ldq_u) + SYMFUNC(ldw_u) + SYMFUNC(stl_u) + SYMFUNC(stq_u) + SYMFUNC(stw_u) + SYMFUNC(write_mem_barrier) # endif # if defined(Lynx) - SYMFUNC(_restf14) - SYMFUNC(_restf17) - SYMFUNC(_restf18) - SYMFUNC(_restf19) - SYMFUNC(_restf20) - SYMFUNC(_restf22) - SYMFUNC(_restf23) - SYMFUNC(_restf24) - SYMFUNC(_restf25) - SYMFUNC(_restf26) - SYMFUNC(_restf27) - SYMFUNC(_restf28) - SYMFUNC(_restf29) - SYMFUNC(_savef14) - SYMFUNC(_savef17) - SYMFUNC(_savef18) - SYMFUNC(_savef19) - SYMFUNC(_savef20) - SYMFUNC(_savef22) - SYMFUNC(_savef23) - SYMFUNC(_savef24) - SYMFUNC(_savef25) - SYMFUNC(_savef26) - SYMFUNC(_savef27) - SYMFUNC(_savef28) - SYMFUNC(_savef29) + SYMFUNC(_restf14) + SYMFUNC(_restf17) + SYMFUNC(_restf18) + SYMFUNC(_restf19) + SYMFUNC(_restf20) + SYMFUNC(_restf22) + SYMFUNC(_restf23) + SYMFUNC(_restf24) + SYMFUNC(_restf25) + SYMFUNC(_restf26) + SYMFUNC(_restf27) + SYMFUNC(_restf28) + SYMFUNC(_restf29) + SYMFUNC(_savef14) + SYMFUNC(_savef17) + SYMFUNC(_savef18) + SYMFUNC(_savef19) + SYMFUNC(_savef20) + SYMFUNC(_savef22) + SYMFUNC(_savef23) + SYMFUNC(_savef24) + SYMFUNC(_savef25) + SYMFUNC(_savef26) + SYMFUNC(_savef27) + SYMFUNC(_savef28) + SYMFUNC(_savef29) # endif # if PPCIO_DEBUG - SYMFUNC(debug_inb) - SYMFUNC(debug_inw) - SYMFUNC(debug_inl) - SYMFUNC(debug_outb) - SYMFUNC(debug_outw) - SYMFUNC(debug_outl) + SYMFUNC(debug_inb) + SYMFUNC(debug_inw) + SYMFUNC(debug_inl) + SYMFUNC(debug_outb) + SYMFUNC(debug_outw) + SYMFUNC(debug_outl) # endif #endif #if defined(__GNUC__) - SYMFUNC(__div64) - SYMFUNC(__divdf3) - SYMFUNC(__divdi3) - SYMFUNC(__divsf3) - SYMFUNC(__divsi3) - SYMFUNC(__moddi3) - SYMFUNC(__modsi3) - SYMFUNC(__mul64) - SYMFUNC(__muldf3) - SYMFUNC(__muldi3) - SYMFUNC(__mulsf3) - SYMFUNC(__mulsi3) - SYMFUNC(__udivdi3) - SYMFUNC(__udivsi3) - SYMFUNC(__umoddi3) - SYMFUNC(__umodsi3) +#ifndef __UNIXOS2__ + SYMFUNC(__div64) +#endif + SYMFUNC(__divdf3) + SYMFUNC(__divdi3) + SYMFUNC(__divsf3) + SYMFUNC(__divsi3) + SYMFUNC(__moddi3) + SYMFUNC(__modsi3) +#ifndef __UNIXOS2__ + SYMFUNC(__mul64) +#endif + SYMFUNC(__muldf3) + SYMFUNC(__muldi3) + SYMFUNC(__mulsf3) + SYMFUNC(__mulsi3) + SYMFUNC(__udivdi3) + SYMFUNC(__udivsi3) + SYMFUNC(__umoddi3) + SYMFUNC(__umodsi3) #endif #if defined(__ia64__) - SYMFUNC(_outw) - SYMFUNC(_outb) - SYMFUNC(_outl) - SYMFUNC(_inb) - SYMFUNC(_inw) - SYMFUNC(_inl) + SYMFUNC(_outw) + SYMFUNC(_outb) + SYMFUNC(_outl) + SYMFUNC(_inb) + SYMFUNC(_inw) + SYMFUNC(_inl) #endif #if defined(__arm__) - SYMFUNC(outw) - SYMFUNC(outb) - SYMFUNC(outl) - SYMFUNC(inb) - SYMFUNC(inw) - SYMFUNC(inl) + SYMFUNC(outw) + SYMFUNC(outb) + SYMFUNC(outl) + SYMFUNC(inb) + SYMFUNC(inw) + SYMFUNC(inl) #endif #ifdef __FreeBSD__ - SYMFUNC(sysctlbyname) +#if defined(__sparc__) + SYMFUNC(_Qp_qtos) + SYMFUNC(_Qp_qtod) + SYMFUNC(_Qp_qtoux) + SYMFUNC(_Qp_uitoq) + SYMFUNC(_Qp_dtoq) +#endif #endif -/* - * and now some variables - */ + /* Some variables. */ - SYMVAR(xf86stdin) - SYMVAR(xf86stdout) - SYMVAR(xf86stderr) - SYMVAR(xf86errno) - SYMVAR(xf86HUGE_VAL) + SYMVAR(xf86stdin) + SYMVAR(xf86stdout) + SYMVAR(xf86stderr) + SYMVAR(xf86errno) + SYMVAR(xf86HUGE_VAL) - /* General variables (from xf86.h) */ - SYMVAR(xf86ScreenIndex) - SYMVAR(xf86PixmapIndex) - SYMVAR(xf86Screens) - SYMVAR(byte_reversed) - SYMVAR(xf86inSuspend) - /* debugging variables */ + /* General variables (from xf86.h) */ + SYMVAR(xf86ScreenIndex) + SYMVAR(xf86PixmapIndex) + SYMVAR(xf86Screens) + SYMVAR(byte_reversed) + SYMVAR(xf86inSuspend) + /* debugging variables */ #ifdef BUILDDEBUG - SYMVAR(xf86p8bit) - SYMVAR(xf86DummyVar1) - SYMVAR(xf86DummyVar2) - SYMVAR(xf86DummyVar3) + SYMVAR(xf86p8bit) + SYMVAR(xf86DummyVar1) + SYMVAR(xf86DummyVar2) + SYMVAR(xf86DummyVar3) #endif #ifdef async - SYMVAR(xf86CurrentScreen) + SYMVAR(xf86CurrentScreen) #endif - /* predefined resource lists from xf86Bus.h */ - SYMVAR(resVgaExclusive) - SYMVAR(resVgaShared) - SYMVAR(resVgaMemShared) - SYMVAR(resVgaIoShared) - SYMVAR(resVgaUnusedExclusive) - SYMVAR(resVgaUnusedShared) - SYMVAR(resVgaSparseExclusive) - SYMVAR(resVgaSparseShared) - SYMVAR(res8514Exclusive) - SYMVAR(res8514Shared) - SYMVAR(PciAvoid) + /* predefined resource lists from xf86Bus.h */ + SYMVAR(resVgaExclusive) + SYMVAR(resVgaShared) + SYMVAR(resVgaMemShared) + SYMVAR(resVgaIoShared) + SYMVAR(resVgaUnusedExclusive) + SYMVAR(resVgaUnusedShared) + SYMVAR(resVgaSparseExclusive) + SYMVAR(resVgaSparseShared) + SYMVAR(res8514Exclusive) + SYMVAR(res8514Shared) + SYMVAR(PciAvoid) #if defined(__powerpc__) && (!defined(NO_INLINE) || defined(Lynx)) - SYMVAR(ioBase) + SYMVAR(ioBase) #endif - /* Globals from xf86Globals.c and xf86Priv.h */ - SYMVAR(xf86ConfigDRI) + /* Globals from xf86Globals.c and xf86Priv.h */ + SYMVAR(xf86ConfigDRI) - /* Globals from xf86Configure.c */ - SYMVAR(ConfiguredMonitor) + /* Globals from xf86Configure.c */ + SYMVAR(ConfiguredMonitor) - /* Pci.c */ - SYMVAR(pciNumBuses) - - { 0, 0 }, + /* Pci.c */ + SYMVAR(pciNumBuses) + {0, 0} }; diff --git a/hw/xfree86/os-support/assyntax.h b/hw/xfree86/os-support/assyntax.h index 3ae8a7940..191c7e49e 100644 --- a/hw/xfree86/os-support/assyntax.h +++ b/hw/xfree86/os-support/assyntax.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.12 1999/12/27 00:39:46 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.13 2003/08/24 17:37:03 dawes Exp $ */ #ifndef __ASSYNTAX_H__ #define __ASSYNTAX_H__ @@ -23,6 +23,33 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +/* + * Copyright (c) 1993-1999 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */ /* diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index d3aa25961..aa3313dc3 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/hw/xfree86/os-support/bsd/alpha_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.2.2.1 2003/05/09 02:30:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.5 2003/04/03 16:50:04 dawes Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -215,7 +215,7 @@ checkDevMem(Bool warn) /* Try the aperture driver first */ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE, + base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE); if (base != MAP_FAILED) { @@ -235,7 +235,7 @@ checkDevMem(Bool warn) #endif if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE, + base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE); if (base != MAP_FAILED) { @@ -308,8 +308,10 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } - base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE, - MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX); + base = mmap((caddr_t)0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX); if (base == MAP_FAILED) { FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n", @@ -325,9 +327,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) FatalError("%s: Address 0x%x outside allowable range\n", "xf86MapVidMem", Base); } - base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS, - xf86Info.screenFd, - (unsigned long)Base + BUS_BASE); + base = mmap(0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, xf86Info.screenFd, + (unsigned long)Base + BUS_BASE); if (base == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n", diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c index 96abe2ea4..36943add1 100644 --- a/hw/xfree86/os-support/bsd/arm_video.c +++ b/hw/xfree86/os-support/bsd/arm_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.1 2002/08/06 13:08:38 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.2 2003/03/14 13:46:03 tsi Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -135,7 +135,7 @@ checkDevMem(Bool warn) if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE, + base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE); if (base != MAP_FAILED) @@ -190,8 +190,10 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } - base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE, - MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX); + base = mmap((caddr_t)0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX); if (base == MAP_FAILED) { FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n", @@ -207,9 +209,11 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) FatalError("%s: Address 0x%x outside allowable range\n", "xf86MapVidMem", Base); } - base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS, - xf86Info.screenFd, - (unsigned long)Base - 0xA0000); + base = mmap(0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, xf86Info.screenFd, + (unsigned long)Base - 0xA0000); if (base == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n", @@ -353,7 +357,7 @@ xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size) if((memInfoP->regionVirtBase = mmap((caddr_t)0, Size, - PROT_READ|PROT_WRITE, + PROT_READ | PROT_WRITE, MAP_SHARED, xf86Info.screenFd, (unsigned long)mapInfoP->u.map_info_mmap.map_offset)) @@ -485,7 +489,7 @@ xf86EnableIO() if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) { /* Try to map a page at the pccons I/O space */ - base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE, + base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0x0000); if (base != (pointer)-1) { @@ -571,7 +575,7 @@ int ScreenNum; #ifdef USE_ARC_MMAP if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) { /* Try to map a page at the pccons I/O space */ - base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE, + base = (pointer)mmap((caddr_t)0, 65536, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0x0000); if (base != (pointer)-1) { @@ -613,7 +617,7 @@ int ScreenNum; if (devMemFd >= 0 && useDevMem) { - base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ|PROT_WRITE, + base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ | PROT_WRITE, MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE); if (base != (pointer)-1) diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c index f999561cf..6c675b5da 100644 --- a/hw/xfree86/os-support/bsd/bsdResource.c +++ b/hw/xfree86/os-support/bsd/bsdResource.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.8 2002/05/22 21:38:29 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.9 2003/10/02 13:30:06 eich Exp $ */ /* Resource information code */ @@ -18,7 +18,7 @@ resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #ifdef INCLUDE_XF86_NO_DOMAIN -#if defined(__alpha__) || defined(__sparc64__) +#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) resPtr xf86BusAccWindowsFromOS(void) diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c index c38ac073c..91367078e 100644 --- a/hw/xfree86/os-support/bsd/bsd_axp.c +++ b/hw/xfree86/os-support/bsd/bsd_axp.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.2 2002/10/29 23:19:13 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.3 2003/10/07 22:33:37 herrb Exp $ */ #include "X.h" #include "os.h" @@ -23,9 +23,9 @@ axpDevice bsdGetAXP(void); typedef struct { char *name; int type; -} AXP; +} _AXP; -static AXP axpList[] = { +static _AXP axpList[] = { {"apecs",APECS}, {"pyxis",PYXIS}, {"cia",CIA}, diff --git a/hw/xfree86/os-support/bsd/bsd_init.c b/hw/xfree86/os-support/bsd/bsd_init.c index 236b6ffbb..e4927d91a 100644 --- a/hw/xfree86/os-support/bsd/bsd_init.c +++ b/hw/xfree86/os-support/bsd/bsd_init.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c,v 3.19 2002/05/05 18:54:02 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c,v 3.22 2003/10/07 23:14:55 herrb Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -38,8 +38,10 @@ static Bool KeepTty = FALSE; static int devConsoleFd = -1; +#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) static int VTnum = -1; static int initialVT = -1; +#endif #ifdef PCCONS_SUPPORT /* Stock 0.1 386bsd pccons console driver interface */ @@ -146,10 +148,10 @@ void xf86OpenConsole() { int i, fd = -1; - int result; - struct utsname uts; xf86ConsOpen_t *driver; #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) + int result; + struct utsname uts; vtmode_t vtmode; #endif @@ -158,7 +160,7 @@ xf86OpenConsole() /* check if we are run with euid==0 */ if (geteuid() != 0) { - FatalError("xf86OpenConsole: Server must be suid root\n"); + FatalError("xf86OpenConsole: Server must be suid root"); } if (!KeepTty) @@ -196,7 +198,7 @@ xf86OpenConsole() strcat(cons_drivers, supported_drivers[i]); } FatalError( - "%s: No console driver found\n\tSupported drivers: %s\n\t%s\n", + "%s: No console driver found\n\tSupported drivers: %s\n\t%s", "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG); } #if 0 /* stdin is already closed in OsInit() */ @@ -211,7 +213,7 @@ xf86OpenConsole() case PCCONS: if (ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_ON, 0) < 0) { - FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s\n", + FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s", "xf86OpenConsole", strerror(errno), CHECK_DRIVER_MSG); } @@ -280,18 +282,18 @@ acquire_vt: vtmode.frsig = SIGUSR1; if (ioctl(xf86Info.consoleFd, VT_SETMODE, &vtmode) < 0) { - FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); + FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed"); } #if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) if (ioctl(xf86Info.consoleFd, KDENABIO, 0) < 0) { - FatalError("xf86OpenConsole: KDENABIO failed (%s)\n", + FatalError("xf86OpenConsole: KDENABIO failed (%s)", strerror(errno)); } #endif if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { - FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n"); + FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed"); } break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ @@ -335,7 +337,7 @@ xf86OpenPccons() if (ioctl(fd, CONSOLE_X_MODE_OFF, 0) < 0) { FatalError( - "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s\n", + "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s", "xf86OpenPccons", strerror(errno), "Was expecting pccons driver with X support", @@ -425,11 +427,11 @@ xf86OpenSyscons() { if (syscons_version >= 0x100) { - FatalError("%s: Cannot find a free VT\n", + FatalError("%s: Cannot find a free VT", "xf86OpenSyscons"); } /* Should no longer reach here */ - FatalError("%s: %s %s\n\t%s %s\n", + FatalError("%s: %s %s\n\t%s %s", "xf86OpenSyscons", "syscons versions prior to 1.0 require", "either the", @@ -448,18 +450,18 @@ xf86OpenSyscons() #endif if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0) { - FatalError("xf86OpenSyscons: Cannot open %s (%s)\n", + FatalError("xf86OpenSyscons: Cannot open %s (%s)", vtname, strerror(errno)); } if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("xf86OpenSyscons: VT_GETMODE failed\n"); + FatalError("xf86OpenSyscons: VT_GETMODE failed"); } xf86Info.consType = SYSCONS; xf86Msg(X_PROBED, "Using syscons driver with X support"); if (syscons_version >= 0x100) { - xf86ErrorF(" (version %d.%d)\n", syscons_version >> 8, + xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8, syscons_version & 0xFF); } else @@ -513,7 +515,7 @@ xf86OpenPcvt() { if(ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("%s: VT_GETMODE failed\n%s%s\n%s\n", + FatalError("%s: VT_GETMODE failed\n%s%s\n%s", "xf86OpenPcvt", "Found pcvt driver but X11 seems to be", " not supported.", CHECK_DRIVER_MSG); @@ -552,7 +554,7 @@ xf86OpenPcvt() } else { - FatalError("%s: Cannot find a free VT\n", + FatalError("%s: Cannot find a free VT", "xf86OpenPcvt"); } } @@ -562,12 +564,12 @@ xf86OpenPcvt() sprintf(vtname, "%s%01x", vtprefix, xf86Info.vtno - 1); if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { - FatalError("xf86OpenPcvt: Cannot open %s (%s)\n", + FatalError("xf86OpenPcvt: Cannot open %s (%s)", vtname, strerror(errno)); } if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("xf86OpenPcvt: VT_GETMODE failed\n"); + FatalError("xf86OpenPcvt: VT_GETMODE failed"); } xf86Info.consType = PCVT; #ifdef WSCONS_SUPPORT @@ -614,7 +616,7 @@ xf86OpenWScons() } if (fd != -1) { if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) < 0) { - FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s\n", + FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s", "xf86OpenConsole", strerror(errno), CHECK_DRIVER_MSG); } @@ -652,7 +654,7 @@ xf86CloseConsole() #if !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0) { - xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)\n", + xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)", strerror(errno)); } #endif @@ -676,7 +678,7 @@ xf86CloseConsole() close(xf86Info.consoleFd); if ((xf86Info.consoleFd = open("/dev/console",O_RDONLY,0)) <0) { - xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)\n", + xf86FatalError("xf86CloseConsole: Cannot open /dev/console (%s)", strerror(errno)); } } diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c index 20d8b04d4..0d586ef72 100644 --- a/hw/xfree86/os-support/bsd/bsd_kbd.c +++ b/hw/xfree86/os-support/bsd/bsd_kbd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.5 2003/02/17 15:11:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.8 2003/11/04 03:16:58 tsi Exp $ */ /* * Copyright (c) 2002 by The XFree86 Project, Inc. @@ -33,7 +33,7 @@ static KbdProtocolRec protocols[] = { #ifdef WSCONS_SUPPORT {"wskbd", PROT_WSCONS }, #endif - { NULL, PROT_UNKNOWN } + { NULL, PROT_UNKNOWN_KBD } }; typedef struct { @@ -143,8 +143,10 @@ static int KbdOn(InputInfoPtr pInfo, int what) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; +#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private; struct termios nTty; +#endif #ifdef WSCONS_SUPPORT int option; #endif @@ -406,7 +408,7 @@ OpenKeyboard(InputInfoPtr pInfo) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; int i; - KbdProtocolId prot = PROT_UNKNOWN; + KbdProtocolId prot = PROT_UNKNOWN_KBD; char *s; s = xf86SetStrOption(pInfo->options, "Protocol", NULL); diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c index f681d90d9..943bb9855 100644 --- a/hw/xfree86/os-support/bsd/bsd_mouse.c +++ b/hw/xfree86/os-support/bsd/bsd_mouse.c @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.24 2003/02/15 05:37:59 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.26 2003/10/10 20:56:05 herrb Exp $ */ /* - * Copyright 1999 by The XFree86 Project, Inc. + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ #include "X.h" @@ -45,6 +68,20 @@ static void usbSigioReadInput (int fd, void *closure); #endif +#if defined(__FreeBSD__) +/* These are for FreeBSD */ +#define DEFAULT_MOUSE_DEV "/dev/mouse" +#define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse" +#define DEFAULT_PS2_DEV "/dev/psm0" + +static const char *mouseDevs[] = { + DEFAULT_MOUSE_DEV, + DEFAULT_SYSMOUSE_DEV, + DEFAULT_PS2_DEV, + NULL +}; +#endif + static int SupportedInterfaces(void) { @@ -196,6 +233,98 @@ SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res) } #endif +#if defined(__FreeBSD__) + +#define MOUSED_PID_FILE "/var/run/moused.pid" + +/* + * Try to check if moused is running. DEFAULT_SYSMOUSE_DEV is useless without + * it. There doesn't seem to be a better way of checking. + */ +static Bool +MousedRunning(void) +{ + FILE *f = NULL; + unsigned int pid; + + if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) { + if (fscanf(f, "%u", &pid) == 1 && pid > 0) { + if (kill(pid, 0) == 0) { + fclose(f); + return TRUE; + } + } + fclose(f); + } + return FALSE; +} + +static const char * +FindDevice(InputInfoPtr pInfo, const char *protocol, int flags) +{ + int fd = -1; + const char **pdev, *dev = NULL; + Bool devMouse = FALSE; + struct stat devMouseStat; + struct stat sb; + + for (pdev = mouseDevs; *pdev; pdev++) { + SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK)); + if (fd == -1) { +#ifdef DEBUG + ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno)); +#endif + } else { + /* + * /dev/mouse is held until checks for matches with other devices + * are done. This is so that when it points to /dev/sysmouse, + * the test for whether /dev/sysmouse is usable can be made. + */ + if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) { + if (fstat(fd, &devMouseStat) == 0) + devMouse = TRUE; + close(fd); + continue; + } else if (!strcmp(*pdev, DEFAULT_SYSMOUSE_DEV)) { + /* Check if /dev/mouse is the same as /dev/sysmouse. */ + if (devMouse && fstat(fd, &sb) == 0 && + devMouseStat.st_dev == sb.st_dev && + devMouseStat.st_ino == sb.st_ino) { + /* If the same, use /dev/sysmouse. */ + devMouse = FALSE; + } + close(fd); + if (MousedRunning()) + break; + else { +#ifdef DEBUG + ErrorF("moused isn't running\n"); +#endif + } + } else { + close(fd); + break; + } + } + } + + if (*pdev) + dev = *pdev; + else if (devMouse) + dev = DEFAULT_MOUSE_DEV; + + if (dev) { + /* Set the Device option. */ + pInfo->conf_idev->commonOptions = + xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", dev); + xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", + pInfo->name, dev); + } + + return *pdev; +} +#endif + #if defined(WSCONS_SUPPORT) #define NUMEVENTS 64 @@ -502,11 +631,11 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags) #ifdef USB_NEW_HID if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) { - xf86Msg(X_WARNING, "%s: no x locator\n"); + xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name); } if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) { - xf86Msg(X_WARNING, "%s: no y locator\n"); + xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name); } if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL), hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) { @@ -514,11 +643,11 @@ usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags) #else if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), hid_input, &pUsbMse->loc_x) < 0) { - xf86Msg(X_WARNING, "%s: no x locator\n"); + xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name); } if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), hid_input, &pUsbMse->loc_y) < 0) { - xf86Msg(X_WARNING, "%s: no y locator\n"); + xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name); } if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL), hid_input, &pUsbMse->loc_z) < 0) { @@ -589,6 +718,9 @@ xf86OSMouseInit(int flags) p->SetBMRes = SetSysMouseRes; p->SetMiscRes = SetSysMouseRes; #endif +#if defined(__FreeBSD__) + p->FindDevice = FindDevice; +#endif p->PreInit = bsdMousePreInit; return p; } diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index 3c056ce55..75c8f8200 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.2 2002/09/10 15:53:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.5 2003/10/07 23:14:55 herrb Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -62,11 +62,11 @@ #ifdef __OpenBSD__ #define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ "\tin /etc/sysctl.conf and reboot your machine\n" \ - "\trefer to xf86(4) for details\n" + "\trefer to xf86(4) for details" #define SYSCTL_MSG2 \ "Check that you have set 'machdep.allowaperture=2'\n" \ "\tin /etc/sysctl.conf and reboot your machine\n" \ - "\trefer to xf86(4) for details\n" + "\trefer to xf86(4) for details" #endif /***************************************************************************/ @@ -114,7 +114,7 @@ checkDevMem(Bool warn) if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE, + base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000); if (base != MAP_FAILED) @@ -147,7 +147,7 @@ checkDevMem(Bool warn) if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE, + base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000); if (base != MAP_FAILED) @@ -220,14 +220,16 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { if (devMemFd < 0) { - FatalError("xf86MapVidMem: failed to open %s (%s)\n", + FatalError("xf86MapVidMem: failed to open %s (%s)", DEV_MEM, strerror(errno)); } - base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE, - MAP_FLAGS, devMemFd, (off_t)Base); + base = mmap((caddr_t)0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, devMemFd, (off_t)Base); if (base == MAP_FAILED) { - FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n", + FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)", "xf86MapVidMem", DEV_MEM, Size, Base, strerror(errno)); } @@ -237,16 +239,18 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) /* else, mmap /dev/vga */ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000) { - FatalError("%s: Address 0x%x outside allowable range\n", + FatalError("%s: Address 0x%lx outside allowable range", "xf86MapVidMem", Base); } - base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS, - xf86Info.screenFd, - (unsigned long)Base - 0xA0000 + base = mmap(0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_FLAGS, xf86Info.screenFd, + (unsigned long)Base - 0xA0000 ); if (base == MAP_FAILED) { - FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n", + FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)", strerror(errno)); } return(base); @@ -284,7 +288,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, if ((long)ptr == -1) { xf86Msg(X_WARNING, - "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n", + "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n", DEV_MEM, Len, Base, Offset, strerror(errno)); #ifdef __OpenBSD__ if (Base < 0xa0000) { @@ -324,7 +328,7 @@ xf86EnableIO() if (i386_iopl(TRUE) < 0) { #ifndef __OpenBSD__ - FatalError("%s: Failed to set IOPL for extended I/O\n", + FatalError("%s: Failed to set IOPL for extended I/O", "xf86EnableIO"); #else FatalError("%s: Failed to set IOPL for extended I/O\n%s", @@ -362,7 +366,7 @@ xf86EnableIO() if ((IoFd = open("/dev/io", O_RDWR)) == -1) { FatalError("xf86EnableIO: " - "Failed to open /dev/io for extended I/O\n"); + "Failed to open /dev/io for extended I/O"); } return; } @@ -435,7 +439,7 @@ xf86SetTVOut(int mode) #endif /* PCCONS_SUPPORT */ default: - FatalError("Xf86SetTVOut: Unsupported console\n"); + FatalError("Xf86SetTVOut: Unsupported console"); break; } return; @@ -460,7 +464,7 @@ xf86SetRGBOut() #endif /* PCCONS_SUPPORT */ default: - FatalError("Xf86SetTVOut: Unsupported console\n"); + FatalError("Xf86SetTVOut: Unsupported console"); break; } return; diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index 4ec7045e8..3e4ff9ee7 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.3 2002/11/09 17:28:08 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -44,7 +44,11 @@ /* Video Memory Mapping section */ /***************************************************************************/ +#ifndef __OpenBSD__ #define DEV_MEM "/dev/mem" +#else +#define DEV_MEM "/dev/xf86" +#endif static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); static void ppcUnmapVidMem(int, pointer, unsigned long); @@ -71,9 +75,12 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) Base, Size, fd); #endif - base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base); + base = mmap(0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_SHARED, fd, Base); if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n", + FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", "xf86MapVidMem", Size, Base, strerror(errno)); return base; @@ -93,9 +100,9 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, static int kmem = -1; if (kmem == -1) { - kmem = open("/dev/xf86", 2); + kmem = open(DEV_MEM, 2); if (kmem == -1) { - FatalError("xf86ReadBIOS: open /dev/xf86\n"); + FatalError("xf86ReadBIOS: open %s", DEV_MEM); } } diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c index 877550154..fe301acf5 100644 --- a/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/hw/xfree86/os-support/bsd/sparc64_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.1 2002/08/06 13:08:39 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.3 2003/10/07 23:14:55 herrb Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -66,9 +66,12 @@ sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, Base, Size, fd); #endif - base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base); + base = mmap(0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_SHARED, fd, Base); if (base == MAP_FAILED) - FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n", + FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", "xf86MapVidMem", Size, Base, strerror(errno)); return base; } diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c index 4840fd144..3b16f401a 100644 --- a/hw/xfree86/os-support/bus/460gxPCI.c +++ b/hw/xfree86/os-support/bus/460gxPCI.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.2 2003/01/10 22:05:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.4 2003/08/29 21:08:06 tsi Exp $ */ /* * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. * @@ -122,7 +122,7 @@ Control460GXBridge(int bus, CARD16 mask, CARD16 value) * host bridges. */ static void -Get460GXBridgeBusses(int bus, int *primary, int *secondary, int *subordinate) +Get460GXBridgeBuses(int bus, int *primary, int *secondary, int *subordinate) { pciConfigPtr pPCI = Verify460GXBus(bus); int i; @@ -217,7 +217,7 @@ xf86PreScan460GX(void) /* First look for a 460GX's primary host bridge */ tag = PCI_MAKE_TAG(0, 0x10, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) { + if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { cbn_460gx = -1; return FALSE; } @@ -239,7 +239,7 @@ xf86PreScan460GX(void) } tag = PCI_MAKE_TAG(cbn_460gx, 0, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) { + if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { /* Sanity check failed */ cbn_460gx = -1; return TRUE; @@ -253,7 +253,8 @@ xf86PreScan460GX(void) for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) { tag = PCI_MAKE_TAG(cbn_460gx, devno, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) { + if (pciReadLong(tag, PCI_ID_REG) != + DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { /* Sanity check failed */ cbn_460gx = -1; return TRUE; @@ -272,8 +273,8 @@ xf86PreScan460GX(void) tag = PCI_MAKE_TAG(cbn_460gx, devno, 1); tmp = pciReadLong(tag, PCI_ID_REG); switch (tmp) { - case DEVID(INTEL, 460GX_PXB): - case DEVID(INTEL, 460GX_WXB): + case DEVID(VENDOR_INTEL, CHIP_460GX_PXB): + case DEVID(VENDOR_INTEL, CHIP_460GX_WXB): if (cbdevs_460gx & (1 << devno)) { /* Sanity check failed */ cbn_460gx = -1; @@ -289,7 +290,7 @@ xf86PreScan460GX(void) has_err_460gx[i] = 1; break; - case DEVID(INTEL, 460GX_GXB_1): + case DEVID(VENDOR_INTEL, CHIP_460GX_GXB_1): if (cbdevs_460gx & (1 << devno)) { /* Sanity check failed */ cbn_460gx = -1; @@ -323,7 +324,7 @@ xf86PreScan460GX(void) } /* - * The 460GX spec says that any access to busses higher than CBN will be + * The 460GX spec says that any access to buses higher than CBN will be * master-aborted. It seems possible however that this is not the case in * all 460GX implementations. For now, limit the bus scan to CBN, unless * we have already found a higher bus number. @@ -353,7 +354,7 @@ xf86PostScan460GX(void) /* Set up our extra bus functions */ BusFuncs_460gx = *(pciBusInfo[0]->funcs); BusFuncs_460gx.pciControlBridge = Control460GXBridge; - BusFuncs_460gx.pciGetBridgeBusses = Get460GXBridgeBusses; + BusFuncs_460gx.pciGetBridgeBuses = Get460GXBridgeBuses; BusFuncs_460gx.pciGetBridgeResources = Get460GXBridgeResources; /* diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index c7777827d..a0b639143 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.71.2.2 2003/05/06 17:00:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.81 2003/09/24 02:43:34 dawes Exp $ */ /* * Pci.c - New server PCI access functions * @@ -19,8 +19,6 @@ * pciWriteByte() - Write an 8 bit value to a device's cfg space * pciSetBitsLong() - Write a 32 bit value against a mask * pciSetBitsByte() - Write an 8 bit value against a mask - * pciLongFunc() - Return pointer to the requested low level - * function * pciTag() - Return tag for a given PCI bus, device, & * function * pciBusAddrToHostAddr() - Convert a PCI address to a host address @@ -170,6 +168,33 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #include <errno.h> #include <signal.h> #include "Xarch.h" @@ -376,7 +401,7 @@ pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val) pciInit(); if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] && - pciBusInfo[bus]->funcs->pciReadLong) { + pciBusInfo[bus]->funcs->pciSetBitsLong) { (*pciBusInfo[bus]->funcs->pciSetBitsLong)(tag, offset, mask, val); } } @@ -393,27 +418,6 @@ pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val) pciSetBitsLong(tag, aligned_offset, tmp_mask, tmp_val); } -pointer -pciLongFunc(PCITAG tag, pciFunc func) -{ - int bus = PCI_BUS_FROM_TAG(tag); - - pciInit(); - - if ((bus < 0) || (bus > pciNumBuses) || !pciBusInfo[bus] || - !pciBusInfo[bus]->funcs->pciReadLong) return NULL; - - switch (func) { - case WRITE: - return (void *)pciBusInfo[bus]->funcs->pciWriteLong; - case READ: - return (void *)pciBusInfo[bus]->funcs->pciReadLong; - case SET_BITS: - return (void *)pciBusInfo[bus]->funcs->pciSetBitsLong; - } - return NULL; -} - ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr) { @@ -551,11 +555,7 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min) } /* I/O maps can be no larger than 8 bits */ -#if defined(Lynx) && defined(__powerpc__) - if (PCI_MAP_IS_IO(addr1) && bits > 8) -#else if ((index < 6) && PCI_MAP_IS_IO(addr1) && bits > 8) -#endif bits = 8; /* ROM maps can be no larger than 24 bits */ if (index == 6 && bits > 24) @@ -569,6 +569,8 @@ pciTag(int busnum, int devnum, int funcnum) return(PCI_MAKE_TAG(busnum,devnum,funcnum)); } +#if defined(PCI_MFDEV_SUPPORT) || defined(PowerMAX_OS) + Bool pciMfDev(int busnum, int devnum) { @@ -579,7 +581,7 @@ pciMfDev(int busnum, int devnum) tag0 = PCI_MAKE_TAG(busnum, devnum, 0); id0 = pciReadLong(tag0, PCI_ID_REG); - if (id0 == 0xffffffff) + if ((CARD16)(id0 + 1) <= (CARD16)1UL) return FALSE; val = pciReadLong(tag0, PCI_HEADER_MISC) & 0x00ff0000; @@ -594,10 +596,15 @@ pciMfDev(int busnum, int devnum) */ tag1 = PCI_MAKE_TAG(busnum, devnum, 1); id1 = pciReadLong(tag1, PCI_ID_REG); - if (id1 == 0xffffffff || id1 == 0x00000000) + if ((CARD16)(id1 + 1) <= (CARD16)1UL) + return FALSE; + + /* Vendor IDs should match */ + if ((id0 ^ id1) & 0x0000ffff) return FALSE; if ((id0 != id1) || + /* Note the following test is valid for header types 0, 1 and 2 */ (pciReadLong(tag0, PCI_MAP_REG_START) != pciReadLong(tag1, PCI_MAP_REG_START))) return TRUE; @@ -605,6 +612,8 @@ pciMfDev(int busnum, int devnum) return FALSE; } +#endif + /* * Generic find/read/write functions */ @@ -678,6 +687,7 @@ pciGenFindNext(void) * No more devices for this bus. Next bus please */ if (speculativeProbe) { + NextSpeculativeBus: xfree(pciBusInfo[pciBusNum]); pciBusInfo[pciBusNum] = NULL; speculativeProbe = FALSE; @@ -715,7 +725,7 @@ pciGenFindNext(void) #endif pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum); inProbe = TRUE; - devid = pciReadLong(pciDeviceTag, 0); + devid = pciReadLong(pciDeviceTag, PCI_ID_REG); inProbe = FALSE; #ifdef DEBUGPCI ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); @@ -723,18 +733,36 @@ pciGenFindNext(void) if ((CARD16)(devid + 1U) <= (CARD16)1UL) continue; /* Nobody home. Next device please */ + /* + * Some devices mis-decode configuration cycles in such a way as to + * create phantom buses. + */ + if (speculativeProbe && (pciDevNum == 0) && (pciFuncNum == 0) && + (PCI_BUS_NO_DOMAIN(pciBusNum) > 0)) { + for (;;) { + if (++pciDevNum >= pciBusInfo[pciBusNum]->numDevices) + goto NextSpeculativeBus; + if (devid != + pciReadLong(PCI_MAKE_TAG(pciBusNum, pciDevNum, 0), + PCI_ID_REG)) + break; + } + + pciDevNum = 0; + } + if (pciNumBuses <= pciBusNum) pciNumBuses = pciBusNum + 1; speculativeProbe = FALSE; previousBus = pciBusNum; +#ifdef PCI_BRIDGE_SUPPORT /* * Before checking for a specific devid, look for enabled * PCI to PCI bridge devices. If one is found, create and * initialize a bus info record (if one does not already exist). */ -#ifdef PCI_BRIDGE_SUPPORT tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG); base_class = PCI_CLASS_EXTRACT(tmp); sub_class = PCI_SUBCLASS_EXTRACT(tmp); @@ -754,7 +782,7 @@ pciGenFindNext(void) (sub_class != PCI_SUBCLASS_BRIDGE_CARDBUS)) xf86Msg(X_WARNING, "pciGenFindNext: primary bus mismatch on PCI" - " bridge 0x%08x (0x%02x, 0x%02x)\n", + " bridge 0x%08lx (0x%02x, 0x%02x)\n", pciDeviceTag, pciBusNum, pri_bus); pri_bus = pciBusNum; } @@ -970,12 +998,6 @@ xf86scanpci(int flags) for (i = 0; i < 17; i++) /* PCI hdr plus 1st dev spec dword */ devp->cfgspc.dwords[i] = pciReadLong(tag, i * sizeof(CARD32)); -#ifdef ARCH_PCI_HOST_BRIDGE - if ((devp->pci_base_class == PCI_CLASS_BRIDGE) && - (devp->pci_sub_class == PCI_SUBCLASS_BRIDGE_HOST)) - ARCH_PCI_HOST_BRIDGE(devp); -#endif - /* Some broken devices don't implement this field... */ if (devp->pci_header_type == 0xff) devp->pci_header_type = 0; @@ -1115,7 +1137,7 @@ xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base, base = xf86MapDomainMemory(ScreenNum, Flags, Tag, hostbase, Size); if (!base) { FatalError("xf86MapPciMem: Could not mmap PCI memory " - "[base=0x%x,hostbase=0x%x,size=%x] (%s)\n", + "[base=0x%lx,hostbase=0x%lx,size=%lx] (%s)\n", Base, hostbase, Size, strerror(errno)); } /* @@ -1165,8 +1187,8 @@ handlePciBIOS(PCITAG Tag, int basereg, savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2)); xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" " for device %i:%i:%i\n", basereg, - PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag), - PCI_FUNC_FROM_TAG(Tag)); + (int)PCI_BUS_FROM_TAG(Tag), (int)PCI_DEV_FROM_TAG(Tag), + (int)PCI_FUNC_FROM_TAG(Tag)); pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), (CARD32)~0); } @@ -1275,7 +1297,7 @@ readPciBios(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer args) } if ((rd->Offset) > (image_length)) { xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past " - "end of BIOS %i > %i\n",(rd->Offset) , (image_length)); + "end of BIOS %li > %i\n",(rd->Offset) , (image_length)); } else { if ((rd->Offset + rd->Len) > (image_length)) { rd->Len = (image_length) - rd->Offset; @@ -1299,7 +1321,7 @@ getPciBIOSTypes(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer arg) /* We found a PCI BIOS Image. Now we collect the types type */ do { unsigned short data_off = tmp[0x18] | (tmp[0x19] << 8); - unsigned char data[16]; + unsigned char data[0x16]; unsigned int i_length; if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data) @@ -1359,22 +1381,20 @@ HandlePciBios(PCITAG Tag, int basereg, if (!num) return 0; #define PCI_ENA (PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE) - Acc1 = ((ReadProcPtr)(pciLongFunc(Tag,READ)))(Tag,PCI_CMD_STAT_REG); - ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag, - PCI_CMD_STAT_REG,(Acc1 & ~PCI_ENA)); + Acc1 = pciReadLong(Tag, PCI_CMD_STAT_REG); + pciWriteLong(Tag, PCI_CMD_STAT_REG, (Acc1 & ~PCI_ENA)); for (i = 0; i < num; i++) { - Acc2 = ((ReadProcPtr)(pciLongFunc(pTag[i],READ)))(pTag[i],PCI_CMD_STAT_REG); - ((WriteProcPtr)(pciLongFunc(pTag[i],WRITE)))(pTag[i], - PCI_CMD_STAT_REG,(Acc2 | PCI_ENA)); + Acc2 = pciReadLong(pTag[i], PCI_CMD_STAT_REG); + pciWriteLong(pTag[i], PCI_CMD_STAT_REG, (Acc2 | PCI_ENA)); n = handlePciBIOS(pTag[i],0,func,ptr); - ((WriteProcPtr)(pciLongFunc(pTag[i],WRITE)))(pTag[i],PCI_CMD_STAT_REG,Acc2); + pciWriteLong(pTag[i], PCI_CMD_STAT_REG, Acc2); if (n) break; } - ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag,PCI_CMD_STAT_REG,Acc1); + pciWriteLong(Tag, PCI_CMD_STAT_REG, Acc1); return n; } diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 8fb421b34..74ca95baf 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.44 2003/11/07 23:57:47 dawes Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -69,6 +69,33 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * This file has the private Pci definitions. The public ones are imported @@ -98,7 +125,7 @@ #endif #define DEVID(vendor, device) \ - ((CARD32)((PCI_CHIP_##device << 16) | PCI_VENDOR_##vendor)) + ((CARD32)((PCI_##device << 16) | PCI_##vendor)) #ifndef PCI_DOM_MASK # define PCI_DOM_MASK 0x0ffu @@ -228,11 +255,14 @@ # define ARCH_PCI_INIT linuxPciInit # define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN +# elif defined(FreeBSD) +# define ARCH_PCI_INIT freebsdPciInit +# define INCLUDE_XF86_MAP_PCI_MEM +# define INCLUDE_XF86_NO_DOMAIN # endif # define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper #elif defined(__i386__) # define ARCH_PCI_INIT ix86PciInit -# define ARCH_PCI_HOST_BRIDGE ix86PciHostBridge # define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # if defined(linux) @@ -289,14 +319,20 @@ # elif defined(sun) # define ARCH_PCI_INIT sparcPciInit # define INCLUDE_XF86_MAP_PCI_MEM -# elif defined(__OpenBSD__) && defined(__sparc64__) +# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__) # define ARCH_PCI_INIT freebsdPciInit # define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # endif -# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge -#elif defined(__x86_64__) -# define ARCH_PCI_INIT ix86PciInit +# if !defined(__FreeBSD__) +# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge +# endif +#elif defined(__AMD64__) +# if defined(__FreeBSD__) +# define ARCH_PCI_INIT freebsdPciInit +# else +# define ARCH_PCI_INIT ix86PciInit +# endif # define INCLUDE_XF86_MAP_PCI_MEM # define INCLUDE_XF86_NO_DOMAIN # if defined(linux) @@ -313,10 +349,6 @@ extern void ARCH_PCI_INIT(void); extern void ARCH_PCI_OS_INIT(void); #endif -#if defined(ARCH_PCI_HOST_BRIDGE) -extern void ARCH_PCI_HOST_BRIDGE(pciConfigPtr pPCI); -#endif - #if defined(ARCH_PCI_PCI_BRIDGE) extern void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI); #endif @@ -344,7 +376,7 @@ typedef struct pci_bus_funcs { * to be performed generically. */ CARD16 (*pciControlBridge)(int, CARD16, CARD16); - void (*pciGetBridgeBusses)(int, int *, int *, int *); + void (*pciGetBridgeBuses)(int, int *, int *, int *); /* Use pointer's to avoid #include recursion */ void (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *); } pciBusFuncs_t, *pciBusFuncs_p; diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c index c730c1559..57262efa2 100644 --- a/hw/xfree86/os-support/bus/Sbus.c +++ b/hw/xfree86/os-support/bus/Sbus.c @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.2 2001/10/28 03:34:01 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.4 2003/10/02 13:30:06 eich Exp $ */ #include <fcntl.h> #include <stdio.h> @@ -170,6 +170,8 @@ promIsP1275(void) promP1275 = TRUE; else promP1275 = FALSE; +#elif defined(__FreeBSD__) + promP1275 = TRUE; #else #error Missing promIsP1275() function for this OS #endif @@ -554,6 +556,9 @@ pointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size) { pointer ret; + unsigned long pagemask = xf86getpagesize() - 1; + unsigned long off = offset & ~pagemask; + unsigned long len = ((offset + size + pagemask) & ~pagemask) - off; if (psdp->fd == -1) { psdp->fd = open(psdp->device, O_RDWR); @@ -562,22 +567,26 @@ xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size) } else if (psdp->fd < 0) return NULL; - ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, - psdp->fd, offset); + ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, + psdp->fd, off); if (ret == (pointer) -1) { - ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, - psdp->fd, offset); + ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, + psdp->fd, off); } if (ret == (pointer) -1) return NULL; - return ret; + return (char *)ret + (offset - off); } void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size) { - munmap (addr, size); + unsigned long mask = xf86getpagesize() - 1; + unsigned long base = (unsigned long)addr & ~mask; + unsigned long len = (((unsigned long)addr + size + mask) & ~mask) - base; + + munmap ((pointer)base, len); } /* Tell OS that we are driving the HW cursor ourselves. */ diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c index 829de03c0..adbd189f1 100644 --- a/hw/xfree86/os-support/bus/e8870PCI.c +++ b/hw/xfree86/os-support/bus/e8870PCI.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.2 2003/07/17 15:08:22 tsi Exp $ */ /* * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. * @@ -40,7 +40,7 @@ xf86PreScanE8870(void) /* Look for an E8870's Hub interface */ tag = PCI_MAKE_TAG(0, 0x1E, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 82801_P2P)) + if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_82801_P2P)) return FALSE; /* XXX Fill me in... */ diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c index c3e621daf..06baa69ea 100644 --- a/hw/xfree86/os-support/bus/freebsdPci.c +++ b/hw/xfree86/os-support/bus/freebsdPci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.5 2002/08/27 22:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.6 2003/10/02 13:30:07 eich Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -84,7 +84,7 @@ static pciBusInfo_t freebsdPci0 = { /* bridge */ NULL }; -#if !defined(__OpenBSD__) +#if !defined(__OpenBSD__) && !defined(__FreeBSD__) #if X_BYTE_ORDER == X_BIG_ENDIAN #ifdef __sparc__ #ifndef ASI_PL diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c index e07f5497c..b135d0b73 100644 --- a/hw/xfree86/os-support/bus/ix86Pci.c +++ b/hw/xfree86/os-support/bus/ix86Pci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.18 2003/01/27 00:01:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.25 2003/09/24 02:43:34 dawes Exp $ */ /* * ix86Pci.c - x86 PCI driver * @@ -109,6 +109,33 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #include <stdio.h> #include "compiler.h" #include "xf86.h" @@ -318,8 +345,9 @@ void ix86PciSelectCfgmech(void) xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n"); xf86MsgVerb(X_INFO, 3, - "PCI: stages = 0x%02x, oldVal1 = 0x%08x, mode1Res1" - " = 0x%08x\n", stages, oldVal1, mode1Res1); + "PCI: stages = 0x%02x, oldVal1 = 0x%08lx, mode1Res1" + " = 0x%08lx\n", stages, (unsigned long)oldVal1, + (unsigned long)mode1Res1); return; } @@ -372,9 +400,10 @@ void ix86PciSelectCfgmech(void) xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n"); xf86MsgVerb(X_INFO, 3, - "PCI: stages = 0x%02x, oldVal1 = 0x%08x,\n" - "\tmode1Res1 = 0x%08x, mode1Res2 = 0x%08x\n", - stages, oldVal1, mode1Res1, mode1Res2); + "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n" + "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n", + stages, (unsigned long)oldVal1, + (unsigned long)mode1Res1, (unsigned long)mode1Res2); return; } @@ -388,9 +417,10 @@ void ix86PciSelectCfgmech(void) } xf86MsgVerb(X_INFO, 3, "PCI: Standard check for type 1 failed.\n"); - xf86MsgVerb(X_INFO, 3, "PCI: stages = 0x%02x, oldVal1 = 0x%08x,\n" - "\tmode1Res1 = 0x%08x, mode1Res2 = 0x%08x\n", - stages, oldVal1, mode1Res1, mode1Res2); + xf86MsgVerb(X_INFO, 3, "PCI: stages = 0x%02x, oldVal1 = 0x%08lx,\n" + "\tmode1Res1 = 0x%08lx, mode1Res2 = 0x%08lx\n", + stages, (unsigned long)oldVal1, (unsigned long)mode1Res1, + (unsigned long)mode1Res2); /* Try config type 2 */ oldVal2 = inb(PCI_CFGMECH2_ENABLE_REG); @@ -656,35 +686,3 @@ ix86PciInit() pciBusInfo[0] = NULL; } } - -#ifdef ARCH_PCI_HOST_BRIDGE - -/* - * A small table of host bridges that limit the number of PCI buses to less - * than the maximum of 256. - */ -static struct { - CARD32 devid; - int maxpcibus; -} host_bridges[] = { - { DEVID(ALI_2, M1541), 128}, - { DEVID(VIA, APOLLOVP1), 64}, - { DEVID(VIA, APOLLOPRO133X), 64}, - { DEVID(INTEL, 430HX_BRIDGE), 16}, - { DEVID(INTEL, 440BX_BRIDGE), 32}, -}; -#define NUM_BRIDGES (sizeof(host_bridges) / sizeof(host_bridges[0])) - -void ARCH_PCI_HOST_BRIDGE(pciConfigPtr pPCI) -{ - int i; - - for (i = 0; i < NUM_BRIDGES; i++) { - if (pPCI->pci_device_vendor == host_bridges[i].devid) { - pciMaxBusNum = host_bridges[i].maxpcibus; - break; - } - } -} - -#endif /* ARCH_PCI_HOST_BRIDGE */ diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c index 637bd7021..9c46ee3d3 100644 --- a/hw/xfree86/os-support/bus/netbsdPci.c +++ b/hw/xfree86/os-support/bus/netbsdPci.c @@ -1,5 +1,6 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.4 2003/08/24 17:37:04 dawes Exp $ */ /* - * Copyright (C) 1994-2002 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -25,7 +26,6 @@ * use or other dealings in this Software without prior written * authorization from the XFree86 Project. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.2 2002/08/27 22:07:07 tsi Exp $ */ #include <sys/types.h> #include <sys/mman.h> @@ -60,10 +60,6 @@ static pciBusInfo_t netbsdPci0 = { /* numDevices */ 32, /* secondary */ FALSE, /* primary_bus */ 0, -#ifdef PowerMAX_OS -/* io_base */ 0, -/* io_size */ 0, -#endif /* funcs */ &netbsdFuncs0, /* pciBusPriv */ NULL, /* bridge */ NULL @@ -72,6 +68,7 @@ static pciBusInfo_t netbsdPci0 = { void netbsdPciInit() { + struct pciio_businfo pci_businfo; devpci = open("/dev/pci0", O_RDWR); if (devpci == -1) @@ -81,6 +78,10 @@ netbsdPciInit() pciBusInfo[0] = &netbsdPci0; pciFindFirstFP = pciGenFindFirst; pciFindNextFP = pciGenFindNext; + /* use businfo to get the number of devs */ + if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0) + FatalError("netbsdPciInit: not a PCI bus device"); + netbsdPci0.numDevices = pci_businfo.maxdevs; } static CARD32 diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c index 24bbec44c..2ada6fd47 100644 --- a/hw/xfree86/os-support/bus/sparcPci.c +++ b/hw/xfree86/os-support/bus/sparcPci.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.12 2003/01/02 18:11:32 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.14 2003/08/24 17:37:04 dawes Exp $ */ /* - * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved. + * Copyright (C) 2001-2003 The XFree86 Project, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -852,7 +852,7 @@ simbaVerifyBus(int bus) pciConfigPtr pPCI; if ((bus < 0) || (bus >= pciNumBuses) || !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) || - (pPCI->pci_device_vendor != DEVID(SUN, SIMBA))) + (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA))) return NULL; return pPCI; @@ -1012,7 +1012,7 @@ void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI) pciBusInfo_t *pBusInfo; CARD16 pcicommand; - if (pPCI->pci_device_vendor != DEVID(SUN, SIMBA)) + if (pPCI->pci_device_vendor != DEVID(VENDOR_SUN, CHIP_SIMBA)) return; pBusInfo = pPCI->businfo; diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h index 3ffc7d544..f2b5c0727 100644 --- a/hw/xfree86/os-support/bus/xf86Pci.h +++ b/hw/xfree86/os-support/bus/xf86Pci.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.39 2003/08/24 17:37:05 dawes Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -69,6 +69,33 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * This file contains just the public interface to the PCI code. @@ -638,12 +665,6 @@ typedef struct pci_device { } pciDevice, *pciConfigPtr; typedef enum { - WRITE, - READ, - SET_BITS -} pciFunc; - -typedef enum { PCI_MEM, PCI_MEM_SIZE, PCI_MEM_SPARSE_BASE, @@ -744,7 +765,6 @@ void pciWriteWord(PCITAG tag, int offset, CARD16 val); void pciWriteByte(PCITAG tag, int offset, CARD8 val); void pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val); void pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val); -pointer pciLongFunc(PCITAG tag, pciFunc func); ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr); ADDRESS pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr); PCITAG pciTag(int busnum, int devnum, int funcnum); diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h index 5c8acfd4b..1f5f03bd2 100644 --- a/hw/xfree86/os-support/bus/xf86Sbus.h +++ b/hw/xfree86/os-support/bus/xf86Sbus.h @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.5 2002/05/22 21:38:30 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.6 2003/10/02 13:30:07 eich Exp $ */ #ifndef _XF86_SBUS_H #define _XF86_SBUS_H @@ -35,7 +35,13 @@ #elif defined(__OpenBSD__) && defined(__sparc64__) /* XXX */ #elif defined(CSRG_BASED) +#if defined(__FreeBSD__) +#include <sys/types.h> +#include <sys/fbio.h> +#include <dev/ofw/openpromio.h> +#else #include <machine/fbio.h> +#endif #else #include <sun/fbio.h> #endif diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c index dc4d062f3..b5a483560 100644 --- a/hw/xfree86/os-support/bus/zx1PCI.c +++ b/hw/xfree86/os-support/bus/zx1PCI.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.5 2003/11/06 18:38:14 tsi Exp $ */ /* * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. * @@ -97,6 +97,8 @@ #define LBA_PORT5_CNTRL 0x1228U #define LBA_PORT6_CNTRL 0x1230U #define LBA_PORT7_CNTRL 0x1238U +#define LBA_ROPE_RESET 0x01UL +#define LBA_CLEAR_ERROR 0x10UL #define LBA_HARD_FAIL 0x40UL #define ROPE_PAGE_CONTROL 0x1418U @@ -326,7 +328,8 @@ ControlZX1Bridge(int bus, CARD16 mask, CARD16 value) } /* Move on to master abort failure enablement */ - tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL); + tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) & + ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR); if ((tmp1 & LBA_HARD_FAIL) || (tmp2 & IOA_HARD_FAIL)) { current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN; if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) && @@ -388,14 +391,15 @@ GetZX1BridgeResources(int bus, static CARD32 zx1FakeReadLong(PCITAG tag, int offset) { - FatalError("zx1FakeReadLong(0x%X, 0x%X) called\n", tag, offset); + FatalError("zx1FakeReadLong(0x%lX, 0x%X) called\n", + (unsigned long)tag, offset); } static void zx1FakeWriteLong(PCITAG tag, int offset, CARD32 val) { - FatalError("zx1FakeWriteLong(0x%X, 0x%X, 0x%08X) called\n", - tag, offset, val); + FatalError("zx1FakeWriteLong(0x%lX, 0x%X, 0x%08X) called\n", + (unsigned long)tag, offset, val); } static void @@ -458,8 +462,10 @@ xf86PreScanZX1(void) return FALSE; /* Look for ZX1's SBA and IOC */ - if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) != DEVID(HP, ZX1_SBA)) || - (MIO_LONG(MIO_FUNCTION1 + PCI_ID_REG) != DEVID(HP, ZX1_IOC))) { + if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) != + DEVID(VENDOR_HP, CHIP_ZX1_SBA)) || + (MIO_LONG(MIO_FUNCTION1 + PCI_ID_REG) != + DEVID(VENDOR_HP, CHIP_ZX1_IOC))) { xf86UnMapVidMem(-1, pZX1mio, mapSize); pZX1mio = NULL; return FALSE; @@ -513,7 +519,8 @@ xf86PreScanZX1(void) if (zx1_ropemap[i] == i) { /* Prevent hard-fails */ - zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL); + zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) & + ~(LBA_ROPE_RESET | LBA_CLEAR_ERROR); if (zx1_lbacntl[i] & LBA_HARD_FAIL) MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) = zx1_lbacntl[i] & ~LBA_HARD_FAIL; @@ -521,8 +528,10 @@ xf86PreScanZX1(void) /* Poke for an ioa */ tmp = IOA_LONG(i, PCI_ID_REG); switch ((CARD32)tmp) { - case DEVID(HP, ELROY): /* Expected vendor/device id's */ - case DEVID(HP, ZX1_LBA): + case DEVID(VENDOR_HP, CHIP_ELROY): + case DEVID(VENDOR_HP, CHIP_ZX1_LBA): /* Mercury */ + case DEVID(VENDOR_HP, CHIP_ZX1_AGP8): /* QuickSilver */ + /* Expected vendor/device IDs */ zx1_busno[i] = (unsigned int)IOA_BYTE(i, IOA_SECONDARY_BUS); zx1_subno[i] = @@ -900,9 +909,9 @@ xf86PostScanZX1(void) ppPCI = ppPCI2 = xf86scanpci(0); /* Recursion is only apparent */ while ((pPCI = *ppPCI2++)) { switch (pPCI->pci_device_vendor) { - case DEVID(HP, ZX1_SBA): - case DEVID(HP, ZX1_IOC): - case DEVID(HP, ZX1_LBA): + case DEVID(VENDOR_HP, CHIP_ZX1_SBA): + case DEVID(VENDOR_HP, CHIP_ZX1_IOC): + case DEVID(VENDOR_HP, CHIP_ZX1_LBA): xfree(pPCI); /* Remove it */ continue; @@ -975,7 +984,7 @@ xf86PostScanZX1(void) pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, 0, 0); pPCI->busnum = zx1_fakebus; /* pPCI->devnum = pPCI->funcnum = 0; */ - pPCI->pci_device_vendor = DEVID(HP, ZX1_SBA); + pPCI->pci_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_SBA); pPCI->pci_base_class = PCI_CLASS_BRIDGE; /* pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_HOST; */ pPCI->fakeDevice = TRUE; @@ -1009,7 +1018,7 @@ xf86PostScanZX1(void) pPCI->devnum = i | 0x10; /* pPCI->funcnum = 0; */ pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, pPCI->devnum, 0); - pPCI->pci_device_vendor = DEVID(HP, ZX1_LBA); + pPCI->pci_device_vendor = DEVID(VENDOR_HP, CHIP_ZX1_LBA); pPCI->pci_base_class = PCI_CLASS_BRIDGE; pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_PCI; pPCI->pci_header_type = 1; diff --git a/hw/xfree86/os-support/int10Defines.h b/hw/xfree86/os-support/int10Defines.h index d99ea8672..77d2f4db9 100644 --- a/hw/xfree86/os-support/int10Defines.h +++ b/hw/xfree86/os-support/int10Defines.h @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.3 2001/06/30 21:54:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.4 2003/08/24 17:37:03 dawes Exp $ */ +/* + * Copyright (c) 2000-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _INT10DEFINES_H_ #define _INT10DEFINES_H_ 1 diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index 4ef765451..11fe19f67 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.29 2002/10/16 21:13:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.31 2003/09/24 02:43:35 dawes Exp $ */ /* * linux specific part of the int10 module * Copyright 1999 Egbert Eich @@ -123,7 +123,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) ErrorF("Mapping sys bios area\n"); #endif if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE, - PROT_READ | PROT_WRITE | PROT_EXEC, + PROT_READ | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, SYS_BIOS)) == MAP_FAILED) { xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n"); @@ -238,7 +238,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE) if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE) xf86DrvMsg(screen, X_WARNING, - "Unable to retrieve all of segment 0x%06X.\n", cs); + "Unable to retrieve all of segment 0x%06lX.\n", cs); #ifdef DEBUG ErrorF("done\n"); #endif @@ -250,13 +250,13 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) && !(initPrimary(options))) { if (bios.bus == BUS_ISA && bios.location.legacy) { xf86DrvMsg(screen, X_CONFIG, - "Overriding BIOS location: 0x%lx\n", + "Overriding BIOS location: 0x%x\n", bios.location.legacy); cs = bios.location.legacy >> 4; bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { xf86DrvMsg(screen, X_ERROR, - "No V_BIOS at specified address 0x%x\n",cs << 4); + "No V_BIOS at specified address 0x%lx\n",cs << 4); goto error3; } } else { @@ -286,7 +286,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } } - xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs); + xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", cs); pInt->BIOSseg = cs; set_return_trap(pInt); @@ -345,7 +345,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { xf86DrvMsg(screen,X_ERROR,"No V_BIOS found " - "on override address 0x%x\n",bios_base); + "on override address %p\n",bios_base); goto error3; } } else { @@ -365,7 +365,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } } } - xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%x\n",cs); + xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%lx\n",cs); pInt->BIOSseg = cs; break; default: diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c index 6203cc3c3..dc737ac47 100644 --- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c +++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c @@ -1,3 +1,5 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c,v 1.3 2003/11/03 05:36:33 tsi Exp $ */ + #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -173,7 +175,7 @@ vm86_GP_fault(xf86Int10InfoPtr pInt) case 0x0f: xf86DrvMsg(pInt->scrnIndex, X_ERROR, - "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8x\n", X86_CS, X86_EIP); + "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP); goto op0ferr; default: diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index 13e423433..acac20bce 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/hw/xfree86/os-support/linux/lnx_agp.c @@ -7,7 +7,7 @@ * Copyright © 2001 The XFree86 Project, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.10 2002/12/12 18:29:11 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.12 2003/09/24 02:43:35 dawes Exp $ */ #include "X.h" #include "xf86.h" @@ -18,7 +18,7 @@ #if defined(linux) #include <asm/ioctl.h> #include <linux/agpgart.h> -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #include <sys/ioctl.h> #include <sys/agpio.h> #endif @@ -263,14 +263,14 @@ xf86BindGARTMemory(int screenNum, int key, unsigned long offset) if (offset % AGP_PAGE_SIZE != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " - "offset (0x%x) is not page-aligned (%d)\n", + "offset (0x%lx) is not page-aligned (%d)\n", offset, AGP_PAGE_SIZE); return FALSE; } pageOffset = offset / AGP_PAGE_SIZE; xf86DrvMsgVerb(screenNum, X_INFO, 3, - "xf86BindGARTMemory: bind key %d at 0x%08x " + "xf86BindGARTMemory: bind key %d at 0x%08lx " "(pgoffset %d)\n", key, offset, pageOffset); bind.pg_start = pageOffset; @@ -279,7 +279,7 @@ xf86BindGARTMemory(int screenNum, int key, unsigned long offset) if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: " "binding of gart memory with key %d\n" - "\tat offset 0x%x failed (%s)\n", + "\tat offset 0x%lx failed (%s)\n", key, offset, strerror(errno)); return FALSE; } @@ -332,8 +332,8 @@ xf86EnableAGP(int screenNum, CARD32 mode) setup.agp_mode = mode; if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) { xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: " - "AGPIOC_SETUP with mode %d failed (%s)\n", - mode, strerror(errno)); + "AGPIOC_SETUP with mode %ld failed (%s)\n", + (unsigned long)mode, strerror(errno)); return FALSE; } diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c index 741b9a279..7631a1ff0 100644 --- a/hw/xfree86/os-support/linux/lnx_io.c +++ b/hw/xfree86/os-support/linux/lnx_io.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.24 2002/10/20 21:45:27 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c,v 3.26 2003/11/17 22:20:41 dawes Exp $ */ /* * Copyright 1992 by Orest Zborowski <obz@Kodak.com> * Copyright 1993 by David Dawes <dawes@xfree86.org> @@ -67,6 +67,7 @@ xf86GetKbdLeds() * from util-linux-2.9t package */ #include <linux/kd.h> +#include <linux/version.h> #ifdef __sparc__ #include <asm/param.h> #include <asm/kbio.h> @@ -142,12 +143,7 @@ KIOCSRATE_ioctl_ok(int rate, int delay) { #undef rate -#if NeedFunctionPrototypes void xf86SetKbdRepeat(char rad) -#else -void xf86SetKbdRepeat(rad) -char rad; -#endif { #ifdef __sparc__ int rate = 500; /* Default rate */ diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c index f2d508c04..ba18f28a1 100644 --- a/hw/xfree86/os-support/linux/lnx_kbd.c +++ b/hw/xfree86/os-support/linux/lnx_kbd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.2 2003/02/17 15:11:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.5 2003/11/04 03:14:39 tsi Exp $ */ /* * Copyright (c) 2002 by The XFree86 Project, Inc. @@ -27,7 +27,7 @@ static KbdProtocolRec protocols[] = { {"standard", PROT_STD }, - { NULL, PROT_UNKNOWN } + { NULL, PROT_UNKNOWN_KBD } }; extern Bool VTSwitchEnabled; @@ -93,12 +93,20 @@ GetKbdLeds(InputInfoPtr pInfo) /* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al. * from util-linux-2.9t package */ - +#include <linux/kd.h> +#include <linux/version.h> #ifdef __sparc__ #include <asm/param.h> #include <asm/kbio.h> #endif +/* Deal with spurious kernel header change */ +#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42) +# define rate period +# endif +#endif + static int KDKBDREP_ioctl_ok(int rate, int delay) { #if defined(KDKBDREP) && !defined(__sparc__) @@ -160,6 +168,8 @@ KIOCSRATE_ioctl_ok(int rate, int delay) { #endif /* KIOCSRATE */ } +#undef rate + static void SetKbdRepeat(InputInfoPtr pInfo, char rad) { @@ -436,7 +446,7 @@ OpenKeyboard(InputInfoPtr pInfo) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; int i; - KbdProtocolId prot = PROT_UNKNOWN; + KbdProtocolId prot = PROT_UNKNOWN_KBD; char *s; s = xf86SetStrOption(pInfo->options, "Protocol", NULL); diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c index 8bc7e6331..3d0d30f52 100644 --- a/hw/xfree86/os-support/linux/lnx_mouse.c +++ b/hw/xfree86/os-support/linux/lnx_mouse.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.1 1999/05/17 13:17:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.2 2003/10/08 14:58:30 dawes Exp $ */ /* * Copyright 1999 by The XFree86 Project, Inc. @@ -8,6 +8,10 @@ #include "xf86.h" #include "xf86Xinput.h" #include "xf86OSmouse.h" +#include "xf86_OSlib.h" +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> static int SupportedInterfaces(void) @@ -15,6 +19,172 @@ SupportedInterfaces(void) return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO; } +static const char * +DefaultProtocol(void) +{ + return "Auto"; +} + +#define DEFAULT_MOUSE_DEV "/dev/mouse" +#define DEFAULT_PS2_DEV "/dev/psaux" +#define DEFAULT_GPM_DATA_DEV "/dev/gpmdata" +#define DEFAULT_GPM_CTL_DEV "/dev/gpmdata" + +static const char *mouseDevs[] = { + DEFAULT_MOUSE_DEV, + DEFAULT_PS2_DEV, + DEFAULT_GPM_DATA_DEV, + NULL +}; + +typedef enum { + MOUSE_PROTO_UNKNOWN = 0, + MOUSE_PROTO_SERIAL, + MOUSE_PROTO_PS2, + MOUSE_PROTO_MSC, + MOUSE_PROTO_GPM +} protocolTypes; + +static struct { + protocolTypes proto; + const char *name; +} devproto[] = { + { MOUSE_PROTO_UNKNOWN, NULL }, + { MOUSE_PROTO_PS2, "PS/2" }, + { MOUSE_PROTO_MSC, "MouseSystems" }, + { MOUSE_PROTO_GPM, "GPM" } +}; + +static const char * +FindDevice(InputInfoPtr pInfo, const char *protocol, int flags) +{ + int fd = -1; + const char **pdev; + + for (pdev = mouseDevs; *pdev; pdev++) { + SYSCALL (fd = open(*pdev, O_RDWR | O_NONBLOCK | O_EXCL)); + if (fd == -1) { +#ifdef DEBUG + ErrorF("Cannot open %s (%s)\n", *pdev, strerror(errno)); +#endif + } else + break; + } + + if (*pdev) { + close(fd); + /* Set the Device option. */ + pInfo->conf_idev->commonOptions = + xf86AddNewOption(pInfo->conf_idev->commonOptions, "Device", *pdev); + xf86Msg(X_INFO, "%s: Setting Device option to \"%s\"\n", + pInfo->name, *pdev); + } + + return *pdev; +} + +static const char * +GuessProtocol(InputInfoPtr pInfo, int flags) +{ + int fd = -1; + const char *dev; + char *realdev; + struct stat sbuf; + int i; + int proto = MOUSE_PROTO_UNKNOWN; + + dev = xf86SetStrOption(pInfo->conf_idev->commonOptions, "Device", NULL); + if (!dev) { +#ifdef DEBUG + ErrorF("xf86SetStrOption failed to return the device name\n"); +#endif + return NULL; + } + /* Look at the device name to guess the protocol. */ + realdev = NULL; + if (strcmp(dev, DEFAULT_MOUSE_DEV) == 0) { + if (lstat(dev, &sbuf) != 0) { +#ifdef DEBUG + ErrorF("lstat failed for %s (%s)\n", dev, strerror(errno)); +#endif + return NULL; + } + if (S_ISLNK(sbuf.st_mode)) { + realdev = xnfalloc(PATH_MAX + 1); + i = readlink(dev, realdev, PATH_MAX); + if (i <= 0) { +#ifdef DEBUG + ErrorF("readlink failed for %s (%s)\n", dev, strerror(errno)); +#endif + xfree(realdev); + return NULL; + } + realdev[i] = '\0'; + } + } + if (!realdev) + realdev = xnfstrdup(dev); + else { + /* If realdev doesn't contain a '/' then prepend "/dev/" */ + if (!strchr(realdev, '/')) { + char *tmp = xnfalloc(strlen(realdev) + 5 + 1); + sprintf(tmp, "/dev/%s", realdev); + xfree(realdev); + realdev = tmp; + } + } + + if (strcmp(realdev, DEFAULT_PS2_DEV) == 0) + proto = MOUSE_PROTO_PS2; + else if (strcmp(realdev, DEFAULT_GPM_DATA_DEV) == 0) + proto = MOUSE_PROTO_MSC; + else if (strcmp(realdev, DEFAULT_GPM_CTL_DEV) == 0) + proto = MOUSE_PROTO_GPM; + xfree(realdev); + /* + * If the protocol can't be guessed from the device name, + * try to characterise it. + */ + if (proto == MOUSE_PROTO_UNKNOWN) { + SYSCALL (fd = open(dev, O_RDWR | O_NONBLOCK | O_EXCL)); + if (isatty(fd)) { + /* Serial PnP has already failed, so give up. */ + } else { + if (fstat(fd, &sbuf) != 0) { +#ifdef DEBUG + ErrorF("fstat failed for %s (%s)\n", dev, strerror(errno)); +#endif + close(fd); + return NULL; + } + if (S_ISFIFO(sbuf.st_mode)) { + /* Assume GPM data in MSC format. */ + proto = MOUSE_PROTO_MSC; + } else { + /* Default to PS/2 */ + proto = MOUSE_PROTO_PS2; + } + } + close(fd); + } + if (proto == MOUSE_PROTO_UNKNOWN) { + xf86Msg(X_ERROR, "%s: GuessProtocol: Cannot find mouse protocol.\n", + pInfo->name); + return NULL; + } else { + for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); i++) { + if (devproto[i].proto == proto) { + xf86Msg(X_INFO, + "%s: GuessProtocol: " + "setting mouse protocol to \"%s\"\n", + pInfo->name, devproto[i].name); + return devproto[i].name; + } + } + } + return NULL; +} + OSMouseInfoPtr xf86OSMouseInit(int flags) { @@ -24,6 +194,9 @@ xf86OSMouseInit(int flags) if (!p) return NULL; p->SupportedInterfaces = SupportedInterfaces; + p->DefaultProtocol = DefaultProtocol; + p->FindDevice = FindDevice; + p->GuessProtocol = GuessProtocol; return p; } diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 107d5595e..ad3a17fa2 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.64 2003/02/17 15:29:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.68 2003/09/24 02:43:35 dawes Exp $ */ /* * Copyright 1992 by Orest Zborowski <obz@Kodak.com> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -407,6 +407,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) pointer base; int fd; int mapflags = MAP_SHARED; + int prot; memType realBase, alignOff; realBase = Base & ~(getpagesize() - 1); @@ -429,25 +430,31 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) mapflags |= MAP_NONCACHED; #endif -#if defined(__ia64__) +#if 0 /* this will disappear when people upgrade their kernels */ - if ((fd = open(DEV_MEM, O_RDWR|O_SYNC)) < 0) + fd = open(DEV_MEM, + ((flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR) | O_SYNC); #else - if ((fd = open(DEV_MEM, O_RDWR)) < 0) + fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); #endif + if (fd < 0) { FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", strerror(errno)); } + + if (flags & VIDMEM_READONLY) + prot = PROT_READ; + else + prot = PROT_READ | PROT_WRITE; + /* This requires linux-0.99.pl10 or above */ - base = mmap((caddr_t)0, Size + alignOff, - PROT_READ|PROT_WRITE, - mapflags, fd, + base = mmap((caddr_t)0, Size + alignOff, prot, mapflags, fd, (off_t)(off_t)realBase + BUS_BASE); close(fd); if (base == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap framebuffer" - " (0x%08x,0x%x) (%s)\n", Base, Size, + " (0x%08lx,0x%lx) (%s)\n", Base, Size, strerror(errno)); } #ifdef DEBUG @@ -500,7 +507,7 @@ xf86EnableIO(void) fd = open("/dev/mem", O_RDWR); if (ioBase == NULL) { ioBase = (volatile unsigned char *)mmap(0, 0x20000, - PROT_READ|PROT_WRITE, MAP_SHARED, fd, + PROT_READ | PROT_WRITE, MAP_SHARED, fd, ioBase_phys); /* Should this be fatal or just a warning? */ #if 0 @@ -656,7 +663,7 @@ static unsigned long msb_set = 0; static pointer mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { - int fd; + int fd, prot; unsigned long ret, rets = 0; static Bool was_here = FALSE; @@ -675,7 +682,8 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags xf86ReadMmio32 = readSparse32; } - if ((fd = open(DEV_MEM, O_RDWR)) < 0) { + fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); + if (fd < 0) { FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", strerror(errno)); } @@ -685,14 +693,18 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags Base, Size, flags); #endif + if (flags & VIDMEM_READONLY) + prot = PROT_READ; + else + prot = PROT_READ | PROT_WRITE; + /* This requirers linux-0.99.pl10 or above */ /* * Always do DENSE mmap, since read32/write32 currently require it. */ ret = (unsigned long)mmap((caddr_t)(DENSE_BASE + Base), Size, - PROT_READ | PROT_WRITE, - MAP_SHARED, fd, + prot, MAP_SHARED, fd, (off_t) (bus_base + Base)); /* @@ -706,8 +718,7 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags ((flags & VIDMEM_FRAMEBUFFER) && (flags & VIDMEM_SPARSE))) { rets = (unsigned long)mmap((caddr_t)(SPARSE_BASE + (Base << 5)), - Size << 5, PROT_READ | PROT_WRITE, - MAP_SHARED, fd, + Size << 5, prot, MAP_SHARED, fd, (off_t) _bus_base_sparse() + (Base << 5)); } @@ -968,7 +979,7 @@ static pointer mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { pointer base; - int fd; + int fd, prot; xf86WriteMmio8 = writeSparseJensen8; xf86WriteMmio16 = writeSparseJensen16; @@ -980,14 +991,20 @@ mapVidMemJensen(int ScreenNum, unsigned long Base, unsigned long Size, int flags xf86ReadMmio16 = readSparseJensen16; xf86ReadMmio32 = readSparseJensen32; - if ((fd = open(DEV_MEM, O_RDWR)) < 0) { + fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); + if (fd < 0) { FatalError("xf86MapVidMem: failed to open " DEV_MEM " (%s)\n", strerror(errno)); } + + if (flags & VIDMEM_READONLY) + prot = PROT_READ; + else + prot = PROT_READ | PROT_WRITE; + /* This requires linux-0.99.pl10 or above */ base = mmap((caddr_t)0, JENSEN_SHIFT(Size), - PROT_READ|PROT_WRITE, - MAP_SHARED, fd, + prot, MAP_SHARED, fd, (off_t)(JENSEN_SHIFT((off_t)Base) + _bus_base_sparse())); close(fd); if (base == MAP_FAILED) { diff --git a/hw/xfree86/os-support/misc/Delay.c b/hw/xfree86/os-support/misc/Delay.c index 7d5dad40b..b5de1d899 100644 --- a/hw/xfree86/os-support/misc/Delay.c +++ b/hw/xfree86/os-support/misc/Delay.c @@ -1,5 +1,8 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.3 2000/12/08 20:13:38 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.4 2003/03/25 04:18:23 dawes Exp $ */ +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include "X.h" #include "xf86.h" #include "xf86Priv.h" diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index f705e0f42..98546b688 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/hw/xfree86/os-support/misc/SlowBcopy.c @@ -4,7 +4,7 @@ for Alpha Linux *******************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c,v 1.5 2001/11/19 15:44:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c,v 1.6 2003/04/07 16:23:39 eich Exp $ */ /* * Create a dependency that should be immune from the effect of register @@ -26,6 +26,9 @@ void xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) { +#if defined(__ia64__) + outb(0x80, 0x00); +#endif while(len--) { *dst++ = *src++; diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c index d06bd3949..899c3820b 100644 --- a/hw/xfree86/os-support/sco/VTsw_sco.c +++ b/hw/xfree86/os-support/sco/VTsw_sco.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v 1.3 2001/06/30 22:41:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/VTsw_sco.c,v 1.4 2003/07/07 15:34:27 eich Exp $ */ /* * Copyright 1993 by David Wexelblat <dwex@goblin.org> * Copyright 1993 by David McCullough <davidm@stallion.oz.au> @@ -72,6 +72,7 @@ xf86VTSwitchAway() { ev_flush(); ev_suspend(); + sco_ledstatus = ioctl(xf86Info.consoleFd, KDGETLED, &sco_ledstate); xf86Info.vtRequestsPending = FALSE; @@ -97,7 +98,7 @@ xf86VTSwitchTo() return(FALSE); } else { if (sco_ledstatus >= 0) { - ioctl (xf86Info.consoleFd, KDSETLED, &sco_ledstate); + ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate); } sco_ledstatus = -1; diff --git a/hw/xfree86/os-support/sco/sco_video.c b/hw/xfree86/os-support/sco/sco_video.c index eb4b80c48..3c00f5564 100644 --- a/hw/xfree86/os-support/sco/sco_video.c +++ b/hw/xfree86/os-support/sco/sco_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c,v 3.8 2002/06/03 21:22:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_video.c,v 3.9 2003/03/14 13:46:07 tsi Exp $ */ /* * Copyright 2001 by J. Kean Johnston <jkj@sco.com> * @@ -112,7 +112,7 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags) unsigned long realBase, alignOff; pointer base; - fd = open (DEV_MEM, O_RDWR); + fd = open (DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); if (fd < 0) { FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); @@ -126,8 +126,9 @@ mapVidMemMMAP(int ScreenNum, unsigned long Base, unsigned long Size, int flags) ErrorF("base: %lx, realBase: %lx, alignOff: %lx\n", Base,realBase,alignOff); #endif - base = mmap((caddr_t)0, Size + alignOff, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, (off_t)realBase); + base = mmap((caddr_t)0, Size + alignOff, + (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), + MAP_SHARED, fd, (off_t)realBase); close(fd); if (base == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap framebuffer (0x%08x,0x%x) (%s)\n", diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c index c1100e67b..5da36fa19 100644 --- a/hw/xfree86/os-support/shared/agp_noop.c +++ b/hw/xfree86/os-support/shared/agp_noop.c @@ -1,10 +1,39 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.5 2003/08/24 17:37:05 dawes Exp $ */ +/* + * Copyright (c) 2000-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * Abstraction of the AGP GART interface. Stubs for platforms without * AGP GART support. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.3 2001/05/19 00:26:46 dawes Exp $ */ - +#ifdef __UNIXOS2__ +# define I_NEED_OS2_H +#endif #include "X.h" #include "xf86.h" #include "xf86Priv.h" diff --git a/hw/xfree86/os-support/shared/at_scancode.c b/hw/xfree86/os-support/shared/at_scancode.c index a1529579f..821e116ab 100644 --- a/hw/xfree86/os-support/shared/at_scancode.c +++ b/hw/xfree86/os-support/shared/at_scancode.c @@ -1,7 +1,29 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.1 2002/10/11 01:40:37 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.4 2003/08/24 17:37:05 dawes Exp $ */ /* - * Copyright (c) 2002 by The XFree86 Project, Inc. + * Copyright (c) 2002-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ #include "xf86.h" @@ -21,6 +43,34 @@ ATScancode(InputInfoPtr pInfo, int *scanCode) case KEY_Prefix1: pKbd->scanPrefix = *scanCode; /* special prefixes */ return TRUE; + case 0x59: *scanCode = KEY_0x59; break; + case 0x5a: *scanCode = KEY_0x5A; break; + case 0x5b: *scanCode = KEY_0x5B; break; + case 0x5c: *scanCode = KEY_KP_Equal; break; /* Keypad Equal */ + case 0x5d: *scanCode = KEY_0x5D; break; + case 0x5e: *scanCode = KEY_0x5E; break; + case 0x5f: *scanCode = KEY_0x5F; break; + case 0x62: *scanCode = KEY_0x62; break; + case 0x63: *scanCode = KEY_0x63; break; + case 0x64: *scanCode = KEY_0x64; break; + case 0x65: *scanCode = KEY_0x65; break; + case 0x66: *scanCode = KEY_0x66; break; + case 0x67: *scanCode = KEY_0x67; break; + case 0x68: *scanCode = KEY_0x68; break; + case 0x69: *scanCode = KEY_0x69; break; + case 0x6a: *scanCode = KEY_0x6A; break; + case 0x6b: *scanCode = KEY_0x6B; break; + case 0x6c: *scanCode = KEY_0x6C; break; + case 0x6d: *scanCode = KEY_0x6D; break; + case 0x6e: *scanCode = KEY_0x6E; break; + case 0x6f: *scanCode = KEY_0x6F; break; + case 0x70: *scanCode = KEY_0x70; break; + case 0x71: *scanCode = KEY_0x71; break; + case 0x72: *scanCode = KEY_0x72; break; + case 0x73: *scanCode = KEY_0x73; break; + case 0x74: *scanCode = KEY_0x74; break; + case 0x75: *scanCode = KEY_0x75; break; + case 0x76: *scanCode = KEY_0x76; break; } break; case KEY_Prefix0: diff --git a/hw/xfree86/os-support/shared/kbd.c b/hw/xfree86/os-support/shared/kbd.c index 0ebf729ac..213e8bd62 100644 --- a/hw/xfree86/os-support/shared/kbd.c +++ b/hw/xfree86/os-support/shared/kbd.c @@ -1,7 +1,29 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.2 2003/02/17 15:11:59 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.3 2003/08/24 17:37:05 dawes Exp $ */ /* - * Copyright (c) 2001 by The XFree86 Project, Inc. + * Copyright (c) 2001-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ #include "xf86OSKbd.h" diff --git a/hw/xfree86/os-support/shared/kmod_noop.c b/hw/xfree86/os-support/shared/kmod_noop.c index 80f487593..ae6852ed9 100644 --- a/hw/xfree86/os-support/shared/kmod_noop.c +++ b/hw/xfree86/os-support/shared/kmod_noop.c @@ -1,3 +1,30 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kmod_noop.c,v 1.2 2003/08/24 17:37:05 dawes Exp $ */ +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "xf86_OSproc.h" diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c index e72997cc3..b6aa8fb29 100644 --- a/hw/xfree86/os-support/shared/libc_wrapper.c +++ b/hw/xfree86/os-support/shared/libc_wrapper.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.88.2.2 2003/03/13 21:49:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.102 2003/11/19 03:52:58 dawes Exp $ */ /* - * Copyright 1997 by The XFree86 Project, Inc. + * Copyright 1997-2003 by The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -27,6 +27,9 @@ #undef __STRICT_ANSI__ #endif #include <X.h> +#ifdef __UNIXOS2__ +#define I_NEED_OS2_H +#endif #include <Xmd.h> #include <Xos.h> #include <sys/types.h> @@ -251,6 +254,18 @@ xf86strlen(const char* s) return (xf86size_t)strlen(s); } +xf86size_t +xf86strlcat(char *dest, const char *src, xf86size_t size) +{ + return(strlcat(dest, src, size)); +} + +xf86size_t +xf86strlcpy(char *dest, const char *src, xf86size_t size) +{ + return strlcpy(dest, src, size); +} + char* xf86strncat(char* dest, const char* src, xf86size_t n) { @@ -481,7 +496,7 @@ xf86mmap(void *start, xf86size_t length, int prot, if (flags & XF86_MAP_FIXED) f |= MAP_FIXED; if (flags & XF86_MAP_SHARED) f |= MAP_SHARED; if (flags & XF86_MAP_PRIVATE) f |= MAP_PRIVATE; -#ifdef __x86_64__ +#if defined(__AMD64__) && defined(linux) if (flags & XF86_MAP_32BIT) f |= MAP_32BIT; #endif if (prot & XF86_PROT_EXEC) p |= PROT_EXEC; @@ -655,7 +670,7 @@ static void _xf86checkhndl(XF86FILE_priv* f,const char *func) { if (!f || f->magic != XF86FILE_magic || !f->filehnd || !f->fname) { - FatalError("libc_wrapper error: passed invalid FILE handle to %s\n", + FatalError("libc_wrapper error: passed invalid FILE handle to %s", func); exit(42); } @@ -1088,7 +1103,7 @@ xf86setvbuf(XF86FILE* f, char *buf, int mode, xf86size_t size) vbufmode = _IOLBF; break; default: - FatalError("libc_wrapper error: mode in setvbuf incorrect\n"); + FatalError("libc_wrapper error: mode in setvbuf incorrect"); exit(42); } @@ -1298,7 +1313,7 @@ static void _xf86checkdirhndl(XF86DIR_priv* f,const char *func) { if (!f || f->magic != XF86DIR_magic || !f->dir || !f->dirent) { - FatalError("libc_wrapper error: passed invalid DIR handle to %s\n", + FatalError("libc_wrapper error: passed invalid DIR handle to %s", func); exit(42); } @@ -1550,8 +1565,12 @@ int xf86finite(double x) { #ifndef QNX4 +#ifndef __UNIXOS2__ return(finite(x)); #else + return(isfinite(x)); +#endif /* __UNIXOS2__ */ +#else /* XXX Replace this with something that really works. */ return 1; #endif @@ -1810,7 +1829,7 @@ xf86getpagesize() pagesize = PAGE_SIZE; #endif if (pagesize == -1) - FatalError("xf86getpagesize: Cannot determine page size\n"); + FatalError("xf86getpagesize: Cannot determine page size"); return pagesize; } @@ -1859,22 +1878,18 @@ xf86GetErrno () -#ifdef NEED_SNPRINTF -#include "snprintf.c" -#endif - #ifdef HAVE_SYSV_IPC int xf86shmget(xf86key_t key, int size, int xf86shmflg) { - int shmflg = xf86shmflg & 0777; + int shmflg; + + /* This copies the permissions (SHM_R, SHM_W for u, g, o). */ + shmflg = xf86shmflg & 0777; if (key == XF86IPC_PRIVATE) key = IPC_PRIVATE; - - if (xf86shmflg & XF86SHM_R) shmflg |= SHM_R; - if (xf86shmflg & XF86SHM_W) shmflg |= SHM_W; if (xf86shmflg & XF86IPC_CREAT) shmflg |= IPC_CREAT; if (xf86shmflg & XF86IPC_EXCL) shmflg |= IPC_EXCL; if (xf86shmflg & XF86IPC_NOWAIT) shmflg |= IPC_NOWAIT; @@ -1967,7 +1982,7 @@ int xf86setjmp(xf86jmp_buf env) { #if defined(__GLIBC__) && (__GLIBC__ >= 2) - return __sigsetjmp(env, xf86setjmp1_arg2()); + return __sigsetjmp((void *)env, xf86setjmp1_arg2()); #else return xf86setjmp1(env, xf86setjmp1_arg2()); #endif @@ -1976,7 +1991,7 @@ xf86setjmp(xf86jmp_buf env) int xf86setjmp0(xf86jmp_buf env) { - FatalError("setjmp: type 0 called instead of type %d\n", xf86getjmptype()); + FatalError("setjmp: type 0 called instead of type %d", xf86getjmptype()); } #if !defined(__GLIBC__) || (__GLIBC__ < 2) /* libc5 */ @@ -1995,7 +2010,7 @@ xf86setjmp1(xf86jmp_buf env, int arg2) int xf86setjmp1(xf86jmp_buf env, int arg2) { - FatalError("setjmp: type 1 called instead of type %d\n", xf86getjmptype()); + FatalError("setjmp: type 1 called instead of type %d", xf86getjmptype()); } #endif /* HAS_GLIBC_SIGSETJMP */ @@ -2009,7 +2024,7 @@ xf86setjmp1_arg2() int xf86setjmperror(xf86jmp_buf env) { - FatalError("setjmp: don't know how to handle setjmp() type %d\n", + FatalError("setjmp: don't know how to handle setjmp() type %d", xf86getjmptype()); } diff --git a/hw/xfree86/os-support/shared/pm_noop.c b/hw/xfree86/os-support/shared/pm_noop.c index fc02b3a20..b5f4941bc 100644 --- a/hw/xfree86/os-support/shared/pm_noop.c +++ b/hw/xfree86/os-support/shared/pm_noop.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.1 2000/02/13 03:36:11 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.2 2003/08/24 17:37:06 dawes Exp $ */ +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Stubs for the OS-support layer power-management functions. */ diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c index a4f487025..1812729c0 100644 --- a/hw/xfree86/os-support/shared/posix_tty.c +++ b/hw/xfree86/os-support/shared/posix_tty.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.28 2003/02/17 15:11:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.30 2003/08/24 17:37:06 dawes Exp $ */ /* - * Copyright 1993-1999 by The XFree86 Project, Inc. + * Copyright 1993-2003 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -127,12 +127,7 @@ xf86OpenSerial (pointer options) return (-1); } -#ifndef Lynx - SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK | O_EXCL)); -#else - /* O_EXCL yields an EEXIST on LynxOS */ SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK)); -#endif if (fd == -1) { xf86Msg (X_ERROR, diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index 077c566a6..fbab2a517 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -1,3 +1,5 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.16 2003/09/04 00:21:17 dawes Exp $ */ + /* sigio.c -- Support for SIGIO handler installation and removal * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com * @@ -24,12 +26,34 @@ * DEALINGS IN THE SOFTWARE. * * Authors: Rickard E. (Rik) Faith <faith@valinux.com> + */ +/* + * Copyright (c) 2002 by The XFree86 Project, Inc. * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.14 2002/05/05 19:18:14 herrb Exp $ - * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ - #ifdef XFree86Server # include "X.h" # include "xf86.h" @@ -151,6 +175,7 @@ xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure) fprintf(stderr,"fcntl(%d, F_SETOWN): %s\n", fd, strerror(errno)); #endif + xf86UnblockSIGIO(blocked); return 0; } sigemptyset(&sa.sa_mask); diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c index 0fdebda1d..51f98f2a4 100644 --- a/hw/xfree86/os-support/shared/sigiostubs.c +++ b/hw/xfree86/os-support/shared/sigiostubs.c @@ -1,6 +1,35 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.2 1999/10/14 04:25:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.4 2003/08/24 17:37:06 dawes Exp $ */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifdef XFree86Server +#ifdef __UNIXOS2__ +# define I_NEED_OS2_H +#endif # include "X.h" # include "xf86.h" # include "xf86drm.h" diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c index b21acabcc..fd60ec509 100644 --- a/hw/xfree86/os-support/shared/stdPci.c +++ b/hw/xfree86/os-support/shared/stdPci.c @@ -1,5 +1,34 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.2 1999/12/06 03:55:13 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.4 2003/08/24 17:37:06 dawes Exp $ */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ +#ifdef __UNIXOS2__ +# define I_NEED_OS2_H +#endif #include "X.h" #include "xf86.h" #include "xf86Priv.h" diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c index 5aae4ae9d..df781c371 100644 --- a/hw/xfree86/os-support/shared/stdResource.c +++ b/hw/xfree86/os-support/shared/stdResource.c @@ -1,7 +1,36 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.20 2002/01/25 21:56:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.22 2003/08/24 17:37:06 dawes Exp $ */ +/* + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Standard resource information code */ +#ifdef __UNIXOS2__ +# define I_NEED_OS2_H +#endif #include "X.h" #include "xf86.h" #include "xf86Priv.h" @@ -11,6 +40,9 @@ #include "xf86_OSlib.h" #include "xf86Resources.h" +#ifdef __UNIXOS2__ +# undef ADDRESS +#endif /* Avoid Imakefile changes */ #include "bus/Pci.h" diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c index 872cd7aa9..aed735680 100644 --- a/hw/xfree86/os-support/shared/vidmem.c +++ b/hw/xfree86/os-support/shared/vidmem.c @@ -1,9 +1,35 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.15 2001/10/28 03:34:02 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.17 2003/08/24 17:37:06 dawes Exp $ */ /* - * Copyright 1993-1999 by The XFree86 Project, Inc + * Copyright (c) 1993-2003 by The XFree86 Project, Inc. * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ + +#ifdef __UNIXOS2__ +# define I_NEED_OS2_H +#endif #include "X.h" #include "input.h" #include "scrnintstr.h" diff --git a/hw/xfree86/os-support/shared/xf86Axp.c b/hw/xfree86/os-support/shared/xf86Axp.c index 24d31db59..42edbc53c 100644 --- a/hw/xfree86/os-support/shared/xf86Axp.c +++ b/hw/xfree86/os-support/shared/xf86Axp.c @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.2 2000/11/06 21:57:11 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.3 2003/08/24 17:37:06 dawes Exp $ */ +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #include "xf86Axp.h" diff --git a/hw/xfree86/os-support/solaris/sun_bios.c b/hw/xfree86/os-support/solaris/sun_bios.c index d1c79888b..e93e0e9dd 100644 --- a/hw/xfree86/os-support/solaris/sun_bios.c +++ b/hw/xfree86/os-support/solaris/sun_bios.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.2 2001/10/28 03:34:02 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.3 2003/11/07 13:45:27 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -71,7 +71,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, { if (!xf86LinearVidMem()) FatalError("xf86ReadBIOS: Could not mmap BIOS" - " [a=%x]\n", Base); + " [a=%lx]\n", Base); sprintf(solx86_vtname, apertureDevName); } @@ -86,7 +86,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, if (ptr == MAP_FAILED) { xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed " - "[0x%05x, 0x%04x]\n", + "[0x%08lx, 0x%04x]\n", solx86_vtname, Base, mlen); close(fd); return -1; diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c index 7e4998817..058f1109a 100644 --- a/hw/xfree86/os-support/solaris/sun_kbd.c +++ b/hw/xfree86/os-support/solaris/sun_kbd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.1 2001/05/28 02:42:31 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.2 2003/10/09 11:44:00 pascal Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany * Copyright 1993 by David Dawes <dawes@XFree86.org> @@ -29,6 +29,7 @@ static int sun_otranslation = -1; static int sun_odirect = -1; +int sun_ktype; int xf86GetKbdLeds() @@ -53,7 +54,7 @@ xf86SetKbdRepeat(char rad) void xf86KbdInit() { - int ktype, klayout; + int klayout; if (xf86Info.kbdFd < 0) { xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK); @@ -66,7 +67,7 @@ xf86KbdInit() * broken (IMO) - DWH 8/21/99 */ - if (ioctl(xf86Info.kbdFd, KIOCTYPE, &ktype) < 0) + if (ioctl(xf86Info.kbdFd, KIOCTYPE, &sun_ktype) < 0) FatalError("Unable to determine keyboard type: %d\n", errno); if (ioctl(xf86Info.kbdFd, KIOCLAYOUT, &klayout) < 0) diff --git a/hw/xfree86/os-support/solaris/sun_kbdEv.c b/hw/xfree86/os-support/solaris/sun_kbdEv.c index ff4ef3288..f6481af29 100644 --- a/hw/xfree86/os-support/solaris/sun_kbdEv.c +++ b/hw/xfree86/os-support/solaris/sun_kbdEv.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.4 2001/11/08 04:15:33 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.6 2003/10/09 11:44:00 pascal Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * Copyright 1993 by David Dawes <dawes@xfree86.org> @@ -41,8 +41,11 @@ #endif #include <sys/vuid_event.h> +#include <sys/kbd.h> #include "atKeynames.h" +extern int sun_ktype; + #ifdef XKB extern Bool noXkbExtension; #endif @@ -105,7 +108,7 @@ static OsTimerPtr sunTimer = NULL; * type. */ static unsigned char map[256] = { -#if defined(i368) || defined(__i386) || defined(__i386__) +#if defined(i386) || defined(__i386) || defined(__i386__) KEY_NOTUSED, /* 0 */ KEY_Tilde, /* 1 */ KEY_1, /* 2 */ @@ -374,6 +377,248 @@ static unsigned char map[256] = { /* The rest default to KEY_UNKNOWN */ }; +#if defined(KB_USB) +static unsigned char usbmap[256] = { +/* + * partially taken from ../bsd/bsd_KbdMap.c + * + * added keycodes for Sun special keys (left function keys, audio control) + */ + /* 0 */ KEY_NOTUSED, + /* 1 */ KEY_NOTUSED, + /* 2 */ KEY_NOTUSED, + /* 3 */ KEY_NOTUSED, + /* 4 */ KEY_A, + /* 5 */ KEY_B, + /* 6 */ KEY_C, + /* 7 */ KEY_D, + /* 8 */ KEY_E, + /* 9 */ KEY_F, + /* 10 */ KEY_G, + /* 11 */ KEY_H, + /* 12 */ KEY_I, + /* 13 */ KEY_J, + /* 14 */ KEY_K, + /* 15 */ KEY_L, + /* 16 */ KEY_M, + /* 17 */ KEY_N, + /* 18 */ KEY_O, + /* 19 */ KEY_P, + /* 20 */ KEY_Q, + /* 21 */ KEY_R, + /* 22 */ KEY_S, + /* 23 */ KEY_T, + /* 24 */ KEY_U, + /* 25 */ KEY_V, + /* 26 */ KEY_W, + /* 27 */ KEY_X, + /* 28 */ KEY_Y, + /* 29 */ KEY_Z, + /* 30 */ KEY_1, /* 1 !*/ + /* 31 */ KEY_2, /* 2 @ */ + /* 32 */ KEY_3, /* 3 # */ + /* 33 */ KEY_4, /* 4 $ */ + /* 34 */ KEY_5, /* 5 % */ + /* 35 */ KEY_6, /* 6 ^ */ + /* 36 */ KEY_7, /* 7 & */ + /* 37 */ KEY_8, /* 8 * */ + /* 38 */ KEY_9, /* 9 ( */ + /* 39 */ KEY_0, /* 0 ) */ + /* 40 */ KEY_Enter, /* Return */ + /* 41 */ KEY_Escape, /* Escape */ + /* 42 */ KEY_BackSpace, /* Backspace Delete */ + /* 43 */ KEY_Tab, /* Tab */ + /* 44 */ KEY_Space, /* Space */ + /* 45 */ KEY_Minus, /* - _ */ + /* 46 */ KEY_Equal, /* = + */ + /* 47 */ KEY_LBrace, /* [ { */ + /* 48 */ KEY_RBrace, /* ] } */ + /* 49 */ KEY_BSlash, /* \ | */ + /* 50 */ KEY_BSlash, /* \ _ # ~ on some keyboards */ + /* 51 */ KEY_SemiColon, /* ; : */ + /* 52 */ KEY_Quote, /* ' " */ + /* 53 */ KEY_Tilde, /* ` ~ */ + /* 54 */ KEY_Comma, /* , < */ + /* 55 */ KEY_Period, /* . > */ + /* 56 */ KEY_Slash, /* / ? */ + /* 57 */ KEY_CapsLock, /* Caps Lock */ + /* 58 */ KEY_F1, /* F1 */ + /* 59 */ KEY_F2, /* F2 */ + /* 60 */ KEY_F3, /* F3 */ + /* 61 */ KEY_F4, /* F4 */ + /* 62 */ KEY_F5, /* F5 */ + /* 63 */ KEY_F6, /* F6 */ + /* 64 */ KEY_F7, /* F7 */ + /* 65 */ KEY_F8, /* F8 */ + /* 66 */ KEY_F9, /* F9 */ + /* 67 */ KEY_F10, /* F10 */ + /* 68 */ KEY_F11, /* F11 */ + /* 69 */ KEY_F12, /* F12 */ + /* 70 */ KEY_Print, /* PrintScrn SysReq */ + /* 71 */ KEY_ScrollLock, /* Scroll Lock */ + /* 72 */ KEY_Pause, /* Pause Break */ + /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */ + /* 74 */ KEY_Home, /* Home */ + /* 75 */ KEY_PgUp, /* Page Up */ + /* 76 */ KEY_Delete, /* Delete */ + /* 77 */ KEY_End, /* End */ + /* 78 */ KEY_PgDown, /* Page Down */ + /* 79 */ KEY_Right, /* Right Arrow */ + /* 80 */ KEY_Left, /* Left Arrow */ + /* 81 */ KEY_Down, /* Down Arrow */ + /* 82 */ KEY_Up, /* Up Arrow */ + /* 83 */ KEY_NumLock, /* Num Lock */ + /* 84 */ KEY_KP_Divide, /* Keypad / */ + /* 85 */ KEY_KP_Multiply, /* Keypad * */ + /* 86 */ KEY_KP_Minus, /* Keypad - */ + /* 87 */ KEY_KP_Plus, /* Keypad + */ + /* 88 */ KEY_KP_Enter, /* Keypad Enter */ + /* 89 */ KEY_KP_1, /* Keypad 1 End */ + /* 90 */ KEY_KP_2, /* Keypad 2 Down */ + /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */ + /* 92 */ KEY_KP_4, /* Keypad 4 Left */ + /* 93 */ KEY_KP_5, /* Keypad 5 */ + /* 94 */ KEY_KP_6, /* Keypad 6 */ + /* 95 */ KEY_KP_7, /* Keypad 7 Home */ + /* 96 */ KEY_KP_8, /* Keypad 8 Up */ + /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */ + /* 98 */ KEY_KP_0, /* Keypad 0 Ins */ + /* 99 */ KEY_KP_Decimal, /* Keypad . Del */ + /* 100 */ KEY_Less, /* < > on some keyboards */ + /* 101 */ KEY_Menu, /* Menu */ + /* 102 */ KEY_Power, /* Sun: Power */ + /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */ + /* 104 */ KEY_NOTUSED, + /* 105 */ KEY_NOTUSED, + /* 106 */ KEY_NOTUSED, + /* 107 */ KEY_NOTUSED, + /* 108 */ KEY_NOTUSED, + /* 109 */ KEY_NOTUSED, + /* 110 */ KEY_NOTUSED, + /* 111 */ KEY_NOTUSED, + /* 112 */ KEY_NOTUSED, + /* 113 */ KEY_NOTUSED, + /* 114 */ KEY_NOTUSED, + /* 115 */ KEY_NOTUSED, + /* 116 */ KEY_L7, /* Sun: Open */ + /* 117 */ KEY_Help, /* Sun: Help */ + /* 118 */ KEY_L3, /* Sun: Props */ + /* 119 */ KEY_L5, /* Sun: Front */ + /* 120 */ KEY_L1, /* Sun: Stop */ + /* 121 */ KEY_L2, /* Sun: Again */ + /* 122 */ KEY_L4, /* Sun: Undo */ + /* 123 */ KEY_L10, /* Sun: Cut */ + /* 124 */ KEY_L6, /* Sun: Copy */ + /* 125 */ KEY_L8, /* Sun: Paste */ + /* 126 */ KEY_L9, /* Sun: Find */ + /* 127 */ KEY_Mute, /* Sun: AudioMute */ + /* 128 */ KEY_AudioRaise, /* Sun: AudioRaise */ + /* 129 */ KEY_AudioLower, /* Sun: AudioLower */ + /* 130 */ KEY_NOTUSED, + /* 131 */ KEY_NOTUSED, + /* 132 */ KEY_NOTUSED, + /* 133 */ KEY_NOTUSED, + /* 134 */ KEY_NOTUSED, + /* 135 */ KEY_NOTUSED, + /* 136 */ KEY_NOTUSED, + /* 137 */ KEY_NOTUSED, + /* 138 */ KEY_NOTUSED, + /* 139 */ KEY_NOTUSED, + /* 140 */ KEY_NOTUSED, + /* 141 */ KEY_NOTUSED, + /* 142 */ KEY_NOTUSED, + /* 143 */ KEY_NOTUSED, + /* 144 */ KEY_NOTUSED, + /* 145 */ KEY_NOTUSED, + /* 146 */ KEY_NOTUSED, + /* 147 */ KEY_NOTUSED, + /* 148 */ KEY_NOTUSED, + /* 149 */ KEY_NOTUSED, + /* 150 */ KEY_NOTUSED, + /* 151 */ KEY_NOTUSED, + /* 152 */ KEY_NOTUSED, + /* 153 */ KEY_NOTUSED, + /* 154 */ KEY_NOTUSED, + /* 155 */ KEY_NOTUSED, + /* 156 */ KEY_NOTUSED, + /* 157 */ KEY_NOTUSED, + /* 158 */ KEY_NOTUSED, + /* 159 */ KEY_NOTUSED, + /* 160 */ KEY_NOTUSED, + /* 161 */ KEY_NOTUSED, + /* 162 */ KEY_NOTUSED, + /* 163 */ KEY_NOTUSED, + /* 164 */ KEY_NOTUSED, + /* 165 */ KEY_NOTUSED, + /* 166 */ KEY_NOTUSED, + /* 167 */ KEY_NOTUSED, + /* 168 */ KEY_NOTUSED, + /* 169 */ KEY_NOTUSED, + /* 170 */ KEY_NOTUSED, + /* 171 */ KEY_NOTUSED, + /* 172 */ KEY_NOTUSED, + /* 173 */ KEY_NOTUSED, + /* 174 */ KEY_NOTUSED, + /* 175 */ KEY_NOTUSED, + /* 176 */ KEY_NOTUSED, + /* 177 */ KEY_NOTUSED, + /* 178 */ KEY_NOTUSED, + /* 179 */ KEY_NOTUSED, + /* 180 */ KEY_NOTUSED, + /* 181 */ KEY_NOTUSED, + /* 182 */ KEY_NOTUSED, + /* 183 */ KEY_NOTUSED, + /* 184 */ KEY_NOTUSED, + /* 185 */ KEY_NOTUSED, + /* 186 */ KEY_NOTUSED, + /* 187 */ KEY_NOTUSED, + /* 188 */ KEY_NOTUSED, + /* 189 */ KEY_NOTUSED, + /* 190 */ KEY_NOTUSED, + /* 191 */ KEY_NOTUSED, + /* 192 */ KEY_NOTUSED, + /* 193 */ KEY_NOTUSED, + /* 194 */ KEY_NOTUSED, + /* 195 */ KEY_NOTUSED, + /* 196 */ KEY_NOTUSED, + /* 197 */ KEY_NOTUSED, + /* 198 */ KEY_NOTUSED, + /* 199 */ KEY_NOTUSED, + /* 200 */ KEY_NOTUSED, + /* 201 */ KEY_NOTUSED, + /* 202 */ KEY_NOTUSED, + /* 203 */ KEY_NOTUSED, + /* 204 */ KEY_NOTUSED, + /* 205 */ KEY_NOTUSED, + /* 206 */ KEY_NOTUSED, + /* 207 */ KEY_NOTUSED, + /* 208 */ KEY_NOTUSED, + /* 209 */ KEY_NOTUSED, + /* 210 */ KEY_NOTUSED, + /* 211 */ KEY_NOTUSED, + /* 212 */ KEY_NOTUSED, + /* 213 */ KEY_NOTUSED, + /* 214 */ KEY_NOTUSED, + /* 215 */ KEY_NOTUSED, + /* 216 */ KEY_NOTUSED, + /* 217 */ KEY_NOTUSED, + /* 218 */ KEY_NOTUSED, + /* 219 */ KEY_NOTUSED, + /* 220 */ KEY_NOTUSED, + /* 221 */ KEY_NOTUSED, + /* 222 */ KEY_NOTUSED, + /* 223 */ KEY_NOTUSED, + /* 224 */ KEY_LCtrl, /* Left Control */ + /* 225 */ KEY_ShiftL, /* Left Shift */ + /* 226 */ KEY_Alt, /* Left Alt */ + /* 227 */ KEY_LMeta, /* Left Meta */ + /* 228 */ KEY_RCtrl, /* Right Control */ + /* 229 */ KEY_ShiftR, /* Right Shift */ + /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */ + /* 231 */ KEY_RMeta, /* Right Meta */ +}; + +#endif /* KB_USB */ /* * sunPostKbdEvent -- * Translate the raw hardware Firm_event into an XEvent, and tell DIX @@ -404,7 +649,12 @@ sunPostKbdEvent(Firm_event *event) * and now get some special keysequences */ - keycode = map[event->id]; +#if defined(KB_USB) + if(sun_ktype == KB_USB) + keycode = usbmap[event->id]; + else +#endif + keycode = map[event->id]; if ((ModifierDown(ControlMask | AltMask)) || (ModifierDown(ControlMask | AltLangMask))) diff --git a/hw/xfree86/os-support/sysv/sysv_video.c b/hw/xfree86/os-support/sysv/sysv_video.c index ab604e95a..c0460f524 100644 --- a/hw/xfree86/os-support/sysv/sysv_video.c +++ b/hw/xfree86/os-support/sysv/sysv_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c,v 3.20 2000/10/28 01:42:29 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_video.c,v 3.21 2003/03/14 13:46:08 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -144,13 +144,16 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) int fd; #if defined(SVR4) - if ((fd = open(DEV_MEM, O_RDWR)) < 0) + fd = open(DEV_MEM, (flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR); + if (fd < 0) { FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } - base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE, - MAP_SHARED, fd, (off_t)Base); + base = mmap((caddr_t)0, Size, + (flags & VIDMEM_READONLY) ? + PROT_READ : (PROT_READ | PROT_WRITE), + MAP_SHARED, fd, (off_t)Base); close(fd); if (base == MAP_FAILED) { diff --git a/hw/xfree86/os-support/xf86OSKbd.h b/hw/xfree86/os-support/xf86OSKbd.h index e63d7759c..917b11526 100644 --- a/hw/xfree86/os-support/xf86OSKbd.h +++ b/hw/xfree86/os-support/xf86OSKbd.h @@ -1,7 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.3 2003/02/17 15:11:55 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.6 2003/11/03 05:11:51 tsi Exp $ */ /* - * Copyright (c) 2002 by The XFree86 Project, Inc. + * Copyright (c) 2002-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + * * Author: Ivan Pascal. */ @@ -81,7 +104,7 @@ typedef enum { PROT_XQUEUE, PROT_WSCONS, PROT_USB, - PROT_UNKNOWN + PROT_UNKNOWN_KBD } KbdProtocolId; typedef struct { @@ -90,3 +113,21 @@ typedef struct { } KbdProtocolRec; Bool xf86OSKbdPreInit(InputInfoPtr pInfo); + +/* Adjust this when the kbd interface changes. */ + +/* + * History: + * + * 1.0.0 - Initial version. + */ + +#define OS_KBD_VERSION_MAJOR 1 +#define OS_KBD_VERSION_MINOR 0 +#define OS_KBD_VERSION_PATCH 0 + +#define OS_KBD_VERSION_CURRENT \ + BUILTIN_INTERFACE_VERSION_NUMERIC(OS_KBD_VERSION_MAJOR, \ + OS_KBD_VERSION_MINOR, \ + OS_KBD_VERSION_PATCH) + diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h index a4486b987..ee6313a3b 100644 --- a/hw/xfree86/os-support/xf86OSmouse.h +++ b/hw/xfree86/os-support/xf86OSmouse.h @@ -1,7 +1,29 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.20 2002/12/17 20:55:23 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.24 2003/11/03 05:11:51 tsi Exp $ */ /* - * Copyright (c) 1997-1999 by The XFree86 Project, Inc. + * Copyright (c) 1999-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ /* Public interface to OS-specific mouse support. */ @@ -22,6 +44,36 @@ * specific protocol names that are * supported for this class. */ +/* Mouse Protocol IDs. */ +typedef enum { + PROT_UNKNOWN = -2, + PROT_UNSUP = -1, /* protocol is not supported */ + PROT_MS = 0, + PROT_MSC, + PROT_MM, + PROT_LOGI, + PROT_LOGIMAN, + PROT_MMHIT, + PROT_GLIDE, + PROT_IMSERIAL, + PROT_THINKING, + PROT_ACECAD, + PROT_VALUMOUSESCROLL, + PROT_PS2, + PROT_GENPS2, + PROT_IMPS2, + PROT_EXPPS2, + PROT_THINKPS2, + PROT_MMPS2, + PROT_GLIDEPS2, + PROT_NETPS2, + PROT_NETSCPS2, + PROT_BM, + PROT_AUTO, + PROT_SYSMOUSE, + PROT_NUMPROTOS /* This must always be last. */ +} MouseProtocolID; + struct _MouseDevRec; typedef int (*GetInterfaceTypesProc)(void); @@ -33,10 +85,9 @@ typedef const char *(*DefaultProtocolProc)(void); typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara); typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate, int res); -typedef void (*checkMovementsProc)(InputInfoPtr,int, int); -typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool); -typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char); -typedef Bool (*dataGoodProc)(struct _MouseDevRec *); +typedef const char *(*FindDeviceProc)(InputInfoPtr pInfo, const char *protocol, + int flags); +typedef const char *(*GuessProtocolProc)(InputInfoPtr pInfo, int flags); /* * OSMouseInfoRec is used to pass information from the OSMouse layer to the @@ -52,6 +103,8 @@ typedef struct { SetResProc SetPS2Res; SetResProc SetBMRes; SetResProc SetMiscRes; + FindDeviceProc FindDevice; + GuessProtocolProc GuessProtocol; } OSMouseInfoRec, *OSMouseInfoPtr; /* @@ -78,7 +131,11 @@ typedef struct { * auto-detection. It returns the name of the detected protocol, * or NULL when detection fails. It may also adjust one or more * of the "protoPara" values for the detected protocol by setting - * then to something other than -1. + * then to something other than -1. SetupAuto gets called in two + * ways. The first is before any devices have been opened. This + * can be used when the protocol "Auto" always maps to a single + * protocol type. The second is with the device open, allowing + * OS-specific probing to be done. * * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2 * protocol types. @@ -86,15 +143,62 @@ typedef struct { * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types. * * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types. + * + * FindDevice: This function gets called when no Device has been specified + * in the config file. OS-specific methods may be used to guess + * which input device to use. This function is called after the + * pre-open attempts at protocol discovery are done, but before + * the device is open. I.e., after the first SetupAuto() call, + * after the DefaultProtocol() call, but before the PreInit() + * call. Available protocol information may be used in locating + * the default input device. + * + * GuessProtocol: A last resort attempt at guessing the mouse protocol by + * whatever OS-specific means might be available. OS-independent + * things should be in the mouse driver. This function gets + * called after the mouse driver's OS-independent methods have + * failed. */ extern OSMouseInfoPtr xf86OSMouseInit(int flags); +/* Adjust this when the mouse interface changes. */ + +/* + * History: + * + * 1.0.0 - Everything up to when versioning was started. + * 1.1.0 - FindDevice and GuessProtocol added to OSMouseInfoRec + * + */ + +#define OS_MOUSE_VERSION_MAJOR 1 +#define OS_MOUSE_VERSION_MINOR 1 +#define OS_MOUSE_VERSION_PATCH 0 + +#define OS_MOUSE_VERSION_CURRENT \ + BUILTIN_INTERFACE_VERSION_NUMERIC(OS_MOUSE_VERSION_MAJOR, \ + OS_MOUSE_VERSION_MINOR, \ + OS_MOUSE_VERSION_PATCH) + +#define HAVE_GUESS_PROTOCOL \ + (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \ + BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0)) + +#define HAVE_FIND_DEVICE \ + (xf86GetBuiltinInterfaceVersion(BUILTIN_IF_OSMOUSE, 0) >= \ + BUILTIN_INTERFACE_VERSION_NUMERIC(1, 1, 0)) + /* * Mouse device record. This is shared by the mouse driver and the OSMouse * layer. */ +typedef void (*checkMovementsProc)(InputInfoPtr,int, int); +typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool); +typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char); +typedef Bool (*dataGoodProc)(struct _MouseDevRec *); + typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw); typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo); @@ -106,8 +210,8 @@ typedef struct _MouseDevRec { DeviceIntPtr device; const char * mseDevice; const char * protocol; - int protocolID; - int oldProtocolID; /* hack */ + MouseProtocolID protocolID; + MouseProtocolID oldProtocolID; /* hack */ int class; int mseModel; int baudRate; diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h index c3224aeeb..865738c40 100644 --- a/hw/xfree86/os-support/xf86OSpriv.h +++ b/hw/xfree86/os-support/xf86OSpriv.h @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.5 2000/10/28 01:42:24 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.6 2003/08/24 17:37:03 dawes Exp $ */ +/* + * Copyright (c) 1999-2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef _XF86OSPRIV_H #define _XF86OSPRIV_H diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index b35186724..4d3205eb4 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.90 2002/05/31 18:46:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.95 2003/11/17 22:20:40 dawes Exp $ */ /* * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany * Copyright 1992 by David Dawes <dawes@XFree86.org> @@ -10,7 +10,7 @@ * Copyright 1993 by David Wexelblat <dwex@XFree86.org> * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de> * Copyright 1997 by Takis Psarogiannakopoulos <takis@dpmms.cam.ac.uk> - * Copyright 1994-1998 by The XFree86 Project, Inc + * Copyright 1994-2003 by The XFree86 Project, Inc * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -92,10 +92,6 @@ extern int xf86getpagesize(void); extern int xf86GetErrno(void); typedef unsigned long xf86size_t; typedef signed long xf86ssize_t; -#ifdef NEED_SNPRINTF -extern int snprintf(char *str, size_t size, const char *format, ...); -extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif #endif #include <stdio.h> @@ -106,7 +102,7 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); /* SYSV386 (SVR3, SVR4) - But not Solaris8 */ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ - !defined(DGUX) && \ + !defined(DGUX) && !defined(sgi) && \ !defined(__SOL8__) && \ (!defined(sun) || defined(i386)) # ifdef SCO325 @@ -180,11 +176,11 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); # if defined(SCO) # include <sys/vtkd.h> # include <sys/console.h> -# include <sys/keyboard.h> +# include <sys/scankbd.h> # include <sys/vid.h> -# define LED_CAP 0x01 -# define LED_NUM 0x02 -# define LED_SCR 0x04 +# define LED_CAP CLKED +# define LED_NUM NLKED +# define LED_SCR SLKED # elif defined(HAS_USL_VTS) # include <sys/at_ansi.h> # include <sys/kd.h> @@ -675,6 +671,17 @@ extern char* __XOS2RedirRoot(char*); #endif /* __GNU__ */ /**************************************************************************/ +/* IRIX */ +/**************************************************************************/ +#if defined(sgi) + +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> + +#endif + +/**************************************************************************/ /* Generic */ /**************************************************************************/ @@ -721,9 +728,7 @@ extern int sys_nerr; #if defined(ISC) || defined(Lynx) #define rint(x) RInt(x) double RInt( -#if NeedFunctionPrototypes double x -#endif ); #endif diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 4f067d5e0..09d3f2861 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -8,7 +8,7 @@ * Copyright 1993 by Vrije Universiteit, The Netherlands * Copyright 1993 by David Wexelblat <dwex@XFree86.org> * Copyright 1994, 1996 by Holger Veit <Holger.Veit@gmd.de> - * Copyright 1994-1999 by The XFree86 Project, Inc + * Copyright 1994-2003 by The XFree86 Project, Inc * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -64,7 +64,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.55 2002/01/25 21:56:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.57 2003/10/07 23:14:54 herrb Exp $ */ #ifndef _XF86_OSPROC_H #define _XF86_OSPROC_H @@ -125,6 +125,7 @@ extern void xf86WrapperInit(void); #define xf86FatalError(a, b) \ if (dispatchException & DE_TERMINATE) { \ ErrorF(a, b); \ + ErrorF("\n"); \ return; \ } else FatalError(a, b) diff --git a/hw/xfree86/os-support/xf86_ansic.h b/hw/xfree86/os-support/xf86_ansic.h index 03fa33417..733a5543d 100644 --- a/hw/xfree86/os-support/xf86_ansic.h +++ b/hw/xfree86/os-support/xf86_ansic.h @@ -1,5 +1,6 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.53 2003/10/28 18:36:37 tsi Exp $ */ /* - * Copyright 1997-2000 by The XFree86 Project, Inc + * Copyright 1997-2003 by The XFree86 Project, Inc * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,8 +23,6 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.49.2.1 2003/03/13 04:10:49 tsi Exp $ */ - #ifndef _XF86_ANSIC_H #define _XF86_ANSIC_H @@ -240,6 +239,8 @@ extern int xf86strcasecmp(const char*,const char*); extern char* xf86strcpy(char*,const char*); extern xf86size_t xf86strcspn(const char*,const char*); extern char* xf86strerror(int); +extern xf86size_t xf86strlcat(char*,const char*,xf86size_t); +extern xf86size_t xf86strlcpy(char*,const char*,xf86size_t); extern xf86size_t xf86strlen(const char*); extern char* xf86strncat(char *, const char *, xf86size_t); extern int xf86strncmp(const char*,const char*,xf86size_t); diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h index b97599ed5..61eb93d8b 100644 --- a/hw/xfree86/os-support/xf86_libc.h +++ b/hw/xfree86/os-support/xf86_libc.h @@ -1,6 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.56 2003/02/22 06:00:39 dawes Exp $ */ - - +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.60 2003/10/26 12:17:17 herrb Exp $ */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* * This file is an attempt to make developing code for the new loadable module @@ -71,7 +95,11 @@ struct xf86stat { typedef int xf86key_t; /* setjmp/longjmp */ +#if defined(__ia64__) +typedef int xf86jmp_buf[1024] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ +#else typedef int xf86jmp_buf[1024]; +#endif /* for setvbuf */ #define XF86_IONBF 1 @@ -348,6 +376,10 @@ typedef int xf86jmp_buf[1024]; #define strcspn(ccp1,ccp2) xf86strcspn(ccp1,ccp2) #undef strerror #define strerror(i) xf86strerror(i) +#undef strlcat +#define strlcat(cp,ccp,I) xf86strlcat(cp,ccp,I) +#undef strlcpy +#define strlcpy(cp,ccp,I) xf86strlcpy(cp,ccp,I) #undef strlen #define strlen(ccp) xf86strlen(ccp) #undef strncmp @@ -385,11 +417,11 @@ typedef int xf86jmp_buf[1024]; #undef ungetc #define ungetc(i,FP) xf86ungetc(i,FP) #undef vfprinf -#define vfprintf xf86vfprintf +#define vfprintf(p,f,a) xf86vfprintf(p,f,a) #undef vsnprintf -#define vsnprintf xf86vsnprintf +#define vsnprintf(s,n,f,a) xf86vsnprintf(s,n,f,a) #undef vsprintf -#define vsprintf xf86vsprintf +#define vsprintf(s,f,a) xf86vsprintf(s,f,a) /* XXX Disable assert as if NDEBUG was defined */ /* Some X headers defined this away too */ #undef assert diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h index 43605dac3..1659d1be4 100644 --- a/hw/xfree86/parser/Configint.h +++ b/hw/xfree86/parser/Configint.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.20 2002/03/04 16:11:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.21 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * These definitions are used through out the configuration file parser, but diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c index e929641c9..9bfe4d1b9 100644 --- a/hw/xfree86/parser/Device.c +++ b/hw/xfree86/parser/Device.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.26 2003/01/04 20:20:22 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.27 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c index 4be58b512..816a16c94 100644 --- a/hw/xfree86/parser/Files.c +++ b/hw/xfree86/parser/Files.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.16 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index dfd3ab0bd..e6326a74e 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.22 2003/01/04 20:20:22 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.23 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c index f5387b384..6e38bdd15 100644 --- a/hw/xfree86/parser/Input.c +++ b/hw/xfree86/parser/Input.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.13 2003/01/04 20:20:22 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.14 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Keyboard.c b/hw/xfree86/parser/Keyboard.c index 68cbaf3c0..cca3ce412 100644 --- a/hw/xfree86/parser/Keyboard.c +++ b/hw/xfree86/parser/Keyboard.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.17 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ @@ -101,8 +128,8 @@ xf86parseKeyboardSection (void) if (xf86getSubToken (&(ptr->inp_comment)) != STRING) Error (QUOTE_MSG, "Protocol"); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("Protocol"), - val.str); + xf86configStrdup("Protocol"), + val.str); break; case AUTOREPEAT: if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER) @@ -117,7 +144,7 @@ xf86parseKeyboardSection (void) xf86conffree(s1); xf86conffree(s2); ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst, - xf86configStrdup("AutoRepeat"), s); + xf86configStrdup("AutoRepeat"), s); break; case XLEDS: if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER) diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c index cd351c9c6..9907d29c8 100644 --- a/hw/xfree86/parser/Layout.c +++ b/hw/xfree86/parser/Layout.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.24 2003/08/24 17:37:07 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c index 1d61da9a6..33b591d88 100644 --- a/hw/xfree86/parser/Module.c +++ b/hw/xfree86/parser/Module.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.11 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.12 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c index 939b621ea..942b199d2 100644 --- a/hw/xfree86/parser/Monitor.c +++ b/hw/xfree86/parser/Monitor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.27 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.28 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c index fac4260a4..8b373c562 100644 --- a/hw/xfree86/parser/Pointer.c +++ b/hw/xfree86/parser/Pointer.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.12 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c index af8c407a9..e3bf18048 100644 --- a/hw/xfree86/parser/Screen.c +++ b/hw/xfree86/parser/Screen.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.28 2003/11/07 23:41:41 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ @@ -61,6 +88,7 @@ xf86parseDisplaySubSection (void) ptr->disp_black.red = ptr->disp_black.green = ptr->disp_black.blue = -1; ptr->disp_white.red = ptr->disp_white.green = ptr->disp_white.blue = -1; + ptr->disp_frameX0 = ptr->disp_frameY0 = -1; while ((token = xf86getToken (DisplayTab)) != ENDSUBSECTION) { switch (token) @@ -338,7 +366,7 @@ xf86printScreenSection (FILE * cf, XF86ConfScreenPtr ptr) fprintf (cf, "\tSubSection \"Display\"\n"); if (dptr->disp_comment) fprintf (cf, "%s", dptr->disp_comment); - if (dptr->disp_frameX0 != 0 || dptr->disp_frameY0 != 0) + if (dptr->disp_frameX0 >= 0 || dptr->disp_frameY0 >= 0) { fprintf (cf, "\t\tViewport %d %d\n", dptr->disp_frameX0, dptr->disp_frameY0); @@ -479,17 +507,20 @@ xf86validateScreen (XF86ConfigPtr p) screen->scrn_identifier = screen->scrn_obso_driver; monitor = xf86findMonitor (screen->scrn_monitor_str, p->conf_monitor_lst); - if (!monitor) - { - xf86validationError (UNDEFINED_MONITOR_MSG, - screen->scrn_monitor_str, screen->scrn_identifier); - return (FALSE); - } - else + if (screen->scrn_monitor_str) { - screen->scrn_monitor = monitor; - if (!xf86validateMonitor(p, screen)) + if (!monitor) + { + xf86validationError (UNDEFINED_MONITOR_MSG, + screen->scrn_monitor_str, screen->scrn_identifier); return (FALSE); + } + else + { + screen->scrn_monitor = monitor; + if (!xf86validateMonitor(p, screen)) + return (FALSE); + } } device = xf86findDevice (screen->scrn_device_str, p->conf_device_lst); @@ -541,15 +572,3 @@ xf86findScreen (const char *ident, XF86ConfScreenPtr p) return (NULL); } -XF86ConfDisplayPtr -xf86findDisplay (int depth, XF86ConfDisplayPtr p) -{ - while (p) - { - if (depth == p->disp_depth) - return (p); - - p = p->list.next; - } - return (NULL); -} diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c index f2e98872c..fbbb2e00f 100644 --- a/hw/xfree86/parser/Vendor.c +++ b/hw/xfree86/parser/Vendor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.16 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.17 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c index b899f0d3d..de65c415e 100644 --- a/hw/xfree86/parser/Video.c +++ b/hw/xfree86/parser/Video.c @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Video.c,v 1.13 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -25,7 +26,32 @@ * in this Software without prior written authorization from Metro Link. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Video.c,v 1.12 2003/01/04 20:20:23 paulo Exp $ */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h index a2440540d..522cf5c2f 100644 --- a/hw/xfree86/parser/configProcs.h +++ b/hw/xfree86/parser/configProcs.h @@ -1,4 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.16 2001/08/06 20:51:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.17 2003/08/24 17:37:08 dawes Exp $ */ +/* + * Copyright (c) 1997-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */ diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index cd7bbf10b..2a5afeb27 100644 --- a/hw/xfree86/parser/read.c +++ b/hw/xfree86/parser/read.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.24 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 4d8167622..4dc2e0dd1 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.30 2003/11/03 05:11:52 tsi Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ @@ -65,7 +92,8 @@ static int StringToToken (char *, xf86ConfigSymTabRec *); static FILE *configFile = NULL; -static int configStart = 0; /* start of the current token */ +static const char **builtinConfig = NULL; +static int builtinIndex = 0; static int configPos = 0; /* current readers position */ static int configLineNo = 0; /* linenumber */ static char *configBuf, *configRBuf; /* buffer for lines */ @@ -160,12 +188,24 @@ xf86getToken (xf86ConfigSymTabRec * tab) again: if (!c) { - if (fgets (configBuf, CONFIG_BUF_LEN - 1, configFile) == NULL) + char *ret; + if (configFile) + ret = fgets (configBuf, CONFIG_BUF_LEN - 1, configFile); + else { + if (builtinConfig[builtinIndex] == NULL) + ret = NULL; + else { + ret = strncpy(configBuf, builtinConfig[builtinIndex], + CONFIG_BUF_LEN); + builtinIndex++; + } + } + if (ret == NULL) { return (pushToken = EOF_TOKEN); } configLineNo++; - configStart = configPos = 0; + configPos = 0; eol_seen = 1; } @@ -205,16 +245,13 @@ again: /* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */ else if ((c == ',') && !isalpha (configBuf[configPos])) { - configStart = configPos; return COMMA; } else if ((c == '-') && !isalpha (configBuf[configPos])) { - configStart = configPos; return DASH; } - configStart = configPos; /* * Numbers are returned immediately ... */ @@ -359,7 +396,6 @@ xf86tokenString (void) return configRBuf; } -#if 1 int xf86pathIsAbsolute(const char *path) { @@ -367,7 +403,7 @@ xf86pathIsAbsolute(const char *path) return 1; #ifdef __UNIXOS2__ if (path && (path[0] == '\\' || (path[1] == ':'))) - return 0; + return 1; #endif return 0; } @@ -649,7 +685,6 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot) int cmdlineUsed = 0; configFile = NULL; - configStart = 0; /* start of the current token */ configPos = 0; /* current readers position */ configLineNo = 0; /* linenumber */ pushToken = LOCK_TOKEN; @@ -692,178 +727,6 @@ xf86openConfigFile(const char *path, const char *cmdline, const char *projroot) return configPath; } -#else -/* - * xf86openConfigFile -- - * - * Formerly findConfigFile(). This function take a pointer to a location - * in which to place the actual name of the file that was opened. - * This function uses the global character array xf86ConfigFile - * This function returns the following results. - * - * 0 unable to open the config file - * 1 file opened and ready to read - * - */ - -int -xf86openConfigFile (char *filename) -{ -#define MAXPTRIES 6 - char *home = NULL; - char *xconfig = NULL; - char *xwinhome = NULL; - char *configPaths[MAXPTRIES]; - int pcount = 0, idx; - -/* - * First open if necessary the config file. - * If the -xf86config flag was used, use the name supplied there (root only). - * If $XF86CONFIG is a pathname, use it as the name of the config file (root) - * If $XF86CONFIG is set but doesn't contain a '/', append it to 'XF86Config' - * and search the standard places (root only). - * If $XF86CONFIG is not set, just search the standard places. - */ - configFile = NULL; - configStart = 0; /* start of the current token */ - configPos = 0; /* current readers position */ - configLineNo = 0; /* linenumber */ - pushToken = LOCK_TOKEN; - while (!configFile) - { - - /* - * configPaths[0] is used as a buffer for -xf86config - * and $XF86CONFIG if it contains a path - * configPaths[1...MAXPTRIES-1] is used to store the paths of each of - * the other attempts - */ - for (pcount = idx = 0; idx < MAXPTRIES; idx++) - configPaths[idx] = NULL; - - /* - * First check if the -xf86config option was used. - */ - configPaths[pcount] = xf86confmalloc (PATH_MAX); - if (xf86ConfigFile[0]) - { - strcpy (configPaths[pcount], xf86ConfigFile); - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; - else - return 0; - } - /* - * Check if XF86CONFIG is set. - */ -#ifndef __UNIXOS2__ - if (getuid () == 0 - && (xconfig = getenv ("XF86CONFIG")) != 0 - && strchr (xconfig, '/')) -#else - /* no root available, and filenames start with drive letter */ - if ((xconfig = getenv ("XF86CONFIG")) != 0 - && isalpha (xconfig[0]) - && xconfig[1] == ':') -#endif - { - strcpy (configPaths[pcount], xconfig); - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; - else - return 0; - } - -#ifndef __UNIXOS2__ - /* - * ~/XF86Config ... - */ - if (getuid () == 0 && (home = getenv ("HOME")) != NULL) - { - configPaths[++pcount] = xf86confmalloc (PATH_MAX); - strcpy (configPaths[pcount], home); - strcat (configPaths[pcount], "/" XCONFIGFILE); - if (xconfig) - strcat (configPaths[pcount], xconfig); - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; - } - - /* - * /etc/XF86Config - */ - configPaths[++pcount] = xf86confmalloc (PATH_MAX); - strcpy (configPaths[pcount], "/etc/" XCONFIGFILE); - if (xconfig) - strcat (configPaths[pcount], xconfig); - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; - - /* - * $(XCONFIGDIR)/XF86Config.<hostname> - */ - - configPaths[++pcount] = xf86confmalloc (PATH_MAX); - if (getuid () == 0 && (xwinhome = getenv ("XWINHOME")) != NULL) - sprintf (configPaths[pcount], "%s/lib/X11/" XCONFIGFILE, xwinhome); - else - strcpy (configPaths[pcount], XCONFIGDIR "/" XCONFIGFILE); - if (getuid () == 0 && xconfig) - strcat (configPaths[pcount], xconfig); - strcat (configPaths[pcount], "."); - gethostname (configPaths[pcount] + strlen (configPaths[pcount]), - MAXHOSTNAMELEN); - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; -#endif /* !__UNIXOS2__ */ - - /* - * $(XCONFIGDIR)/XF86Config - */ - configPaths[++pcount] = xf86confmalloc (PATH_MAX); -#ifndef __UNIXOS2__ - if (getuid () == 0 && xwinhome) - sprintf (configPaths[pcount], "%s/lib/X11/" XCONFIGFILE, xwinhome); - else - strcpy (configPaths[pcount], XCONFIGDIR "/" XCONFIGFILE); - if (getuid () == 0 && xconfig) - strcat (configPaths[pcount], xconfig); -#else - /* - * we explicitly forbid numerous config files everywhere for OS/2; - * users should consider them lucky to have one in a standard place - * and another one with the -xf86config option - */ - xwinhome = getenv ("X11ROOT"); /* get drive letter */ - if (!xwinhome) { - fprintf (stderr,"X11ROOT environment variable not set\n"); - exit(2); - } - strcpy (configPaths[pcount], __XOS2RedirRoot ("/XFree86/lib/X11/XConfig")); -#endif - - if ((configFile = fopen (configPaths[pcount], "r")) != 0) - break; - - return 0; - } - configBuf = xf86confmalloc (CONFIG_BUF_LEN); - configRBuf = xf86confmalloc (CONFIG_BUF_LEN); - configPath = xf86confmalloc (PATH_MAX); - - strcpy (configPath, configPaths[pcount]); - - if (filename) - strcpy (filename, configPaths[pcount]); - for (idx = 0; idx <= pcount; idx++) - if (configPaths[idx] != NULL) - xf86conffree (configPaths[idx]); - - configBuf[0] = '\0'; /* sanity ... */ - - return 1; -} -#endif void xf86closeConfigFile (void) @@ -875,8 +738,24 @@ xf86closeConfigFile (void) xf86conffree (configBuf); configBuf = NULL; - fclose (configFile); - configFile = NULL; + if (configFile) { + fclose (configFile); + configFile = NULL; + } else { + builtinConfig = NULL; + builtinIndex = 0; + } +} + +void +xf86setBuiltinConfig(const char *config[]) +{ + builtinConfig = config; + configPath = xf86configStrdup("<builtin configuration>"); + configBuf = xf86confmalloc (CONFIG_BUF_LEN); + configRBuf = xf86confmalloc (CONFIG_BUF_LEN); + configBuf[0] = '\0'; /* sanity ... */ + } void @@ -884,16 +763,6 @@ xf86parseError (char *format,...) { va_list ap; -#if 0 - fprintf (stderr, "Parse error on line %d of section %s in file %s\n", - configLineNo, configSection, configPath); - fprintf (stderr, "\t"); - va_start (ap, format); - vfprintf (stderr, format, ap); - va_end (ap); - - fprintf (stderr, "\n"); -#else ErrorF ("Parse error on line %d of section %s in file %s\n\t", configLineNo, configSection, configPath); va_start (ap, format); @@ -901,8 +770,6 @@ xf86parseError (char *format,...) va_end (ap); ErrorF ("\n"); -#endif - } void @@ -910,16 +777,6 @@ xf86parseWarning (char *format,...) { va_list ap; -#if 0 - fprintf (stderr, "Parse warning on line %d of section %s in file %s\n", - configLineNo, configSection, configPath); - fprintf (stderr, "\t"); - va_start (ap, format); - vfprintf (stderr, format, ap); - va_end (ap); - - fprintf (stderr, "\n"); -#else ErrorF ("Parse warning on line %d of section %s in file %s\n\t", configLineNo, configSection, configPath); va_start (ap, format); @@ -927,7 +784,6 @@ xf86parseWarning (char *format,...) va_end (ap); ErrorF ("\n"); -#endif } void @@ -935,23 +791,12 @@ xf86validationError (char *format,...) { va_list ap; -#if 0 - fprintf (stderr, "Data incomplete in file %s\n", - configPath); - fprintf (stderr, "\t"); - va_start (ap, format); - vfprintf (stderr, format, ap); - va_end (ap); - - fprintf (stderr, "\n"); -#else ErrorF ("Data incomplete in file %s\n\t", configPath); va_start (ap, format); VErrorF (format, ap); va_end (ap); ErrorF ("\n"); -#endif } void diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 1d7472a5c..e096c6247 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.17 2002/09/17 18:54:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.18 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* View/edit this file with tab stops set to 4 */ diff --git a/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h index 25f91a037..d7a1e7ae5 100644 --- a/hw/xfree86/parser/xf86Optrec.h +++ b/hw/xfree86/parser/xf86Optrec.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.10 2001/06/30 04:00:24 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.11 2003/08/24 17:37:08 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2001 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * This file contains the Option Record that is passed between the Parser, diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index ae89005a4..1a30d17a8 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.30 2002/09/16 18:06:16 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.33 2003/10/08 14:58:30 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + /* * This file contains the external interfaces for the XFree86 configuration @@ -417,6 +444,7 @@ xf86ConfigSymTabRec, *xf86ConfigSymTabPtr; */ extern const char *xf86openConfigFile (const char *, const char *, const char *); +extern void xf86setBuiltinConfig(const char *config[]); extern XF86ConfigPtr xf86readConfigFile (void); extern void xf86closeConfigFile (void); extern void xf86freeConfig (XF86ConfigPtr p); @@ -427,7 +455,6 @@ XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p); XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p); XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p); XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p); -XF86ConfDisplayPtr xf86findDisplay(int depth, XF86ConfDisplayPtr p); XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p); XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p); XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list); diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index eb8eab766..387773dc0 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.19 2003/01/04 20:20:23 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.20 2003/08/24 17:37:09 dawes Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -26,6 +26,33 @@ * in this Software without prior written authorization from Metro Link. * */ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + #ifndef _xf86_tokens_h #define _xf86_tokens_h diff --git a/hw/xfree86/ramdac/BT.c b/hw/xfree86/ramdac/BT.c index 9ddd3b20b..3b42ecb13 100644 --- a/hw/xfree86/ramdac/BT.c +++ b/hw/xfree86/ramdac/BT.c @@ -23,7 +23,7 @@ * * BT RAMDAC routines. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.7 2000/10/20 12:57:27 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -107,7 +107,7 @@ BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/*, RamDacRecP return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF]); + "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF].DeviceName); } for (i=0;ramdacs[i].token != -1;i++) { diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c index d62a9ba56..34562e297 100644 --- a/hw/xfree86/ramdac/IBM.c +++ b/hw/xfree86/ramdac/IBM.c @@ -23,7 +23,7 @@ * * IBM RAMDAC routines. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.12 2003/02/17 16:08:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.13 2003/09/24 02:43:35 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -282,7 +282,7 @@ IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/* , RamDacRe return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF]); + "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF].DeviceName); } for (i=0;ramdacs[i].token != -1;i++) { diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c index 267a13f9f..5e466b707 100644 --- a/hw/xfree86/ramdac/TI.c +++ b/hw/xfree86/ramdac/TI.c @@ -24,7 +24,7 @@ * Modified from IBM.c to support TI RAMDAC routines * by Jens Owen, <jens@tungstengraphics.com>. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.c,v 1.7 2003/02/17 16:08:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.c,v 1.8 2003/09/24 02:43:35 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -318,7 +318,7 @@ TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs) return NULL; } else { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF]); + "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF].DeviceName); } for (i=0;ramdacs[i].token != -1;i++) { diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c index e911f8066..41b623a6a 100644 --- a/hw/xfree86/ramdac/xf86HWCurs.c +++ b/hw/xfree86/ramdac/xf86HWCurs.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.12 2003/02/13 20:28:41 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.13 2003/03/04 21:21:15 mvojkovi Exp $ */ #include "misc.h" #include "xf86.h" @@ -191,6 +191,13 @@ xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed) pScreen->devPrivates[xf86CursorScreenIndex].ptr; xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr; +#ifdef ARGB_CURSOR + /* recoloring isn't applicable to ARGB cursors and drivers + shouldn't have to ignore SetCursorColors requests */ + if (pCurs->bits->argb) + return; +#endif + if (ScreenPriv->PalettedCursor) { xColorItem sourceColor, maskColor; ColormapPtr pmap = ScreenPriv->pInstalledMap; diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c index 7db16e394..b45be814d 100644 --- a/hw/xfree86/ramdac/xf86RamDac.c +++ b/hw/xfree86/ramdac/xf86RamDac.c @@ -23,7 +23,7 @@ * * Generic RAMDAC access routines. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.6 2000/09/26 15:57:21 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.7 2003/11/03 05:11:53 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -69,8 +69,6 @@ RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec) Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv) { - RamDacHWRecPtr ramdacHWPtr; - RamDacRegRecPtr ramdacReg; RamDacScreenRecPtr ramdacScrPtr; /* @@ -78,10 +76,8 @@ RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv) */ if (!RamDacGetRec(pScrn)) return FALSE; - ramdacHWPtr = RAMDACHWPTR(pScrn); - ramdacReg = &ramdacHWPtr->ModeReg; - ramdacScrPtr = ((RamDacScreenRecPtr) - (pScrn)->privates[RamDacGetScreenIndex()].ptr); + ramdacScrPtr = + ((RamDacScreenRecPtr) (pScrn)->privates[RamDacGetScreenIndex()].ptr); ramdacScrPtr->RamDacRec = ramdacPriv; return(TRUE); @@ -100,8 +96,6 @@ RamDacGetRecPrivate() Bool RamDacGetRec(ScrnInfoPtr scrp) { - RamDacRegRecPtr regp; - RamDacGetRecPrivate(); /* * New privates are always set to NULL, so we can check if the allocation @@ -116,8 +110,6 @@ RamDacGetRec(ScrnInfoPtr scrp) xnfcalloc(sizeof(RamDacHWRec), 1); scrp->privates[RamDacScreenPrivateIndex].ptr = xnfcalloc(sizeof(RamDacScreenRec), 1); - /* Does this really belong here? */ - regp = &((RamDacHWRecPtr)scrp->privates[RamDacHWPrivateIndex].ptr)->ModeReg; return TRUE; } diff --git a/hw/xfree86/scanpci/extrapci.ids b/hw/xfree86/scanpci/extrapci.ids index 926e1a75f..32d96cec8 100644 --- a/hw/xfree86/scanpci/extrapci.ids +++ b/hw/xfree86/scanpci/extrapci.ids @@ -14,7 +14,7 @@ # changes/additions that aren't XFree86-specific to the pciids # project (http://pciids.sf.net/). # -# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.7 2003/02/06 04:18:09 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.10 2003/10/30 15:29:32 tsi Exp $ # # Vendors, devices and subsystems. Please keep sorted. @@ -32,14 +32,13 @@ # xyzw " # 20ce New Chipset Description +103c " + 12b4 zx1 QuickSilver AGP8x LBA + 1102 " 0002 " C 0401 -# Intel(R) 852GM/855GM, 865G -8086 " - 3580 852GM/852GME/855GM/855GME Chipset Host-Hub Bridge - 3582 852GM/852GME/855GM/855GME Chipset Graphics Controller - 2570 865G Chipset Host-Hub Bridge - 2572 865G Chipset Graphics Controller - +126f " + 0730 SM731 Cougar3DR + diff --git a/hw/xfree86/scanpci/pci.ids b/hw/xfree86/scanpci/pci.ids index a6bb2fa1c..0d6a460f3 100644 --- a/hw/xfree86/scanpci/pci.ids +++ b/hw/xfree86/scanpci/pci.ids @@ -7,7 +7,7 @@ # so if you have anything to contribute, please visit the home page or # send a diff -u against the most recent pci.ids to pci-ids@ucw.cz. # -# Daily snapshot on Tue 2003-02-25 11:00:06 +# Daily snapshot on Wed 2003-05-14 10:00:04 # # Vendors, devices and subsystems. Please keep sorted. @@ -126,7 +126,7 @@ 0020 53c1010 Ultra3 SCSI Adapter 1de1 1020 DC-390U3W 0021 53c1010 66MHz Ultra3 SCSI Adapter - 0030 53c1030 + 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI 1028 1010 LSI U320 SCSI Controller 0040 53c1035 008f 53c875J @@ -161,6 +161,7 @@ 0017 PROTO-3 PCI Prototyping board 9100 INI-9100/9100W SCSI Host 1002 ATI Technologies Inc + 4136 Radeon IGP 320 M # New support forthcoming in XFree86 4.3.0 4144 Radeon R300 AD [Radeon 9500 Pro] # New support forthcoming in XFree86 4.3.0 @@ -305,16 +306,18 @@ 4c67 Radeon R250 Lg [Radeon Mobility 9000 M9] 4d46 Rage Mobility M4 AGP 4d4c Rage Mobility M4 AGP - 4e44 Radeon R300 ND [Radeon 9700] - 4e45 Radeon R300 NE [Radeon 9700] + 4e44 Radeon R300 ND [Radeon 9700 Pro] + 4e45 Radeon R300 NE [Radeon 9500 Pro] + 1002 0002 Radeon R300 NE [Radeon 9500 Pro] 4e46 Radeon R300 NF [Radeon 9700] # Update: This is FireGL X1, not Radeon 9700 4e47 Radeon R300 NG [FireGL X1] -# Update + 4e48 Radeon R350 [Radeon 9800] 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary) - 4e65 Radeon R300 [Radeon 9700] (Secondary) + 4e65 Radeon R300 [Radeon 9500 Pro] (Secondary) 4e66 Radeon R300 [Radeon 9700] (Secondary) 4e67 Radeon R300 [FireGL X1] (Secondary) + 4e68 Radeon R350 [Radeon 9800] (Secondary) 5041 Rage 128 PA/PRO 5042 Rage 128 PB/PRO AGP 2x 5043 Rage 128 PC/PRO AGP 4x @@ -438,6 +441,7 @@ 1002 0088 Xpert 99 5345 Rage 128 SE/4x 5346 Rage 128 SF/4x AGP 2x + 1002 0048 RAGE 128 16MB VGA TVOUT AMC PAL 5347 Rage 128 SG/4x AGP 4x 5348 Rage 128 SH 534b Rage 128 SK/4x @@ -468,7 +472,9 @@ 1002 5654 Mach64VT Reference 5655 264VT3 [Mach64 VT3] 5656 264VT4 [Mach64 VT4] - 700f U1/A3 AGP Bridge [IGP 320M] + 700f PCI Bridge [IGP 320M] + 7010 PCI Bridge [IGP 340M] + cab2 RS200/RS200M AGP Bridge [IGP 340M] 1003 ULSI Systems 0201 US201 1004 VLSI Technology Inc @@ -574,6 +580,7 @@ 0014 DECchip 21041 [Tulip Pass 3] 1186 0100 DE-530+ 0016 DGLPB [OPPO] + 0017 PV-PCI Graphics Controller (ZLXp-L) 0019 DECchip 21142/43 1011 500a DE500A Fast Ethernet 1011 500b DE500B Fast Ethernet @@ -977,13 +984,15 @@ 1028 00d0 PowerEdge Expandable RAID Controller 3/Si 0005 PowerEdge Expandable RAID Controller 3/Di 0006 PowerEdge Expandable RAID Controller 3/Di - 0007 Remote Assistant Card 3 - 0008 PowerEdge Expandable RAID Controller 3/Di + 0007 Remote Access Controller:DRAC III + 0008 Remote Access Controller + 0009 BMC/SMIC device not present 000a PowerEdge Expandable RAID Controller 3 1028 0106 PowerEdge Expandable RAID Controller 3/Di 1028 011b PowerEdge Expandable RAID Controller 3/Di 1028 0121 PowerEdge Expandable RAID Controller 3/Di - 000c Embedded Systems Management Device 4 + 000c Remote Access Controller:ERA or ERA/O + 000d BMC/SMIC device 000e PowerEdge Expandable RAID Controller 000f PowerEdge Expandable RAID Controller 4/Di 1029 Siemens Nixdorf IS @@ -993,6 +1002,7 @@ 102b Matrox Graphics, Inc. # DJ: I've a suspicion that 0010 is a duplicate of 0d10. 0010 MGA-I [Impression?] + 0100 MGA 1064SG [Mystique] 0518 MGA-II [Athena] 0519 MGA 2064W [Millennium] 051a MGA 1064SG [Mystique] @@ -1225,6 +1235,7 @@ 0635 635 Host 0645 SiS645 Host & Memory & AGP Controller 0646 SiS645DX Host & Memory & AGP Controller + 0648 SiS 645xx 0650 650 Host 0651 SiS651 Host 0730 730 Host @@ -1232,6 +1243,7 @@ 0735 735 Host 0740 740 Host 0745 745 Host + 0755 SiS 755 Host Bridge 0900 SiS900 10/100 Ethernet 1039 0900 SiS900 10/100 Ethernet Adapter 0961 SiS961 [MuTIOL Media IO] @@ -1268,14 +1280,14 @@ 1092 4910 SpeedStar A70 1092 4920 SpeedStar A70 1569 6326 SiS6326 GUI Accelerator - 7001 SiS7001 USB Controller + 7001 USB 1.0 Controller 1039 7000 Onboard USB Controller - 7002 SiS7002 USB 2.0 + 7002 USB 2.0 Controller 1509 7002 Onboard USB Controller 7007 FireWire Controller - 7012 SiS7012 PCI Audio Accelerator + 7012 Sound Controller 7013 Intel 537 [56k Winmodem] - 7016 SiS7016 10/100 Ethernet Adapter + 7016 10/100 Ethernet Adapter 1039 7016 SiS7016 10/100 Ethernet Adapter 7018 SiS PCI Audio Accelerator 1014 01b6 SiS PCI Audio Accelerator @@ -1352,8 +1364,8 @@ 1040 Accelgraphics Inc. 1041 Computrend 1042 Micron - 1000 FDC 37C665 - 1001 37C922 + 1000 PC Tech RZ1000 + 1001 PC Tech RZ1001 3000 Samurai_0 3010 Samurai_1 3020 Samurai_IDE @@ -1616,6 +1628,7 @@ 105a 4d39 Fasttrak66 1275 20275 3376 PDC20376 + 1043 809e A7V8X motherboard 4d30 20267 105a 4d33 Ultra100 105a 4d39 Fasttrak100 @@ -1628,6 +1641,7 @@ 4d68 20268 105a 4d68 Ultra100TX2 4d69 20269 + 105a 4d68 Ultra133TX2 5275 PDC20276 IDE 105a 0275 SuperTrak SX6000 IDE 5300 DC5300 @@ -1672,6 +1686,7 @@ 13cc 0009 Barco Metheus 5 Megapixel, Dual Head 13cc 000a Barco Metheus 5 Megapixel, Dual Head 5348 Revolution 4 + 105d 0037 Revolution IV-FP AGP (For SGI 1600SW) 105e Vtech Computers Ltd 105f Infotronic America Inc 1060 United Microelectronics [UMC] @@ -1810,6 +1825,7 @@ 2100 QLA2100 64-bit Fibre Channel Adapter 1077 0001 QLA2100 64-bit Fibre Channel Adapter 2200 QLA2200 + 1077 0002 QLA2200 2300 QLA2300 64-bit FC-AL Adapter 2312 QLA2312 Fibre Channel Adapter 1078 Cyrix Corporation @@ -1961,6 +1977,7 @@ c831 PCI-GPIB bridge 1094 First International Computers [FIC] 1095 CMD Technology Inc + 0240 Adaptec AAR-1210SA SATA HostRAID Controller 0640 PCI0640 0643 PCI0643 0646 PCI0646 @@ -2109,6 +2126,7 @@ 10a3 Everex Systems Inc 10a4 Globe Manufacturing Sales 10a5 Smart Link Ltd. + 3052 SmartPCI562 56K Modem 5449 SmartPCI561 modem 10a6 Informtech Industrial Ltd. 10a7 Benchmarq Microelectronics @@ -2124,6 +2142,7 @@ 0007 RPCEX 0008 DiVO VIP 0009 Alteon Gigabit Ethernet + 10a9 8002 Acenic Gigabit Ethernet 0010 AMP Video I/O 0011 GRIP 0012 SGH PSHAC GSN @@ -2135,6 +2154,7 @@ 1006 Dual JPEG 4 1007 Dual JPEG 5 1008 Cesium + 100a IOC4 I/O controller 2001 Fibre Channel 2002 ASDE 8001 O2 1394 @@ -2209,6 +2229,7 @@ d84d 4078 EX-4078 2S(16C552) RS-232+1P 9054 PCI <-> IOBus Bridge 10b5 2455 Wessex Techology PHIL-PCI + 12d9 0002 PCI Prosody Card rev 1.5 9060 9060 906d 9060SD 125c 0640 Aries 16000P @@ -2216,6 +2237,7 @@ 9080 9080 10b5 9080 9080 [real subsystem ID not set] 129d 0002 Aculab PCI Prosidy card + 12d9 0002 PCI Prosody Card 10b6 Madge Networks 0001 Smart 16/4 PCI Ringnode 0002 Smart 16/4 PCI Ringnode Mk2 @@ -2243,6 +2265,7 @@ 1001 Collage 155 ATM Server Adapter 10b7 3Com Corporation 0001 3c985 1000BaseSX (SX/TX) + 0910 3C910-A01 1006 MINI PCI type 3B Data Fax Modem 1007 Mini PCI 56k Winmodem 10b7 615c Mini PCI 56K Modem @@ -2423,6 +2446,7 @@ 5251 M5251 P1394 OHCI 1.0 Controller 5253 M5253 P1394 OHCI 1.1 Controller 5261 M5261 Ethernet Controller + 5450 Lucent Technologies Soft Modem AMR 5451 M5451 PCI AC-Link Controller Audio Device 1014 0506 ThinkPad R30 5453 M5453 PCI AC-Link Controller Modem Device @@ -2568,6 +2592,7 @@ 1043 0201 AGP-V3800 SDRAM 1043 0205 PCI-V3800 1043 4000 AGP-V3800PRO + 1048 0c21 Synergy II 1092 4804 Viper V770 1092 4a00 Viper V770 1092 4a02 Viper V770 Ultra @@ -2656,6 +2681,7 @@ 0153 NV15GL [Quadro2 Pro] 0170 NV17 [GeForce4 MX 460] 0171 NV17 [GeForce4 MX 440] + 10b0 0002 Gainward Pro/600 TV 1462 8661 G4MX440-VTP 1462 8730 MX440SES-T (MS-8873) 147b 8f00 Abit Siluro GeForce4MX440 @@ -2870,6 +2896,8 @@ 1102 8040 CT4760 SBLive! 1102 8051 CT4850 SBLive! Value 1102 8061 SBLive! Player 5.1 + 1102 8064 SB Live! 5.1 Model SB0100 + 1102 8065 SBLive! 5.1 Digital Model SB0220 0004 SB Audigy 1102 0051 SB0090 Audigy Player 1102 0053 SB0090 Audigy Player/OEM @@ -2882,7 +2910,7 @@ 1102 0040 SB Audigy MIDI/Game Port 7004 [SB Live! Value] Input device controller 8064 SB0100 [SBLive! 5.1 OEM] - 8938 ES1371 + 8938 Ectiva EV1938 1103 Triones Technologies, Inc. 0003 HPT343 # Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372 @@ -2893,6 +2921,7 @@ 0006 HPT302 0007 HPT371 0008 HPT374 + 0009 HPT372N 1104 RasterOps Corp. 1105 Sigma Designs, Inc. 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder @@ -2909,10 +2938,13 @@ 0391 VT8371 [KX133] 0501 VT8501 [Apollo MVP4] 0505 VT82C505 - 0561 VT82C561 - 0571 VT82C586/B/686A/B PIPC Bus Master IDE +# Shares chip with :0576. The VT82C576M has :1571 instead of :0561. + 0561 VT82C576MV + 0571 VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE + 1019 0985 P6VXA Motherboard 1043 8052 VT8233A Bus Master ATA100/66/33 IDE - 1106 0571 VT8235 Bus Master ATA133/100/66/33 IDE + 1043 808c A7V8X motherboard + 1106 0571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE 1179 0001 Magnia Z310 1458 5002 GA-7VAX Mainboard 0576 VT82C576 3V [Apollo Master] @@ -2927,8 +2959,11 @@ 0598 VT82C598 [Apollo MVP3] 0601 VT8601 [Apollo ProMedia] 0605 VT8605 [ProSavage PM133] + 1043 802c CUV4X mainboard 0680 VT82C680 [Apollo P6] 0686 VT82C686 [Apollo Super South] + 1019 0985 P6VXA Motherboard + 1043 802c CUV4X mainboard 1043 8033 A7V Mainboard 1043 803e A7V-E Mainboard 1043 8040 A7M266 Mainboard @@ -2938,6 +2973,7 @@ 1179 0001 Magnia Z310 147b a702 KG7-Lite Mainboard 0691 VT82C693A/694x [Apollo PRO133x] + 1019 0985 P6VXA Motherboard 1179 0001 Magnia Z310 1458 0691 VT82C691 Apollo Pro System Controller 0693 VT82C693 [Apollo Pro Plus] @@ -2945,10 +2981,12 @@ 0926 VT82C926 [Amazon] 1000 VT82C570MV 1106 VT82C570MV - 1571 VT82C416MV + 1571 VT82C576M/VT82C586 1595 VT82C595/97 [Apollo VP2/97] 3038 USB 0925 1234 USB Controller + 1019 0985 P6VXA Motherboard + 1043 808c A7V8X motherboard 1179 0001 Magnia Z310 3040 VT82C586B ACPI 3043 VT86C100A [Rhine] @@ -2959,6 +2997,7 @@ 3050 VT82C596 Power Management 3051 VT82C596 Power Management 3057 VT82C686 [Apollo Super ACPI] + 1019 0985 P6VXA Motherboard 1043 8033 A7V Mainboard 1043 803e A7V-E Mainboard 1043 8040 A7M266 Mainboard @@ -2966,16 +3005,19 @@ 1179 0001 Magnia Z310 3058 VT82C686 AC97 Audio Controller 0e11 b194 Soundmax integrated digital audio + 1019 0985 P6VXA Motherboard 1106 4511 Onboard Audio on EP7KXA 1458 7600 Onboard Audio 1462 3091 MS-6309 Onboard Audio 15dd 7609 Onboard Audio - 3059 VT8233 AC97 Audio Controller + 3059 VT8233/A/8235 AC97 Audio Controller + 1043 8095 A7V8X Motherboard (Realtek ALC650 codec) 1458 a002 GA-7VAX Onboard Audio (Realtek ALC650) 3065 VT6102 [Rhine-II] 1106 0102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235 1186 1400 DFE-530TX rev A 1186 1401 DFE-530TX rev B + 13b9 1421 LD-10/100AL PCI Fast Ethernet Adapter (rev.B) 3068 Intel 537 [AC97 Modem] 3074 VT8233 PCI to ISA Bridge 1043 8052 VT8233A @@ -2987,11 +3029,12 @@ 3102 VT8662 Host Bridge 3103 VT8615 Host Bridge 3104 USB 2.0 + 1043 808c A7V8X motherboard 1458 5004 GA-7VAX Mainboard 3106 VT6105 [Rhine-III] 3109 VT8233C PCI to ISA Bridge 3112 VT8361 [KLE133] Host Bridge - 3116 VT8375 [KM266] Host Bridge + 3116 VT8375 [KM266/KL266] Host Bridge # found on EPIA M6000/9000 mainboard 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics # found on EPIA M6000/9000 mainboard @@ -3003,8 +3046,10 @@ 3156 P/KN266 Host Bridge 3168 VT8374 P4X400 Host Controller/AGP Bridge 3177 VT8235 ISA Bridge + 1043 808c A7V8X motherboard 1458 5001 GA-7VAX Mainboard 3189 VT8377 [KT400 AGP] Host Bridge + 1043 807f A7V8X motherboard 1458 5000 GA-7VAX Mainboard 5030 VT82C596 ACPI [Apollo PRO] 6100 VT85C100A [Rhine II] @@ -3016,6 +3061,7 @@ 8596 VT82C596 [Apollo PRO AGP] 8597 VT82C597 [Apollo VP3 AGP] 8598 VT82C598/694x [Apollo MVP3/Pro133x AGP] + 1019 0985 P6VXA Motherboard 8601 VT8601 [Apollo ProMedia AGP] 8605 VT8605 [PM133 AGP] 8691 VT82C691 [Apollo Pro] @@ -3043,6 +3089,12 @@ 110a Siemens Nixdorf AG 0002 Pirahna 2-port 0005 Tulip controller, power management, switch extender + 0006 FSC PINC (I/O-APIC) + 0015 FSC Multiprocessor Interrupt Controller + 001d FSC Copernicus Management Controller + 007b FSC Remote Service Controller, mailbox device + 007c FSC Remote Service Controller, shared memory device + 007d FSC Remote Service Controller, SMIC device 2102 DSCC4 WAN adapter 4942 FPGA I-Bus Tracer for MBD 6120 SZB6120 @@ -3461,6 +3513,7 @@ 0001 Motion TPEG Recorder/Player with audio 1166 ServerWorks 0005 CNB20-LE Host Bridge + 0006 CNB20HE Host Bridge 0007 CNB20-LE Host Bridge 0008 CNB20HE Host Bridge 0009 CNB20LE Host Bridge @@ -3733,6 +3786,7 @@ 0443 LT WinModem 0444 LT WinModem 0445 LT WinModem + 8086 2203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card) 0446 LT WinModem 0447 LT WinModem 0448 WinModem 56k @@ -4164,6 +4218,7 @@ 1668 0414 HWP01170-01 802.11b PCI Wireless Adapter 1737 3874 WMP11 Wireless 802.11b PCI Adapter 8086 2513 Wireless 802.11b MiniPCI Adapter + 3890 D-Links DWL-g650 A1 8130 HMP8130 NTSC/PAL Video Decoder 8131 HMP8131 NTSC/PAL Video Decoder 1261 Matsushita-Kotobuki Electronics Industries, Ltd. @@ -4199,6 +4254,7 @@ 1273 Hughes Network Systems 0002 DirecPC 1274 Ensoniq + 1171 ES1373 [AudioPCI] (also Creative Labs CT5803) 1371 ES1371 [AudioPCI-97] 0e11 0024 AudioPCI on Motherboard Compaq Deskpro 0e11 b1a7 ES1371, ES1373 AudioPCI @@ -4268,6 +4324,7 @@ 1277 Comstream 1278 Transtech Parallel Systems Ltd. 0701 TPE3/TM3 PowerPC Node + 0710 TPE5 PowerPC PCI board 1279 Transmeta Corporation 0295 Northbridge 0395 LongRun Northbridge @@ -4463,6 +4520,7 @@ 12ae 0001 Gigabit Ethernet-SX (Universal) 1410 0104 Gigabit Ethernet-SX PCI Adapter 0002 AceNIC Gigabit Ethernet (Copper) + 10a9 8002 Acenic Gigabit Ethernet 12ae 0002 Gigabit Ethernet-T (3C986-T) 12af TDK USA Corp 12b0 Jorge Scientific Corp @@ -4557,11 +4615,14 @@ 00a0 ITNT2 12d3 Vingmed Sound A/S 12d4 Ulticom (Formerly DGM&S) + 0200 T1 Card 12d5 Equator Technologies 12d6 Analogic Corp 12d7 Biotronic SRL 12d8 Pericom Semiconductor 12d9 Aculab PLC + 0002 PCI Prosody + 0004 cPCI Prosody 12da True Time Inc. 12db Annapolis Micro Systems, Inc 12dc Symicron Computer Communication Ltd. @@ -4679,6 +4740,7 @@ 0036 PCI-DAS64/M2/16 0037 PCI-DAS64/M3/16 004c PCI-DAS1000 + 004d PCI-QUAD04 1308 Jato Technologies Inc. 0001 NetCelerator Adapter 1308 0001 NetCelerator Adapter @@ -4766,6 +4828,7 @@ 1331 Radisys Corp. 1332 Micro Memory 5415 MM-5415CN PCI Memory Module with Battery Backup + 5425 MM-5425CN PCI 64/66 Memory Module with Battery Backup 1334 Redcreek Communications, Inc 1335 Videomail, Inc 1337 Third Planet Publishing @@ -4875,6 +4938,7 @@ 1384 Reality Simulation Systems Inc 1385 Netgear 4100 802.11b Wireless Adapter (MA301) + 4105 MA311 802.11b wireless adapter 620a GA620 622a GA622 630a GA630 @@ -5011,7 +5075,7 @@ 13e6 Argosy research Inc 13e7 NAC Incorporated 13e8 Chip Express Corporation -13e9 Chip Express Corporation +13e9 Intraserver Technology Inc 13ea Dallas Semiconductor 13eb Hauppauge Computer Works Inc 13ec Zydacron Inc @@ -5036,6 +5100,7 @@ 1043 8077 CMI8738 6-channel audio controller 1043 80e2 CMI8738 6ch-MX 13f6 0111 CMI8738/C3DX PCI Audio Device + 1681 a000 Gamesurround MUSE XL 0211 CM8738 13f7 Wildfire Communications 13f8 Ad Lib Multimedia Inc @@ -5191,6 +5256,7 @@ 146a IFR 146b Parascan Technologies Ltd 146c Ruby Tech Corp. + 1430 FE-1430TX Fast Ethernet PCI Adapter 146d Tachyon, INC. 146e Williams Electronics Games, Inc. 146f Multi Dimensional Consulting Inc @@ -5241,6 +5307,7 @@ 149b SEIKO Instruments Inc 149c OVISLINK Corp. 149d NEWTEK Inc + 0001 Video Toaster for PC 149e Mapletree Networks Inc. 149f LECTRON Co Ltd 14a0 SOFTING GmBH @@ -5383,6 +5450,9 @@ 0e11 009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0e11 00c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX) 1028 0121 Broadcom BCM5701 1000Base-T + 10a9 8010 SGI IO9 Gigabit Ethernet (Copper) + 10a9 8011 SGI Gigabit Ethernet (Copper) + 10a9 8012 SGI Gigabit Ethernet (Fiber) 10b7 1004 3C996-SX 1000Base-SX 10b7 1006 3C996B-T 1000Base-T 10b7 1007 3C1000-T 1000Base-T @@ -5400,6 +5470,7 @@ 1647 NetXtreme BCM5703 Gigabit Ethernet 0e11 0099 NC7780 1000BaseTX 0e11 009a NC7770 1000BaseTX + 10a9 8010 SGI IO9 Gigabit Ethernet (Copper) 14e4 0009 BCM5703 1000BaseTX 14e4 000a BCM5703 1000BaseSX 14e4 000b BCM5703 1000BaseTX @@ -5417,6 +5488,7 @@ 165d NetXtreme BCM5705M Gigabit Ethernet 1696 NetXtreme BCM5782 Gigabit Ethernet 14e4 000d NetXtreme BCM5782 1000Base-T + 169c NetXtreme BCM5788 Gigabit Ethernet 16a6 NetXtreme BCM5702 Gigabit Ethernet 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 1028 0126 BCM5702 1000Base-T @@ -5442,7 +5514,9 @@ 4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem 4212 BCM4212 v.90 56k modem 4301 BCM4301 802.11b + 4320 BCM94306 802.11g 4401 BCM4401 100Base-T + 1043 80a8 A7V8X motherboard 4402 BCM4402 Integrated 10/100BaseT 4410 BCM4413 iLine32 HomePNA 2.0 4411 BCM4413 V.90 56k modem @@ -5531,6 +5605,9 @@ 122d 4302 Dell MP3930V-W(C) MiniPCI 1610 ADSL AccessRunner PCI Arbitration Device 1611 AccessRunner PCI ADSL Interface Device + 1620 ADSL AccessRunner V2 PCI Arbitration Device + 1621 AccessRunner V2 PCI ADSL Interface Device + 1622 AccessRunner V2 PCI ADSL Yukon WAN Adapter 1803 HCF 56k Modem 0e11 0023 623-LAN Grizzly 0e11 0043 623-LAN Yogi @@ -5945,6 +6022,7 @@ 1638 Standard Microsystems Corp [SMC] 1100 SMC2602W EZConnect / Addtron AWA-100 163c Smart Link Ltd. + 3052 SmartLink SmartPCI562 56K Modem 5449 SmartPCI561 Modem 1657 Brocade Communications Systems, Inc. 165a Epix Inc @@ -5958,6 +6036,8 @@ 16ab Global Sun Technology Inc 1102 PCMCIA-to-PCI Wireless Network Bridge 16be Creatix Polymedia GmbH +16ca CENATEK Inc + 0001 Rocket Drive DL 16ec U.S. Robotics 3685 Wireless Access PCI Adapter Model 022415 16f6 VideoTele.com, Inc. @@ -6011,6 +6091,8 @@ 2020 DC-390 690c 690c dc29 DC290 +1fc0 Tumsan Oy + 0300 E2200 Dual E1/Rawpipe Card 2000 Smart Link Ltd. 2001 Temporal Research Ltd 2003 Smart Link Ltd. @@ -6029,6 +6111,8 @@ 0013 HiNT HC4 PCI to ISDN bridge, Multimedia audio controller 0014 HiNT HC4 PCI to ISDN bridge, Network controller 0021 HB1-SE33 PCI-PCI Bridge + 101a E.Band [AudioTrak Inca88] + 101b E.Band [AudioTrak Inca88] 8011 VXPro II Chipset 3388 8011 VXPro II Chipset CPU to PCI Bridge 8012 VXPro II Chipset @@ -6259,7 +6343,7 @@ 8d01 86C380 [ProSavageDDR K4M266] 8d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK) 8d03 VT8751 [ProSavageDDR P4M266] - 8d04 [ProSavageDDR K4M266] + 8d04 VT8375 [ProSavage8 KM266/KL266] 9102 86C410 Savage 2000 1092 5932 Viper II Z200 1092 5934 Viper II Z200 @@ -6271,6 +6355,7 @@ 1092 5a57 Viper II Z200 ca00 SonicVibes 544c Teralogic Inc + 0350 TL880-based HDTV/ATSC tuner 5455 Technische University Berlin 4458 S5933 5519 Cnet Technologies, Inc. @@ -6377,15 +6462,20 @@ 103e 82801BD PRO/100 VM (MOB) Ethernet Controller 1040 536EP Data Fax Modem 16be 1040 V.9X DSP Data Fax Modem + 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 1059 82551QM Ethernet Controller 1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1025 1016 Travelmate 612 TX 1043 8027 TUSL2-C Mainboard 104d 80df Vaio PCG-FX403 + 8086 4532 D815EEA2 mainboard + 8086 4557 D815EGEW Mainboard 1131 82815 815 Chipset AGP Bridge 1132 82815 CGC [Chipset Graphics Controller] 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 + 8086 4532 D815EEA2 Mainboard + 8086 4557 D815EGEW Mainboard 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip @@ -6626,22 +6716,28 @@ 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 147b 0507 TH7II-RAID + 8086 4532 D815EEA2 mainboard + 8086 4557 D815EGEW Mainboard 2443 82801BA/BAM SMBus 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX 1043 8027 TUSL2-C Mainboard 104d 80df Vaio PCG-FX403 147b 0507 TH7II-RAID + 8086 4532 D815EEA2 mainboard + 8086 4557 D815EGEW Mainboard 2444 82801BA/BAM USB (Hub #2) 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 147b 0507 TH7II-RAID + 8086 4532 D815EEA2 mainboard 2445 82801BA/BAM AC'97 Audio 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 1462 3370 STAC9721 AC 147b 0507 TH7II-RAID + 8086 4557 D815EGEW Mainboard 2446 Intel 537 [82801BA/BAM AC'97 Modem] 1025 1016 Travelmate 612 TX 104d 80df Vaio PCG-FX403 @@ -6660,8 +6756,12 @@ 1014 023d EtherExpress PRO/100 VE 1014 0244 EtherExpress PRO/100 VE 1014 0245 EtherExpress PRO/100 VE + 1014 0265 PRO/100 VE Desktop Connection + 1014 0267 PRO/100 VE Desktop Connection + 1014 026a PRO/100 VE Desktop Connection 109f 315d EtherExpress PRO/100 VE 109f 3181 EtherExpress PRO/100 VE + 1179 ff01 PRO/100 VE Network Connection 1186 7801 EtherExpress PRO/100 VE 144d 2602 HomePNA 1M CNR 8086 3010 EtherExpress PRO/100 VE @@ -6680,8 +6780,10 @@ 1014 01c6 Netvista A40/A40p 1043 8027 TUSL2-C Mainboard 147b 0507 TH7II-RAID + 8086 4532 D815EEA2 mainboard + 8086 4557 D815EGEW Mainboard 244c 82801BAM ISA Bridge (LPC) - 244e 82801BA/CA/DB PCI Bridge + 244e 82801BA/CA/DB/EB PCI Bridge 2450 82801E ISA Bridge (LPC) 2452 82801E USB 2453 82801E SMBus @@ -6689,13 +6791,13 @@ 245b 82801E IDE U100 245d 82801E Ethernet Controller 1 245e 82801E PCI Bridge - 2480 82801CA ISA Bridge (LPC) + 2480 82801CA LPC Interface Controller 2482 82801CA/CAM USB (Hub #1) 1014 0220 ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 15d9 3480 P4DP6 8086 1958 vpr Matrix 170B4 - 2483 82801CA/CAM SMBus + 2483 82801CA/CAM SMBus Controller 1014 0220 ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 15d9 3480 P4DP6 @@ -6705,13 +6807,13 @@ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 15d9 3480 P4DP6 8086 1958 vpr Matrix 170B4 - 2485 82801CA/CAM AC'97 Audio + 2485 82801CA/CAM AC'97 Audio Controller 1014 0222 ThinkPad T23 (2647-4MG) or A30p (2653-64G) 1014 0508 ThinkPad T30 1014 051c ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 144d c006 vpr Matrix 170B4 - 2486 82801CA/CAM AC'97 Modem + 2486 82801CA/CAM AC'97 Modem Controller 1014 0223 ThinkPad A/T/X Series 1014 0503 ThinkPad R31 2656BBG 1014 051a ThinkPad A/T/X Series @@ -6729,26 +6831,40 @@ 1014 0220 ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 8086 1958 vpr Matrix 170B4 - 248b 82801CA IDE U100 + 248b 82801CA Ultra ATA Storage Controller 15d9 3480 P4DP6 248c 82801CAM ISA Bridge (LPC) - 24c0 82801DB ISA Bridge (LPC) + 24c0 82801DB LPC Interface Controller 1462 5800 845PE Max (MS-6580) 24c2 82801DB USB (Hub #1) 1462 5800 845PE Max (MS-6580) - 24c3 82801DB SMBus + 24c3 82801DB/DBM SMBus Controller 1462 5800 845PE Max (MS-6580) 24c4 82801DB USB (Hub #2) 1462 5800 845PE Max (MS-6580) - 24c5 82801DB AC'97 Audio + 24c5 82801DB AC'97 Audio Controller 1462 5800 845PE Max (MS-6580) - 24c6 82801DB AC'97 Modem + 24c6 82801DB AC'97 Modem Controller 24c7 82801DB USB (Hub #3) 1462 5800 845PE Max (MS-6580) - 24cb 82801DB ICH4 IDE + 24ca 82801DBM Ultra ATA Storage Controller + 24cb 82801DB Ultra ATA Storage Controller 1462 5800 845PE Max (MS-6580) - 24cd 82801DB USB EHCI Controller + 24cc 82801DBM LPC Interface Controller + 24cd 82801DB USB2 1462 3981 845PE Max (MS-6580) Onboard USB EHCI Controller + 24d0 82801EB LPC Interface Controller + 24d1 82801EB Ultra ATA Storage Controller + 24d2 82801EB USB + 24d3 82801EB SMBus Controller + 24d4 82801EB USB + 24d5 82801EB AC'97 Audio Controller + 24d6 82801EB AC'97 Modem Controller + 24d7 82801EB USB + 24db 82801EB Ultra ATA Storage Controller + 24dc 82801EB LPC Interface Controller + 24dd 82801EB USB2 + 24de 82801EB USB 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -6764,21 +6880,39 @@ 2532 82850 850 (Tehama) Chipset AGP Bridge 2533 82860 860 (Wombat) Chipset AGP Bridge 2534 82860 860 (Wombat) Chipset PCI Bridge - 2540 e7500 [Plumas] DRAM Controller + 2540 E7500 Memory Controller Hub 15d9 3480 P4DP6 - 2541 e7500 [Plumas] DRAM Controller Error Reporting + 2541 E7000 Series Host RASUM Controller 15d9 3480 P4DP6 - 2543 e7500 [Plumas] HI_B Virtual PCI Bridge (F0) - 2544 e7500 [Plumas] HI_B Virtual PCI Bridge (F1) - 2545 e7500 [Plumas] HI_C Virtual PCI Bridge (F0) - 2546 e7500 [Plumas] HI_C Virtual PCI Bridge (F1) - 2547 e7500 [Plumas] HI_D Virtual PCI Bridge (F0) - 2548 e7500 [Plumas] HI_D Virtual PCI Bridge (F1) + 2543 E7000 Series Hub Interface B PCI-to-PCI Bridge + 2544 E7000 Series Hub Interface B RASUM Controller + 2545 E7000 Series Hub Interface C PCI-to-PCI Bridge + 2546 E7000 Series Hub Interface C RASUM Controller + 2547 E7000 Series Hub Interface D PCI-to-PCI Bridge + 2548 E7000 Series Hub Interface D RASUM Controller + 254c E7501 Memory Controller Hub + 2550 E7505 Memory Controller Hub + 2551 E7000 Series RAS Controller + 2552 E7000 Series Processor to AGP Controller + 2553 E7000 Series Hub Interface B PCI-to-PCI Bridge + 2554 E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller + 255d E7205 Memory Controller Hub 2560 82845G/GL [Brookdale-G] Chipset Host Bridge 1462 5800 845PE Max (MS-6580) 2561 82845G/GL [Brookdale-G] Chipset AGP Bridge 2562 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device + 2570 82865G/PE/P Processor to I/O Controller + 2571 82865G/PE/P Processor to AGP Controller + 2572 82865G Integrated Graphics Device + 2573 82865G/PE/P Processor to PCI to CSA Bridge + 2576 82864G/PE/P Processor to I/O Memory Interface + 2578 82875P Memory Controller Hub + 2579 82875P Processor to AGP Controller + 257b 82875P Processor to PCI to CSA Bridge + 257e 82875P Processor to I/O Memory Interface 3092 Integrated RAID + 3340 82855PM Processor to I/O Controller + 3341 82855PM Processor to AGP Controller 3575 82830 830 Chipset Host Bridge 1014 021d ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP @@ -6786,6 +6920,8 @@ 3577 82830 CGC [Chipset Graphics Controller] 1014 0513 ThinkPad A/T/X Series 3578 82830 830 Chipset Host Bridge + 3580 82852/855GM Host Bridge + 3582 82852/855GM Integrated Graphics Device 5200 EtherExpress PRO/100 Intelligent Server 5201 EtherExpress PRO/100 Intelligent Server 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter @@ -6801,6 +6937,7 @@ 7113 82371AB/EB/MB PIIX4 ACPI 7120 82810 GMCH [Graphics Memory Controller Hub] 7121 82810 CGC [Chipset Graphics Controller] + 8086 4341 Cayman (CA810) Mainboard 7122 82810 DC-100 GMCH [Graphics Memory Controller Hub] 7123 82810 DC-100 CGC [Chipset Graphics Controller] 7124 82810E DC-133 GMCH [Graphics Memory Controller Hub] @@ -6889,9 +7026,6 @@ 5478 AIC-7850 5575 AVA-2930 5578 AIC-7855 - 5647 ANA-7711 TCP Offload Engine - 9004 7710 ANA-7711F TCP Offload Engine - Optical - 9004 7711 ANA-7711LP TCP Offload Engine - Copper 5675 AIC-755x 5678 AIC-7856 5775 AIC-755x @@ -6933,6 +7067,8 @@ 7478 AHA-2944/2944W / AIC-7874 7578 AHA-3944/3944W / AIC-7875 7678 AHA-4944W/UW / AIC-7876 + 7710 ANA-7711F Network Accelerator Card (NAC) - Optical + 7711 ANA-7711C Network Accelerator Card (NAC) - Copper 7778 AIC-787x 7810 AIC-7810 7815 AIC-7815 RAID+Memory Controller IC @@ -7038,11 +7174,18 @@ 8014 ASC-29320LP U320 801e AIC-7901A U320 801f AIC-7902 U320 + 8080 ASC-29320A U320 w/HostRAID + 808f AIC-7901 U320 w/HostRAID 8090 ASC-39320 U320 w/HostRAID 8091 ASC-39320D U320 w/HostRAID 8092 ASC-29320 U320 w/HostRAID 8093 ASC-29320B U320 w/HostRAID 8094 ASC-29320LP U320 w/HostRAID + 8095 ASC-39320(B) U320 w/HostRAID + 8096 ASC-39320A U320 w/HostRAID + 8097 ASC-29320ALP U320 w/HostRAID + 809c ASC-39320D(B) U320 w/HostRAID + 809d AIC-7902(B) U320 w/HostRAID 809e AIC-7901A U320 w/HostRAID 809f AIC-7902 U320 w/HostRAID 907f Atronics diff --git a/hw/xfree86/scanpci/pciid2c.pl b/hw/xfree86/scanpci/pciid2c.pl index a43bc5be6..71586d421 100644 --- a/hw/xfree86/scanpci/pciid2c.pl +++ b/hw/xfree86/scanpci/pciid2c.pl @@ -10,9 +10,34 @@ # # Copyright © 2002 by The XFree86 Project, Inc. # +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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 conditions: +# +# 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 MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, 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 copyright holder(s) +# and author(s) 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 copyright holder(s) and author(s). +# + +# # Author: David Dawes # -# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.2 2002/12/23 16:45:19 tsi Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.3 2003/08/24 17:37:10 dawes Exp $ # if (@ARGV[0]) { diff --git a/hw/xfree86/scanpci/xf86PciData.h b/hw/xfree86/scanpci/xf86PciData.h index 0fa21b6db..2253de8e5 100644 --- a/hw/xfree86/scanpci/xf86PciData.h +++ b/hw/xfree86/scanpci/xf86PciData.h @@ -1,6 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.2 2002/07/15 20:46:02 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */ +/* + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef PCI_DATA_H_ #define PCI_DATA_H_ diff --git a/hw/xfree86/scanpci/xf86PciStdIds.h b/hw/xfree86/scanpci/xf86PciStdIds.h index 58403ccf7..ff8f3d14a 100644 --- a/hw/xfree86/scanpci/xf86PciStdIds.h +++ b/hw/xfree86/scanpci/xf86PciStdIds.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.10 2003/02/26 16:33:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.14 2003/10/30 15:26:34 tsi Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT @@ -189,7 +189,7 @@ static const char pci_device_1000_0020[] = "53c1010 Ultra3 SCSI Adapter"; static const char pci_subsys_1000_0020_1de1_1020[] = "DC-390U3W"; #endif static const char pci_device_1000_0021[] = "53c1010 66MHz Ultra3 SCSI Adapter"; -static const char pci_device_1000_0030[] = "53c1030"; +static const char pci_device_1000_0030[] = "53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI"; #endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1000_0030_1028_1010[] = "LSI U320 SCSI Controller"; @@ -253,6 +253,7 @@ static const char pci_device_1001_0017[] = "PROTO-3 PCI Prototyping board"; static const char pci_device_1001_9100[] = "INI-9100/9100W SCSI Host"; #endif static const char pci_vendor_1002[] = "ATI Technologies Inc"; +static const char pci_device_1002_4136[] = "Radeon IGP 320 M"; static const char pci_device_1002_4144[] = "Radeon R300 AD [Radeon 9500 Pro]"; static const char pci_device_1002_4145[] = "Radeon R300 AE [Radeon 9500 Pro]"; static const char pci_device_1002_4146[] = "Radeon R300 AF [Radeon 9500 Pro]"; @@ -537,14 +538,19 @@ static const char pci_device_1002_4c66[] = "Radeon R250 Lf [Radeon Mobility 9000 static const char pci_device_1002_4c67[] = "Radeon R250 Lg [Radeon Mobility 9000 M9]"; static const char pci_device_1002_4d46[] = "Rage Mobility M4 AGP"; static const char pci_device_1002_4d4c[] = "Rage Mobility M4 AGP"; -static const char pci_device_1002_4e44[] = "Radeon R300 ND [Radeon 9700]"; -static const char pci_device_1002_4e45[] = "Radeon R300 NE [Radeon 9700]"; +static const char pci_device_1002_4e44[] = "Radeon R300 ND [Radeon 9700 Pro]"; +static const char pci_device_1002_4e45[] = "Radeon R300 NE [Radeon 9500 Pro]"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1002_4e45_1002_0002[] = "Radeon R300 NE [Radeon 9500 Pro]"; +#endif static const char pci_device_1002_4e46[] = "Radeon R300 NF [Radeon 9700]"; static const char pci_device_1002_4e47[] = "Radeon R300 NG [FireGL X1]"; +static const char pci_device_1002_4e48[] = "Radeon R350 [Radeon 9800]"; static const char pci_device_1002_4e64[] = "Radeon R300 [Radeon 9700 Pro] (Secondary)"; -static const char pci_device_1002_4e65[] = "Radeon R300 [Radeon 9700] (Secondary)"; +static const char pci_device_1002_4e65[] = "Radeon R300 [Radeon 9500 Pro] (Secondary)"; static const char pci_device_1002_4e66[] = "Radeon R300 [Radeon 9700] (Secondary)"; static const char pci_device_1002_4e67[] = "Radeon R300 [FireGL X1] (Secondary)"; +static const char pci_device_1002_4e68[] = "Radeon R350 [Radeon 9800] (Secondary)"; static const char pci_device_1002_5041[] = "Rage 128 PA/PRO"; static const char pci_device_1002_5042[] = "Rage 128 PB/PRO AGP 2x"; static const char pci_device_1002_5043[] = "Rage 128 PC/PRO AGP 4x"; @@ -789,6 +795,9 @@ static const char pci_subsys_1002_524c_1002_0088[] = "Xpert 99"; #endif static const char pci_device_1002_5345[] = "Rage 128 SE/4x"; static const char pci_device_1002_5346[] = "Rage 128 SF/4x AGP 2x"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1002_5346_1002_0048[] = "RAGE 128 16MB VGA TVOUT AMC PAL"; +#endif static const char pci_device_1002_5347[] = "Rage 128 SG/4x AGP 4x"; static const char pci_device_1002_5348[] = "Rage 128 SH"; static const char pci_device_1002_534b[] = "Rage 128 SK/4x"; @@ -847,7 +856,9 @@ static const char pci_subsys_1002_5654_1002_5654[] = "Mach64VT Reference"; #endif static const char pci_device_1002_5655[] = "264VT3 [Mach64 VT3]"; static const char pci_device_1002_5656[] = "264VT4 [Mach64 VT4]"; -static const char pci_device_1002_700f[] = "U1/A3 AGP Bridge [IGP 320M]"; +static const char pci_device_1002_700f[] = "PCI Bridge [IGP 320M]"; +static const char pci_device_1002_7010[] = "PCI Bridge [IGP 340M]"; +static const char pci_device_1002_cab2[] = "RS200/RS200M AGP Bridge [IGP 340M]"; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1003[] = "ULSI Systems"; static const char pci_device_1003_0201[] = "US201"; @@ -1021,6 +1032,7 @@ static const char pci_device_1011_0014[] = "DECchip 21041 [Tulip Pass 3]"; static const char pci_subsys_1011_0014_1186_0100[] = "DE-530+"; #endif static const char pci_device_1011_0016[] = "DGLPB [OPPO]"; +static const char pci_device_1011_0017[] = "PV-PCI Graphics Controller (ZLXp-L)"; static const char pci_device_1011_0019[] = "DECchip 21142/43"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1011_0019_1011_500a[] = "DE500A Fast Ethernet"; @@ -1716,8 +1728,9 @@ static const char pci_subsys_1028_0004_1028_00d0[] = "PowerEdge Expandable RAID #endif static const char pci_device_1028_0005[] = "PowerEdge Expandable RAID Controller 3/Di"; static const char pci_device_1028_0006[] = "PowerEdge Expandable RAID Controller 3/Di"; -static const char pci_device_1028_0007[] = "Remote Assistant Card 3"; -static const char pci_device_1028_0008[] = "PowerEdge Expandable RAID Controller 3/Di"; +static const char pci_device_1028_0007[] = "Remote Access Controller:DRAC III"; +static const char pci_device_1028_0008[] = "Remote Access Controller"; +static const char pci_device_1028_0009[] = "BMC/SMIC device not present"; static const char pci_device_1028_000a[] = "PowerEdge Expandable RAID Controller 3"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1028_000a_1028_0106[] = "PowerEdge Expandable RAID Controller 3/Di"; @@ -1728,7 +1741,8 @@ static const char pci_subsys_1028_000a_1028_011b[] = "PowerEdge Expandable RAID #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1028_000a_1028_0121[] = "PowerEdge Expandable RAID Controller 3/Di"; #endif -static const char pci_device_1028_000c[] = "Embedded Systems Management Device 4"; +static const char pci_device_1028_000c[] = "Remote Access Controller:ERA or ERA/O"; +static const char pci_device_1028_000d[] = "BMC/SMIC device"; static const char pci_device_1028_000e[] = "PowerEdge Expandable RAID Controller"; static const char pci_device_1028_000f[] = "PowerEdge Expandable RAID Controller 4/Di"; #ifdef VENDOR_INCLUDE_NONVIDEO @@ -1741,6 +1755,7 @@ static const char pci_device_102a_0010[] = "ASPEN"; #endif static const char pci_vendor_102b[] = "Matrox Graphics, Inc."; static const char pci_device_102b_0010[] = "MGA-I [Impression?]"; +static const char pci_device_102b_0100[] = "MGA 1064SG [Mystique]"; static const char pci_device_102b_0518[] = "MGA-II [Athena]"; static const char pci_device_102b_0519[] = "MGA 2064W [Millennium]"; static const char pci_device_102b_051a[] = "MGA 1064SG [Mystique]"; @@ -2244,6 +2259,7 @@ static const char pci_device_1039_0633[] = "633 Host"; static const char pci_device_1039_0635[] = "635 Host"; static const char pci_device_1039_0645[] = "SiS645 Host & Memory & AGP Controller"; static const char pci_device_1039_0646[] = "SiS645DX Host & Memory & AGP Controller"; +static const char pci_device_1039_0648[] = "SiS 645xx"; static const char pci_device_1039_0650[] = "650 Host"; static const char pci_device_1039_0651[] = "SiS651 Host"; static const char pci_device_1039_0730[] = "730 Host"; @@ -2251,6 +2267,7 @@ static const char pci_device_1039_0733[] = "733 Host"; static const char pci_device_1039_0735[] = "735 Host"; static const char pci_device_1039_0740[] = "740 Host"; static const char pci_device_1039_0745[] = "745 Host"; +static const char pci_device_1039_0755[] = "SiS 755 Host Bridge"; static const char pci_device_1039_0900[] = "SiS900 10/100 Ethernet"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1039_0900_1039_0900[] = "SiS900 10/100 Ethernet Adapter"; @@ -2309,18 +2326,18 @@ static const char pci_subsys_1039_6326_1092_4920[] = "SpeedStar A70"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1039_6326_1569_6326[] = "SiS6326 GUI Accelerator"; #endif -static const char pci_device_1039_7001[] = "SiS7001 USB Controller"; +static const char pci_device_1039_7001[] = "USB 1.0 Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1039_7001_1039_7000[] = "Onboard USB Controller"; #endif -static const char pci_device_1039_7002[] = "SiS7002 USB 2.0"; +static const char pci_device_1039_7002[] = "USB 2.0 Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1039_7002_1509_7002[] = "Onboard USB Controller"; #endif static const char pci_device_1039_7007[] = "FireWire Controller"; -static const char pci_device_1039_7012[] = "SiS7012 PCI Audio Accelerator"; +static const char pci_device_1039_7012[] = "Sound Controller"; static const char pci_device_1039_7013[] = "Intel 537 [56k Winmodem]"; -static const char pci_device_1039_7016[] = "SiS7016 10/100 Ethernet Adapter"; +static const char pci_device_1039_7016[] = "10/100 Ethernet Adapter"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1039_7016_1039_7016[] = "SiS7016 10/100 Ethernet Adapter"; #endif @@ -2472,6 +2489,7 @@ static const char pci_device_103c_1229[] = "zx1 System Bus Adapter"; static const char pci_device_103c_122a[] = "zx1 I/O Controller"; static const char pci_device_103c_122e[] = "zx1 Local Bus Adapter"; static const char pci_device_103c_1290[] = "Auxiliary Diva Serial Port"; +static const char pci_device_103c_12b4[] = "zx1 QuickSilver AGP8x LBA"; static const char pci_device_103c_2910[] = "E2910A PCIBus Exerciser"; static const char pci_device_103c_2925[] = "E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer"; #ifdef VENDOR_INCLUDE_NONVIDEO @@ -2488,8 +2506,8 @@ static const char pci_vendor_1041[] = "Computrend"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1042[] = "Micron"; -static const char pci_device_1042_1000[] = "FDC 37C665"; -static const char pci_device_1042_1001[] = "37C922"; +static const char pci_device_1042_1000[] = "PC Tech RZ1000"; +static const char pci_device_1042_1001[] = "PC Tech RZ1001"; static const char pci_device_1042_3000[] = "Samurai_0"; static const char pci_device_1042_3010[] = "Samurai_1"; static const char pci_device_1042_3020[] = "Samurai_IDE"; @@ -2974,6 +2992,9 @@ static const char pci_subsys_105a_0d38_105a_4d39[] = "Fasttrak66"; #endif static const char pci_device_105a_1275[] = "20275"; static const char pci_device_105a_3376[] = "PDC20376"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_105a_3376_1043_809e[] = "A7V8X motherboard"; +#endif static const char pci_device_105a_4d30[] = "20267"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_105a_4d30_105a_4d33[] = "Ultra100"; @@ -3000,6 +3021,9 @@ static const char pci_device_105a_4d68[] = "20268"; static const char pci_subsys_105a_4d68_105a_4d68[] = "Ultra100TX2"; #endif static const char pci_device_105a_4d69[] = "20269"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_105a_4d69_105a_4d68[] = "Ultra133TX2"; +#endif static const char pci_device_105a_5275[] = "PDC20276 IDE"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_105a_5275_105a_0275[] = "SuperTrak SX6000 IDE"; @@ -3111,6 +3135,9 @@ static const char pci_subsys_105d_493d_13cc_0009[] = "Barco Metheus 5 Megapixel, static const char pci_subsys_105d_493d_13cc_000a[] = "Barco Metheus 5 Megapixel, Dual Head"; #endif static const char pci_device_105d_5348[] = "Revolution 4"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_105d_5348_105d_0037[] = "Revolution IV-FP AGP (For SGI 1600SW)"; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_105e[] = "Vtech Computers Ltd"; #endif @@ -3328,6 +3355,9 @@ static const char pci_device_1077_2100[] = "QLA2100 64-bit Fibre Channel Adapter static const char pci_subsys_1077_2100_1077_0001[] = "QLA2100 64-bit Fibre Channel Adapter"; #endif static const char pci_device_1077_2200[] = "QLA2200"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1077_2200_1077_0002[] = "QLA2200"; +#endif static const char pci_device_1077_2300[] = "QLA2300 64-bit FC-AL Adapter"; static const char pci_device_1077_2312[] = "QLA2312 Fibre Channel Adapter"; #endif @@ -3540,6 +3570,7 @@ static const char pci_vendor_1094[] = "First International Computers [FIC]"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1095[] = "CMD Technology Inc"; +static const char pci_device_1095_0240[] = "Adaptec AAR-1210SA SATA HostRAID Controller"; static const char pci_device_1095_0640[] = "PCI0640"; static const char pci_device_1095_0643[] = "PCI0643"; static const char pci_device_1095_0646[] = "PCI0646"; @@ -3926,6 +3957,7 @@ static const char pci_vendor_10a4[] = "Globe Manufacturing Sales"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_10a5[] = "Smart Link Ltd."; +static const char pci_device_10a5_3052[] = "SmartPCI562 56K Modem"; static const char pci_device_10a5_5449[] = "SmartPCI561 modem"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -3949,6 +3981,9 @@ static const char pci_device_10a9_0006[] = "HPCEX"; static const char pci_device_10a9_0007[] = "RPCEX"; static const char pci_device_10a9_0008[] = "DiVO VIP"; static const char pci_device_10a9_0009[] = "Alteon Gigabit Ethernet"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_10a9_0009_10a9_8002[] = "Acenic Gigabit Ethernet"; +#endif static const char pci_device_10a9_0010[] = "AMP Video I/O"; static const char pci_device_10a9_0011[] = "GRIP"; static const char pci_device_10a9_0012[] = "SGH PSHAC GSN"; @@ -3960,6 +3995,7 @@ static const char pci_device_10a9_1005[] = "Dual JPEG 3"; static const char pci_device_10a9_1006[] = "Dual JPEG 4"; static const char pci_device_10a9_1007[] = "Dual JPEG 5"; static const char pci_device_10a9_1008[] = "Cesium"; +static const char pci_device_10a9_100a[] = "IOC4 I/O controller"; static const char pci_device_10a9_2001[] = "Fibre Channel"; static const char pci_device_10a9_2002[] = "ASDE"; static const char pci_device_10a9_8001[] = "O2 1394"; @@ -4130,6 +4166,9 @@ static const char pci_device_10b5_9054[] = "PCI <-> IOBus Bridge"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_10b5_9054_10b5_2455[] = "Wessex Techology PHIL-PCI"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_10b5_9054_12d9_0002[] = "PCI Prosody Card rev 1.5"; +#endif static const char pci_device_10b5_9060[] = "9060"; static const char pci_device_10b5_906d[] = "9060SD"; #ifdef INIT_SUBSYS_INFO @@ -4143,6 +4182,9 @@ static const char pci_subsys_10b5_9080_10b5_9080[] = "9080 [real subsystem ID no #ifdef INIT_SUBSYS_INFO static const char pci_subsys_10b5_9080_129d_0002[] = "Aculab PCI Prosidy card"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_10b5_9080_12d9_0002[] = "PCI Prosody Card"; +#endif #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_10b6[] = "Madge Networks"; @@ -4200,6 +4242,7 @@ static const char pci_device_10b6_1001[] = "Collage 155 ATM Server Adapter"; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_10b7[] = "3Com Corporation"; static const char pci_device_10b7_0001[] = "3c985 1000BaseSX (SX/TX)"; +static const char pci_device_10b7_0910[] = "3C910-A01"; static const char pci_device_10b7_1006[] = "MINI PCI type 3B Data Fax Modem"; static const char pci_device_10b7_1007[] = "Mini PCI 56k Winmodem"; #ifdef INIT_SUBSYS_INFO @@ -4491,6 +4534,7 @@ static const char pci_device_10b8_1001[] = "FDC 37C922"; static const char pci_device_10b8_a011[] = "83C170QF"; static const char pci_device_10b8_b106[] = "SMC34C90"; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_10b9[] = "ALi Corporation"; static const char pci_device_10b9_0111[] = "C-Media CMI8738/C3DX Audio Device (OEM)"; #ifdef INIT_SUBSYS_INFO @@ -4561,6 +4605,7 @@ static const char pci_device_10b9_5249[] = "M5249 HTT to PCI Bridge"; static const char pci_device_10b9_5251[] = "M5251 P1394 OHCI 1.0 Controller"; static const char pci_device_10b9_5253[] = "M5253 P1394 OHCI 1.1 Controller"; static const char pci_device_10b9_5261[] = "M5261 Ethernet Controller"; +static const char pci_device_10b9_5450[] = "Lucent Technologies Soft Modem AMR"; static const char pci_device_10b9_5451[] = "M5451 PCI AC-Link Controller Audio Device"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_10b9_5451_1014_0506[] = "ThinkPad R30"; @@ -4576,6 +4621,7 @@ static const char pci_device_10b9_7101[] = "M7101 PMU"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_10b9_7101_10b9_7101[] = "ALI M7101 Power Management Controller"; #endif +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_10ba[] = "Mitsubishi Electric Corp."; static const char pci_device_10ba_0301[] = "AccelGraphics AccelECLIPSE"; @@ -4895,6 +4941,9 @@ static const char pci_subsys_10de_0028_1043_0205[] = "PCI-V3800"; static const char pci_subsys_10de_0028_1043_4000[] = "AGP-V3800PRO"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_10de_0028_1048_0c21[] = "Synergy II"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_10de_0028_1092_4804[] = "Viper V770"; #endif #ifdef INIT_SUBSYS_INFO @@ -5099,6 +5148,9 @@ static const char pci_device_10de_0153[] = "NV15GL [Quadro2 Pro]"; static const char pci_device_10de_0170[] = "NV17 [GeForce4 MX 460]"; static const char pci_device_10de_0171[] = "NV17 [GeForce4 MX 440]"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_10de_0171_10b0_0002[] = "Gainward Pro/600 TV"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_10de_0171_1462_8661[] = "G4MX440-VTP"; #endif #ifdef INIT_SUBSYS_INFO @@ -5490,6 +5542,12 @@ static const char pci_subsys_1102_0002_1102_8051[] = "CT4850 SBLive! Value"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1102_0002_1102_8061[] = "SBLive! Player 5.1"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1102_0002_1102_8064[] = "SB Live! 5.1 Model SB0100"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1102_0002_1102_8065[] = "SBLive! 5.1 Digital Model SB0220"; +#endif static const char pci_device_1102_0004[] = "SB Audigy"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1102_0004_1102_0051[] = "SB0090 Audigy Player"; @@ -5512,7 +5570,7 @@ static const char pci_subsys_1102_7003_1102_0040[] = "SB Audigy MIDI/Game Port"; #endif static const char pci_device_1102_7004[] = "[SB Live! Value] Input device controller"; static const char pci_device_1102_8064[] = "SB0100 [SBLive! 5.1 OEM]"; -static const char pci_device_1102_8938[] = "ES1371"; +static const char pci_device_1102_8938[] = "Ectiva EV1938"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1103[] = "Triones Technologies, Inc."; @@ -5528,6 +5586,7 @@ static const char pci_device_1103_0005[] = "HPT372A"; static const char pci_device_1103_0006[] = "HPT302"; static const char pci_device_1103_0007[] = "HPT371"; static const char pci_device_1103_0008[] = "HPT374"; +static const char pci_device_1103_0009[] = "HPT372N"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1104[] = "RasterOps Corp."; @@ -5538,6 +5597,7 @@ static const char pci_device_1105_1105[] = "REALmagic Xcard MPEG 1/2/3/4 DVD Dec static const char pci_device_1105_8300[] = "REALmagic Hollywood Plus DVD Decoder"; static const char pci_device_1105_8400[] = "EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder"; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1106[] = "VIA Technologies, Inc."; static const char pci_device_1106_0102[] = "Embedded VIA Ethernet Controller"; static const char pci_device_1106_0130[] = "VT6305 1394.A Controller"; @@ -5557,13 +5617,19 @@ static const char pci_subsys_1106_0305_147b_a401[] = "KT7/KT7-RAID/KT7A/KT7A-RAI static const char pci_device_1106_0391[] = "VT8371 [KX133]"; static const char pci_device_1106_0501[] = "VT8501 [Apollo MVP4]"; static const char pci_device_1106_0505[] = "VT82C505"; -static const char pci_device_1106_0561[] = "VT82C561"; -static const char pci_device_1106_0571[] = "VT82C586/B/686A/B PIPC Bus Master IDE"; +static const char pci_device_1106_0561[] = "VT82C576MV"; +static const char pci_device_1106_0571[] = "VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0571_1019_0985[] = "P6VXA Motherboard"; +#endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_0571_1043_8052[] = "VT8233A Bus Master ATA100/66/33 IDE"; #endif #ifdef INIT_SUBSYS_INFO -static const char pci_subsys_1106_0571_1106_0571[] = "VT8235 Bus Master ATA133/100/66/33 IDE"; +static const char pci_subsys_1106_0571_1043_808c[] = "A7V8X motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0571_1106_0571[] = "VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE"; #endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_0571_1179_0001[] = "Magnia Z310"; @@ -5589,9 +5655,18 @@ static const char pci_device_1106_0597[] = "VT82C597 [Apollo VP3]"; static const char pci_device_1106_0598[] = "VT82C598 [Apollo MVP3]"; static const char pci_device_1106_0601[] = "VT8601 [Apollo ProMedia]"; static const char pci_device_1106_0605[] = "VT8605 [ProSavage PM133]"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0605_1043_802c[] = "CUV4X mainboard"; +#endif static const char pci_device_1106_0680[] = "VT82C680 [Apollo P6]"; static const char pci_device_1106_0686[] = "VT82C686 [Apollo Super South]"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0686_1019_0985[] = "P6VXA Motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0686_1043_802c[] = "CUV4X mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_0686_1043_8033[] = "A7V Mainboard"; #endif #ifdef INIT_SUBSYS_INFO @@ -5617,6 +5692,9 @@ static const char pci_subsys_1106_0686_147b_a702[] = "KG7-Lite Mainboard"; #endif static const char pci_device_1106_0691[] = "VT82C693A/694x [Apollo PRO133x]"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_0691_1019_0985[] = "P6VXA Motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_0691_1179_0001[] = "Magnia Z310"; #endif #ifdef INIT_SUBSYS_INFO @@ -5627,13 +5705,19 @@ static const char pci_device_1106_0698[] = "VT82C693A [Apollo Pro133 AGP]"; static const char pci_device_1106_0926[] = "VT82C926 [Amazon]"; static const char pci_device_1106_1000[] = "VT82C570MV"; static const char pci_device_1106_1106[] = "VT82C570MV"; -static const char pci_device_1106_1571[] = "VT82C416MV"; +static const char pci_device_1106_1571[] = "VT82C576M/VT82C586"; static const char pci_device_1106_1595[] = "VT82C595/97 [Apollo VP2/97]"; static const char pci_device_1106_3038[] = "USB"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3038_0925_1234[] = "USB Controller"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3038_1019_0985[] = "P6VXA Motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3038_1043_808c[] = "A7V8X motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3038_1179_0001[] = "Magnia Z310"; #endif static const char pci_device_1106_3040[] = "VT82C586B ACPI"; @@ -5652,6 +5736,9 @@ static const char pci_device_1106_3050[] = "VT82C596 Power Management"; static const char pci_device_1106_3051[] = "VT82C596 Power Management"; static const char pci_device_1106_3057[] = "VT82C686 [Apollo Super ACPI]"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3057_1019_0985[] = "P6VXA Motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3057_1043_8033[] = "A7V Mainboard"; #endif #ifdef INIT_SUBSYS_INFO @@ -5667,9 +5754,14 @@ static const char pci_subsys_1106_3057_1043_8042[] = "A7V133/A7V133-C Mainboard" static const char pci_subsys_1106_3057_1179_0001[] = "Magnia Z310"; #endif static const char pci_device_1106_3058[] = "VT82C686 AC97 Audio Controller"; +#endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3058_0e11_b194[] = "Soundmax integrated digital audio"; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3058_1019_0985[] = "P6VXA Motherboard"; +#endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3058_1106_4511[] = "Onboard Audio on EP7KXA"; #endif @@ -5682,7 +5774,10 @@ static const char pci_subsys_1106_3058_1462_3091[] = "MS-6309 Onboard Audio"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3058_15dd_7609[] = "Onboard Audio"; #endif -static const char pci_device_1106_3059[] = "VT8233 AC97 Audio Controller"; +static const char pci_device_1106_3059[] = "VT8233/A/8235 AC97 Audio Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3059_1043_8095[] = "A7V8X Motherboard (Realtek ALC650 codec)"; +#endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3059_1458_a002[] = "GA-7VAX Onboard Audio (Realtek ALC650)"; #endif @@ -5696,6 +5791,9 @@ static const char pci_subsys_1106_3065_1186_1400[] = "DFE-530TX rev A"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3065_1186_1401[] = "DFE-530TX rev B"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3065_13b9_1421[] = "LD-10/100AL PCI Fast Ethernet Adapter (rev.B)"; +#endif static const char pci_device_1106_3068[] = "Intel 537 [AC97 Modem]"; static const char pci_device_1106_3074[] = "VT8233 PCI to ISA Bridge"; #ifdef INIT_SUBSYS_INFO @@ -5714,12 +5812,15 @@ static const char pci_device_1106_3102[] = "VT8662 Host Bridge"; static const char pci_device_1106_3103[] = "VT8615 Host Bridge"; static const char pci_device_1106_3104[] = "USB 2.0"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3104_1043_808c[] = "A7V8X motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3104_1458_5004[] = "GA-7VAX Mainboard"; #endif static const char pci_device_1106_3106[] = "VT6105 [Rhine-III]"; static const char pci_device_1106_3109[] = "VT8233C PCI to ISA Bridge"; static const char pci_device_1106_3112[] = "VT8361 [KLE133] Host Bridge"; -static const char pci_device_1106_3116[] = "VT8375 [KM266] Host Bridge"; +static const char pci_device_1106_3116[] = "VT8375 [KM266/KL266] Host Bridge"; static const char pci_device_1106_3122[] = "VT8623 [Apollo CLE266] integrated CastleRock graphics"; static const char pci_device_1106_3123[] = "VT8623 [Apollo CLE266]"; static const char pci_device_1106_3128[] = "VT8753 [P4X266 AGP]"; @@ -5730,10 +5831,16 @@ static const char pci_device_1106_3156[] = "P/KN266 Host Bridge"; static const char pci_device_1106_3168[] = "VT8374 P4X400 Host Controller/AGP Bridge"; static const char pci_device_1106_3177[] = "VT8235 ISA Bridge"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3177_1043_808c[] = "A7V8X motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3177_1458_5001[] = "GA-7VAX Mainboard"; #endif static const char pci_device_1106_3189[] = "VT8377 [KT400 AGP] Host Bridge"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_3189_1043_807f[] = "A7V8X motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_1106_3189_1458_5000[] = "GA-7VAX Mainboard"; #endif static const char pci_device_1106_5030[] = "VT82C596 ACPI [Apollo PRO]"; @@ -5746,6 +5853,9 @@ static const char pci_device_1106_8501[] = "VT8501 [Apollo MVP4 AGP]"; static const char pci_device_1106_8596[] = "VT82C596 [Apollo PRO AGP]"; static const char pci_device_1106_8597[] = "VT82C597 [Apollo VP3 AGP]"; static const char pci_device_1106_8598[] = "VT82C598/694x [Apollo MVP3/Pro133x AGP]"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_1106_8598_1019_0985[] = "P6VXA Motherboard"; +#endif static const char pci_device_1106_8601[] = "VT8601 [Apollo ProMedia AGP]"; static const char pci_device_1106_8605[] = "VT8605 [PM133 AGP]"; static const char pci_device_1106_8691[] = "VT82C691 [Apollo Pro]"; @@ -5757,6 +5867,7 @@ static const char pci_device_1106_b102[] = "VT8362 AGP Bridge"; static const char pci_device_1106_b103[] = "VT8615 AGP Bridge"; static const char pci_device_1106_b112[] = "VT8361 [KLE133] AGP Bridge"; static const char pci_device_1106_b168[] = "VT8235 PCI Bridge"; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1107[] = "Stratus Computers"; static const char pci_device_1107_0576[] = "VIA VT82C570MV [Apollo] (Wrong vendor ID!)"; @@ -5780,6 +5891,12 @@ static const char pci_device_1109_1400[] = "EM110TX [EX110TX]"; static const char pci_vendor_110a[] = "Siemens Nixdorf AG"; static const char pci_device_110a_0002[] = "Pirahna 2-port"; static const char pci_device_110a_0005[] = "Tulip controller, power management, switch extender"; +static const char pci_device_110a_0006[] = "FSC PINC (I/O-APIC)"; +static const char pci_device_110a_0015[] = "FSC Multiprocessor Interrupt Controller"; +static const char pci_device_110a_001d[] = "FSC Copernicus Management Controller"; +static const char pci_device_110a_007b[] = "FSC Remote Service Controller, mailbox device"; +static const char pci_device_110a_007c[] = "FSC Remote Service Controller, shared memory device"; +static const char pci_device_110a_007d[] = "FSC Remote Service Controller, SMIC device"; static const char pci_device_110a_2102[] = "DSCC4 WAN adapter"; static const char pci_device_110a_4942[] = "FPGA I-Bus Tracer for MBD"; static const char pci_device_110a_6120[] = "SZB6120"; @@ -6578,6 +6695,7 @@ static const char pci_device_1165_0001[] = "Motion TPEG Recorder/Player with aud #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1166[] = "ServerWorks"; static const char pci_device_1166_0005[] = "CNB20-LE Host Bridge"; +static const char pci_device_1166_0006[] = "CNB20HE Host Bridge"; static const char pci_device_1166_0007[] = "CNB20-LE Host Bridge"; static const char pci_device_1166_0008[] = "CNB20HE Host Bridge"; static const char pci_device_1166_0009[] = "CNB20LE Host Bridge"; @@ -7179,6 +7297,11 @@ static const char pci_subsys_11c1_0442_1668_0440[] = "LT WinModem 56k Data+Fax+V static const char pci_device_11c1_0443[] = "LT WinModem"; static const char pci_device_11c1_0444[] = "LT WinModem"; static const char pci_device_11c1_0445[] = "LT WinModem"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_11c1_0445_8086_2203[] = "PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)"; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_device_11c1_0446[] = "LT WinModem"; static const char pci_device_11c1_0447[] = "LT WinModem"; static const char pci_device_11c1_0448[] = "WinModem 56k"; @@ -8157,6 +8280,7 @@ static const char pci_subsys_1260_3873_1737_3874[] = "WMP11 Wireless 802.11b PCI static const char pci_subsys_1260_3873_8086_2513[] = "Wireless 802.11b MiniPCI Adapter"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const char pci_device_1260_3890[] = "D-Links DWL-g650 A1"; static const char pci_device_1260_8130[] = "HMP8130 NTSC/PAL Video Decoder"; static const char pci_device_1260_8131[] = "HMP8131 NTSC/PAL Video Decoder"; #endif @@ -8213,6 +8337,7 @@ static const char pci_vendor_126f[] = "Silicon Motion, Inc."; static const char pci_device_126f_0710[] = "SM710 LynxEM"; static const char pci_device_126f_0712[] = "SM712 LynxEM+"; static const char pci_device_126f_0720[] = "SM720 Lynx3DM"; +static const char pci_device_126f_0730[] = "SM731 Cougar3DR"; static const char pci_device_126f_0810[] = "SM810 LynxE"; static const char pci_device_126f_0811[] = "SM811 LynxE"; static const char pci_device_126f_0820[] = "SM820 Lynx3D"; @@ -8232,6 +8357,7 @@ static const char pci_device_1273_0002[] = "DirecPC"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1274[] = "Ensoniq"; +static const char pci_device_1274_1171[] = "ES1373 [AudioPCI] (also Creative Labs CT5803)"; static const char pci_device_1274_1371[] = "ES1371 [AudioPCI-97]"; #endif #ifdef INIT_SUBSYS_INFO @@ -8463,6 +8589,7 @@ static const char pci_vendor_1277[] = "Comstream"; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1278[] = "Transtech Parallel Systems Ltd."; static const char pci_device_1278_0701[] = "TPE3/TM3 PowerPC Node"; +static const char pci_device_1278_0710[] = "TPE5 PowerPC PCI board"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1279[] = "Transmeta Corporation"; @@ -8971,6 +9098,9 @@ static const char pci_subsys_12ae_0001_1410_0104[] = "Gigabit Ethernet-SX PCI Ad #endif static const char pci_device_12ae_0002[] = "AceNIC Gigabit Ethernet (Copper)"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_12ae_0002_10a9_8002[] = "Acenic Gigabit Ethernet"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_12ae_0002_12ae_0002[] = "Gigabit Ethernet-T (3C986-T)"; #endif #endif @@ -9208,6 +9338,7 @@ static const char pci_vendor_12d3[] = "Vingmed Sound A/S"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_12d4[] = "Ulticom (Formerly DGM&S)"; +static const char pci_device_12d4_0200[] = "T1 Card"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_12d5[] = "Equator Technologies"; @@ -9223,6 +9354,8 @@ static const char pci_vendor_12d8[] = "Pericom Semiconductor"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_12d9[] = "Aculab PLC"; +static const char pci_device_12d9_0002[] = "PCI Prosody"; +static const char pci_device_12d9_0004[] = "cPCI Prosody"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_12da[] = "True Time Inc."; @@ -9516,6 +9649,7 @@ static const char pci_device_1307_0035[] = "PCI-DAS64/M1/16"; static const char pci_device_1307_0036[] = "PCI-DAS64/M2/16"; static const char pci_device_1307_0037[] = "PCI-DAS64/M3/16"; static const char pci_device_1307_004c[] = "PCI-DAS1000"; +static const char pci_device_1307_004d[] = "PCI-QUAD04"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1308[] = "Jato Technologies Inc."; @@ -9683,6 +9817,7 @@ static const char pci_vendor_1331[] = "Radisys Corp."; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1332[] = "Micro Memory"; static const char pci_device_1332_5415[] = "MM-5415CN PCI Memory Module with Battery Backup"; +static const char pci_device_1332_5425[] = "MM-5425CN PCI 64/66 Memory Module with Battery Backup"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1334[] = "Redcreek Communications, Inc"; @@ -9940,6 +10075,7 @@ static const char pci_vendor_1384[] = "Reality Simulation Systems Inc"; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1385[] = "Netgear"; static const char pci_device_1385_4100[] = "802.11b Wireless Adapter (MA301)"; +static const char pci_device_1385_4105[] = "MA311 802.11b wireless adapter"; static const char pci_device_1385_620a[] = "GA620"; static const char pci_device_1385_622a[] = "GA622"; static const char pci_device_1385_630a[] = "GA630"; @@ -10283,7 +10419,7 @@ static const char pci_vendor_13e7[] = "NAC Incorporated"; static const char pci_vendor_13e8[] = "Chip Express Corporation"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO -static const char pci_vendor_13e9[] = "Chip Express Corporation"; +static const char pci_vendor_13e9[] = "Intraserver Technology Inc"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_13ea[] = "Dallas Semiconductor"; @@ -10346,6 +10482,9 @@ static const char pci_subsys_13f6_0111_1043_80e2[] = "CMI8738 6ch-MX"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_13f6_0111_13f6_0111[] = "CMI8738/C3DX PCI Audio Device"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_13f6_0111_1681_a000[] = "Gamesurround MUSE XL"; +#endif static const char pci_device_13f6_0211[] = "CM8738"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -10739,6 +10878,7 @@ static const char pci_vendor_146b[] = "Parascan Technologies Ltd"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_146c[] = "Ruby Tech Corp."; +static const char pci_device_146c_1430[] = "FE-1430TX Fast Ethernet PCI Adapter"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_146d[] = "Tachyon, INC."; @@ -10887,6 +11027,7 @@ static const char pci_vendor_149c[] = "OVISLINK Corp."; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_149d[] = "NEWTEK Inc"; +static const char pci_device_149d_0001[] = "Video Toaster for PC"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_149e[] = "Mapletree Networks Inc."; @@ -11240,6 +11381,15 @@ static const char pci_subsys_14e4_1645_1028_0121[] = "Broadcom BCM5701 1000Base- #endif #ifdef VENDOR_INCLUDE_NONVIDEO #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_14e4_1645_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_14e4_1645_10a9_8011[] = "SGI Gigabit Ethernet (Copper)"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_14e4_1645_10a9_8012[] = "SGI Gigabit Ethernet (Fiber)"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_14e4_1645_10b7_1004[] = "3C996-SX 1000Base-SX"; #endif #ifdef INIT_SUBSYS_INFO @@ -11295,6 +11445,9 @@ static const char pci_subsys_14e4_1647_0e11_009a[] = "NC7770 1000BaseTX"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_14e4_1647_10a9_8010[] = "SGI IO9 Gigabit Ethernet (Copper)"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_14e4_1647_14e4_0009[] = "BCM5703 1000BaseTX"; #endif #ifdef INIT_SUBSYS_INFO @@ -11341,6 +11494,7 @@ static const char pci_device_14e4_1696[] = "NetXtreme BCM5782 Gigabit Ethernet"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_14e4_1696_14e4_000d[] = "NetXtreme BCM5782 1000Base-T"; #endif +static const char pci_device_14e4_169c[] = "NetXtreme BCM5788 Gigabit Ethernet"; static const char pci_device_14e4_16a6[] = "NetXtreme BCM5702 Gigabit Ethernet"; #endif #ifdef INIT_SUBSYS_INFO @@ -11406,7 +11560,11 @@ static const char pci_device_14e4_4210[] = "BCM4210 iLine10 HomePNA 2.0"; static const char pci_device_14e4_4211[] = "BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem"; static const char pci_device_14e4_4212[] = "BCM4212 v.90 56k modem"; static const char pci_device_14e4_4301[] = "BCM4301 802.11b"; +static const char pci_device_14e4_4320[] = "BCM94306 802.11g"; static const char pci_device_14e4_4401[] = "BCM4401 100Base-T"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_14e4_4401_1043_80a8[] = "A7V8X motherboard"; +#endif static const char pci_device_14e4_4402[] = "BCM4402 Integrated 10/100BaseT"; static const char pci_device_14e4_4410[] = "BCM4413 iLine32 HomePNA 2.0"; static const char pci_device_14e4_4411[] = "BCM4413 V.90 56k modem"; @@ -11589,6 +11747,9 @@ static const char pci_subsys_14f1_1456_122d_4302[] = "Dell MP3930V-W(C) MiniPCI" #endif static const char pci_device_14f1_1610[] = "ADSL AccessRunner PCI Arbitration Device"; static const char pci_device_14f1_1611[] = "AccessRunner PCI ADSL Interface Device"; +static const char pci_device_14f1_1620[] = "ADSL AccessRunner V2 PCI Arbitration Device"; +static const char pci_device_14f1_1621[] = "AccessRunner V2 PCI ADSL Interface Device"; +static const char pci_device_14f1_1622[] = "AccessRunner V2 PCI ADSL Yukon WAN Adapter"; static const char pci_device_14f1_1803[] = "HCF 56k Modem"; #endif #ifdef INIT_SUBSYS_INFO @@ -12640,6 +12801,7 @@ static const char pci_device_1638_1100[] = "SMC2602W EZConnect / Addtron AWA-100 #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_163c[] = "Smart Link Ltd."; +static const char pci_device_163c_3052[] = "SmartLink SmartPCI562 56K Modem"; static const char pci_device_163c_5449[] = "SmartPCI561 Modem"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -12671,6 +12833,10 @@ static const char pci_device_16ab_1102[] = "PCMCIA-to-PCI Wireless Network Bridg static const char pci_vendor_16be[] = "Creatix Polymedia GmbH"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const char pci_vendor_16ca[] = "CENATEK Inc"; +static const char pci_device_16ca_0001[] = "Rocket Drive DL"; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_16ec[] = "U.S. Robotics"; static const char pci_device_16ec_3685[] = "Wireless Access PCI Adapter Model 022415"; #endif @@ -12779,6 +12945,10 @@ static const char pci_device_1de1_690c[] = "690c"; static const char pci_device_1de1_dc29[] = "DC290"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const char pci_vendor_1fc0[] = "Tumsan Oy"; +static const char pci_device_1fc0_0300[] = "E2200 Dual E1/Rawpipe Card"; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_2000[] = "Smart Link Ltd."; #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -12823,6 +12993,8 @@ static const char pci_vendor_3388[] = "Hint Corp"; static const char pci_device_3388_0013[] = "HiNT HC4 PCI to ISDN bridge, Multimedia audio controller"; static const char pci_device_3388_0014[] = "HiNT HC4 PCI to ISDN bridge, Network controller"; static const char pci_device_3388_0021[] = "HB1-SE33 PCI-PCI Bridge"; +static const char pci_device_3388_101a[] = "E.Band [AudioTrak Inca88]"; +static const char pci_device_3388_101b[] = "E.Band [AudioTrak Inca88]"; static const char pci_device_3388_8011[] = "VXPro II Chipset"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_3388_8011_3388_8011[] = "VXPro II Chipset CPU to PCI Bridge"; @@ -13232,7 +13404,7 @@ static const char pci_device_5333_8c2f[] = "SuperSavage IX/C DDR"; static const char pci_device_5333_8d01[] = "86C380 [ProSavageDDR K4M266]"; static const char pci_device_5333_8d02[] = "VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)"; static const char pci_device_5333_8d03[] = "VT8751 [ProSavageDDR P4M266]"; -static const char pci_device_5333_8d04[] = "[ProSavageDDR K4M266]"; +static const char pci_device_5333_8d04[] = "VT8375 [ProSavage8 KM266/KL266]"; static const char pci_device_5333_9102[] = "86C410 Savage 2000"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_5333_9102_1092_5932[] = "Viper II Z200"; @@ -13261,6 +13433,7 @@ static const char pci_subsys_5333_9102_1092_5a57[] = "Viper II Z200"; static const char pci_device_5333_ca00[] = "SonicVibes"; #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_544c[] = "Teralogic Inc"; +static const char pci_device_544c_0350[] = "TL880-based HDTV/ATSC tuner"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_5455[] = "Technische University Berlin"; @@ -13472,6 +13645,7 @@ static const char pci_device_8086_1040[] = "536EP Data Fax Modem"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1040_16be_1040[] = "V.9X DSP Data Fax Modem"; #endif +static const char pci_device_8086_1043[] = "PRO/Wireless LAN 2100 3B Mini PCI Adapter"; static const char pci_device_8086_1059[] = "82551QM Ethernet Controller"; static const char pci_device_8086_1130[] = "82815 815 Chipset Host Bridge and Memory Controller Hub"; #ifdef INIT_SUBSYS_INFO @@ -13483,6 +13657,12 @@ static const char pci_subsys_8086_1130_1043_8027[] = "TUSL2-C Mainboard"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1130_104d_80df[] = "Vaio PCG-FX403"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1130_8086_4532[] = "D815EEA2 mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1130_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_1131[] = "82815 815 Chipset AGP Bridge"; static const char pci_device_8086_1132[] = "82815 CGC [Chipset Graphics Controller]"; #ifdef INIT_SUBSYS_INFO @@ -13491,6 +13671,12 @@ static const char pci_subsys_8086_1132_1025_1016[] = "Travelmate 612 TX"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1132_104d_80df[] = "Vaio PCG-FX403"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1132_8086_4532[] = "D815EEA2 Mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1132_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_1161[] = "82806AA PCI64 Hub Advanced Programmable Interrupt Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1161_8086_1161[] = "82806AA PCI64 Hub APIC"; @@ -14098,6 +14284,12 @@ static const char pci_subsys_8086_2442_104d_80df[] = "Vaio PCG-FX403"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2442_147b_0507[] = "TH7II-RAID"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2442_8086_4532[] = "D815EEA2 mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2442_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_2443[] = "82801BA/BAM SMBus"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2443_1014_01c6[] = "Netvista A40/A40p"; @@ -14114,6 +14306,12 @@ static const char pci_subsys_8086_2443_104d_80df[] = "Vaio PCG-FX403"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2443_147b_0507[] = "TH7II-RAID"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2443_8086_4532[] = "D815EEA2 mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2443_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_2444[] = "82801BA/BAM USB (Hub #2)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2444_1025_1016[] = "Travelmate 612 TX"; @@ -14124,6 +14322,9 @@ static const char pci_subsys_8086_2444_104d_80df[] = "Vaio PCG-FX403"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2444_147b_0507[] = "TH7II-RAID"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2444_8086_4532[] = "D815EEA2 mainboard"; +#endif static const char pci_device_8086_2445[] = "82801BA/BAM AC'97 Audio"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2445_1014_01c6[] = "Netvista A40/A40p"; @@ -14140,6 +14341,9 @@ static const char pci_subsys_8086_2445_1462_3370[] = "STAC9721 AC"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2445_147b_0507[] = "TH7II-RAID"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2445_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_2446[] = "Intel 537 [82801BA/BAM AC'97 Modem]"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2446_1025_1016[] = "Travelmate 612 TX"; @@ -14189,12 +14393,24 @@ static const char pci_subsys_8086_2449_1014_0244[] = "EtherExpress PRO/100 VE"; static const char pci_subsys_8086_2449_1014_0245[] = "EtherExpress PRO/100 VE"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2449_1014_0265[] = "PRO/100 VE Desktop Connection"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2449_1014_0267[] = "PRO/100 VE Desktop Connection"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2449_1014_026a[] = "PRO/100 VE Desktop Connection"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2449_109f_315d[] = "EtherExpress PRO/100 VE"; #endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2449_109f_3181[] = "EtherExpress PRO/100 VE"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2449_1179_ff01[] = "PRO/100 VE Network Connection"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2449_1186_7801[] = "EtherExpress PRO/100 VE"; #endif #ifdef INIT_SUBSYS_INFO @@ -14244,8 +14460,14 @@ static const char pci_subsys_8086_244b_1043_8027[] = "TUSL2-C Mainboard"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_244b_147b_0507[] = "TH7II-RAID"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_244b_8086_4532[] = "D815EEA2 mainboard"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_244b_8086_4557[] = "D815EGEW Mainboard"; +#endif static const char pci_device_8086_244c[] = "82801BAM ISA Bridge (LPC)"; -static const char pci_device_8086_244e[] = "82801BA/CA/DB PCI Bridge"; +static const char pci_device_8086_244e[] = "82801BA/CA/DB/EB PCI Bridge"; static const char pci_device_8086_2450[] = "82801E ISA Bridge (LPC)"; static const char pci_device_8086_2452[] = "82801E USB"; static const char pci_device_8086_2453[] = "82801E SMBus"; @@ -14253,7 +14475,7 @@ static const char pci_device_8086_2459[] = "82801E Ethernet Controller 0"; static const char pci_device_8086_245b[] = "82801E IDE U100"; static const char pci_device_8086_245d[] = "82801E Ethernet Controller 1"; static const char pci_device_8086_245e[] = "82801E PCI Bridge"; -static const char pci_device_8086_2480[] = "82801CA ISA Bridge (LPC)"; +static const char pci_device_8086_2480[] = "82801CA LPC Interface Controller"; static const char pci_device_8086_2482[] = "82801CA/CAM USB (Hub #1)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2482_1014_0220[] = "ThinkPad A/T/X Series"; @@ -14267,7 +14489,7 @@ static const char pci_subsys_8086_2482_15d9_3480[] = "P4DP6"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2482_8086_1958[] = "vpr Matrix 170B4"; #endif -static const char pci_device_8086_2483[] = "82801CA/CAM SMBus"; +static const char pci_device_8086_2483[] = "82801CA/CAM SMBus Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2483_1014_0220[] = "ThinkPad A/T/X Series"; #endif @@ -14293,7 +14515,7 @@ static const char pci_subsys_8086_2484_15d9_3480[] = "P4DP6"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2484_8086_1958[] = "vpr Matrix 170B4"; #endif -static const char pci_device_8086_2485[] = "82801CA/CAM AC'97 Audio"; +static const char pci_device_8086_2485[] = "82801CA/CAM AC'97 Audio Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2485_1014_0222[] = "ThinkPad T23 (2647-4MG) or A30p (2653-64G)"; #endif @@ -14309,7 +14531,7 @@ static const char pci_subsys_8086_2485_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/G #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2485_144d_c006[] = "vpr Matrix 170B4"; #endif -static const char pci_device_8086_2486[] = "82801CA/CAM AC'97 Modem"; +static const char pci_device_8086_2486[] = "82801CA/CAM AC'97 Modem Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2486_1014_0223[] = "ThinkPad A/T/X Series"; #endif @@ -14357,12 +14579,12 @@ static const char pci_subsys_8086_248a_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/G #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_248a_8086_1958[] = "vpr Matrix 170B4"; #endif -static const char pci_device_8086_248b[] = "82801CA IDE U100"; +static const char pci_device_8086_248b[] = "82801CA Ultra ATA Storage Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_248b_15d9_3480[] = "P4DP6"; #endif static const char pci_device_8086_248c[] = "82801CAM ISA Bridge (LPC)"; -static const char pci_device_8086_24c0[] = "82801DB ISA Bridge (LPC)"; +static const char pci_device_8086_24c0[] = "82801DB LPC Interface Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c0_1462_5800[] = "845PE Max (MS-6580)"; #endif @@ -14370,7 +14592,7 @@ static const char pci_device_8086_24c2[] = "82801DB USB (Hub #1)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c2_1462_5800[] = "845PE Max (MS-6580)"; #endif -static const char pci_device_8086_24c3[] = "82801DB SMBus"; +static const char pci_device_8086_24c3[] = "82801DB/DBM SMBus Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c3_1462_5800[] = "845PE Max (MS-6580)"; #endif @@ -14378,23 +14600,37 @@ static const char pci_device_8086_24c4[] = "82801DB USB (Hub #2)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c4_1462_5800[] = "845PE Max (MS-6580)"; #endif -static const char pci_device_8086_24c5[] = "82801DB AC'97 Audio"; +static const char pci_device_8086_24c5[] = "82801DB AC'97 Audio Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c5_1462_5800[] = "845PE Max (MS-6580)"; #endif -static const char pci_device_8086_24c6[] = "82801DB AC'97 Modem"; +static const char pci_device_8086_24c6[] = "82801DB AC'97 Modem Controller"; static const char pci_device_8086_24c7[] = "82801DB USB (Hub #3)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c7_1462_5800[] = "845PE Max (MS-6580)"; #endif -static const char pci_device_8086_24cb[] = "82801DB ICH4 IDE"; +static const char pci_device_8086_24ca[] = "82801DBM Ultra ATA Storage Controller"; +static const char pci_device_8086_24cb[] = "82801DB Ultra ATA Storage Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24cb_1462_5800[] = "845PE Max (MS-6580)"; #endif -static const char pci_device_8086_24cd[] = "82801DB USB EHCI Controller"; +static const char pci_device_8086_24cc[] = "82801DBM LPC Interface Controller"; +static const char pci_device_8086_24cd[] = "82801DB USB2"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24cd_1462_3981[] = "845PE Max (MS-6580) Onboard USB EHCI Controller"; #endif +static const char pci_device_8086_24d0[] = "82801EB LPC Interface Controller"; +static const char pci_device_8086_24d1[] = "82801EB Ultra ATA Storage Controller"; +static const char pci_device_8086_24d2[] = "82801EB USB"; +static const char pci_device_8086_24d3[] = "82801EB SMBus Controller"; +static const char pci_device_8086_24d4[] = "82801EB USB"; +static const char pci_device_8086_24d5[] = "82801EB AC'97 Audio Controller"; +static const char pci_device_8086_24d6[] = "82801EB AC'97 Modem Controller"; +static const char pci_device_8086_24d7[] = "82801EB USB"; +static const char pci_device_8086_24db[] = "82801EB Ultra ATA Storage Controller"; +static const char pci_device_8086_24dc[] = "82801EB LPC Interface Controller"; +static const char pci_device_8086_24dd[] = "82801EB USB2"; +static const char pci_device_8086_24de[] = "82801EB USB"; static const char pci_device_8086_2500[] = "82820 820 (Camino) Chipset Host Bridge (MCH)"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2500_1028_0095[] = "Precision Workstation 220 Chipset"; @@ -14418,29 +14654,45 @@ static const char pci_device_8086_2531[] = "82860 860 (Wombat) Chipset Host Brid static const char pci_device_8086_2532[] = "82850 850 (Tehama) Chipset AGP Bridge"; static const char pci_device_8086_2533[] = "82860 860 (Wombat) Chipset AGP Bridge"; static const char pci_device_8086_2534[] = "82860 860 (Wombat) Chipset PCI Bridge"; -static const char pci_device_8086_2540[] = "e7500 [Plumas] DRAM Controller"; +static const char pci_device_8086_2540[] = "E7500 Memory Controller Hub"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2540_15d9_3480[] = "P4DP6"; #endif -static const char pci_device_8086_2541[] = "e7500 [Plumas] DRAM Controller Error Reporting"; +static const char pci_device_8086_2541[] = "E7000 Series Host RASUM Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2541_15d9_3480[] = "P4DP6"; #endif -static const char pci_device_8086_2543[] = "e7500 [Plumas] HI_B Virtual PCI Bridge (F0)"; -static const char pci_device_8086_2544[] = "e7500 [Plumas] HI_B Virtual PCI Bridge (F1)"; -static const char pci_device_8086_2545[] = "e7500 [Plumas] HI_C Virtual PCI Bridge (F0)"; -static const char pci_device_8086_2546[] = "e7500 [Plumas] HI_C Virtual PCI Bridge (F1)"; -static const char pci_device_8086_2547[] = "e7500 [Plumas] HI_D Virtual PCI Bridge (F0)"; -static const char pci_device_8086_2548[] = "e7500 [Plumas] HI_D Virtual PCI Bridge (F1)"; +static const char pci_device_8086_2543[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge"; +static const char pci_device_8086_2544[] = "E7000 Series Hub Interface B RASUM Controller"; +static const char pci_device_8086_2545[] = "E7000 Series Hub Interface C PCI-to-PCI Bridge"; +static const char pci_device_8086_2546[] = "E7000 Series Hub Interface C RASUM Controller"; +static const char pci_device_8086_2547[] = "E7000 Series Hub Interface D PCI-to-PCI Bridge"; +static const char pci_device_8086_2548[] = "E7000 Series Hub Interface D RASUM Controller"; +static const char pci_device_8086_254c[] = "E7501 Memory Controller Hub"; +static const char pci_device_8086_2550[] = "E7505 Memory Controller Hub"; +static const char pci_device_8086_2551[] = "E7000 Series RAS Controller"; +static const char pci_device_8086_2552[] = "E7000 Series Processor to AGP Controller"; +static const char pci_device_8086_2553[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge"; +static const char pci_device_8086_2554[] = "E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller"; +static const char pci_device_8086_255d[] = "E7205 Memory Controller Hub"; static const char pci_device_8086_2560[] = "82845G/GL [Brookdale-G] Chipset Host Bridge"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2560_1462_5800[] = "845PE Max (MS-6580)"; #endif static const char pci_device_8086_2561[] = "82845G/GL [Brookdale-G] Chipset AGP Bridge"; static const char pci_device_8086_2562[] = "82845G/GL [Brookdale-G] Chipset Integrated Graphics Device"; -static const char pci_device_8086_2570[] = "865G Chipset Host-Hub Bridge"; -static const char pci_device_8086_2572[] = "865G Chipset Graphics Controller"; +static const char pci_device_8086_2570[] = "82865G/PE/P Processor to I/O Controller"; +static const char pci_device_8086_2571[] = "82865G/PE/P Processor to AGP Controller"; +static const char pci_device_8086_2572[] = "82865G Integrated Graphics Device"; +static const char pci_device_8086_2573[] = "82865G/PE/P Processor to PCI to CSA Bridge"; +static const char pci_device_8086_2576[] = "82864G/PE/P Processor to I/O Memory Interface"; +static const char pci_device_8086_2578[] = "82875P Memory Controller Hub"; +static const char pci_device_8086_2579[] = "82875P Processor to AGP Controller"; +static const char pci_device_8086_257b[] = "82875P Processor to PCI to CSA Bridge"; +static const char pci_device_8086_257e[] = "82875P Processor to I/O Memory Interface"; static const char pci_device_8086_3092[] = "Integrated RAID"; +static const char pci_device_8086_3340[] = "82855PM Processor to I/O Controller"; +static const char pci_device_8086_3341[] = "82855PM Processor to AGP Controller"; static const char pci_device_8086_3575[] = "82830 830 Chipset Host Bridge"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_3575_1014_021d[] = "ThinkPad A/T/X Series"; @@ -14454,8 +14706,8 @@ static const char pci_device_8086_3577[] = "82830 CGC [Chipset Graphics Controll static const char pci_subsys_8086_3577_1014_0513[] = "ThinkPad A/T/X Series"; #endif static const char pci_device_8086_3578[] = "82830 830 Chipset Host Bridge"; -static const char pci_device_8086_3580[] = "852GM/852GME/855GM/855GME Chipset Host-Hub Bridge"; -static const char pci_device_8086_3582[] = "852GM/852GME/855GM/855GME Chipset Graphics Controller"; +static const char pci_device_8086_3580[] = "82852/855GM Host Bridge"; +static const char pci_device_8086_3582[] = "82852/855GM Integrated Graphics Device"; static const char pci_device_8086_5200[] = "EtherExpress PRO/100 Intelligent Server"; static const char pci_device_8086_5201[] = "EtherExpress PRO/100 Intelligent Server"; #ifdef INIT_SUBSYS_INFO @@ -14473,6 +14725,9 @@ static const char pci_device_8086_7112[] = "82371AB/EB/MB PIIX4 USB"; static const char pci_device_8086_7113[] = "82371AB/EB/MB PIIX4 ACPI"; static const char pci_device_8086_7120[] = "82810 GMCH [Graphics Memory Controller Hub]"; static const char pci_device_8086_7121[] = "82810 CGC [Chipset Graphics Controller]"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_7121_8086_4341[] = "Cayman (CA810) Mainboard"; +#endif static const char pci_device_8086_7122[] = "82810 DC-100 GMCH [Graphics Memory Controller Hub]"; static const char pci_device_8086_7123[] = "82810 DC-100 CGC [Chipset Graphics Controller]"; static const char pci_device_8086_7124[] = "82810E DC-133 GMCH [Graphics Memory Controller Hub]"; @@ -14603,13 +14858,6 @@ static const char pci_device_9004_5475[] = "AIC-755x"; static const char pci_device_9004_5478[] = "AIC-7850"; static const char pci_device_9004_5575[] = "AVA-2930"; static const char pci_device_9004_5578[] = "AIC-7855"; -static const char pci_device_9004_5647[] = "ANA-7711 TCP Offload Engine"; -#ifdef INIT_SUBSYS_INFO -static const char pci_subsys_9004_5647_9004_7710[] = "ANA-7711F TCP Offload Engine - Optical"; -#endif -#ifdef INIT_SUBSYS_INFO -static const char pci_subsys_9004_5647_9004_7711[] = "ANA-7711LP TCP Offload Engine - Copper"; -#endif static const char pci_device_9004_5675[] = "AIC-755x"; static const char pci_device_9004_5678[] = "AIC-7856"; static const char pci_device_9004_5775[] = "AIC-755x"; @@ -14683,6 +14931,8 @@ static const char pci_device_9004_7378[] = "AHA-3985 / AIC-7873"; static const char pci_device_9004_7478[] = "AHA-2944/2944W / AIC-7874"; static const char pci_device_9004_7578[] = "AHA-3944/3944W / AIC-7875"; static const char pci_device_9004_7678[] = "AHA-4944W/UW / AIC-7876"; +static const char pci_device_9004_7710[] = "ANA-7711F Network Accelerator Card (NAC) - Optical"; +static const char pci_device_9004_7711[] = "ANA-7711C Network Accelerator Card (NAC) - Copper"; static const char pci_device_9004_7778[] = "AIC-787x"; static const char pci_device_9004_7810[] = "AIC-7810"; static const char pci_device_9004_7815[] = "AIC-7815 RAID+Memory Controller IC"; @@ -14884,11 +15134,18 @@ static const char pci_device_9005_8013[] = "ASC-29320B U320"; static const char pci_device_9005_8014[] = "ASC-29320LP U320"; static const char pci_device_9005_801e[] = "AIC-7901A U320"; static const char pci_device_9005_801f[] = "AIC-7902 U320"; +static const char pci_device_9005_8080[] = "ASC-29320A U320 w/HostRAID"; +static const char pci_device_9005_808f[] = "AIC-7901 U320 w/HostRAID"; static const char pci_device_9005_8090[] = "ASC-39320 U320 w/HostRAID"; static const char pci_device_9005_8091[] = "ASC-39320D U320 w/HostRAID"; static const char pci_device_9005_8092[] = "ASC-29320 U320 w/HostRAID"; static const char pci_device_9005_8093[] = "ASC-29320B U320 w/HostRAID"; static const char pci_device_9005_8094[] = "ASC-29320LP U320 w/HostRAID"; +static const char pci_device_9005_8095[] = "ASC-39320(B) U320 w/HostRAID"; +static const char pci_device_9005_8096[] = "ASC-39320A U320 w/HostRAID"; +static const char pci_device_9005_8097[] = "ASC-29320ALP U320 w/HostRAID"; +static const char pci_device_9005_809c[] = "ASC-39320D(B) U320 w/HostRAID"; +static const char pci_device_9005_809d[] = "AIC-7902(B) U320 w/HostRAID"; static const char pci_device_9005_809e[] = "AIC-7901A U320 w/HostRAID"; static const char pci_device_9005_809f[] = "AIC-7902 U320 w/HostRAID"; #endif @@ -15478,6 +15735,10 @@ static const pciSubsystemInfo pci_ss_info_1002_4c59_104d_80e7 = {0x104d, 0x80e7, pci_subsys_1002_4c59_104d_80e7, 0}; #undef pci_ss_info_104d_80e7 #define pci_ss_info_104d_80e7 pci_ss_info_1002_4c59_104d_80e7 +static const pciSubsystemInfo pci_ss_info_1002_4e45_1002_0002 = + {0x1002, 0x0002, pci_subsys_1002_4e45_1002_0002, 0}; +#undef pci_ss_info_1002_0002 +#define pci_ss_info_1002_0002 pci_ss_info_1002_4e45_1002_0002 static const pciSubsystemInfo pci_ss_info_1002_5044_1002_0028 = {0x1002, 0x0028, pci_subsys_1002_5044_1002_0028, 0}; #undef pci_ss_info_1002_0028 @@ -15734,6 +15995,10 @@ static const pciSubsystemInfo pci_ss_info_1002_524c_1002_0088 = {0x1002, 0x0088, pci_subsys_1002_524c_1002_0088, 0}; #undef pci_ss_info_1002_0088 #define pci_ss_info_1002_0088 pci_ss_info_1002_524c_1002_0088 +static const pciSubsystemInfo pci_ss_info_1002_5346_1002_0048 = + {0x1002, 0x0048, pci_subsys_1002_5346_1002_0048, 0}; +#undef pci_ss_info_1002_0048 +#define pci_ss_info_1002_0048 pci_ss_info_1002_5346_1002_0048 static const pciSubsystemInfo pci_ss_info_1002_534d_1002_0008 = {0x1002, 0x0008, pci_subsys_1002_534d_1002_0008, 0}; #undef pci_ss_info_1002_0008 @@ -17523,6 +17788,10 @@ static const pciSubsystemInfo pci_ss_info_105a_0d38_105a_4d39 = {0x105a, 0x4d39, pci_subsys_105a_0d38_105a_4d39, 0}; #undef pci_ss_info_105a_4d39 #define pci_ss_info_105a_4d39 pci_ss_info_105a_0d38_105a_4d39 +static const pciSubsystemInfo pci_ss_info_105a_3376_1043_809e = + {0x1043, 0x809e, pci_subsys_105a_3376_1043_809e, 0}; +#undef pci_ss_info_1043_809e +#define pci_ss_info_1043_809e pci_ss_info_105a_3376_1043_809e static const pciSubsystemInfo pci_ss_info_105a_4d30_105a_4d33 = {0x105a, 0x4d33, pci_subsys_105a_4d30_105a_4d33, 0}; #undef pci_ss_info_105a_4d33 @@ -17551,6 +17820,10 @@ static const pciSubsystemInfo pci_ss_info_105a_4d68_105a_4d68 = {0x105a, 0x4d68, pci_subsys_105a_4d68_105a_4d68, 0}; #undef pci_ss_info_105a_4d68 #define pci_ss_info_105a_4d68 pci_ss_info_105a_4d68_105a_4d68 +static const pciSubsystemInfo pci_ss_info_105a_4d69_105a_4d68 = + {0x105a, 0x4d68, pci_subsys_105a_4d69_105a_4d68, 0}; +#undef pci_ss_info_105a_4d68 +#define pci_ss_info_105a_4d68 pci_ss_info_105a_4d69_105a_4d68 static const pciSubsystemInfo pci_ss_info_105a_5275_105a_0275 = {0x105a, 0x0275, pci_subsys_105a_5275_105a_0275, 0}; #undef pci_ss_info_105a_0275 @@ -17676,6 +17949,10 @@ static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_000a = {0x13cc, 0x000a, pci_subsys_105d_493d_13cc_000a, 0}; #undef pci_ss_info_13cc_000a #define pci_ss_info_13cc_000a pci_ss_info_105d_493d_13cc_000a +static const pciSubsystemInfo pci_ss_info_105d_5348_105d_0037 = + {0x105d, 0x0037, pci_subsys_105d_5348_105d_0037, 0}; +#undef pci_ss_info_105d_0037 +#define pci_ss_info_105d_0037 pci_ss_info_105d_5348_105d_0037 #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_1073_0004_1073_0004 = {0x1073, 0x0004, pci_subsys_1073_0004_1073_0004, 0}; @@ -17735,6 +18012,10 @@ static const pciSubsystemInfo pci_ss_info_1077_2100_1077_0001 = {0x1077, 0x0001, pci_subsys_1077_2100_1077_0001, 0}; #undef pci_ss_info_1077_0001 #define pci_ss_info_1077_0001 pci_ss_info_1077_2100_1077_0001 +static const pciSubsystemInfo pci_ss_info_1077_2200_1077_0002 = + {0x1077, 0x0002, pci_subsys_1077_2200_1077_0002, 0}; +#undef pci_ss_info_1077_0002 +#define pci_ss_info_1077_0002 pci_ss_info_1077_2200_1077_0002 #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_108d_0004_108d_0004 = @@ -18173,6 +18454,12 @@ static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1722 = #undef pci_ss_info_14f1_1722 #define pci_ss_info_14f1_1722 pci_ss_info_109e_0879_14f1_1722 #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo pci_ss_info_10a9_0009_10a9_8002 = + {0x10a9, 0x8002, pci_subsys_10a9_0009_10a9_8002, 0}; +#undef pci_ss_info_10a9_8002 +#define pci_ss_info_10a9_8002 pci_ss_info_10a9_0009_10a9_8002 +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_10b4_1b1d_10b4_237e = {0x10b4, 0x237e, pci_subsys_10b4_1b1d_10b4_237e, 0}; #undef pci_ss_info_10b4_237e @@ -18319,6 +18606,10 @@ static const pciSubsystemInfo pci_ss_info_10b5_9054_10b5_2455 = {0x10b5, 0x2455, pci_subsys_10b5_9054_10b5_2455, 0}; #undef pci_ss_info_10b5_2455 #define pci_ss_info_10b5_2455 pci_ss_info_10b5_9054_10b5_2455 +static const pciSubsystemInfo pci_ss_info_10b5_9054_12d9_0002 = + {0x12d9, 0x0002, pci_subsys_10b5_9054_12d9_0002, 0}; +#undef pci_ss_info_12d9_0002 +#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9054_12d9_0002 static const pciSubsystemInfo pci_ss_info_10b5_906d_125c_0640 = {0x125c, 0x0640, pci_subsys_10b5_906d_125c_0640, 0}; #undef pci_ss_info_125c_0640 @@ -18331,6 +18622,10 @@ static const pciSubsystemInfo pci_ss_info_10b5_9080_129d_0002 = {0x129d, 0x0002, pci_subsys_10b5_9080_129d_0002, 0}; #undef pci_ss_info_129d_0002 #define pci_ss_info_129d_0002 pci_ss_info_10b5_9080_129d_0002 +static const pciSubsystemInfo pci_ss_info_10b5_9080_12d9_0002 = + {0x12d9, 0x0002, pci_subsys_10b5_9080_12d9_0002, 0}; +#undef pci_ss_info_12d9_0002 +#define pci_ss_info_12d9_0002 pci_ss_info_10b5_9080_12d9_0002 #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0002 = @@ -18678,6 +18973,7 @@ static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8006 = #undef pci_ss_info_13a2_8006 #define pci_ss_info_13a2_8006 pci_ss_info_10b8_0006_13a2_8006 #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_10b9_0111_10b9_0111 = {0x10b9, 0x0111, pci_subsys_10b9_0111_10b9_0111, 0}; #undef pci_ss_info_10b9_0111 @@ -18710,6 +19006,7 @@ static const pciSubsystemInfo pci_ss_info_10b9_7101_10b9_7101 = {0x10b9, 0x7101, pci_subsys_10b9_7101_10b9_7101, 0}; #undef pci_ss_info_10b9_7101 #define pci_ss_info_10b9_7101 pci_ss_info_10b9_7101_10b9_7101 +#endif static const pciSubsystemInfo pci_ss_info_10c8_0004_1014_00ba = {0x1014, 0x00ba, pci_subsys_10c8_0004_1014_00ba, 0}; #undef pci_ss_info_1014_00ba @@ -18946,6 +19243,10 @@ static const pciSubsystemInfo pci_ss_info_10de_0028_1043_4000 = {0x1043, 0x4000, pci_subsys_10de_0028_1043_4000, 0}; #undef pci_ss_info_1043_4000 #define pci_ss_info_1043_4000 pci_ss_info_10de_0028_1043_4000 +static const pciSubsystemInfo pci_ss_info_10de_0028_1048_0c21 = + {0x1048, 0x0c21, pci_subsys_10de_0028_1048_0c21, 0}; +#undef pci_ss_info_1048_0c21 +#define pci_ss_info_1048_0c21 pci_ss_info_10de_0028_1048_0c21 static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4804 = {0x1092, 0x4804, pci_subsys_10de_0028_1092_4804, 0}; #undef pci_ss_info_1092_4804 @@ -19178,6 +19479,10 @@ static const pciSubsystemInfo pci_ss_info_10de_0152_1048_0c56 = {0x1048, 0x0c56, pci_subsys_10de_0152_1048_0c56, 0}; #undef pci_ss_info_1048_0c56 #define pci_ss_info_1048_0c56 pci_ss_info_10de_0152_1048_0c56 +static const pciSubsystemInfo pci_ss_info_10de_0171_10b0_0002 = + {0x10b0, 0x0002, pci_subsys_10de_0171_10b0_0002, 0}; +#undef pci_ss_info_10b0_0002 +#define pci_ss_info_10b0_0002 pci_ss_info_10de_0171_10b0_0002 static const pciSubsystemInfo pci_ss_info_10de_0171_1462_8661 = {0x1462, 0x8661, pci_subsys_10de_0171_1462_8661, 0}; #undef pci_ss_info_1462_8661 @@ -19403,6 +19708,14 @@ static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8061 = {0x1102, 0x8061, pci_subsys_1102_0002_1102_8061, 0}; #undef pci_ss_info_1102_8061 #define pci_ss_info_1102_8061 pci_ss_info_1102_0002_1102_8061 +static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8064 = + {0x1102, 0x8064, pci_subsys_1102_0002_1102_8064, 0}; +#undef pci_ss_info_1102_8064 +#define pci_ss_info_1102_8064 pci_ss_info_1102_0002_1102_8064 +static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8065 = + {0x1102, 0x8065, pci_subsys_1102_0002_1102_8065, 0}; +#undef pci_ss_info_1102_8065 +#define pci_ss_info_1102_8065 pci_ss_info_1102_0002_1102_8065 static const pciSubsystemInfo pci_ss_info_1102_0004_1102_0051 = {0x1102, 0x0051, pci_subsys_1102_0004_1102_0051, 0}; #undef pci_ss_info_1102_0051 @@ -19434,6 +19747,7 @@ static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0005 = #undef pci_ss_info_1103_0005 #define pci_ss_info_1103_0005 pci_ss_info_1103_0004_1103_0005 #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_1106_0305_1043_8033 = {0x1043, 0x8033, pci_subsys_1106_0305_1043_8033, 0}; #undef pci_ss_info_1043_8033 @@ -19450,10 +19764,18 @@ static const pciSubsystemInfo pci_ss_info_1106_0305_147b_a401 = {0x147b, 0xa401, pci_subsys_1106_0305_147b_a401, 0}; #undef pci_ss_info_147b_a401 #define pci_ss_info_147b_a401 pci_ss_info_1106_0305_147b_a401 +static const pciSubsystemInfo pci_ss_info_1106_0571_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_0571_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_0571_1019_0985 static const pciSubsystemInfo pci_ss_info_1106_0571_1043_8052 = {0x1043, 0x8052, pci_subsys_1106_0571_1043_8052, 0}; #undef pci_ss_info_1043_8052 #define pci_ss_info_1043_8052 pci_ss_info_1106_0571_1043_8052 +static const pciSubsystemInfo pci_ss_info_1106_0571_1043_808c = + {0x1043, 0x808c, pci_subsys_1106_0571_1043_808c, 0}; +#undef pci_ss_info_1043_808c +#define pci_ss_info_1043_808c pci_ss_info_1106_0571_1043_808c static const pciSubsystemInfo pci_ss_info_1106_0571_1106_0571 = {0x1106, 0x0571, pci_subsys_1106_0571_1106_0571, 0}; #undef pci_ss_info_1106_0571 @@ -19478,6 +19800,18 @@ static const pciSubsystemInfo pci_ss_info_1106_0596_1458_0596 = {0x1458, 0x0596, pci_subsys_1106_0596_1458_0596, 0}; #undef pci_ss_info_1458_0596 #define pci_ss_info_1458_0596 pci_ss_info_1106_0596_1458_0596 +static const pciSubsystemInfo pci_ss_info_1106_0605_1043_802c = + {0x1043, 0x802c, pci_subsys_1106_0605_1043_802c, 0}; +#undef pci_ss_info_1043_802c +#define pci_ss_info_1043_802c pci_ss_info_1106_0605_1043_802c +static const pciSubsystemInfo pci_ss_info_1106_0686_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_0686_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_0686_1019_0985 +static const pciSubsystemInfo pci_ss_info_1106_0686_1043_802c = + {0x1043, 0x802c, pci_subsys_1106_0686_1043_802c, 0}; +#undef pci_ss_info_1043_802c +#define pci_ss_info_1043_802c pci_ss_info_1106_0686_1043_802c static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8033 = {0x1043, 0x8033, pci_subsys_1106_0686_1043_8033, 0}; #undef pci_ss_info_1043_8033 @@ -19510,6 +19844,10 @@ static const pciSubsystemInfo pci_ss_info_1106_0686_147b_a702 = {0x147b, 0xa702, pci_subsys_1106_0686_147b_a702, 0}; #undef pci_ss_info_147b_a702 #define pci_ss_info_147b_a702 pci_ss_info_1106_0686_147b_a702 +static const pciSubsystemInfo pci_ss_info_1106_0691_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_0691_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_0691_1019_0985 static const pciSubsystemInfo pci_ss_info_1106_0691_1179_0001 = {0x1179, 0x0001, pci_subsys_1106_0691_1179_0001, 0}; #undef pci_ss_info_1179_0001 @@ -19522,6 +19860,14 @@ static const pciSubsystemInfo pci_ss_info_1106_3038_0925_1234 = {0x0925, 0x1234, pci_subsys_1106_3038_0925_1234, 0}; #undef pci_ss_info_0925_1234 #define pci_ss_info_0925_1234 pci_ss_info_1106_3038_0925_1234 +static const pciSubsystemInfo pci_ss_info_1106_3038_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_3038_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_3038_1019_0985 +static const pciSubsystemInfo pci_ss_info_1106_3038_1043_808c = + {0x1043, 0x808c, pci_subsys_1106_3038_1043_808c, 0}; +#undef pci_ss_info_1043_808c +#define pci_ss_info_1043_808c pci_ss_info_1106_3038_1043_808c static const pciSubsystemInfo pci_ss_info_1106_3038_1179_0001 = {0x1179, 0x0001, pci_subsys_1106_3038_1179_0001, 0}; #undef pci_ss_info_1179_0001 @@ -19538,6 +19884,10 @@ static const pciSubsystemInfo pci_ss_info_1106_3043_1186_1400 = {0x1186, 0x1400, pci_subsys_1106_3043_1186_1400, 0}; #undef pci_ss_info_1186_1400 #define pci_ss_info_1186_1400 pci_ss_info_1106_3043_1186_1400 +static const pciSubsystemInfo pci_ss_info_1106_3057_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_3057_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_3057_1019_0985 static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8033 = {0x1043, 0x8033, pci_subsys_1106_3057_1043_8033, 0}; #undef pci_ss_info_1043_8033 @@ -19558,10 +19908,16 @@ static const pciSubsystemInfo pci_ss_info_1106_3057_1179_0001 = {0x1179, 0x0001, pci_subsys_1106_3057_1179_0001, 0}; #undef pci_ss_info_1179_0001 #define pci_ss_info_1179_0001 pci_ss_info_1106_3057_1179_0001 +#endif static const pciSubsystemInfo pci_ss_info_1106_3058_0e11_b194 = {0x0e11, 0xb194, pci_subsys_1106_3058_0e11_b194, 0}; #undef pci_ss_info_0e11_b194 #define pci_ss_info_0e11_b194 pci_ss_info_1106_3058_0e11_b194 +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo pci_ss_info_1106_3058_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_3058_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_3058_1019_0985 static const pciSubsystemInfo pci_ss_info_1106_3058_1106_4511 = {0x1106, 0x4511, pci_subsys_1106_3058_1106_4511, 0}; #undef pci_ss_info_1106_4511 @@ -19578,6 +19934,10 @@ static const pciSubsystemInfo pci_ss_info_1106_3058_15dd_7609 = {0x15dd, 0x7609, pci_subsys_1106_3058_15dd_7609, 0}; #undef pci_ss_info_15dd_7609 #define pci_ss_info_15dd_7609 pci_ss_info_1106_3058_15dd_7609 +static const pciSubsystemInfo pci_ss_info_1106_3059_1043_8095 = + {0x1043, 0x8095, pci_subsys_1106_3059_1043_8095, 0}; +#undef pci_ss_info_1043_8095 +#define pci_ss_info_1043_8095 pci_ss_info_1106_3059_1043_8095 static const pciSubsystemInfo pci_ss_info_1106_3059_1458_a002 = {0x1458, 0xa002, pci_subsys_1106_3059_1458_a002, 0}; #undef pci_ss_info_1458_a002 @@ -19594,6 +19954,10 @@ static const pciSubsystemInfo pci_ss_info_1106_3065_1186_1401 = {0x1186, 0x1401, pci_subsys_1106_3065_1186_1401, 0}; #undef pci_ss_info_1186_1401 #define pci_ss_info_1186_1401 pci_ss_info_1106_3065_1186_1401 +static const pciSubsystemInfo pci_ss_info_1106_3065_13b9_1421 = + {0x13b9, 0x1421, pci_subsys_1106_3065_13b9_1421, 0}; +#undef pci_ss_info_13b9_1421 +#define pci_ss_info_13b9_1421 pci_ss_info_1106_3065_13b9_1421 static const pciSubsystemInfo pci_ss_info_1106_3074_1043_8052 = {0x1043, 0x8052, pci_subsys_1106_3074_1043_8052, 0}; #undef pci_ss_info_1043_8052 @@ -19606,18 +19970,35 @@ static const pciSubsystemInfo pci_ss_info_1106_3099_1043_807f = {0x1043, 0x807f, pci_subsys_1106_3099_1043_807f, 0}; #undef pci_ss_info_1043_807f #define pci_ss_info_1043_807f pci_ss_info_1106_3099_1043_807f +static const pciSubsystemInfo pci_ss_info_1106_3104_1043_808c = + {0x1043, 0x808c, pci_subsys_1106_3104_1043_808c, 0}; +#undef pci_ss_info_1043_808c +#define pci_ss_info_1043_808c pci_ss_info_1106_3104_1043_808c static const pciSubsystemInfo pci_ss_info_1106_3104_1458_5004 = {0x1458, 0x5004, pci_subsys_1106_3104_1458_5004, 0}; #undef pci_ss_info_1458_5004 #define pci_ss_info_1458_5004 pci_ss_info_1106_3104_1458_5004 +static const pciSubsystemInfo pci_ss_info_1106_3177_1043_808c = + {0x1043, 0x808c, pci_subsys_1106_3177_1043_808c, 0}; +#undef pci_ss_info_1043_808c +#define pci_ss_info_1043_808c pci_ss_info_1106_3177_1043_808c static const pciSubsystemInfo pci_ss_info_1106_3177_1458_5001 = {0x1458, 0x5001, pci_subsys_1106_3177_1458_5001, 0}; #undef pci_ss_info_1458_5001 #define pci_ss_info_1458_5001 pci_ss_info_1106_3177_1458_5001 +static const pciSubsystemInfo pci_ss_info_1106_3189_1043_807f = + {0x1043, 0x807f, pci_subsys_1106_3189_1043_807f, 0}; +#undef pci_ss_info_1043_807f +#define pci_ss_info_1043_807f pci_ss_info_1106_3189_1043_807f static const pciSubsystemInfo pci_ss_info_1106_3189_1458_5000 = {0x1458, 0x5000, pci_subsys_1106_3189_1458_5000, 0}; #undef pci_ss_info_1458_5000 #define pci_ss_info_1458_5000 pci_ss_info_1106_3189_1458_5000 +static const pciSubsystemInfo pci_ss_info_1106_8598_1019_0985 = + {0x1019, 0x0985, pci_subsys_1106_8598_1019_0985, 0}; +#undef pci_ss_info_1019_0985 +#define pci_ss_info_1019_0985 pci_ss_info_1106_8598_1019_0985 +#endif #ifdef VENDOR_INCLUDE_NONVIDEO #endif static const pciSubsystemInfo pci_ss_info_1113_1211_103c_1207 = @@ -20321,6 +20702,12 @@ static const pciSubsystemInfo pci_ss_info_11c1_0442_1668_0440 = {0x1668, 0x0440, pci_subsys_11c1_0442_1668_0440, 0}; #undef pci_ss_info_1668_0440 #define pci_ss_info_1668_0440 pci_ss_info_11c1_0442_1668_0440 +#endif +static const pciSubsystemInfo pci_ss_info_11c1_0445_8086_2203 = + {0x8086, 0x2203, pci_subsys_11c1_0445_8086_2203, 0}; +#undef pci_ss_info_8086_2203 +#define pci_ss_info_8086_2203 pci_ss_info_11c1_0445_8086_2203 +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_11c1_0448_1014_0131 = {0x1014, 0x0131, pci_subsys_11c1_0448_1014_0131, 0}; #undef pci_ss_info_1014_0131 @@ -21467,6 +21854,10 @@ static const pciSubsystemInfo pci_ss_info_12ae_0001_1410_0104 = {0x1410, 0x0104, pci_subsys_12ae_0001_1410_0104, 0}; #undef pci_ss_info_1410_0104 #define pci_ss_info_1410_0104 pci_ss_info_12ae_0001_1410_0104 +static const pciSubsystemInfo pci_ss_info_12ae_0002_10a9_8002 = + {0x10a9, 0x8002, pci_subsys_12ae_0002_10a9_8002, 0}; +#undef pci_ss_info_10a9_8002 +#define pci_ss_info_10a9_8002 pci_ss_info_12ae_0002_10a9_8002 static const pciSubsystemInfo pci_ss_info_12ae_0002_12ae_0002 = {0x12ae, 0x0002, pci_subsys_12ae_0002_12ae_0002, 0}; #undef pci_ss_info_12ae_0002 @@ -21827,6 +22218,10 @@ static const pciSubsystemInfo pci_ss_info_13f6_0111_13f6_0111 = {0x13f6, 0x0111, pci_subsys_13f6_0111_13f6_0111, 0}; #undef pci_ss_info_13f6_0111 #define pci_ss_info_13f6_0111 pci_ss_info_13f6_0111_13f6_0111 +static const pciSubsystemInfo pci_ss_info_13f6_0111_1681_a000 = + {0x1681, 0xa000, pci_subsys_13f6_0111_1681_a000, 0}; +#undef pci_ss_info_1681_a000 +#define pci_ss_info_1681_a000 pci_ss_info_13f6_0111_1681_a000 #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2000 = @@ -21965,6 +22360,18 @@ static const pciSubsystemInfo pci_ss_info_14e4_1645_1028_0121 = #undef pci_ss_info_1028_0121 #define pci_ss_info_1028_0121 pci_ss_info_14e4_1645_1028_0121 #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8010 = + {0x10a9, 0x8010, pci_subsys_14e4_1645_10a9_8010, 0}; +#undef pci_ss_info_10a9_8010 +#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1645_10a9_8010 +static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8011 = + {0x10a9, 0x8011, pci_subsys_14e4_1645_10a9_8011, 0}; +#undef pci_ss_info_10a9_8011 +#define pci_ss_info_10a9_8011 pci_ss_info_14e4_1645_10a9_8011 +static const pciSubsystemInfo pci_ss_info_14e4_1645_10a9_8012 = + {0x10a9, 0x8012, pci_subsys_14e4_1645_10a9_8012, 0}; +#undef pci_ss_info_10a9_8012 +#define pci_ss_info_10a9_8012 pci_ss_info_14e4_1645_10a9_8012 static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1004 = {0x10b7, 0x1004, pci_subsys_14e4_1645_10b7_1004, 0}; #undef pci_ss_info_10b7_1004 @@ -22033,6 +22440,10 @@ static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_009a = #undef pci_ss_info_0e11_009a #define pci_ss_info_0e11_009a pci_ss_info_14e4_1647_0e11_009a #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo pci_ss_info_14e4_1647_10a9_8010 = + {0x10a9, 0x8010, pci_subsys_14e4_1647_10a9_8010, 0}; +#undef pci_ss_info_10a9_8010 +#define pci_ss_info_10a9_8010 pci_ss_info_14e4_1647_10a9_8010 static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_0009 = {0x14e4, 0x0009, pci_subsys_14e4_1647_14e4_0009, 0}; #undef pci_ss_info_14e4_0009 @@ -22159,6 +22570,10 @@ static const pciSubsystemInfo pci_ss_info_14e4_16c7_14e4_000a = {0x14e4, 0x000a, pci_subsys_14e4_16c7_14e4_000a, 0}; #undef pci_ss_info_14e4_000a #define pci_ss_info_14e4_000a pci_ss_info_14e4_16c7_14e4_000a +static const pciSubsystemInfo pci_ss_info_14e4_4401_1043_80a8 = + {0x1043, 0x80a8, pci_subsys_14e4_4401_1043_80a8, 0}; +#undef pci_ss_info_1043_80a8 +#define pci_ss_info_1043_80a8 pci_ss_info_14e4_4401_1043_80a8 #endif #ifdef VENDOR_INCLUDE_NONVIDEO #endif @@ -22888,6 +23303,14 @@ static const pciSubsystemInfo pci_ss_info_8086_1130_104d_80df = {0x104d, 0x80df, pci_subsys_8086_1130_104d_80df, 0}; #undef pci_ss_info_104d_80df #define pci_ss_info_104d_80df pci_ss_info_8086_1130_104d_80df +static const pciSubsystemInfo pci_ss_info_8086_1130_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_1130_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_1130_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_1130_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_1130_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_1130_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_1132_1025_1016 = {0x1025, 0x1016, pci_subsys_8086_1132_1025_1016, 0}; #undef pci_ss_info_1025_1016 @@ -22896,6 +23319,14 @@ static const pciSubsystemInfo pci_ss_info_8086_1132_104d_80df = {0x104d, 0x80df, pci_subsys_8086_1132_104d_80df, 0}; #undef pci_ss_info_104d_80df #define pci_ss_info_104d_80df pci_ss_info_8086_1132_104d_80df +static const pciSubsystemInfo pci_ss_info_8086_1132_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_1132_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_1132_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_1132_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_1132_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_1132_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_1161_8086_1161 = {0x8086, 0x1161, pci_subsys_8086_1161_8086_1161, 0}; #undef pci_ss_info_8086_1161 @@ -23632,6 +24063,14 @@ static const pciSubsystemInfo pci_ss_info_8086_2442_147b_0507 = {0x147b, 0x0507, pci_subsys_8086_2442_147b_0507, 0}; #undef pci_ss_info_147b_0507 #define pci_ss_info_147b_0507 pci_ss_info_8086_2442_147b_0507 +static const pciSubsystemInfo pci_ss_info_8086_2442_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_2442_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_2442_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_2442_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_2442_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_2442_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_2443_1014_01c6 = {0x1014, 0x01c6, pci_subsys_8086_2443_1014_01c6, 0}; #undef pci_ss_info_1014_01c6 @@ -23652,6 +24091,14 @@ static const pciSubsystemInfo pci_ss_info_8086_2443_147b_0507 = {0x147b, 0x0507, pci_subsys_8086_2443_147b_0507, 0}; #undef pci_ss_info_147b_0507 #define pci_ss_info_147b_0507 pci_ss_info_8086_2443_147b_0507 +static const pciSubsystemInfo pci_ss_info_8086_2443_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_2443_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_2443_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_2443_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_2443_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_2443_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_2444_1025_1016 = {0x1025, 0x1016, pci_subsys_8086_2444_1025_1016, 0}; #undef pci_ss_info_1025_1016 @@ -23664,6 +24111,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2444_147b_0507 = {0x147b, 0x0507, pci_subsys_8086_2444_147b_0507, 0}; #undef pci_ss_info_147b_0507 #define pci_ss_info_147b_0507 pci_ss_info_8086_2444_147b_0507 +static const pciSubsystemInfo pci_ss_info_8086_2444_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_2444_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_2444_8086_4532 static const pciSubsystemInfo pci_ss_info_8086_2445_1014_01c6 = {0x1014, 0x01c6, pci_subsys_8086_2445_1014_01c6, 0}; #undef pci_ss_info_1014_01c6 @@ -23684,6 +24135,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2445_147b_0507 = {0x147b, 0x0507, pci_subsys_8086_2445_147b_0507, 0}; #undef pci_ss_info_147b_0507 #define pci_ss_info_147b_0507 pci_ss_info_8086_2445_147b_0507 +static const pciSubsystemInfo pci_ss_info_8086_2445_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_2445_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_2445_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_2446_1025_1016 = {0x1025, 0x1016, pci_subsys_8086_2446_1025_1016, 0}; #undef pci_ss_info_1025_1016 @@ -23744,6 +24199,18 @@ static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0245 = {0x1014, 0x0245, pci_subsys_8086_2449_1014_0245, 0}; #undef pci_ss_info_1014_0245 #define pci_ss_info_1014_0245 pci_ss_info_8086_2449_1014_0245 +static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0265 = + {0x1014, 0x0265, pci_subsys_8086_2449_1014_0265, 0}; +#undef pci_ss_info_1014_0265 +#define pci_ss_info_1014_0265 pci_ss_info_8086_2449_1014_0265 +static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0267 = + {0x1014, 0x0267, pci_subsys_8086_2449_1014_0267, 0}; +#undef pci_ss_info_1014_0267 +#define pci_ss_info_1014_0267 pci_ss_info_8086_2449_1014_0267 +static const pciSubsystemInfo pci_ss_info_8086_2449_1014_026a = + {0x1014, 0x026a, pci_subsys_8086_2449_1014_026a, 0}; +#undef pci_ss_info_1014_026a +#define pci_ss_info_1014_026a pci_ss_info_8086_2449_1014_026a static const pciSubsystemInfo pci_ss_info_8086_2449_109f_315d = {0x109f, 0x315d, pci_subsys_8086_2449_109f_315d, 0}; #undef pci_ss_info_109f_315d @@ -23752,6 +24219,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2449_109f_3181 = {0x109f, 0x3181, pci_subsys_8086_2449_109f_3181, 0}; #undef pci_ss_info_109f_3181 #define pci_ss_info_109f_3181 pci_ss_info_8086_2449_109f_3181 +static const pciSubsystemInfo pci_ss_info_8086_2449_1179_ff01 = + {0x1179, 0xff01, pci_subsys_8086_2449_1179_ff01, 0}; +#undef pci_ss_info_1179_ff01 +#define pci_ss_info_1179_ff01 pci_ss_info_8086_2449_1179_ff01 static const pciSubsystemInfo pci_ss_info_8086_2449_1186_7801 = {0x1186, 0x7801, pci_subsys_8086_2449_1186_7801, 0}; #undef pci_ss_info_1186_7801 @@ -23816,6 +24287,14 @@ static const pciSubsystemInfo pci_ss_info_8086_244b_147b_0507 = {0x147b, 0x0507, pci_subsys_8086_244b_147b_0507, 0}; #undef pci_ss_info_147b_0507 #define pci_ss_info_147b_0507 pci_ss_info_8086_244b_147b_0507 +static const pciSubsystemInfo pci_ss_info_8086_244b_8086_4532 = + {0x8086, 0x4532, pci_subsys_8086_244b_8086_4532, 0}; +#undef pci_ss_info_8086_4532 +#define pci_ss_info_8086_4532 pci_ss_info_8086_244b_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_244b_8086_4557 = + {0x8086, 0x4557, pci_subsys_8086_244b_8086_4557, 0}; +#undef pci_ss_info_8086_4557 +#define pci_ss_info_8086_4557 pci_ss_info_8086_244b_8086_4557 static const pciSubsystemInfo pci_ss_info_8086_2482_1014_0220 = {0x1014, 0x0220, pci_subsys_8086_2482_1014_0220, 0}; #undef pci_ss_info_1014_0220 @@ -24024,6 +24503,10 @@ static const pciSubsystemInfo pci_ss_info_8086_5201_8086_0001 = {0x8086, 0x0001, pci_subsys_8086_5201_8086_0001, 0}; #undef pci_ss_info_8086_0001 #define pci_ss_info_8086_0001 pci_ss_info_8086_5201_8086_0001 +static const pciSubsystemInfo pci_ss_info_8086_7121_8086_4341 = + {0x8086, 0x4341, pci_subsys_8086_7121_8086_4341, 0}; +#undef pci_ss_info_8086_4341 +#define pci_ss_info_8086_4341 pci_ss_info_8086_7121_8086_4341 static const pciSubsystemInfo pci_ss_info_8086_7190_0e11_0500 = {0x0e11, 0x0500, pci_subsys_8086_7190_0e11_0500, 0}; #undef pci_ss_info_0e11_0500 @@ -24089,14 +24572,6 @@ static const pciSubsystemInfo pci_ss_info_9004_5078_9004_7850 = {0x9004, 0x7850, pci_subsys_9004_5078_9004_7850, 0}; #undef pci_ss_info_9004_7850 #define pci_ss_info_9004_7850 pci_ss_info_9004_5078_9004_7850 -static const pciSubsystemInfo pci_ss_info_9004_5647_9004_7710 = - {0x9004, 0x7710, pci_subsys_9004_5647_9004_7710, 0}; -#undef pci_ss_info_9004_7710 -#define pci_ss_info_9004_7710 pci_ss_info_9004_5647_9004_7710 -static const pciSubsystemInfo pci_ss_info_9004_5647_9004_7711 = - {0x9004, 0x7711, pci_subsys_9004_5647_9004_7711, 0}; -#undef pci_ss_info_9004_7711 -#define pci_ss_info_9004_7711 pci_ss_info_9004_5647_9004_7711 static const pciSubsystemInfo pci_ss_info_9004_6075_9004_7560 = {0x9004, 0x7560, pci_subsys_9004_6075_9004_7560, 0}; #undef pci_ss_info_9004_7560 @@ -24499,6 +24974,7 @@ static const pciSubsystemInfo *pci_ss_list_1000_1960[] = { #define pci_ss_list_1001_0016 NULL #define pci_ss_list_1001_0017 NULL #define pci_ss_list_1001_9100 NULL +#define pci_ss_list_1002_4136 NULL #define pci_ss_list_1002_4144 NULL #define pci_ss_list_1002_4145 NULL #define pci_ss_list_1002_4146 NULL @@ -24674,13 +25150,18 @@ static const pciSubsystemInfo *pci_ss_list_1002_4c59[] = { #define pci_ss_list_1002_4d46 NULL #define pci_ss_list_1002_4d4c NULL #define pci_ss_list_1002_4e44 NULL -#define pci_ss_list_1002_4e45 NULL +static const pciSubsystemInfo *pci_ss_list_1002_4e45[] = { + &pci_ss_info_1002_4e45_1002_0002, + NULL +}; #define pci_ss_list_1002_4e46 NULL #define pci_ss_list_1002_4e47 NULL +#define pci_ss_list_1002_4e48 NULL #define pci_ss_list_1002_4e64 NULL #define pci_ss_list_1002_4e65 NULL #define pci_ss_list_1002_4e66 NULL #define pci_ss_list_1002_4e67 NULL +#define pci_ss_list_1002_4e68 NULL #define pci_ss_list_1002_5041 NULL #define pci_ss_list_1002_5042 NULL #define pci_ss_list_1002_5043 NULL @@ -24818,7 +25299,10 @@ static const pciSubsystemInfo *pci_ss_list_1002_524c[] = { NULL }; #define pci_ss_list_1002_5345 NULL -#define pci_ss_list_1002_5346 NULL +static const pciSubsystemInfo *pci_ss_list_1002_5346[] = { + &pci_ss_info_1002_5346_1002_0048, + NULL +}; #define pci_ss_list_1002_5347 NULL #define pci_ss_list_1002_5348 NULL #define pci_ss_list_1002_534b NULL @@ -24860,6 +25344,8 @@ static const pciSubsystemInfo *pci_ss_list_1002_5654[] = { #define pci_ss_list_1002_5655 NULL #define pci_ss_list_1002_5656 NULL #define pci_ss_list_1002_700f NULL +#define pci_ss_list_1002_7010 NULL +#define pci_ss_list_1002_cab2 NULL #define pci_ss_list_1003_0201 NULL #define pci_ss_list_1004_0005 NULL #define pci_ss_list_1004_0006 NULL @@ -24964,6 +25450,7 @@ static const pciSubsystemInfo *pci_ss_list_1011_0014[] = { NULL }; #define pci_ss_list_1011_0016 NULL +#define pci_ss_list_1011_0017 NULL static const pciSubsystemInfo *pci_ss_list_1011_0019[] = { &pci_ss_info_1011_0019_1011_500a, &pci_ss_info_1011_0019_1011_500b, @@ -25429,6 +25916,7 @@ static const pciSubsystemInfo *pci_ss_list_1028_0004[] = { #define pci_ss_list_1028_0006 NULL #define pci_ss_list_1028_0007 NULL #define pci_ss_list_1028_0008 NULL +#define pci_ss_list_1028_0009 NULL static const pciSubsystemInfo *pci_ss_list_1028_000a[] = { &pci_ss_info_1028_000a_1028_0106, &pci_ss_info_1028_000a_1028_011b, @@ -25436,11 +25924,13 @@ static const pciSubsystemInfo *pci_ss_list_1028_000a[] = { NULL }; #define pci_ss_list_1028_000c NULL +#define pci_ss_list_1028_000d NULL #define pci_ss_list_1028_000e NULL #define pci_ss_list_1028_000f NULL #define pci_ss_list_102a_0000 NULL #define pci_ss_list_102a_0010 NULL #define pci_ss_list_102b_0010 NULL +#define pci_ss_list_102b_0100 NULL #define pci_ss_list_102b_0518 NULL #define pci_ss_list_102b_0519 NULL static const pciSubsystemInfo *pci_ss_list_102b_051a[] = { @@ -25698,6 +26188,7 @@ static const pciSubsystemInfo *pci_ss_list_1039_0300[] = { #define pci_ss_list_1039_0635 NULL #define pci_ss_list_1039_0645 NULL #define pci_ss_list_1039_0646 NULL +#define pci_ss_list_1039_0648 NULL #define pci_ss_list_1039_0650 NULL #define pci_ss_list_1039_0651 NULL #define pci_ss_list_1039_0730 NULL @@ -25705,6 +26196,7 @@ static const pciSubsystemInfo *pci_ss_list_1039_0300[] = { #define pci_ss_list_1039_0735 NULL #define pci_ss_list_1039_0740 NULL #define pci_ss_list_1039_0745 NULL +#define pci_ss_list_1039_0755 NULL static const pciSubsystemInfo *pci_ss_list_1039_0900[] = { &pci_ss_info_1039_0900_1039_0900, NULL @@ -25841,6 +26333,7 @@ static const pciSubsystemInfo *pci_ss_list_103c_1048[] = { #define pci_ss_list_103c_122a NULL #define pci_ss_list_103c_122e NULL #define pci_ss_list_103c_1290 NULL +#define pci_ss_list_103c_12b4 NULL #define pci_ss_list_103c_2910 NULL #define pci_ss_list_103c_2925 NULL #define pci_ss_list_1042_1000 NULL @@ -26117,7 +26610,10 @@ static const pciSubsystemInfo *pci_ss_list_105a_0d38[] = { NULL }; #define pci_ss_list_105a_1275 NULL -#define pci_ss_list_105a_3376 NULL +static const pciSubsystemInfo *pci_ss_list_105a_3376[] = { + &pci_ss_info_105a_3376_1043_809e, + NULL +}; static const pciSubsystemInfo *pci_ss_list_105a_4d30[] = { &pci_ss_info_105a_4d30_105a_4d33, &pci_ss_info_105a_4d30_105a_4d39, @@ -26137,7 +26633,10 @@ static const pciSubsystemInfo *pci_ss_list_105a_4d68[] = { &pci_ss_info_105a_4d68_105a_4d68, NULL }; -#define pci_ss_list_105a_4d69 NULL +static const pciSubsystemInfo *pci_ss_list_105a_4d69[] = { + &pci_ss_info_105a_4d69_105a_4d68, + NULL +}; static const pciSubsystemInfo *pci_ss_list_105a_5275[] = { &pci_ss_info_105a_5275_105a_0275, NULL @@ -26187,7 +26686,10 @@ static const pciSubsystemInfo *pci_ss_list_105d_493d[] = { &pci_ss_info_105d_493d_13cc_000a, NULL }; -#define pci_ss_list_105d_5348 NULL +static const pciSubsystemInfo *pci_ss_list_105d_5348[] = { + &pci_ss_info_105d_5348_105d_0037, + NULL +}; #define pci_ss_list_1060_0001 NULL #define pci_ss_list_1060_0002 NULL #define pci_ss_list_1060_0101 NULL @@ -26324,7 +26826,10 @@ static const pciSubsystemInfo *pci_ss_list_1077_2100[] = { &pci_ss_info_1077_2100_1077_0001, NULL }; -#define pci_ss_list_1077_2200 NULL +static const pciSubsystemInfo *pci_ss_list_1077_2200[] = { + &pci_ss_info_1077_2200_1077_0002, + NULL +}; #define pci_ss_list_1077_2300 NULL #define pci_ss_list_1077_2312 NULL #endif @@ -26457,6 +26962,7 @@ static const pciSubsystemInfo *pci_ss_list_108d_0019[] = { #define pci_ss_list_1093_b091 NULL #define pci_ss_list_1093_c801 NULL #define pci_ss_list_1093_c831 NULL +#define pci_ss_list_1095_0240 NULL #define pci_ss_list_1095_0640 NULL #define pci_ss_list_1095_0643 NULL #define pci_ss_list_1095_0646 NULL @@ -26609,6 +27115,7 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = { #define pci_ss_list_109e_8230 NULL #define pci_ss_list_109e_8472 NULL #define pci_ss_list_109e_8474 NULL +#define pci_ss_list_10a5_3052 NULL #define pci_ss_list_10a5_5449 NULL #define pci_ss_list_10a8_0000 NULL #define pci_ss_list_10a9_0001 NULL @@ -26619,7 +27126,11 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = { #define pci_ss_list_10a9_0006 NULL #define pci_ss_list_10a9_0007 NULL #define pci_ss_list_10a9_0008 NULL -#define pci_ss_list_10a9_0009 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo *pci_ss_list_10a9_0009[] = { + &pci_ss_info_10a9_0009_10a9_8002, + NULL +}; #define pci_ss_list_10a9_0010 NULL #define pci_ss_list_10a9_0011 NULL #define pci_ss_list_10a9_0012 NULL @@ -26631,10 +27142,12 @@ static const pciSubsystemInfo *pci_ss_list_109e_0879[] = { #define pci_ss_list_10a9_1006 NULL #define pci_ss_list_10a9_1007 NULL #define pci_ss_list_10a9_1008 NULL +#define pci_ss_list_10a9_100a NULL #define pci_ss_list_10a9_2001 NULL #define pci_ss_list_10a9_2002 NULL #define pci_ss_list_10a9_8001 NULL #define pci_ss_list_10a9_8002 NULL +#endif #define pci_ss_list_10aa_0000 NULL #define pci_ss_list_10ad_0001 NULL #define pci_ss_list_10ad_0003 NULL @@ -26702,6 +27215,7 @@ static const pciSubsystemInfo *pci_ss_list_10b5_9050[] = { }; static const pciSubsystemInfo *pci_ss_list_10b5_9054[] = { &pci_ss_info_10b5_9054_10b5_2455, + &pci_ss_info_10b5_9054_12d9_0002, NULL }; #define pci_ss_list_10b5_9060 NULL @@ -26713,6 +27227,7 @@ static const pciSubsystemInfo *pci_ss_list_10b5_906d[] = { static const pciSubsystemInfo *pci_ss_list_10b5_9080[] = { &pci_ss_info_10b5_9080_10b5_9080, &pci_ss_info_10b5_9080_129d_0002, + &pci_ss_info_10b5_9080_12d9_0002, NULL }; #endif @@ -26759,6 +27274,7 @@ static const pciSubsystemInfo *pci_ss_list_10b6_000c[] = { #define pci_ss_list_10b6_1001 NULL #endif #define pci_ss_list_10b7_0001 NULL +#define pci_ss_list_10b7_0910 NULL #define pci_ss_list_10b7_1006 NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_10b7_1007[] = { @@ -26926,6 +27442,7 @@ static const pciSubsystemInfo *pci_ss_list_10b8_0006[] = { #define pci_ss_list_10b8_a011 NULL #define pci_ss_list_10b8_b106 NULL #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_10b9_0111[] = { &pci_ss_info_10b9_0111_10b9_0111, NULL @@ -26995,6 +27512,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9_5229[] = { #define pci_ss_list_10b9_5251 NULL #define pci_ss_list_10b9_5253 NULL #define pci_ss_list_10b9_5261 NULL +#define pci_ss_list_10b9_5450 NULL static const pciSubsystemInfo *pci_ss_list_10b9_5451[] = { &pci_ss_info_10b9_5451_1014_0506, NULL @@ -27010,6 +27528,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9_7101[] = { &pci_ss_info_10b9_7101_10b9_7101, NULL }; +#endif #define pci_ss_list_10ba_0301 NULL #define pci_ss_list_10bd_0e34 NULL #define pci_ss_list_10c3_1100 NULL @@ -27123,6 +27642,7 @@ static const pciSubsystemInfo *pci_ss_list_10de_0028[] = { &pci_ss_info_10de_0028_1043_0201, &pci_ss_info_10de_0028_1043_0205, &pci_ss_info_10de_0028_1043_4000, + &pci_ss_info_10de_0028_1048_0c21, &pci_ss_info_10de_0028_1092_4804, &pci_ss_info_10de_0028_1092_4a00, &pci_ss_info_10de_0028_1092_4a02, @@ -27239,6 +27759,7 @@ static const pciSubsystemInfo *pci_ss_list_10de_0152[] = { #define pci_ss_list_10de_0153 NULL #define pci_ss_list_10de_0170 NULL static const pciSubsystemInfo *pci_ss_list_10de_0171[] = { + &pci_ss_info_10de_0171_10b0_0002, &pci_ss_info_10de_0171_1462_8661, &pci_ss_info_10de_0171_1462_8730, &pci_ss_info_10de_0171_147b_8f00, @@ -27441,6 +27962,8 @@ static const pciSubsystemInfo *pci_ss_list_1102_0002[] = { &pci_ss_info_1102_0002_1102_8040, &pci_ss_info_1102_0002_1102_8051, &pci_ss_info_1102_0002_1102_8061, + &pci_ss_info_1102_0002_1102_8064, + &pci_ss_info_1102_0002_1102_8065, NULL }; static const pciSubsystemInfo *pci_ss_list_1102_0004[] = { @@ -27476,12 +27999,14 @@ static const pciSubsystemInfo *pci_ss_list_1103_0004[] = { #define pci_ss_list_1103_0006 NULL #define pci_ss_list_1103_0007 NULL #define pci_ss_list_1103_0008 NULL +#define pci_ss_list_1103_0009 NULL #endif #define pci_ss_list_1105_1105 NULL #define pci_ss_list_1105_8300 NULL #define pci_ss_list_1105_8400 NULL #define pci_ss_list_1106_0102 NULL #define pci_ss_list_1106_0130 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1106_0305[] = { &pci_ss_info_1106_0305_1043_8033, &pci_ss_info_1106_0305_1043_803e, @@ -27494,7 +28019,9 @@ static const pciSubsystemInfo *pci_ss_list_1106_0305[] = { #define pci_ss_list_1106_0505 NULL #define pci_ss_list_1106_0561 NULL static const pciSubsystemInfo *pci_ss_list_1106_0571[] = { + &pci_ss_info_1106_0571_1019_0985, &pci_ss_info_1106_0571_1043_8052, + &pci_ss_info_1106_0571_1043_808c, &pci_ss_info_1106_0571_1106_0571, &pci_ss_info_1106_0571_1179_0001, &pci_ss_info_1106_0571_1458_5002, @@ -27515,9 +28042,14 @@ static const pciSubsystemInfo *pci_ss_list_1106_0596[] = { #define pci_ss_list_1106_0597 NULL #define pci_ss_list_1106_0598 NULL #define pci_ss_list_1106_0601 NULL -#define pci_ss_list_1106_0605 NULL +static const pciSubsystemInfo *pci_ss_list_1106_0605[] = { + &pci_ss_info_1106_0605_1043_802c, + NULL +}; #define pci_ss_list_1106_0680 NULL static const pciSubsystemInfo *pci_ss_list_1106_0686[] = { + &pci_ss_info_1106_0686_1019_0985, + &pci_ss_info_1106_0686_1043_802c, &pci_ss_info_1106_0686_1043_8033, &pci_ss_info_1106_0686_1043_803e, &pci_ss_info_1106_0686_1043_8040, @@ -27529,6 +28061,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_0686[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_1106_0691[] = { + &pci_ss_info_1106_0691_1019_0985, &pci_ss_info_1106_0691_1179_0001, &pci_ss_info_1106_0691_1458_0691, NULL @@ -27542,6 +28075,8 @@ static const pciSubsystemInfo *pci_ss_list_1106_0691[] = { #define pci_ss_list_1106_1595 NULL static const pciSubsystemInfo *pci_ss_list_1106_3038[] = { &pci_ss_info_1106_3038_0925_1234, + &pci_ss_info_1106_3038_1019_0985, + &pci_ss_info_1106_3038_1043_808c, &pci_ss_info_1106_3038_1179_0001, NULL }; @@ -27556,6 +28091,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3043[] = { #define pci_ss_list_1106_3050 NULL #define pci_ss_list_1106_3051 NULL static const pciSubsystemInfo *pci_ss_list_1106_3057[] = { + &pci_ss_info_1106_3057_1019_0985, &pci_ss_info_1106_3057_1043_8033, &pci_ss_info_1106_3057_1043_803e, &pci_ss_info_1106_3057_1043_8040, @@ -27565,6 +28101,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3057[] = { }; static const pciSubsystemInfo *pci_ss_list_1106_3058[] = { &pci_ss_info_1106_3058_0e11_b194, + &pci_ss_info_1106_3058_1019_0985, &pci_ss_info_1106_3058_1106_4511, &pci_ss_info_1106_3058_1458_7600, &pci_ss_info_1106_3058_1462_3091, @@ -27572,6 +28109,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3058[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_1106_3059[] = { + &pci_ss_info_1106_3059_1043_8095, &pci_ss_info_1106_3059_1458_a002, NULL }; @@ -27579,6 +28117,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3065[] = { &pci_ss_info_1106_3065_1106_0102, &pci_ss_info_1106_3065_1186_1400, &pci_ss_info_1106_3065_1186_1401, + &pci_ss_info_1106_3065_13b9_1421, NULL }; #define pci_ss_list_1106_3068 NULL @@ -27596,6 +28135,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3099[] = { #define pci_ss_list_1106_3102 NULL #define pci_ss_list_1106_3103 NULL static const pciSubsystemInfo *pci_ss_list_1106_3104[] = { + &pci_ss_info_1106_3104_1043_808c, &pci_ss_info_1106_3104_1458_5004, NULL }; @@ -27612,10 +28152,12 @@ static const pciSubsystemInfo *pci_ss_list_1106_3104[] = { #define pci_ss_list_1106_3156 NULL #define pci_ss_list_1106_3168 NULL static const pciSubsystemInfo *pci_ss_list_1106_3177[] = { + &pci_ss_info_1106_3177_1043_808c, &pci_ss_info_1106_3177_1458_5001, NULL }; static const pciSubsystemInfo *pci_ss_list_1106_3189[] = { + &pci_ss_info_1106_3189_1043_807f, &pci_ss_info_1106_3189_1458_5000, NULL }; @@ -27628,7 +28170,10 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = { #define pci_ss_list_1106_8501 NULL #define pci_ss_list_1106_8596 NULL #define pci_ss_list_1106_8597 NULL -#define pci_ss_list_1106_8598 NULL +static const pciSubsystemInfo *pci_ss_list_1106_8598[] = { + &pci_ss_info_1106_8598_1019_0985, + NULL +}; #define pci_ss_list_1106_8601 NULL #define pci_ss_list_1106_8605 NULL #define pci_ss_list_1106_8691 NULL @@ -27640,6 +28185,7 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = { #define pci_ss_list_1106_b103 NULL #define pci_ss_list_1106_b112 NULL #define pci_ss_list_1106_b168 NULL +#endif #define pci_ss_list_1107_0576 NULL #define pci_ss_list_1108_0100 NULL #define pci_ss_list_1108_0101 NULL @@ -27652,6 +28198,12 @@ static const pciSubsystemInfo *pci_ss_list_1106_3189[] = { #define pci_ss_list_1109_1400 NULL #define pci_ss_list_110a_0002 NULL #define pci_ss_list_110a_0005 NULL +#define pci_ss_list_110a_0006 NULL +#define pci_ss_list_110a_0015 NULL +#define pci_ss_list_110a_001d NULL +#define pci_ss_list_110a_007b NULL +#define pci_ss_list_110a_007c NULL +#define pci_ss_list_110a_007d NULL #define pci_ss_list_110a_2102 NULL #define pci_ss_list_110a_4942 NULL #define pci_ss_list_110a_6120 NULL @@ -28049,6 +28601,7 @@ static const pciSubsystemInfo *pci_ss_list_1163_2000[] = { }; #define pci_ss_list_1165_0001 NULL #define pci_ss_list_1166_0005 NULL +#define pci_ss_list_1166_0006 NULL #define pci_ss_list_1166_0007 NULL #define pci_ss_list_1166_0008 NULL #define pci_ss_list_1166_0009 NULL @@ -28266,7 +28819,10 @@ static const pciSubsystemInfo *pci_ss_list_11c1_0442[] = { }; #define pci_ss_list_11c1_0443 NULL #define pci_ss_list_11c1_0444 NULL -#define pci_ss_list_11c1_0445 NULL +static const pciSubsystemInfo *pci_ss_list_11c1_0445[] = { + &pci_ss_info_11c1_0445_8086_2203, + NULL +}; #define pci_ss_list_11c1_0446 NULL #define pci_ss_list_11c1_0447 NULL static const pciSubsystemInfo *pci_ss_list_11c1_0448[] = { @@ -28625,6 +29181,7 @@ static const pciSubsystemInfo *pci_ss_list_1260_3873[] = { &pci_ss_info_1260_3873_8086_2513, NULL }; +#define pci_ss_list_1260_3890 NULL #define pci_ss_list_1260_8130 NULL #define pci_ss_list_1260_8131 NULL #endif @@ -28640,11 +29197,13 @@ static const pciSubsystemInfo *pci_ss_list_1266_1910[] = { #define pci_ss_list_126f_0710 NULL #define pci_ss_list_126f_0712 NULL #define pci_ss_list_126f_0720 NULL +#define pci_ss_list_126f_0730 NULL #define pci_ss_list_126f_0810 NULL #define pci_ss_list_126f_0811 NULL #define pci_ss_list_126f_0820 NULL #define pci_ss_list_126f_0910 NULL #define pci_ss_list_1273_0002 NULL +#define pci_ss_list_1274_1171 NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1274_1371[] = { &pci_ss_info_1274_1371_0e11_0024, @@ -28716,6 +29275,7 @@ static const pciSubsystemInfo *pci_ss_list_1274_5880[] = { }; #endif #define pci_ss_list_1278_0701 NULL +#define pci_ss_list_1278_0710 NULL #define pci_ss_list_1279_0295 NULL #define pci_ss_list_1279_0395 NULL #define pci_ss_list_1279_0396 NULL @@ -28896,6 +29456,7 @@ static const pciSubsystemInfo *pci_ss_list_12ae_0001[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_12ae_0002[] = { + &pci_ss_info_12ae_0002_10a9_8002, &pci_ss_info_12ae_0002_12ae_0002, NULL }; @@ -28969,6 +29530,9 @@ static const pciSubsystemInfo *pci_ss_list_12d2_0018[] = { #define pci_ss_list_12d2_0029 NULL #define pci_ss_list_12d2_002c NULL #define pci_ss_list_12d2_00a0 NULL +#define pci_ss_list_12d4_0200 NULL +#define pci_ss_list_12d9_0002 NULL +#define pci_ss_list_12d9_0004 NULL #define pci_ss_list_12e0_0010 NULL #define pci_ss_list_12e0_0020 NULL #define pci_ss_list_12e0_0030 NULL @@ -29052,6 +29616,7 @@ static const pciSubsystemInfo *pci_ss_list_12eb_8803[] = { #define pci_ss_list_1307_0036 NULL #define pci_ss_list_1307_0037 NULL #define pci_ss_list_1307_004c NULL +#define pci_ss_list_1307_004d NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1308_0001[] = { &pci_ss_info_1308_0001_1308_0001, @@ -29109,6 +29674,7 @@ static const pciSubsystemInfo *pci_ss_list_131f_2030[] = { #define pci_ss_list_131f_2062 NULL #endif #define pci_ss_list_1332_5415 NULL +#define pci_ss_list_1332_5425 NULL #define pci_ss_list_134a_0001 NULL #define pci_ss_list_134a_0002 NULL #define pci_ss_list_134d_7890 NULL @@ -29149,6 +29715,7 @@ static const pciSubsystemInfo *pci_ss_list_134d_7891[] = { #define pci_ss_list_135e_7801 NULL #define pci_ss_list_135e_8001 NULL #define pci_ss_list_1385_4100 NULL +#define pci_ss_list_1385_4105 NULL #define pci_ss_list_1385_620a NULL #define pci_ss_list_1385_622a NULL #define pci_ss_list_1385_630a NULL @@ -29213,6 +29780,7 @@ static const pciSubsystemInfo *pci_ss_list_13f6_0111[] = { &pci_ss_info_13f6_0111_1043_8077, &pci_ss_info_13f6_0111_1043_80e2, &pci_ss_info_13f6_0111_13f6_0111, + &pci_ss_info_13f6_0111_1681_a000, NULL }; #define pci_ss_list_13f6_0211 NULL @@ -29262,7 +29830,9 @@ static const pciSubsystemInfo *pci_ss_list_1415_9511[] = { #define pci_ss_list_144a_9113 NULL #define pci_ss_list_144a_9114 NULL #define pci_ss_list_145f_0001 NULL +#define pci_ss_list_146c_1430 NULL #define pci_ss_list_148d_1003 NULL +#define pci_ss_list_149d_0001 NULL #define pci_ss_list_14af_7102 NULL #define pci_ss_list_14b3_0000 NULL #define pci_ss_list_14b5_0200 NULL @@ -29338,6 +29908,9 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1645[] = { &pci_ss_info_14e4_1645_0e11_009a, &pci_ss_info_14e4_1645_0e11_00c1, &pci_ss_info_14e4_1645_1028_0121, + &pci_ss_info_14e4_1645_10a9_8010, + &pci_ss_info_14e4_1645_10a9_8011, + &pci_ss_info_14e4_1645_10a9_8012, &pci_ss_info_14e4_1645_10b7_1004, &pci_ss_info_14e4_1645_10b7_1006, &pci_ss_info_14e4_1645_10b7_1007, @@ -29359,6 +29932,7 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1646[] = { static const pciSubsystemInfo *pci_ss_list_14e4_1647[] = { &pci_ss_info_14e4_1647_0e11_0099, &pci_ss_info_14e4_1647_0e11_009a, + &pci_ss_info_14e4_1647_10a9_8010, &pci_ss_info_14e4_1647_14e4_0009, &pci_ss_info_14e4_1647_14e4_000a, &pci_ss_info_14e4_1647_14e4_000b, @@ -29382,6 +29956,7 @@ static const pciSubsystemInfo *pci_ss_list_14e4_1696[] = { &pci_ss_info_14e4_1696_14e4_000d, NULL }; +#define pci_ss_list_14e4_169c NULL static const pciSubsystemInfo *pci_ss_list_14e4_16a6[] = { &pci_ss_info_14e4_16a6_0e11_00bb, &pci_ss_info_14e4_16a6_1028_0126, @@ -29417,7 +29992,11 @@ static const pciSubsystemInfo *pci_ss_list_14e4_16c7[] = { #define pci_ss_list_14e4_4211 NULL #define pci_ss_list_14e4_4212 NULL #define pci_ss_list_14e4_4301 NULL -#define pci_ss_list_14e4_4401 NULL +#define pci_ss_list_14e4_4320 NULL +static const pciSubsystemInfo *pci_ss_list_14e4_4401[] = { + &pci_ss_info_14e4_4401_1043_80a8, + NULL +}; #define pci_ss_list_14e4_4402 NULL #define pci_ss_list_14e4_4410 NULL #define pci_ss_list_14e4_4411 NULL @@ -29507,6 +30086,9 @@ static const pciSubsystemInfo *pci_ss_list_14f1_1456[] = { }; #define pci_ss_list_14f1_1610 NULL #define pci_ss_list_14f1_1611 NULL +#define pci_ss_list_14f1_1620 NULL +#define pci_ss_list_14f1_1621 NULL +#define pci_ss_list_14f1_1622 NULL static const pciSubsystemInfo *pci_ss_list_14f1_1803[] = { &pci_ss_info_14f1_1803_0e11_0023, &pci_ss_info_14f1_1803_0e11_0043, @@ -29661,11 +30243,13 @@ static const pciSubsystemInfo *pci_ss_list_1522_0100[] = { #define pci_ss_list_1629_1003 NULL #define pci_ss_list_1629_2002 NULL #define pci_ss_list_1638_1100 NULL +#define pci_ss_list_163c_3052 NULL #define pci_ss_list_163c_5449 NULL #define pci_ss_list_165a_c100 NULL #define pci_ss_list_165a_d200 NULL #define pci_ss_list_165a_d300 NULL #define pci_ss_list_16ab_1102 NULL +#define pci_ss_list_16ca_0001 NULL #define pci_ss_list_16ec_3685 NULL #define pci_ss_list_173b_03e8 NULL #ifdef VENDOR_INCLUDE_NONVIDEO @@ -29703,10 +30287,13 @@ static const pciSubsystemInfo *pci_ss_list_1813_4100[] = { #define pci_ss_list_1de1_2020 NULL #define pci_ss_list_1de1_690c NULL #define pci_ss_list_1de1_dc29 NULL +#define pci_ss_list_1fc0_0300 NULL #define pci_ss_list_2348_2010 NULL #define pci_ss_list_3388_0013 NULL #define pci_ss_list_3388_0014 NULL #define pci_ss_list_3388_0021 NULL +#define pci_ss_list_3388_101a NULL +#define pci_ss_list_3388_101b NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_3388_8011[] = { &pci_ss_info_3388_8011_3388_8011, @@ -29963,6 +30550,7 @@ static const pciSubsystemInfo *pci_ss_list_5333_9102[] = { NULL }; #define pci_ss_list_5333_ca00 NULL +#define pci_ss_list_544c_0350 NULL #define pci_ss_list_5455_4458 NULL #define pci_ss_list_5544_0001 NULL #define pci_ss_list_5555_0003 NULL @@ -30082,17 +30670,22 @@ static const pciSubsystemInfo *pci_ss_list_8086_1040[] = { &pci_ss_info_8086_1040_16be_1040, NULL }; +#define pci_ss_list_8086_1043 NULL #define pci_ss_list_8086_1059 NULL static const pciSubsystemInfo *pci_ss_list_8086_1130[] = { &pci_ss_info_8086_1130_1025_1016, &pci_ss_info_8086_1130_1043_8027, &pci_ss_info_8086_1130_104d_80df, + &pci_ss_info_8086_1130_8086_4532, + &pci_ss_info_8086_1130_8086_4557, NULL }; #define pci_ss_list_8086_1131 NULL static const pciSubsystemInfo *pci_ss_list_8086_1132[] = { &pci_ss_info_8086_1132_1025_1016, &pci_ss_info_8086_1132_104d_80df, + &pci_ss_info_8086_1132_8086_4532, + &pci_ss_info_8086_1132_8086_4557, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_1161[] = { @@ -30352,6 +30945,8 @@ static const pciSubsystemInfo *pci_ss_list_8086_2442[] = { &pci_ss_info_8086_2442_1025_1016, &pci_ss_info_8086_2442_104d_80df, &pci_ss_info_8086_2442_147b_0507, + &pci_ss_info_8086_2442_8086_4532, + &pci_ss_info_8086_2442_8086_4557, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_2443[] = { @@ -30360,12 +30955,15 @@ static const pciSubsystemInfo *pci_ss_list_8086_2443[] = { &pci_ss_info_8086_2443_1043_8027, &pci_ss_info_8086_2443_104d_80df, &pci_ss_info_8086_2443_147b_0507, + &pci_ss_info_8086_2443_8086_4532, + &pci_ss_info_8086_2443_8086_4557, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_2444[] = { &pci_ss_info_8086_2444_1025_1016, &pci_ss_info_8086_2444_104d_80df, &pci_ss_info_8086_2444_147b_0507, + &pci_ss_info_8086_2444_8086_4532, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_2445[] = { @@ -30374,6 +30972,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_2445[] = { &pci_ss_info_8086_2445_104d_80df, &pci_ss_info_8086_2445_1462_3370, &pci_ss_info_8086_2445_147b_0507, + &pci_ss_info_8086_2445_8086_4557, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_2446[] = { @@ -30396,8 +30995,12 @@ static const pciSubsystemInfo *pci_ss_list_8086_2449[] = { &pci_ss_info_8086_2449_1014_023d, &pci_ss_info_8086_2449_1014_0244, &pci_ss_info_8086_2449_1014_0245, + &pci_ss_info_8086_2449_1014_0265, + &pci_ss_info_8086_2449_1014_0267, + &pci_ss_info_8086_2449_1014_026a, &pci_ss_info_8086_2449_109f_315d, &pci_ss_info_8086_2449_109f_3181, + &pci_ss_info_8086_2449_1179_ff01, &pci_ss_info_8086_2449_1186_7801, &pci_ss_info_8086_2449_144d_2602, &pci_ss_info_8086_2449_8086_3010, @@ -30420,6 +31023,8 @@ static const pciSubsystemInfo *pci_ss_list_8086_244b[] = { &pci_ss_info_8086_244b_1014_01c6, &pci_ss_info_8086_244b_1043_8027, &pci_ss_info_8086_244b_147b_0507, + &pci_ss_info_8086_244b_8086_4532, + &pci_ss_info_8086_244b_8086_4557, NULL }; #define pci_ss_list_8086_244c NULL @@ -30515,14 +31120,28 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = { &pci_ss_info_8086_24c7_1462_5800, NULL }; +#define pci_ss_list_8086_24ca NULL static const pciSubsystemInfo *pci_ss_list_8086_24cb[] = { &pci_ss_info_8086_24cb_1462_5800, NULL }; +#define pci_ss_list_8086_24cc NULL static const pciSubsystemInfo *pci_ss_list_8086_24cd[] = { &pci_ss_info_8086_24cd_1462_3981, NULL }; +#define pci_ss_list_8086_24d0 NULL +#define pci_ss_list_8086_24d1 NULL +#define pci_ss_list_8086_24d2 NULL +#define pci_ss_list_8086_24d3 NULL +#define pci_ss_list_8086_24d4 NULL +#define pci_ss_list_8086_24d5 NULL +#define pci_ss_list_8086_24d6 NULL +#define pci_ss_list_8086_24d7 NULL +#define pci_ss_list_8086_24db NULL +#define pci_ss_list_8086_24dc NULL +#define pci_ss_list_8086_24dd NULL +#define pci_ss_list_8086_24de NULL static const pciSubsystemInfo *pci_ss_list_8086_2500[] = { &pci_ss_info_8086_2500_1028_0095, &pci_ss_info_8086_2500_1043_801c, @@ -30558,6 +31177,13 @@ static const pciSubsystemInfo *pci_ss_list_8086_2541[] = { #define pci_ss_list_8086_2546 NULL #define pci_ss_list_8086_2547 NULL #define pci_ss_list_8086_2548 NULL +#define pci_ss_list_8086_254c NULL +#define pci_ss_list_8086_2550 NULL +#define pci_ss_list_8086_2551 NULL +#define pci_ss_list_8086_2552 NULL +#define pci_ss_list_8086_2553 NULL +#define pci_ss_list_8086_2554 NULL +#define pci_ss_list_8086_255d NULL static const pciSubsystemInfo *pci_ss_list_8086_2560[] = { &pci_ss_info_8086_2560_1462_5800, NULL @@ -30565,8 +31191,17 @@ static const pciSubsystemInfo *pci_ss_list_8086_2560[] = { #define pci_ss_list_8086_2561 NULL #define pci_ss_list_8086_2562 NULL #define pci_ss_list_8086_2570 NULL +#define pci_ss_list_8086_2571 NULL #define pci_ss_list_8086_2572 NULL +#define pci_ss_list_8086_2573 NULL +#define pci_ss_list_8086_2576 NULL +#define pci_ss_list_8086_2578 NULL +#define pci_ss_list_8086_2579 NULL +#define pci_ss_list_8086_257b NULL +#define pci_ss_list_8086_257e NULL #define pci_ss_list_8086_3092 NULL +#define pci_ss_list_8086_3340 NULL +#define pci_ss_list_8086_3341 NULL static const pciSubsystemInfo *pci_ss_list_8086_3575[] = { &pci_ss_info_8086_3575_1014_021d, &pci_ss_info_8086_3575_104d_80e7, @@ -30596,7 +31231,10 @@ static const pciSubsystemInfo *pci_ss_list_8086_5201[] = { #define pci_ss_list_8086_7112 NULL #define pci_ss_list_8086_7113 NULL #define pci_ss_list_8086_7120 NULL -#define pci_ss_list_8086_7121 NULL +static const pciSubsystemInfo *pci_ss_list_8086_7121[] = { + &pci_ss_info_8086_7121_8086_4341, + NULL +}; #define pci_ss_list_8086_7122 NULL #define pci_ss_list_8086_7123 NULL #define pci_ss_list_8086_7124 NULL @@ -30691,11 +31329,6 @@ static const pciSubsystemInfo *pci_ss_list_9004_5078[] = { #define pci_ss_list_9004_5478 NULL #define pci_ss_list_9004_5575 NULL #define pci_ss_list_9004_5578 NULL -static const pciSubsystemInfo *pci_ss_list_9004_5647[] = { - &pci_ss_info_9004_5647_9004_7710, - &pci_ss_info_9004_5647_9004_7711, - NULL -}; #define pci_ss_list_9004_5675 NULL #define pci_ss_list_9004_5678 NULL #define pci_ss_list_9004_5775 NULL @@ -30743,6 +31376,8 @@ static const pciSubsystemInfo *pci_ss_list_9004_6915[] = { #define pci_ss_list_9004_7478 NULL #define pci_ss_list_9004_7578 NULL #define pci_ss_list_9004_7678 NULL +#define pci_ss_list_9004_7710 NULL +#define pci_ss_list_9004_7711 NULL #define pci_ss_list_9004_7778 NULL #define pci_ss_list_9004_7810 NULL static const pciSubsystemInfo *pci_ss_list_9004_7815[] = { @@ -30891,11 +31526,18 @@ static const pciSubsystemInfo *pci_ss_list_9005_8011[] = { #define pci_ss_list_9005_8014 NULL #define pci_ss_list_9005_801e NULL #define pci_ss_list_9005_801f NULL +#define pci_ss_list_9005_8080 NULL +#define pci_ss_list_9005_808f NULL #define pci_ss_list_9005_8090 NULL #define pci_ss_list_9005_8091 NULL #define pci_ss_list_9005_8092 NULL #define pci_ss_list_9005_8093 NULL #define pci_ss_list_9005_8094 NULL +#define pci_ss_list_9005_8095 NULL +#define pci_ss_list_9005_8096 NULL +#define pci_ss_list_9005_8097 NULL +#define pci_ss_list_9005_809c NULL +#define pci_ss_list_9005_809d NULL #define pci_ss_list_9005_809e NULL #define pci_ss_list_9005_809f NULL #endif @@ -31258,6 +31900,9 @@ static const pciSubsystemInfo *pci_ss_list_1014[] = { &pci_ss_info_1014_0245, &pci_ss_info_1014_0258, &pci_ss_info_1014_0259, + &pci_ss_info_1014_0265, + &pci_ss_info_1014_0267, + &pci_ss_info_1014_026a, &pci_ss_info_1014_0277, &pci_ss_info_1014_0279, &pci_ss_info_1014_028c, @@ -31298,6 +31943,7 @@ static const pciSubsystemInfo *pci_ss_list_1014[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1019[] = { &pci_ss_info_1019_0970, + &pci_ss_info_1019_0985, &pci_ss_info_1019_7018, NULL }; @@ -31635,6 +32281,7 @@ static const pciSubsystemInfo *pci_ss_list_1043[] = { &pci_ss_info_1043_800b, &pci_ss_info_1043_801c, &pci_ss_info_1043_8027, + &pci_ss_info_1043_802c, &pci_ss_info_1043_8033, &pci_ss_info_1043_803e, &pci_ss_info_1043_8040, @@ -31645,6 +32292,10 @@ static const pciSubsystemInfo *pci_ss_list_1043[] = { &pci_ss_info_1043_8064, &pci_ss_info_1043_8077, &pci_ss_info_1043_807f, + &pci_ss_info_1043_808c, + &pci_ss_info_1043_8095, + &pci_ss_info_1043_809e, + &pci_ss_info_1043_80a8, &pci_ss_info_1043_80ad, &pci_ss_info_1043_80e2, NULL @@ -31701,6 +32352,7 @@ static const pciSubsystemInfo *pci_ss_list_1048[] = { &pci_ss_info_1048_0c10, &pci_ss_info_1048_0c18, &pci_ss_info_1048_0c1b, + &pci_ss_info_1048_0c21, &pci_ss_info_1048_0c3a, &pci_ss_info_1048_0c56, &pci_ss_info_1048_1500, @@ -31805,6 +32457,7 @@ static const pciSubsystemInfo *pci_ss_list_105d[] = { &pci_ss_info_105d_000b, &pci_ss_info_105d_0018, &pci_ss_info_105d_002a, + &pci_ss_info_105d_0037, &pci_ss_info_105d_003a, &pci_ss_info_105d_092f, NULL @@ -31855,6 +32508,7 @@ static const pciSubsystemInfo *pci_ss_list_1073[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1077[] = { &pci_ss_info_1077_0001, + &pci_ss_info_1077_0002, NULL }; #endif @@ -32042,7 +32696,15 @@ static const pciSubsystemInfo *pci_ss_list_109f[] = { #define pci_ss_list_10a6 NULL #define pci_ss_list_10a7 NULL #define pci_ss_list_10a8 NULL -#define pci_ss_list_10a9 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo *pci_ss_list_10a9[] = { + &pci_ss_info_10a9_8002, + &pci_ss_info_10a9_8010, + &pci_ss_info_10a9_8011, + &pci_ss_info_10a9_8012, + NULL +}; +#endif #define pci_ss_list_10aa NULL #define pci_ss_list_10ab NULL #define pci_ss_list_10ac NULL @@ -32052,6 +32714,7 @@ static const pciSubsystemInfo *pci_ss_list_109f[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_10b0[] = { &pci_ss_info_10b0_0001, + &pci_ss_info_10b0_0002, NULL }; #endif @@ -32163,6 +32826,7 @@ static const pciSubsystemInfo *pci_ss_list_10b8[] = { NULL }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_10b9[] = { &pci_ss_info_10b9_0111, &pci_ss_info_10b9_1521, @@ -32172,6 +32836,7 @@ static const pciSubsystemInfo *pci_ss_list_10b9[] = { &pci_ss_info_10b9_7101, NULL }; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_10ba[] = { &pci_ss_info_10ba_0e00, @@ -32383,6 +33048,8 @@ static const pciSubsystemInfo *pci_ss_list_1102[] = { &pci_ss_info_1102_8040, &pci_ss_info_1102_8051, &pci_ss_info_1102_8061, + &pci_ss_info_1102_8064, + &pci_ss_info_1102_8065, NULL }; #endif @@ -32395,6 +33062,7 @@ static const pciSubsystemInfo *pci_ss_list_1103[] = { #endif #define pci_ss_list_1104 NULL #define pci_ss_list_1105 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_1106[] = { &pci_ss_info_1106_0000, &pci_ss_info_1106_0100, @@ -32404,6 +33072,7 @@ static const pciSubsystemInfo *pci_ss_list_1106[] = { &pci_ss_info_1106_4511, NULL }; +#endif #define pci_ss_list_1107 NULL #define pci_ss_list_1108 NULL #ifdef VENDOR_INCLUDE_NONVIDEO @@ -32673,6 +33342,7 @@ static const pciSubsystemInfo *pci_ss_list_1179[] = { &pci_ss_info_1179_0203, &pci_ss_info_1179_0204, &pci_ss_info_1179_ff00, + &pci_ss_info_1179_ff01, NULL }; #endif @@ -33322,6 +33992,7 @@ static const pciSubsystemInfo *pci_ss_list_12be[] = { #define pci_ss_list_12d8 NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciSubsystemInfo *pci_ss_list_12d9[] = { + &pci_ss_info_12d9_0002, &pci_ss_info_12d9_000a, NULL }; @@ -33628,7 +34299,12 @@ static const pciSubsystemInfo *pci_ss_list_13a2[] = { #define pci_ss_list_13b6 NULL #define pci_ss_list_13b7 NULL #define pci_ss_list_13b8 NULL -#define pci_ss_list_13b9 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo *pci_ss_list_13b9[] = { + &pci_ss_info_13b9_1421, + NULL +}; +#endif #define pci_ss_list_13ba NULL #define pci_ss_list_13bb NULL #define pci_ss_list_13bc NULL @@ -34749,6 +35425,7 @@ static const pciSubsystemInfo *pci_ss_list_1668[] = { static const pciSubsystemInfo *pci_ss_list_1681[] = { &pci_ss_info_1681_0040, &pci_ss_info_1681_0050, + &pci_ss_info_1681_a000, &pci_ss_info_1681_a011, NULL }; @@ -34762,6 +35439,7 @@ static const pciSubsystemInfo *pci_ss_list_16be[] = { NULL }; #endif +#define pci_ss_list_16ca NULL #define pci_ss_list_16ec NULL #define pci_ss_list_16f6 NULL #ifdef VENDOR_INCLUDE_NONVIDEO @@ -34856,6 +35534,7 @@ static const pciSubsystemInfo *pci_ss_list_1de1[] = { NULL }; #endif +#define pci_ss_list_1fc0 NULL #define pci_ss_list_2000 NULL #define pci_ss_list_2001 NULL #define pci_ss_list_2003 NULL @@ -35115,6 +35794,8 @@ static const pciSubsystemInfo *pci_ss_list_8086[] = { &pci_ss_info_8086_425a, &pci_ss_info_8086_4341, &pci_ss_info_8086_4343, + &pci_ss_info_8086_4532, + &pci_ss_info_8086_4557, &pci_ss_info_8086_4649, &pci_ss_info_8086_464a, &pci_ss_info_8086_4d4f, @@ -35149,8 +35830,6 @@ static const pciSubsystemInfo *pci_ss_list_9004[] = { &pci_ss_info_9004_0020, &pci_ss_info_9004_0028, &pci_ss_info_9004_7560, - &pci_ss_info_9004_7710, - &pci_ss_info_9004_7711, &pci_ss_info_9004_7815, &pci_ss_info_9004_7840, &pci_ss_info_9004_7850, @@ -36247,6 +36926,15 @@ static const pciDeviceInfo pci_dev_info_1001_9100 = { 0 }; #endif +static const pciDeviceInfo pci_dev_info_1002_4136 = { + 0x4136, pci_device_1002_4136, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1002_4136, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1002_4144 = { 0x4144, pci_device_1002_4144, #ifdef INIT_SUBSYS_INFO @@ -36814,6 +37502,15 @@ static const pciDeviceInfo pci_dev_info_1002_4e47 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1002_4e48 = { + 0x4e48, pci_device_1002_4e48, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1002_4e48, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1002_4e64 = { 0x4e64, pci_device_1002_4e64, #ifdef INIT_SUBSYS_INFO @@ -36850,6 +37547,15 @@ static const pciDeviceInfo pci_dev_info_1002_4e67 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1002_4e68 = { + 0x4e68, pci_device_1002_4e68, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1002_4e68, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1002_5041 = { 0x5041, pci_device_1002_5041, #ifdef INIT_SUBSYS_INFO @@ -37471,6 +38177,24 @@ static const pciDeviceInfo pci_dev_info_1002_700f = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1002_7010 = { + 0x7010, pci_device_1002_7010, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1002_7010, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_1002_cab2 = { + 0xcab2, pci_device_1002_cab2, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1002_cab2, +#else + NULL, +#endif + 0 +}; #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1003_0201 = { 0x0201, pci_device_1003_0201, @@ -38060,6 +38784,15 @@ static const pciDeviceInfo pci_dev_info_1011_0016 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1011_0017 = { + 0x0017, pci_device_1011_0017, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1011_0017, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1011_0019 = { 0x0019, pci_device_1011_0019, #ifdef INIT_SUBSYS_INFO @@ -40392,6 +41125,15 @@ static const pciDeviceInfo pci_dev_info_1028_0008 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1028_0009 = { + 0x0009, pci_device_1028_0009, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1028_0009, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1028_000a = { 0x000a, pci_device_1028_000a, #ifdef INIT_SUBSYS_INFO @@ -40410,6 +41152,15 @@ static const pciDeviceInfo pci_dev_info_1028_000c = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1028_000d = { + 0x000d, pci_device_1028_000d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1028_000d, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1028_000e = { 0x000e, pci_device_1028_000e, #ifdef INIT_SUBSYS_INFO @@ -40457,6 +41208,15 @@ static const pciDeviceInfo pci_dev_info_102b_0010 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_102b_0100 = { + 0x0100, pci_device_102b_0100, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_102b_0100, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_102b_0518 = { 0x0518, pci_device_102b_0518, #ifdef INIT_SUBSYS_INFO @@ -41282,6 +42042,15 @@ static const pciDeviceInfo pci_dev_info_1039_0646 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1039_0648 = { + 0x0648, pci_device_1039_0648, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1039_0648, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1039_0650 = { 0x0650, pci_device_1039_0650, #ifdef INIT_SUBSYS_INFO @@ -41345,6 +42114,15 @@ static const pciDeviceInfo pci_dev_info_1039_0745 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1039_0755 = { + 0x0755, pci_device_1039_0755, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1039_0755, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1039_0900 = { 0x0900, pci_device_1039_0900, #ifdef INIT_SUBSYS_INFO @@ -41867,6 +42645,15 @@ static const pciDeviceInfo pci_dev_info_103c_1290 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_103c_12b4 = { + 0x12b4, pci_device_103c_12b4, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_103c_12b4, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_103c_2910 = { 0x2910, pci_device_103c_2910, #ifdef INIT_SUBSYS_INFO @@ -45310,6 +46097,15 @@ static const pciDeviceInfo pci_dev_info_1093_c831 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_1095_0240 = { + 0x0240, pci_device_1095_0240, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1095_0240, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1095_0640 = { 0x0640, pci_device_1095_0640, #ifdef INIT_SUBSYS_INFO @@ -45584,6 +46380,15 @@ static const pciDeviceInfo pci_dev_info_109e_8474 = { 0 }; #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_10a5_3052 = { + 0x3052, pci_device_10a5_3052, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_10a5_3052, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_10a5_5449 = { 0x5449, pci_device_10a5_5449, #ifdef INIT_SUBSYS_INFO @@ -45786,6 +46591,15 @@ static const pciDeviceInfo pci_dev_info_10a9_1008 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_10a9_100a = { + 0x100a, pci_device_10a9_100a, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_10a9_100a, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_10a9_2001 = { 0x2001, pci_device_10a9_2001, #ifdef INIT_SUBSYS_INFO @@ -46187,6 +47001,15 @@ static const pciDeviceInfo pci_dev_info_10b7_0001 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_10b7_0910 = { + 0x0910, pci_device_10b7_0910, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_10b7_0910, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_10b7_1006 = { 0x1006, pci_device_10b7_1006, #ifdef INIT_SUBSYS_INFO @@ -46721,6 +47544,7 @@ static const pciDeviceInfo pci_dev_info_10b8_b106 = { 0 }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_10b9_0111 = { 0x0111, pci_device_10b9_0111, #ifdef INIT_SUBSYS_INFO @@ -47180,6 +48004,15 @@ static const pciDeviceInfo pci_dev_info_10b9_5261 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_10b9_5450 = { + 0x5450, pci_device_10b9_5450, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_10b9_5450, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_10b9_5451 = { 0x5451, pci_device_10b9_5451, #ifdef INIT_SUBSYS_INFO @@ -47261,6 +48094,7 @@ static const pciDeviceInfo pci_dev_info_10b9_7101 = { #endif 0 }; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_10ba_0301 = { 0x0301, pci_device_10ba_0301, @@ -49144,6 +49978,15 @@ static const pciDeviceInfo pci_dev_info_1103_0008 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1103_0009 = { + 0x0009, pci_device_1103_0009, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1103_0009, +#else + NULL, +#endif + 0 +}; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1105_1105 = { @@ -49174,6 +50017,7 @@ static const pciDeviceInfo pci_dev_info_1105_8400 = { 0 }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1106_0102 = { 0x0102, pci_device_1106_0102, #ifdef INIT_SUBSYS_INFO @@ -49894,6 +50738,7 @@ static const pciDeviceInfo pci_dev_info_1106_b168 = { #endif 0 }; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1107_0576 = { 0x0576, pci_device_1107_0576, @@ -50009,6 +50854,60 @@ static const pciDeviceInfo pci_dev_info_110a_0005 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_110a_0006 = { + 0x0006, pci_device_110a_0006, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_0006, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_110a_0015 = { + 0x0015, pci_device_110a_0015, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_0015, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_110a_001d = { + 0x001d, pci_device_110a_001d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_001d, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_110a_007b = { + 0x007b, pci_device_110a_007b, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_007b, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_110a_007c = { + 0x007c, pci_device_110a_007c, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_007c, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_110a_007d = { + 0x007d, pci_device_110a_007d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_110a_007d, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_110a_2102 = { 0x2102, pci_device_110a_2102, #ifdef INIT_SUBSYS_INFO @@ -52132,6 +53031,15 @@ static const pciDeviceInfo pci_dev_info_1166_0005 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1166_0006 = { + 0x0006, pci_device_1166_0006, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1166_0006, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1166_0007 = { 0x0007, pci_device_1166_0007, #ifdef INIT_SUBSYS_INFO @@ -54782,6 +55690,15 @@ static const pciDeviceInfo pci_dev_info_1260_3873 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1260_3890 = { + 0x3890, pci_device_1260_3890, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1260_3890, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1260_8130 = { 0x8130, pci_device_1260_8130, #ifdef INIT_SUBSYS_INFO @@ -54868,6 +55785,15 @@ static const pciDeviceInfo pci_dev_info_126f_0720 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_126f_0730 = { + 0x0730, pci_device_126f_0730, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_126f_0730, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_126f_0810 = { 0x0810, pci_device_126f_0810, #ifdef INIT_SUBSYS_INFO @@ -54916,6 +55842,15 @@ static const pciDeviceInfo pci_dev_info_1273_0002 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_1274_1171 = { + 0x1171, pci_device_1274_1171, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1274_1171, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1274_1371 = { 0x1371, pci_device_1274_1371, #ifdef INIT_SUBSYS_INFO @@ -54954,6 +55889,15 @@ static const pciDeviceInfo pci_dev_info_1278_0701 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1278_0710 = { + 0x0710, pci_device_1278_0710, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1278_0710, +#else + NULL, +#endif + 0 +}; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1279_0295 = { @@ -55634,6 +56578,37 @@ static const pciDeviceInfo pci_dev_info_12d2_00a0 = { 0 }; #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_12d4_0200 = { + 0x0200, pci_device_12d4_0200, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_12d4_0200, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_12d9_0002 = { + 0x0002, pci_device_12d9_0002, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_12d9_0002, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_12d9_0004 = { + 0x0004, pci_device_12d9_0004, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_12d9_0004, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_12e0_0010 = { 0x0010, pci_device_12e0_0010, #ifdef INIT_SUBSYS_INFO @@ -56027,6 +57002,15 @@ static const pciDeviceInfo pci_dev_info_1307_004c = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1307_004d = { + 0x004d, pci_device_1307_004d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1307_004d, +#else + NULL, +#endif + 0 +}; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1308_0001 = { @@ -56462,6 +57446,15 @@ static const pciDeviceInfo pci_dev_info_1332_5415 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1332_5425 = { + 0x5425, pci_device_1332_5425, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1332_5425, +#else + NULL, +#endif + 0 +}; #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_134a_0001 = { @@ -56789,6 +57782,15 @@ static const pciDeviceInfo pci_dev_info_1385_4100 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1385_4105 = { + 0x4105, pci_device_1385_4105, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1385_4105, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1385_620a = { 0x620a, pci_device_1385_620a, #ifdef INIT_SUBSYS_INFO @@ -57494,6 +58496,17 @@ static const pciDeviceInfo pci_dev_info_145f_0001 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_146c_1430 = { + 0x1430, pci_device_146c_1430, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_146c_1430, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_148d_1003 = { 0x1003, pci_device_148d_1003, #ifdef INIT_SUBSYS_INFO @@ -57505,6 +58518,17 @@ static const pciDeviceInfo pci_dev_info_148d_1003 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_149d_0001 = { + 0x0001, pci_device_149d_0001, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_149d_0001, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_14af_7102 = { 0x7102, pci_device_14af_7102, #ifdef INIT_SUBSYS_INFO @@ -58016,6 +59040,15 @@ static const pciDeviceInfo pci_dev_info_14e4_1696 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_14e4_169c = { + 0x169c, pci_device_14e4_169c, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_14e4_169c, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_14e4_16a6 = { 0x16a6, pci_device_14e4_16a6, #ifdef INIT_SUBSYS_INFO @@ -58097,6 +59130,15 @@ static const pciDeviceInfo pci_dev_info_14e4_4301 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_14e4_4320 = { + 0x4320, pci_device_14e4_4320, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_14e4_4320, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_14e4_4401 = { 0x4401, pci_device_14e4_4401, #ifdef INIT_SUBSYS_INFO @@ -58497,6 +59539,33 @@ static const pciDeviceInfo pci_dev_info_14f1_1611 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_14f1_1620 = { + 0x1620, pci_device_14f1_1620, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_14f1_1620, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_14f1_1621 = { + 0x1621, pci_device_14f1_1621, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_14f1_1621, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_14f1_1622 = { + 0x1622, pci_device_14f1_1622, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_14f1_1622, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_14f1_1803 = { 0x1803, pci_device_14f1_1803, #ifdef INIT_SUBSYS_INFO @@ -59491,6 +60560,15 @@ static const pciDeviceInfo pci_dev_info_1638_1100 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_163c_3052 = { + 0x3052, pci_device_163c_3052, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_163c_3052, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_163c_5449 = { 0x5449, pci_device_163c_5449, #ifdef INIT_SUBSYS_INFO @@ -59542,6 +60620,17 @@ static const pciDeviceInfo pci_dev_info_16ab_1102 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_16ca_0001 = { + 0x0001, pci_device_16ca_0001, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_16ca_0001, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_16ec_3685 = { 0x3685, pci_device_16ec_3685, #ifdef INIT_SUBSYS_INFO @@ -59780,6 +60869,17 @@ static const pciDeviceInfo pci_dev_info_1de1_dc29 = { }; #endif #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_1fc0_0300 = { + 0x0300, pci_device_1fc0_0300, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1fc0_0300, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_2348_2010 = { 0x2010, pci_device_2348_2010, #ifdef INIT_SUBSYS_INFO @@ -59818,6 +60918,24 @@ static const pciDeviceInfo pci_dev_info_3388_0021 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_3388_101a = { + 0x101a, pci_device_3388_101a, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_3388_101a, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_3388_101b = { + 0x101b, pci_device_3388_101b, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_3388_101b, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_3388_8011 = { 0x8011, pci_device_3388_8011, #ifdef INIT_SUBSYS_INFO @@ -61102,6 +62220,17 @@ static const pciDeviceInfo pci_dev_info_5333_ca00 = { 0 }; #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo pci_dev_info_544c_0350 = { + 0x0350, pci_device_544c_0350, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_544c_0350, +#else + NULL, +#endif + 0 +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_5455_4458 = { 0x4458, pci_device_5455_4458, #ifdef INIT_SUBSYS_INFO @@ -61590,6 +62719,15 @@ static const pciDeviceInfo pci_dev_info_8086_1040 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_1043 = { + 0x1043, pci_device_8086_1043, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1043, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_1059 = { 0x1059, pci_device_8086_1059, #ifdef INIT_SUBSYS_INFO @@ -62427,6 +63565,15 @@ static const pciDeviceInfo pci_dev_info_8086_24c7 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_24ca = { + 0x24ca, pci_device_8086_24ca, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24ca, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_24cb = { 0x24cb, pci_device_8086_24cb, #ifdef INIT_SUBSYS_INFO @@ -62436,6 +63583,15 @@ static const pciDeviceInfo pci_dev_info_8086_24cb = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_24cc = { + 0x24cc, pci_device_8086_24cc, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24cc, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_24cd = { 0x24cd, pci_device_8086_24cd, #ifdef INIT_SUBSYS_INFO @@ -62445,6 +63601,114 @@ static const pciDeviceInfo pci_dev_info_8086_24cd = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_24d0 = { + 0x24d0, pci_device_8086_24d0, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d0, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d1 = { + 0x24d1, pci_device_8086_24d1, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d1, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d2 = { + 0x24d2, pci_device_8086_24d2, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d2, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d3 = { + 0x24d3, pci_device_8086_24d3, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d3, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d4 = { + 0x24d4, pci_device_8086_24d4, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d4, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d5 = { + 0x24d5, pci_device_8086_24d5, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d5, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d6 = { + 0x24d6, pci_device_8086_24d6, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d6, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24d7 = { + 0x24d7, pci_device_8086_24d7, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24d7, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24db = { + 0x24db, pci_device_8086_24db, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24db, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24dc = { + 0x24dc, pci_device_8086_24dc, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24dc, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24dd = { + 0x24dd, pci_device_8086_24dd, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24dd, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_24de = { + 0x24de, pci_device_8086_24de, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_24de, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_2500 = { 0x2500, pci_device_8086_2500, #ifdef INIT_SUBSYS_INFO @@ -62616,6 +63880,69 @@ static const pciDeviceInfo pci_dev_info_8086_2548 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_254c = { + 0x254c, pci_device_8086_254c, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_254c, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2550 = { + 0x2550, pci_device_8086_2550, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2550, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2551 = { + 0x2551, pci_device_8086_2551, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2551, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2552 = { + 0x2552, pci_device_8086_2552, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2552, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2553 = { + 0x2553, pci_device_8086_2553, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2553, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2554 = { + 0x2554, pci_device_8086_2554, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2554, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_255d = { + 0x255d, pci_device_8086_255d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_255d, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_2560 = { 0x2560, pci_device_8086_2560, #ifdef INIT_SUBSYS_INFO @@ -62652,6 +63979,15 @@ static const pciDeviceInfo pci_dev_info_8086_2570 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_2571 = { + 0x2571, pci_device_8086_2571, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2571, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_2572 = { 0x2572, pci_device_8086_2572, #ifdef INIT_SUBSYS_INFO @@ -62661,6 +63997,60 @@ static const pciDeviceInfo pci_dev_info_8086_2572 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_2573 = { + 0x2573, pci_device_8086_2573, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2573, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2576 = { + 0x2576, pci_device_8086_2576, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2576, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2578 = { + 0x2578, pci_device_8086_2578, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2578, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_2579 = { + 0x2579, pci_device_8086_2579, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_2579, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_257b = { + 0x257b, pci_device_8086_257b, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_257b, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_257e = { + 0x257e, pci_device_8086_257e, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_257e, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_3092 = { 0x3092, pci_device_8086_3092, #ifdef INIT_SUBSYS_INFO @@ -62670,6 +64060,24 @@ static const pciDeviceInfo pci_dev_info_8086_3092 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_3340 = { + 0x3340, pci_device_8086_3340, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_3340, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_3341 = { + 0x3341, pci_device_8086_3341, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_3341, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_3575 = { 0x3575, pci_device_8086_3575, #ifdef INIT_SUBSYS_INFO @@ -63440,15 +64848,6 @@ static const pciDeviceInfo pci_dev_info_9004_5578 = { #endif 0 }; -static const pciDeviceInfo pci_dev_info_9004_5647 = { - 0x5647, pci_device_9004_5647, -#ifdef INIT_SUBSYS_INFO - pci_ss_list_9004_5647, -#else - NULL, -#endif - 0 -}; static const pciDeviceInfo pci_dev_info_9004_5675 = { 0x5675, pci_device_9004_5675, #ifdef INIT_SUBSYS_INFO @@ -63674,6 +65073,24 @@ static const pciDeviceInfo pci_dev_info_9004_7678 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_9004_7710 = { + 0x7710, pci_device_9004_7710, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9004_7710, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9004_7711 = { + 0x7711, pci_device_9004_7711, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9004_7711, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_9004_7778 = { 0x7778, pci_device_9004_7778, #ifdef INIT_SUBSYS_INFO @@ -64243,6 +65660,24 @@ static const pciDeviceInfo pci_dev_info_9005_801f = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_9005_8080 = { + 0x8080, pci_device_9005_8080, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_8080, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9005_808f = { + 0x808f, pci_device_9005_808f, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_808f, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_9005_8090 = { 0x8090, pci_device_9005_8090, #ifdef INIT_SUBSYS_INFO @@ -64288,6 +65723,51 @@ static const pciDeviceInfo pci_dev_info_9005_8094 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_9005_8095 = { + 0x8095, pci_device_9005_8095, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_8095, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9005_8096 = { + 0x8096, pci_device_9005_8096, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_8096, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9005_8097 = { + 0x8097, pci_device_9005_8097, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_8097, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9005_809c = { + 0x809c, pci_device_9005_809c, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_809c, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_9005_809d = { + 0x809d, pci_device_9005_809d, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_9005_809d, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_9005_809e = { 0x809e, pci_device_9005_809e, #ifdef INIT_SUBSYS_INFO @@ -64862,6 +66342,7 @@ static const pciDeviceInfo *pci_dev_list_1001[] = { }; #endif static const pciDeviceInfo *pci_dev_list_1002[] = { + &pci_dev_info_1002_4136, &pci_dev_info_1002_4144, &pci_dev_info_1002_4145, &pci_dev_info_1002_4146, @@ -64925,10 +66406,12 @@ static const pciDeviceInfo *pci_dev_list_1002[] = { &pci_dev_info_1002_4e45, &pci_dev_info_1002_4e46, &pci_dev_info_1002_4e47, + &pci_dev_info_1002_4e48, &pci_dev_info_1002_4e64, &pci_dev_info_1002_4e65, &pci_dev_info_1002_4e66, &pci_dev_info_1002_4e67, + &pci_dev_info_1002_4e68, &pci_dev_info_1002_5041, &pci_dev_info_1002_5042, &pci_dev_info_1002_5043, @@ -64998,6 +66481,8 @@ static const pciDeviceInfo *pci_dev_list_1002[] = { &pci_dev_info_1002_5655, &pci_dev_info_1002_5656, &pci_dev_info_1002_700f, + &pci_dev_info_1002_7010, + &pci_dev_info_1002_cab2, NULL }; #ifdef VENDOR_INCLUDE_NONVIDEO @@ -65094,6 +66579,7 @@ static const pciDeviceInfo *pci_dev_list_1011[] = { &pci_dev_info_1011_000f, &pci_dev_info_1011_0014, &pci_dev_info_1011_0016, + &pci_dev_info_1011_0017, &pci_dev_info_1011_0019, &pci_dev_info_1011_001a, &pci_dev_info_1011_0021, @@ -65402,8 +66888,10 @@ static const pciDeviceInfo *pci_dev_list_1028[] = { &pci_dev_info_1028_0006, &pci_dev_info_1028_0007, &pci_dev_info_1028_0008, + &pci_dev_info_1028_0009, &pci_dev_info_1028_000a, &pci_dev_info_1028_000c, + &pci_dev_info_1028_000d, &pci_dev_info_1028_000e, &pci_dev_info_1028_000f, NULL @@ -65418,6 +66906,7 @@ static const pciDeviceInfo *pci_dev_list_102a[] = { #endif static const pciDeviceInfo *pci_dev_list_102b[] = { &pci_dev_info_102b_0010, + &pci_dev_info_102b_0100, &pci_dev_info_102b_0518, &pci_dev_info_102b_0519, &pci_dev_info_102b_051a, @@ -65543,6 +67032,7 @@ static const pciDeviceInfo *pci_dev_list_1039[] = { &pci_dev_info_1039_0635, &pci_dev_info_1039_0645, &pci_dev_info_1039_0646, + &pci_dev_info_1039_0648, &pci_dev_info_1039_0650, &pci_dev_info_1039_0651, &pci_dev_info_1039_0730, @@ -65550,6 +67040,7 @@ static const pciDeviceInfo *pci_dev_list_1039[] = { &pci_dev_info_1039_0735, &pci_dev_info_1039_0740, &pci_dev_info_1039_0745, + &pci_dev_info_1039_0755, &pci_dev_info_1039_0900, &pci_dev_info_1039_0961, &pci_dev_info_1039_0962, @@ -65613,6 +67104,7 @@ static const pciDeviceInfo *pci_dev_list_103c[] = { &pci_dev_info_103c_122a, &pci_dev_info_103c_122e, &pci_dev_info_103c_1290, + &pci_dev_info_103c_12b4, &pci_dev_info_103c_2910, &pci_dev_info_103c_2925, NULL @@ -66213,6 +67705,7 @@ static const pciDeviceInfo *pci_dev_list_1093[] = { #define pci_dev_list_1094 NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1095[] = { + &pci_dev_info_1095_0240, &pci_dev_info_1095_0640, &pci_dev_info_1095_0643, &pci_dev_info_1095_0646, @@ -66269,6 +67762,7 @@ static const pciDeviceInfo *pci_dev_list_109e[] = { #define pci_dev_list_10a4 NULL #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_10a5[] = { + &pci_dev_info_10a5_3052, &pci_dev_info_10a5_5449, NULL }; @@ -66303,6 +67797,7 @@ static const pciDeviceInfo *pci_dev_list_10a9[] = { &pci_dev_info_10a9_1006, &pci_dev_info_10a9_1007, &pci_dev_info_10a9_1008, + &pci_dev_info_10a9_100a, &pci_dev_info_10a9_2001, &pci_dev_info_10a9_2002, &pci_dev_info_10a9_8001, @@ -66388,6 +67883,7 @@ static const pciDeviceInfo *pci_dev_list_10b6[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_10b7[] = { &pci_dev_info_10b7_0001, + &pci_dev_info_10b7_0910, &pci_dev_info_10b7_1006, &pci_dev_info_10b7_1007, &pci_dev_info_10b7_3390, @@ -66455,6 +67951,7 @@ static const pciDeviceInfo *pci_dev_list_10b8[] = { NULL }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_10b9[] = { &pci_dev_info_10b9_0111, &pci_dev_info_10b9_1435, @@ -66507,6 +68004,7 @@ static const pciDeviceInfo *pci_dev_list_10b9[] = { &pci_dev_info_10b9_5251, &pci_dev_info_10b9_5253, &pci_dev_info_10b9_5261, + &pci_dev_info_10b9_5450, &pci_dev_info_10b9_5451, &pci_dev_info_10b9_5453, &pci_dev_info_10b9_5455, @@ -66518,6 +68016,7 @@ static const pciDeviceInfo *pci_dev_list_10b9[] = { &pci_dev_info_10b9_7101, NULL }; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_10ba[] = { &pci_dev_info_10ba_0301, @@ -66897,6 +68396,7 @@ static const pciDeviceInfo *pci_dev_list_1103[] = { &pci_dev_info_1103_0006, &pci_dev_info_1103_0007, &pci_dev_info_1103_0008, + &pci_dev_info_1103_0009, NULL }; #endif @@ -66909,6 +68409,7 @@ static const pciDeviceInfo *pci_dev_list_1105[] = { NULL }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1106[] = { &pci_dev_info_1106_0102, &pci_dev_info_1106_0130, @@ -66992,6 +68493,7 @@ static const pciDeviceInfo *pci_dev_list_1106[] = { &pci_dev_info_1106_b168, NULL }; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1107[] = { &pci_dev_info_1107_0576, @@ -67021,6 +68523,12 @@ static const pciDeviceInfo *pci_dev_list_1109[] = { static const pciDeviceInfo *pci_dev_list_110a[] = { &pci_dev_info_110a_0002, &pci_dev_info_110a_0005, + &pci_dev_info_110a_0006, + &pci_dev_info_110a_0015, + &pci_dev_info_110a_001d, + &pci_dev_info_110a_007b, + &pci_dev_info_110a_007c, + &pci_dev_info_110a_007d, &pci_dev_info_110a_2102, &pci_dev_info_110a_4942, &pci_dev_info_110a_6120, @@ -67469,6 +68977,7 @@ static const pciDeviceInfo *pci_dev_list_1165[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1166[] = { &pci_dev_info_1166_0005, + &pci_dev_info_1166_0006, &pci_dev_info_1166_0007, &pci_dev_info_1166_0008, &pci_dev_info_1166_0009, @@ -68223,6 +69732,7 @@ static const pciDeviceInfo *pci_dev_list_125d[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1260[] = { &pci_dev_info_1260_3873, + &pci_dev_info_1260_3890, &pci_dev_info_1260_8130, &pci_dev_info_1260_8131, NULL @@ -68258,6 +69768,7 @@ static const pciDeviceInfo *pci_dev_list_126f[] = { &pci_dev_info_126f_0710, &pci_dev_info_126f_0712, &pci_dev_info_126f_0720, + &pci_dev_info_126f_0730, &pci_dev_info_126f_0810, &pci_dev_info_126f_0811, &pci_dev_info_126f_0820, @@ -68275,6 +69786,7 @@ static const pciDeviceInfo *pci_dev_list_1273[] = { #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1274[] = { + &pci_dev_info_1274_1171, &pci_dev_info_1274_1371, &pci_dev_info_1274_5000, &pci_dev_info_1274_5880, @@ -68287,6 +69799,7 @@ static const pciDeviceInfo *pci_dev_list_1274[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1278[] = { &pci_dev_info_1278_0701, + &pci_dev_info_1278_0710, NULL }; #endif @@ -68515,12 +70028,23 @@ static const pciDeviceInfo *pci_dev_list_12d2[] = { NULL }; #define pci_dev_list_12d3 NULL -#define pci_dev_list_12d4 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_12d4[] = { + &pci_dev_info_12d4_0200, + NULL +}; +#endif #define pci_dev_list_12d5 NULL #define pci_dev_list_12d6 NULL #define pci_dev_list_12d7 NULL #define pci_dev_list_12d8 NULL -#define pci_dev_list_12d9 NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_12d9[] = { + &pci_dev_info_12d9_0002, + &pci_dev_info_12d9_0004, + NULL +}; +#endif #define pci_dev_list_12da NULL #define pci_dev_list_12db NULL #define pci_dev_list_12dc NULL @@ -68621,6 +70145,7 @@ static const pciDeviceInfo *pci_dev_list_1307[] = { &pci_dev_info_1307_0036, &pci_dev_info_1307_0037, &pci_dev_info_1307_004c, + &pci_dev_info_1307_004d, NULL }; #endif @@ -68730,6 +70255,7 @@ static const pciDeviceInfo *pci_dev_list_131f[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1332[] = { &pci_dev_info_1332_5415, + &pci_dev_info_1332_5425, NULL }; #endif @@ -68862,6 +70388,7 @@ static const pciDeviceInfo *pci_dev_list_135e[] = { #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1385[] = { &pci_dev_info_1385_4100, + &pci_dev_info_1385_4105, &pci_dev_info_1385_620a, &pci_dev_info_1385_622a, &pci_dev_info_1385_630a, @@ -69257,7 +70784,12 @@ static const pciDeviceInfo *pci_dev_list_145f[] = { #define pci_dev_list_1469 NULL #define pci_dev_list_146a NULL #define pci_dev_list_146b NULL -#define pci_dev_list_146c NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_146c[] = { + &pci_dev_info_146c_1430, + NULL +}; +#endif #define pci_dev_list_146d NULL #define pci_dev_list_146e NULL #define pci_dev_list_146f NULL @@ -69311,7 +70843,12 @@ static const pciDeviceInfo *pci_dev_list_148d[] = { #define pci_dev_list_149a NULL #define pci_dev_list_149b NULL #define pci_dev_list_149c NULL -#define pci_dev_list_149d NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_149d[] = { + &pci_dev_info_149d_0001, + NULL +}; +#endif #define pci_dev_list_149e NULL #define pci_dev_list_149f NULL #define pci_dev_list_14a0 NULL @@ -69470,6 +71007,7 @@ static const pciDeviceInfo *pci_dev_list_14e4[] = { &pci_dev_info_14e4_1653, &pci_dev_info_14e4_165d, &pci_dev_info_14e4_1696, + &pci_dev_info_14e4_169c, &pci_dev_info_14e4_16a6, &pci_dev_info_14e4_16a7, &pci_dev_info_14e4_16a8, @@ -69479,6 +71017,7 @@ static const pciDeviceInfo *pci_dev_list_14e4[] = { &pci_dev_info_14e4_4211, &pci_dev_info_14e4_4212, &pci_dev_info_14e4_4301, + &pci_dev_info_14e4_4320, &pci_dev_info_14e4_4401, &pci_dev_info_14e4_4402, &pci_dev_info_14e4_4410, @@ -69544,6 +71083,9 @@ static const pciDeviceInfo *pci_dev_list_14f1[] = { &pci_dev_info_14f1_1456, &pci_dev_info_14f1_1610, &pci_dev_info_14f1_1611, + &pci_dev_info_14f1_1620, + &pci_dev_info_14f1_1621, + &pci_dev_info_14f1_1622, &pci_dev_info_14f1_1803, &pci_dev_info_14f1_1815, &pci_dev_info_14f1_2003, @@ -70012,6 +71554,7 @@ static const pciDeviceInfo *pci_dev_list_1638[] = { #endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_163c[] = { + &pci_dev_info_163c_3052, &pci_dev_info_163c_5449, NULL }; @@ -70037,6 +71580,12 @@ static const pciDeviceInfo *pci_dev_list_16ab[] = { #endif #define pci_dev_list_16be NULL #ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_16ca[] = { + &pci_dev_info_16ca_0001, + NULL +}; +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_16ec[] = { &pci_dev_info_16ec_3685, NULL @@ -70129,6 +71678,12 @@ static const pciDeviceInfo *pci_dev_list_1de1[] = { NULL }; #endif +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_1fc0[] = { + &pci_dev_info_1fc0_0300, + NULL +}; +#endif #define pci_dev_list_2000 NULL #define pci_dev_list_2001 NULL #define pci_dev_list_2003 NULL @@ -70152,6 +71707,8 @@ static const pciDeviceInfo *pci_dev_list_3388[] = { &pci_dev_info_3388_0013, &pci_dev_info_3388_0014, &pci_dev_info_3388_0021, + &pci_dev_info_3388_101a, + &pci_dev_info_3388_101b, &pci_dev_info_3388_8011, &pci_dev_info_3388_8012, &pci_dev_info_3388_8013, @@ -70378,7 +71935,12 @@ static const pciDeviceInfo *pci_dev_list_5333[] = { &pci_dev_info_5333_ca00, NULL }; -#define pci_dev_list_544c NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciDeviceInfo *pci_dev_list_544c[] = { + &pci_dev_info_544c_0350, + NULL +}; +#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_5455[] = { &pci_dev_info_5455_4458, @@ -70471,6 +72033,7 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_103d, &pci_dev_info_8086_103e, &pci_dev_info_8086_1040, + &pci_dev_info_8086_1043, &pci_dev_info_8086_1059, &pci_dev_info_8086_1130, &pci_dev_info_8086_1131, @@ -70564,8 +72127,22 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_24c5, &pci_dev_info_8086_24c6, &pci_dev_info_8086_24c7, + &pci_dev_info_8086_24ca, &pci_dev_info_8086_24cb, + &pci_dev_info_8086_24cc, &pci_dev_info_8086_24cd, + &pci_dev_info_8086_24d0, + &pci_dev_info_8086_24d1, + &pci_dev_info_8086_24d2, + &pci_dev_info_8086_24d3, + &pci_dev_info_8086_24d4, + &pci_dev_info_8086_24d5, + &pci_dev_info_8086_24d6, + &pci_dev_info_8086_24d7, + &pci_dev_info_8086_24db, + &pci_dev_info_8086_24dc, + &pci_dev_info_8086_24dd, + &pci_dev_info_8086_24de, &pci_dev_info_8086_2500, &pci_dev_info_8086_2501, &pci_dev_info_8086_250b, @@ -70585,12 +72162,28 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_2546, &pci_dev_info_8086_2547, &pci_dev_info_8086_2548, + &pci_dev_info_8086_254c, + &pci_dev_info_8086_2550, + &pci_dev_info_8086_2551, + &pci_dev_info_8086_2552, + &pci_dev_info_8086_2553, + &pci_dev_info_8086_2554, + &pci_dev_info_8086_255d, &pci_dev_info_8086_2560, &pci_dev_info_8086_2561, &pci_dev_info_8086_2562, &pci_dev_info_8086_2570, + &pci_dev_info_8086_2571, &pci_dev_info_8086_2572, + &pci_dev_info_8086_2573, + &pci_dev_info_8086_2576, + &pci_dev_info_8086_2578, + &pci_dev_info_8086_2579, + &pci_dev_info_8086_257b, + &pci_dev_info_8086_257e, &pci_dev_info_8086_3092, + &pci_dev_info_8086_3340, + &pci_dev_info_8086_3341, &pci_dev_info_8086_3575, &pci_dev_info_8086_3576, &pci_dev_info_8086_3577, @@ -70693,7 +72286,6 @@ static const pciDeviceInfo *pci_dev_list_9004[] = { &pci_dev_info_9004_5478, &pci_dev_info_9004_5575, &pci_dev_info_9004_5578, - &pci_dev_info_9004_5647, &pci_dev_info_9004_5675, &pci_dev_info_9004_5678, &pci_dev_info_9004_5775, @@ -70719,6 +72311,8 @@ static const pciDeviceInfo *pci_dev_list_9004[] = { &pci_dev_info_9004_7478, &pci_dev_info_9004_7578, &pci_dev_info_9004_7678, + &pci_dev_info_9004_7710, + &pci_dev_info_9004_7711, &pci_dev_info_9004_7778, &pci_dev_info_9004_7810, &pci_dev_info_9004_7815, @@ -70787,11 +72381,18 @@ static const pciDeviceInfo *pci_dev_list_9005[] = { &pci_dev_info_9005_8014, &pci_dev_info_9005_801e, &pci_dev_info_9005_801f, + &pci_dev_info_9005_8080, + &pci_dev_info_9005_808f, &pci_dev_info_9005_8090, &pci_dev_info_9005_8091, &pci_dev_info_9005_8092, &pci_dev_info_9005_8093, &pci_dev_info_9005_8094, + &pci_dev_info_9005_8095, + &pci_dev_info_9005_8096, + &pci_dev_info_9005_8097, + &pci_dev_info_9005_809c, + &pci_dev_info_9005_809d, &pci_dev_info_9005_809e, &pci_dev_info_9005_809f, NULL @@ -71461,7 +73062,9 @@ static const pciVendorInfo pciVendorInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x10b8, pci_vendor_10b8, pci_dev_list_10b8}, #endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x10b9, pci_vendor_10b9, pci_dev_list_10b9}, +#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x10ba, pci_vendor_10ba, pci_dev_list_10ba}, #endif @@ -71682,7 +73285,9 @@ static const pciVendorInfo pciVendorInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x1105, pci_vendor_1105, pci_dev_list_1105}, #endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x1106, pci_vendor_1106, pci_dev_list_1106}, +#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x1107, pci_vendor_1107, pci_dev_list_1107}, #endif @@ -75465,6 +77070,9 @@ static const pciVendorInfo pciVendorInfoList[] = { {0x16be, pci_vendor_16be, pci_dev_list_16be}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO + {0x16ca, pci_vendor_16ca, pci_dev_list_16ca}, +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x16ec, pci_vendor_16ec, pci_dev_list_16ec}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -75540,6 +77148,9 @@ static const pciVendorInfo pciVendorInfoList[] = { {0x1de1, pci_vendor_1de1, pci_dev_list_1de1}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO + {0x1fc0, pci_vendor_1fc0, pci_dev_list_1fc0}, +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x2000, pci_vendor_2000, pci_dev_list_2000}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -76387,7 +77998,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x10b8, pci_vendor_10b8, pci_ss_list_10b8}, #endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x10b9, pci_vendor_10b9, pci_ss_list_10b9}, +#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x10ba, pci_vendor_10ba, pci_ss_list_10ba}, #endif @@ -76608,7 +78221,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x1105, pci_vendor_1105, pci_ss_list_1105}, #endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x1106, pci_vendor_1106, pci_ss_list_1106}, +#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x1107, pci_vendor_1107, pci_ss_list_1107}, #endif @@ -80391,6 +82006,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = { {0x16be, pci_vendor_16be, pci_ss_list_16be}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO + {0x16ca, pci_vendor_16ca, pci_ss_list_16ca}, +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x16ec, pci_vendor_16ec, pci_ss_list_16ec}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO @@ -80466,6 +82084,9 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = { {0x1de1, pci_vendor_1de1, pci_ss_list_1de1}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO + {0x1fc0, pci_vendor_1fc0, pci_ss_list_1fc0}, +#endif +#ifdef VENDOR_INCLUDE_NONVIDEO {0x2000, pci_vendor_2000, pci_ss_list_2000}, #endif #ifdef VENDOR_INCLUDE_NONVIDEO diff --git a/hw/xfree86/scanpci/xf86PciStr.h b/hw/xfree86/scanpci/xf86PciStr.h index 4704a0c31..bb36d510a 100644 --- a/hw/xfree86/scanpci/xf86PciStr.h +++ b/hw/xfree86/scanpci/xf86PciStr.h @@ -1,9 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.1 2002/07/15 20:46:04 dawes Exp $ */ - +/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.2 2003/08/24 17:37:10 dawes Exp $ */ /* - * Copyright © 2002 by The XFree86 Project, Inc + * Copyright (c) 2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). */ - + /* * Structs used to hold the pre-parsed pci.ids data. These are private * to the scanpci and pcidata modules. diff --git a/hw/xfree86/scanpci/xf86ScanPci.c b/hw/xfree86/scanpci/xf86ScanPci.c index 0370a6e5f..534c8973f 100644 --- a/hw/xfree86/scanpci/xf86ScanPci.c +++ b/hw/xfree86/scanpci/xf86ScanPci.c @@ -1,14 +1,37 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.12 2002/07/15 20:46:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.14 2003/09/23 05:21:46 dawes Exp $ */ /* * Display the Subsystem Vendor Id and Subsystem Id in order to identify * the cards installed in this computer * - * Copyright 1995-2002 by The XFree86 Project, Inc. - * * A lot of this comes from Robin Cutshaw's scanpci * */ - +/* + * Copyright (c) 1995-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ /* * This file is used to build both the scanpci and pcidata modules. @@ -167,7 +190,8 @@ ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device, return 2; } for (k = 0; pciVendorInfoList[k].VendorName; k++) { - if (svendor == pciVendorInfoList[k].VendorID) { + if (svendor && + svendor == pciVendorInfoList[k].VendorID) { if (svname) { *svname = pciVendorInfoList[k].VendorName; } diff --git a/hw/xfree86/scanpci/xf86ScanPci.h b/hw/xfree86/scanpci/xf86ScanPci.h index 8dba8937d..3a154174a 100644 --- a/hw/xfree86/scanpci/xf86ScanPci.h +++ b/hw/xfree86/scanpci/xf86ScanPci.h @@ -1,6 +1,30 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.2 2002/07/15 20:46:04 dawes Exp $ */ - - +/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.3 2003/08/24 17:37:10 dawes Exp $ */ +/* + * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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 copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ #ifndef SCANPCI_H_ #define SCANPCI_H_ diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index 065885abc..093f35b30 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -6,7 +6,7 @@ Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan@vmware.com) */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadow.c,v 1.18.2.1 2003/04/15 20:32:29 sven Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadow.c,v 1.21 2003/11/10 18:22:38 tsi Exp $ */ #include "X.h" #include "Xproto.h" @@ -372,7 +372,7 @@ ShadowCopyWindow( RegionRec rgnDst; if (pPriv->vtSema) { - REGION_INIT(pWin->drawable.pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pWin->drawable.pScreen, &rgnDst); REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn); REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst, @@ -646,7 +646,11 @@ ShadowFillSpans( } box.y2++; - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); + + if(!pGC->miTranslate) { + TRANSLATE_BOX(box, pDraw); + } + TRIM_BOX(box, pGC); if(BOX_NOT_EMPTY(box)) { if(pPriv->preRefresh) @@ -698,7 +702,11 @@ ShadowSetSpans( } box.y2++; - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); + + if(!pGC->miTranslate) { + TRANSLATE_BOX(box, pDraw); + } + TRIM_BOX(box, pGC); if(BOX_NOT_EMPTY(box)) { if(pPriv->preRefresh) @@ -1779,9 +1787,15 @@ ShadowPushPixels( SHADOW_GC_OP_PROLOGUE(pGC); if(IS_VISIBLE(pDraw)) { - box.x1 = xOrg + pDraw->x; + box.x1 = xOrg; + box.y1 = yOrg; + + if(!pGC->miTranslate) { + box.x1 += pDraw->x; + box.y1 += pDraw->y; + } + box.x2 = box.x1 + dx; - box.y1 = yOrg + pDraw->y; box.y2 = box.y1 + dy; TRIM_BOX(box, pGC); diff --git a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c index 6e81fd247..e70fb2db7 100644 --- a/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c +++ b/hw/xfree86/utils/kbd_mode/sun-kbd_mode.c @@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.11 2002/10/23 16:23:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.12 2003/10/07 21:39:43 herrb Exp $ */ /* static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13"; @@ -65,7 +65,8 @@ static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13"; #include <stdlib.h> #include <unistd.h> -static void die(), usage(); +static void die(char*); +static void usage(void); static int kbd_fd; int @@ -125,15 +126,14 @@ main(argc, argv) } static void -die(msg) - char *msg; +die(char *msg) { fprintf(stderr, "%s\n", msg); exit(1); } static void -usage() +usage(void) { int translate; diff --git a/hw/xfree86/utils/pcitweak/pcitweak.c b/hw/xfree86/utils/pcitweak/pcitweak.c index 42a9f9712..7ef1150b0 100644 --- a/hw/xfree86/utils/pcitweak/pcitweak.c +++ b/hw/xfree86/utils/pcitweak/pcitweak.c @@ -1,11 +1,36 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.17 2003/08/24 17:37:01 dawes Exp $ */ /* - * pcitweak.c + * Copyright (c) 1999-2002 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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 conditions: + * + * 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 MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, 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. * - * Copyright 1999 by The XFree86 Project, Inc. + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) 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 copyright holder(s) and author(s). + */ + +/* + * pcitweak.c * * Author: David Dawes <dawes@xfree86.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.16 2002/12/14 04:41:13 dawes Exp $ */ #include "X.h" #include "os.h" diff --git a/hw/xfree86/utils/pcitweak/pcitweak.man.pre b/hw/xfree86/utils/pcitweak/pcitweak.man.pre index f4bd8d405..14cfa885f 100644 --- a/hw/xfree86/utils/pcitweak/pcitweak.man.pre +++ b/hw/xfree86/utils/pcitweak/pcitweak.man.pre @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.3 2001/01/27 18:20:56 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.4 2003/05/29 21:48:09 herrb Exp $ .TH PCITWEAK 1 __vendorversion__ .SH NAME pcitweak - read/write PCI config space @@ -21,7 +21,7 @@ pcitweak - read/write PCI config space .SH DESCRIPTION .I Pcitweak is a utility that can be used to examine or change registers in the PCI -configuration space. On most platfoms +configuration space. On most platforms .I pcitweak can only be run by the root user. .SH OPTIONS diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.c b/hw/xfree86/utils/xorgcfg/card-cfg.c index a96797f1c..5299025f1 100644 --- a/hw/xfree86/utils/xorgcfg/card-cfg.c +++ b/hw/xfree86/utils/xorgcfg/card-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.11 2001/11/01 19:08:58 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $ */ #include "xf86config.h" @@ -368,7 +368,7 @@ CardModel(XF86SetupInfo *info) static Widget model; if (first) { - Widget label, viewport; + Widget viewport; first = 0; @@ -376,7 +376,7 @@ CardModel(XF86SetupInfo *info) model = XtCreateWidget("cardModel", formWidgetClass, configp, NULL, 0); - label = XtCreateManagedWidget("label", labelWidgetClass, + (void) XtCreateManagedWidget("label", labelWidgetClass, model, NULL, 0); filter = XtVaCreateManagedWidget("filter", asciiTextWidgetClass, model, diff --git a/hw/xfree86/utils/xorgcfg/config.c b/hw/xfree86/utils/xorgcfg/config.c index 929999f9e..8c2da3d9b 100644 --- a/hw/xfree86/utils/xorgcfg/config.c +++ b/hw/xfree86/utils/xorgcfg/config.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.8 2002/10/21 04:18:36 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.9 2003/11/03 05:11:58 tsi Exp $ */ #include "config.h" @@ -106,7 +106,7 @@ void StartConfig(void) { static int first = 1; - Widget pane, top, label, bottom, cancel; + Widget pane, top, bottom, cancel; const char *filename; if (!first) @@ -144,7 +144,7 @@ StartConfig(void) shell, NULL, 0); top = XtCreateManagedWidget("top", formWidgetClass, pane, NULL, 0); - label = XtCreateManagedWidget("label", labelWidgetClass, + (void) XtCreateManagedWidget("label", labelWidgetClass, top, NULL, 0); ident_widget = XtVaCreateManagedWidget("identifier", asciiTextWidgetClass, top, @@ -199,11 +199,11 @@ ConfigError(void) static int first = 1; if (first) { - Widget label, command; + Widget command; errcurrent = XtCreateWidget("error", formWidgetClass, configp, NULL, 0); - label = XtCreateManagedWidget("label", labelWidgetClass, + (void) XtCreateManagedWidget("label", labelWidgetClass, errcurrent, NULL, 0); command = XtCreateManagedWidget("command", commandWidgetClass, errcurrent, NULL, 0); diff --git a/hw/xfree86/utils/xorgcfg/config.h b/hw/xfree86/utils/xorgcfg/config.h index 34b8d7e52..6d1193a3d 100644 --- a/hw/xfree86/utils/xorgcfg/config.h +++ b/hw/xfree86/utils/xorgcfg/config.h @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.16 2002/05/31 18:46:03 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.17 2003/06/10 17:03:55 dawes Exp $ */ #include <X11/IntrinsicP.h> @@ -97,6 +97,7 @@ #define CONFIG_ACCESSX 3 extern int config_mode; +#ifndef __UNIXOS2__ #define CONFPATH "%A," "%R," \ "/etc/X11/%R," "%P/etc/X11/%R," \ "%E," "%F," \ @@ -113,6 +114,26 @@ extern int config_mode; "%P/etc/X11/%X," \ "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ "%P/lib/X11/%X" +#else +#define CONFPATH "%&"XF86CONFIGDIR"/%R," "%&"XF86CONFIGDIR"/%X," \ + "%A," "%R," \ + "/etc/X11/%R," "%P/etc/X11/%R," \ + "%E," "%F," \ + "/etc/X11/%F," "%P/etc/X11/%F," \ + "%D/%X," \ + "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \ + "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "%P/etc/X11/%X," \ + "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X" +#define USER_CONFPATH "%&"XF86CONFIGDIR"/%X," "%&"XF86CONFIGDIR"/%X," \ + "/etc/X11/%S," "%P/etc/X11/%S," \ + "/etc/X11/%G," "%P/etc/X11/%G," \ + "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "%P/etc/X11/%X," \ + "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X" +#endif /* * Types diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c index b9890b32b..a3dfcbe2d 100644 --- a/hw/xfree86/utils/xorgcfg/expert.c +++ b/hw/xfree86/utils/xorgcfg/expert.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.14 2003/02/07 05:46:53 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.15 2003/11/03 05:11:58 tsi Exp $ */ #include "config.h" @@ -498,12 +498,12 @@ CreateFiles(TreeNode *files) static void CreateFilesField(TreeNode *node, char *name, char *value) { - Widget box, label, text; + Widget box, text; box = XtVaCreateManagedWidget(name, boxWidgetClass, tree, XtNtreeParent, node->node, NULL, 0); node->node = box; - label = XtVaCreateManagedWidget("label", labelWidgetClass, box, + (void) XtVaCreateManagedWidget("label", labelWidgetClass, box, XtNlabel, name, NULL, 0); text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box, XtNeditType, XawtextEdit, XtNstring, value, @@ -542,7 +542,6 @@ static void CreateFontPath(TreeNode *fontpath, char *path) { TreeNode *prev = NULL, *node; - Widget w; if (path == NULL) { if (XF86Font_path) { @@ -568,7 +567,7 @@ CreateFontPath(TreeNode *fontpath, char *path) for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) { node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL); node->destroy = FontPathChanged; - w = CreateFontPathField(node, s, False); + (void) CreateFontPathField(node, s, False); if (fontpath->child == NULL) fontpath->child = node; else @@ -579,7 +578,7 @@ CreateFontPath(TreeNode *fontpath, char *path) } node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL); - w = CreateFontPathField(node, "", True); + (void) CreateFontPathField(node, "", True); if (fontpath->child == NULL) fontpath->child = node; else @@ -719,7 +718,6 @@ static void CreateModulePath(TreeNode *modulepath, char *path) { TreeNode *prev = NULL, *node; - Widget w; if (path == NULL) { if (XF86Module_path) { @@ -745,7 +743,7 @@ CreateModulePath(TreeNode *modulepath, char *path) for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) { node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL); node->destroy = ModulePathChanged; - w = CreateModulePathField(node, s, False); + (void) CreateModulePathField(node, s, False); if (modulepath->child == NULL) modulepath->child = node; else @@ -756,7 +754,7 @@ CreateModulePath(TreeNode *modulepath, char *path) } node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL); - w = CreateModulePathField(node, "", True); + (void) CreateModulePathField(node, "", True); if (modulepath->child == NULL) modulepath->child = node; else @@ -2130,7 +2128,7 @@ CreateMonitorModes(TreeNode *parent, XF86ConfModesLinkPtr lnk) static void CreateMonitorModesField(TreeNode *node, Bool addnew) { - Widget box, command, label; + Widget box, command; box = XtVaCreateWidget("modes", formWidgetClass, tree, XtNtreeParent, node->treeParent, NULL, 0); @@ -2142,7 +2140,7 @@ CreateMonitorModesField(TreeNode *node, Bool addnew) command = XtCreateManagedWidget("remove", commandWidgetClass, box, NULL, 0); XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node); - label = XtVaCreateManagedWidget("mode", labelWidgetClass, box, + (void) XtVaCreateManagedWidget("mode", labelWidgetClass, box, XtNlabel, lnk->ml_modes_str, NULL, 0); } else { @@ -2983,7 +2981,7 @@ CreateScreenAdaptor(TreeNode *parent, XF86ConfAdaptorLinkPtr lnk) static void CreateScreenAdaptorField(TreeNode *node, Bool addnew) { - Widget box, command, label; + Widget box, command; box = XtVaCreateWidget("adaptor", formWidgetClass, tree, XtNtreeParent, node->treeParent, NULL, 0); @@ -2995,7 +2993,7 @@ CreateScreenAdaptorField(TreeNode *node, Bool addnew) command = XtCreateManagedWidget("remove", commandWidgetClass, box, NULL, 0); XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node); - label = XtVaCreateManagedWidget("label", labelWidgetClass, box, + (void) XtVaCreateManagedWidget("label", labelWidgetClass, box, XtNlabel, lnk->al_adaptor_str, NULL, 0); } else { @@ -3756,7 +3754,7 @@ CreateAdjacency(TreeNode *parent, XF86ConfAdjacencyPtr adj) static void CreateAdjacencyField(TreeNode *node, Bool addnew) { - Widget box, command, label, sme; + Widget box, command, sme; XF86ConfScreenPtr ptr = XF86Config->conf_screen_lst; box = XtVaCreateWidget("adjacency", formWidgetClass, tree, @@ -3786,7 +3784,7 @@ CreateAdjacencyField(TreeNode *node, Bool addnew) command = XtCreateManagedWidget("remove", commandWidgetClass, box, NULL, 0); XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node); - label = XtVaCreateManagedWidget("label", labelWidgetClass, box, + (void) XtVaCreateManagedWidget("label", labelWidgetClass, box, XtNlabel, adj->adj_screen->scrn_identifier, NULL, 0); diff --git a/hw/xfree86/utils/xorgcfg/help.c b/hw/xfree86/utils/xorgcfg/help.c index 2b25e8ede..2ae68a082 100644 --- a/hw/xfree86/utils/xorgcfg/help.c +++ b/hw/xfree86/utils/xorgcfg/help.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.7 2002/06/06 21:03:32 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.8 2003/11/03 05:11:58 tsi Exp $ */ #include <X11/IntrinsicP.h> @@ -205,11 +205,11 @@ typedef struct _Html_Item Html_Item; typedef struct _Html_TagInfo { char *name; - int entity : 1; /* it changes the type of the text */ - int nest : 1; /* does not close tags automatically */ - int end : 1; /* need a close markup */ - int adnl : 1; /* add newline before/after tag contents */ - int para : 1; /* changes the paragraph formatting */ + unsigned int entity : 1; /* it changes the type of the text */ + unsigned int nest : 1; /* does not close tags automatically */ + unsigned int end : 1; /* need a close markup */ + unsigned int adnl : 1; /* add newline before/after tag contents */ + unsigned int para : 1; /* changes the paragraph formatting */ unsigned long mask; /* enforce use of attributes of this tag-info */ unsigned long xlfd_mask; void (*parse_args)(Html_Parser*, Html_Item*); diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c index a53bffa01..e3f4e9f47 100644 --- a/hw/xfree86/utils/xorgcfg/loadmod.c +++ b/hw/xfree86/utils/xorgcfg/loadmod.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.14.2.1 2003/03/13 04:10:50 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.18 2003/06/12 14:12:38 eich Exp $ */ #ifdef USE_MODULES @@ -67,6 +67,7 @@ Bool xf86LoaderCheckSymbol(const char*); void xf86LoaderRefSymLists(const char **, ...); void xf86LoaderReqSymLists(const char **, ...); void xf86Msg(int, const char*, ...); +void xf86MsgVerb(int, int, const char*, ...); void xf86PrintChipsets(const char*, const char*, SymTabPtr); void xf86ErrorFVerb(int verb, const char *format, ...); pciVideoPtr *xf86GetPciVideoInfo(void); @@ -77,6 +78,7 @@ void *xf86LoadDrvSubModule(DriverPtr drv, const char*); void xf86DrvMsg(int, int, const char*, ...); pciConfigPtr *xf86GetPciConfigInfo(void); Bool xf86IsPrimaryPci(pcVideoPtr*); +Bool xf86CheckPciSlot(int bus, int device, int func); #endif extern char *loaderPath, **loaderList, **ploaderList; @@ -180,7 +182,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86memchr) SYMFUNC(xf86memcmp) SYMFUNC(xf86memcpy) -#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__x86_64__) +#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__AMD64__) /* * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle * structure copies. This causes a problem both here and in shared @@ -301,6 +303,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86LoaderRefSymLists) SYMFUNC(xf86LoaderReqSymLists) SYMFUNC(xf86Msg) + SYMFUNC(xf86MsgVerb) SYMFUNC(ErrorF) SYMFUNC(xf86PrintChipsets) SYMFUNC(xf86ErrorFVerb) @@ -313,6 +316,10 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86DrvMsg) SYMFUNC(xf86GetPciConfigInfo) SYMFUNC(xf86IsPrimaryPci) + SYMFUNC(xf86CheckPciSlot) + SYMFUNC(XNFalloc) + SYMFUNC(XNFrealloc) + SYMFUNC(XNFcalloc) {0,0} }; @@ -502,9 +509,20 @@ xf86cfgCheckModule(void) numFontModules = 0; fonts = FontModuleList; if (fonts) { + Bool dup = FALSE; while (fonts->name) { - if (strcmp(fonts->name, *ploaderList) == 0) + if (strcasecmp(fonts->name, *ploaderList) == 0) { pfont_module = fonts; + /* HACK: + * fonts->names points into modules. + * Duplicate string of all remaining names to survive + * unloading. Since new fonts are appended to list + * this will only happen once per renderer. + */ + dup = TRUE; + } + if (dup) + fonts->name = strdup(fonts->name); ++numFontModules; ++fonts; } @@ -655,4 +673,10 @@ xf86IsPrimaryPci(pciVideoPtr pPci) { return (True); } + +Bool +xf86CheckPciSlot(int bus, int device, int func) +{ + return (False); +} #endif diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.c b/hw/xfree86/utils/xorgcfg/monitor-cfg.c index 430833381..6ed095416 100644 --- a/hw/xfree86/utils/xorgcfg/monitor-cfg.c +++ b/hw/xfree86/utils/xorgcfg/monitor-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.7 2001/03/24 01:17:20 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.8 2003/09/11 10:08:38 eich Exp $ */ #include "xf86config.h" @@ -69,6 +69,10 @@ static char *hmodes[] = { "Monitor that can do 1280x1024 @ 60 Hz", "Monitor that can do 1280x1024 @ 74 Hz", "Monitor that can do 1280x1024 @ 76 Hz", + "Monitor that can do 1280x1024 @ 85 Hz", + "Monitor that can do 1600x1200 @ 85 Hz", + "Monitor that can do 1920x1440 @ 85 Hz", + "Monitor that can do 2048x1536 @ 85 Hz" }; static char *hmodes_trans[] = { @@ -82,6 +86,10 @@ static char *hmodes_trans[] = { "31.5 - 64.3", "31.5 - 79.0", "31.5 - 82.0", + "31.5 - 92.0", + "31.5 - 108.0", + "31.5 - 128.5", + "31.5 - 137.0" }; static char *vmodes [] = { "50 - 70", "50 - 90", "50 - 100", "40 - 150", }; diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.c b/hw/xfree86/utils/xorgcfg/mouse-cfg.c index 761da248a..17a1c0caf 100644 --- a/hw/xfree86/utils/xorgcfg/mouse-cfg.c +++ b/hw/xfree86/utils/xorgcfg/mouse-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v 1.10 2003/02/15 05:37:58 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v 1.12 2003/11/03 05:11:58 tsi Exp $ */ #include "xf86config.h" @@ -55,6 +55,9 @@ static struct MouseProtocol { char *name; int type; } protocols[] = { +#ifdef __UNIXOS2__ + {"OS2Mouse", MTYPE_AUTOMOUSE}, +#endif #ifdef SCO {"OsMouse", MTYPE_AUTOMOUSE}, #endif @@ -322,7 +325,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info) int i; if (first) { - Widget label, viewport; + Widget viewport; struct dirent *ent; DIR *dir; char **list; @@ -359,7 +362,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info) } } - label = XtCreateManagedWidget("labelD", labelWidgetClass, + (void) XtCreateManagedWidget("labelD", labelWidgetClass, mouse_dp, NULL, 0); text = XtVaCreateManagedWidget("device", asciiTextWidgetClass, mouse_dp, @@ -376,7 +379,7 @@ MouseDeviceAndProtocol(XF86SetupInfo *info) XtAddCallback(listD, XtNcallback, MouseDeviceCallback, (XtPointer)text); /* PROTOCOL */ - label = XtCreateManagedWidget("labelP", labelWidgetClass, + (void) XtCreateManagedWidget("labelP", labelWidgetClass, mouse_dp, NULL, 0); viewport = XtCreateManagedWidget("viewportP", viewportWidgetClass, mouse_dp, NULL, 0); diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.c b/hw/xfree86/utils/xorgcfg/screen-cfg.c index 5aa71188a..9390afc6d 100644 --- a/hw/xfree86/utils/xorgcfg/screen-cfg.c +++ b/hw/xfree86/utils/xorgcfg/screen-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.12 2002/11/18 05:24:18 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.14 2003/11/03 05:11:58 tsi Exp $ */ #include "xf86config.h" @@ -73,6 +73,8 @@ static char *standard_modes[] = { "1800x1400", "512x384", "1400x1050", + "2048x1536", + "1920x1440", }; static char **modes; @@ -519,6 +521,8 @@ ScreenDialog(XF86SetupInfo *info) XtMapWidget(ccw); } } +#else + (void)labelRotate; #endif if (rotate == CW) { XtVaSetValues(cw, XtNstate, True, NULL, 0); diff --git a/hw/xfree86/utils/xorgcfg/stubs.c b/hw/xfree86/utils/xorgcfg/stubs.c index 5962908d1..6496bc868 100644 --- a/hw/xfree86/utils/xorgcfg/stubs.c +++ b/hw/xfree86/utils/xorgcfg/stubs.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.c,v 1.3 2002/11/09 11:12:53 herrb Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.c,v 1.4 2003/03/25 04:18:25 dawes Exp $ */ #include <stdio.h> @@ -36,6 +36,11 @@ /* * Implementation */ + +#ifdef __UNIXOS2__ +static char dummy; +#endif + #if !defined(USE_MODULES) /* these are defined in libdummy.a */ int diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c index ef4da2877..2011d1abd 100644 --- a/hw/xfree86/utils/xorgcfg/text-mode.c +++ b/hw/xfree86/utils/xorgcfg/text-mode.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.22 2003/02/16 05:23:45 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.26 2003/11/14 02:40:22 dawes Exp $ */ #include <stdio.h> @@ -46,7 +46,15 @@ #include "xf86config.h" #include "loader.h" -#define XKB_RULES_DIR "/usr/X11R6/lib/X11/xkb/rules" +#ifndef PROJECT_ROOT +#define PROJECT_ROOT "/usr/X11R6" +#endif + +#ifndef __UNIXOS2__ +#define XKB_RULES_DIR PROJECT_ROOT "/lib/X11/xkb/rules" +#else +#define XKB_RULES_DIR XF86CONFIGDIR "/xkb/rules" +#endif #define CONTROL_A 1 #define CONTROL_D 4 @@ -196,7 +204,11 @@ TextMode(void) "This program will create the XF86Config file, based on " "menu selections you make.\n" "\n" +#ifndef __UNIXOS2__ "The XF86Config file usually resides in /usr/X11R6/etc/X11 " +#else + "The XF86Config file usually resides in "XF86CONFIGDIR" " +#endif "or /etc/X11. A sample XF86Config file is supplied with " "XFree86; it is configured for a standard VGA card and " "monitor with 640x480 resolution. This program will ask for " @@ -285,7 +297,11 @@ WriteXF86Config(void) refresh(); xf86config = DialogInput("Write XF86Config", "Write configuration to file:", 10, 60, XF86Config_path ? XF86Config_path : +#ifndef __UNIXOS2__ "/etc/X11/XF86Config", " Ok ", " Cancel ", 0); +#else + XF86CONFIGDIR"/XF86Config", " Ok ", " Cancel ", 0); +#endif if (xf86config == NULL) return (-1); @@ -301,7 +317,7 @@ WriteXF86Config(void) XtCalloc(1, sizeof(XF86ConfModuleRec)); XF86Config->conf_modules->mod_comment = - XtNewString("\t# Load \"freetype\"\n" + XtNewString("\tLoad \"freetype\"\n" "\t# Load \"xtt\"\n"); for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) { @@ -330,6 +346,9 @@ WriteXF86Config(void) } static char *protocols[] = { +#ifdef __UNIXOS2__ + "OS2Mouse", +#endif #ifdef SCO "OsMouse", #endif @@ -521,6 +540,8 @@ MouseConfig(void) str = "/dev/wsmouse"; #elif defined(__FreeBSD__) str = "/dev/sysmouse"; +#elif defined(__UNIXOS2__) + str = "mouse$"; #else str = "/dev/mouse"; #endif @@ -805,6 +826,10 @@ static char *hsync[] = { "31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz", "31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz", "31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz", + "31.5 - 92.0; Monitor that can do 1280x1024 @ 85 Hz", + "31.5 - 108.0; Monitor that can do 1600x1200 @ 85 Hz", + "31.5 - 128.5; Monitor that can do 1920x1440 @ 85 Hz", + "31.5 - 137.0; Monitor that can do 2048x1536 @ 85 Hz" }; static char *vrefresh[] = { @@ -1358,6 +1383,9 @@ static char *depths[] = { }; static char *modes[] = { + "2048x1536", + "1920x1440", + "1800x1400", "1600x1200", "1400x1050", "1280x1024", diff --git a/hw/xfree86/utils/xorgcfg/vidmode.c b/hw/xfree86/utils/xorgcfg/vidmode.c index d28ac0899..3a51310d9 100644 --- a/hw/xfree86/utils/xorgcfg/vidmode.c +++ b/hw/xfree86/utils/xorgcfg/vidmode.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.c,v 1.7 2001/07/07 23:00:43 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.c,v 1.8 2003/11/03 05:11:58 tsi Exp $ */ /* @@ -130,11 +130,10 @@ static Bool autoflag; static xf86cfgVidmode *vidtune; static XF86VidModeModeLine modeline, orig_modeline; static int dot_clock, hsync_rate, vsync_rate, hitError; -static Bool S3Specials; -static int invert_vclk, blank1, blank2, early_sc, screenno; +static int screenno; static int (*XtErrorFunc)(Display*, XErrorEvent*); -static Widget labels[VSYNC + 1], values[VSYNC + 1], repeater, monitor, - monitorb, add, text, vesab, vesap, forceshell, testshell, addshell; +static Widget values[VSYNC + 1], repeater, monitor, + monitorb, add, text, vesap, forceshell, testshell, addshell; static int MajorVersion, MinorVersion, EventBase, ErrorBase; static XtIntervalId timeout; @@ -449,7 +448,7 @@ VideoModeInitialize(void) vtune = XtCreateWidget("vidtune", formWidgetClass, work, NULL, 0); - vesab = XtVaCreateManagedWidget("vesaB", menuButtonWidgetClass, vtune, + (void) XtVaCreateManagedWidget("vesaB", menuButtonWidgetClass, vtune, XtNmenuName, "vesaP", NULL, 0); vesap = XtCreatePopupShell("vesaP", simpleMenuWidgetClass, vtune, NULL, 0); for (i = 0; i < sizeof(vesamodes) / sizeof(vesamodes[0]); i++) { @@ -556,7 +555,7 @@ VideoModeInitialize(void) form = XtCreateManagedWidget("form", formWidgetClass, vtune, NULL, 0); for (i = 2; i < VSYNC + 1; i++) { - labels[i] = XtCreateManagedWidget(names[i], labelWidgetClass, + (void) XtCreateManagedWidget(names[i], labelWidgetClass, form, NULL, 0); values[i] = XtCreateManagedWidget(vnames[i], labelWidgetClass, form, NULL, 0); @@ -888,15 +887,6 @@ GetModeLine(Bool save) if (save) memcpy(&orig_modeline, &modeline, sizeof(XF86VidModeModeLine)); UpdateSyncRates(False); - if (modeline.privsize != 0 && modeline.private != NULL) { - S3Specials = True; - invert_vclk = modeline.private[1]; - blank1 = modeline.private[2] & 7; - blank2 = (modeline.private[2] >> 4) & 7; - early_sc = modeline.private[3]; - } - else - S3Specials = False; return (True); } diff --git a/hw/xfree86/utils/xorgcfg/xf86config.c b/hw/xfree86/utils/xorgcfg/xf86config.c index b2b0b871c..cb4054a5e 100644 --- a/hw/xfree86/utils/xorgcfg/xf86config.c +++ b/hw/xfree86/utils/xorgcfg/xf86config.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.c,v 1.5 2001/03/27 20:25:30 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.c,v 1.6 2003/11/03 05:11:59 tsi Exp $ */ #include "xf86config.h" @@ -206,7 +206,10 @@ xf86removeMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr monitor) while (scr != NULL) { if (scr->scrn_monitor == monitor) { xf86removeScreen(config, scr); + if (scr == psc) scr = psc = config->conf_screen_lst; + else + scr = psc; continue; } psc = scr; diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index 18e8032e1..07659d943 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/hw/xfree86/vbe/vbe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.1 2003/02/17 17:06:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.3 2003/11/03 05:11:53 tsi Exp $ */ /* * XFree86 vbe module @@ -106,11 +106,13 @@ VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags) } xf86DrvMsgVerb(screen, X_INFO, 4, - "VbeVersion is %d, OemStringPtr is 0x%08x,\n" - "\tOemVendorNamePtr is 0x%08x, OemProductNamePtr is 0x%08x,\n" - "\tOemProductRevPtr is 0x%08x\n", - vbe->VbeVersion, vbe->OemStringPtr, vbe->OemVendorNamePtr, - vbe->OemProductNamePtr, vbe->OemProductRevPtr); + "VbeVersion is %d, OemStringPtr is 0x%08lx,\n" + "\tOemVendorNamePtr is 0x%08lx, OemProductNamePtr is 0x%08lx,\n" + "\tOemProductRevPtr is 0x%08lx\n", + vbe->VbeVersion, (unsigned long)vbe->OemStringPtr, + (unsigned long)vbe->OemVendorNamePtr, + (unsigned long)vbe->OemProductNamePtr, + (unsigned long)vbe->OemProductRevPtr); xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Version %i.%i\n", VERSION(vbe->VbeVersion)); @@ -341,7 +343,7 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) VbeInfoBlock *block = NULL; int i, pStr, pModes; char *str; - CARD16 major, minor, *modes; + CARD16 major, *modes; bzero(pVbe->memory, sizeof(VbeInfoBlock)); @@ -378,7 +380,6 @@ VBEGetVBEInfo(vbeInfoPtr pVbe) block->VESAVersion = *(CARD16*)(((char*)pVbe->memory) + 4); major = (unsigned)block->VESAVersion >> 8; - minor = block->VESAVersion & 0xff; pStr = *(CARD32*)(((char*)pVbe->memory) + 6); str = xf86int10Addr(pVbe->pInt10, FARP(pStr)); diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h index 5bca184f5..30756119d 100644 --- a/hw/xfree86/vbe/vbe.h +++ b/hw/xfree86/vbe/vbe.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.1 2003/02/17 17:06:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.3 2003/11/14 14:58:45 tsi Exp $ */ /* * XFree86 vbe module @@ -60,7 +60,11 @@ typedef struct vbeControllerInfoBlock { CARD8 OemData[256]; } vbeControllerInfoRec, *vbeControllerInfoPtr; -#pragma pack() +#ifdef __GNUC__ +#pragma pack() /* All GCC versions recognise this syntax */ +#else +#pragma pack(0) +#endif #ifndef __GNUC__ #define __attribute__(a) @@ -237,8 +241,8 @@ typedef enum { } vbeScanwidthCommand; #define VBESetLogicalScanline(pVbe, width) \ - VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, \ - width, NULL, NULL, NULL) + VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, width, \ + NULL, NULL, NULL) #define VBESetLogicalScanlineBytes(pVbe, width) \ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \ NULL, NULL, NULL) @@ -246,8 +250,8 @@ typedef enum { VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \ pixels, bytes, max) #define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \ - VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, \ - NULL, pixels, bytes, max) + VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, 0, \ + pixels, bytes, max) Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command, int width, int *pixels, int *bytes, int *max); diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c index 4d4f1bfac..ae16d7b75 100644 --- a/hw/xfree86/vbe/vbeModes.c +++ b/hw/xfree86/vbe/vbeModes.c @@ -27,7 +27,7 @@ * * Authors: David Dawes <dawes@xfree86.org> * - * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.c,v 1.1 2003/02/17 17:06:45 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.c,v 1.4 2003/11/06 18:38:14 tsi Exp $ */ #include "xf86.h" @@ -120,7 +120,7 @@ static DisplayModePtr CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, int flags) { - CARD16 major, minor; + CARD16 major; VbeModeInfoBlock *mode; DisplayModePtr pMode, p; VbeModeInfoData *data; @@ -128,7 +128,6 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, ModeStatus status = MODE_OK; major = (unsigned)(vbe->VESAVersion >> 8); - minor = vbe->VESAVersion & 0xff; if ((mode = VBEGetModeInfo(pVbe, id)) == NULL) return NULL; @@ -193,7 +192,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, xf86ErrorFVerb(DEBUG_VERB, " WinBSegment: 0x%x\n", mode->WinBSegment); xf86ErrorFVerb(DEBUG_VERB, - " WinFuncPtr: 0x%x\n", mode->WinFuncPtr); + " WinFuncPtr: 0x%lx\n", (unsigned long)mode->WinFuncPtr); xf86ErrorFVerb(DEBUG_VERB, " BytesPerScanline: %d\n", mode->BytesPerScanline); xf86ErrorFVerb(DEBUG_VERB, @@ -236,7 +235,8 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, " DirectColorModeInfo: %d\n", mode->DirectColorModeInfo); if (major >= 2) { xf86ErrorFVerb(DEBUG_VERB, - " PhysBasePtr: 0x%x\n", mode->PhysBasePtr); + " PhysBasePtr: 0x%lx\n", + (unsigned long)mode->PhysBasePtr); if (major >= 3) { xf86ErrorFVerb(DEBUG_VERB, " LinBytesPerScanLine: %d\n", mode->LinBytesPerScanLine); @@ -261,7 +261,7 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id, xf86ErrorFVerb(DEBUG_VERB, " LinRsvdFieldPosition: %d\n", mode->LinRsvdFieldPosition); xf86ErrorFVerb(DEBUG_VERB, - " MaxPixelClock: %d\n", mode->MaxPixelClock); + " MaxPixelClock: %ld\n", (unsigned long)mode->MaxPixelClock); } } diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c index e598d91a2..e1fd9716a 100644 --- a/hw/xfree86/vgahw/vgaHW.c +++ b/hw/xfree86/vgahw/vgaHW.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.57 2003/02/24 21:29:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.58 2003/11/03 05:11:53 tsi Exp $ */ /* * @@ -221,14 +221,12 @@ stdWriteFCR(vgaHWPtr hwp, CARD8 value) static void stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; - tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); outb(hwp->PIOOffset + VGA_ATTR_INDEX, index); outb(hwp->PIOOffset + VGA_ATTR_DATA_W, value); } @@ -236,14 +234,12 @@ stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) static CARD8 stdReadAttr(vgaHWPtr hwp, CARD8 index) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; - tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); outb(hwp->PIOOffset + VGA_ATTR_INDEX, index); return inb(hwp->PIOOffset + VGA_ATTR_DATA_R); } @@ -263,9 +259,7 @@ stdReadMiscOut(vgaHWPtr hwp) static void stdEnablePalette(vgaHWPtr hwp) { - CARD8 tmp; - - tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } @@ -273,9 +267,7 @@ stdEnablePalette(vgaHWPtr hwp) static void stdDisablePalette(vgaHWPtr hwp) { - CARD8 tmp; - - tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + (void) inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } @@ -436,14 +428,12 @@ mmioWriteFCR(vgaHWPtr hwp, CARD8 value) static void mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; - tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); + (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, index); moutb(VGA_ATTR_DATA_W, value); } @@ -451,14 +441,12 @@ mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) static CARD8 mmioReadAttr(vgaHWPtr hwp, CARD8 index) { - CARD8 tmp; - if (hwp->paletteEnabled) index &= ~0x20; else index |= 0x20; - tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); + (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, index); return minb(VGA_ATTR_DATA_R); } @@ -478,9 +466,7 @@ mmioReadMiscOut(vgaHWPtr hwp) static void mmioEnablePalette(vgaHWPtr hwp) { - CARD8 tmp; - - tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); + (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } @@ -488,9 +474,7 @@ mmioEnablePalette(vgaHWPtr hwp) static void mmioDisablePalette(vgaHWPtr hwp) { - CARD8 tmp; - - tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); + (void) minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); moutb(VGA_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } diff --git a/hw/xfree86/x86emu/fpu.c b/hw/xfree86/x86emu/fpu.c index 08aea4229..0f679bde6 100644 --- a/hw/xfree86/x86emu/fpu.c +++ b/hw/xfree86/x86emu/fpu.c @@ -36,6 +36,7 @@ * emulation of the FPU instructions. * ****************************************************************************/ +/* $XFree86: xc/extras/x86emu/src/x86emu/fpu.c,v 1.2 2003/10/22 20:03:06 tsi Exp $ */ #include "x86emu/x86emui.h" @@ -95,8 +96,8 @@ static char *x86emu_fpu_op_d9_tab1[] = { void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -289,6 +290,9 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1)) } } } +#else + (void)destoffset; + (void)stkelem; #endif /* X86EMU_FPU_PRESENT */ DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -322,8 +326,8 @@ char *x86emu_fpu_op_da_tab[] = { void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -379,6 +383,9 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; + (void)stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -403,7 +410,7 @@ char *x86emu_fpu_op_db_tab[] = { void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; + uint destoffset = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -499,6 +506,8 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -530,8 +539,8 @@ char *x86emu_fpu_op_dc_tab[] = { void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -613,6 +622,9 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; + (void)stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -640,8 +652,8 @@ static char *x86emu_fpu_op_dd_tab[] = { void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -713,6 +725,9 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; + (void)stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -747,8 +762,8 @@ static char *x86emu_fpu_op_de_tab[] = void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -832,6 +847,9 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; + (void)stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); @@ -866,8 +884,8 @@ static char *x86emu_fpu_op_df_tab[] = { void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1)) { int mod, rl, rh; - uint destoffset; - u8 stkelem; + uint destoffset = 0; + u8 stkelem = 0; START_OF_INSTR(); FETCH_DECODE_MODRM(mod, rh, rl); @@ -939,6 +957,9 @@ void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1)) break; } } +#else + (void)destoffset; + (void)stkelem; #endif DECODE_CLEAR_SEGOVR(); END_OF_INSTR_NO_TRACE(); diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c index 3714070dd..94041f6c8 100644 --- a/hw/xfree86/x86emu/ops.c +++ b/hw/xfree86/x86emu/ops.c @@ -70,7 +70,7 @@ * ****************************************************************************/ -/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.7 2002/07/15 16:49:10 dawes Exp $ */ +/* $XFree86: xc/extras/x86emu/src/x86emu/ops.c,v 1.9 2003/10/22 20:03:06 tsi Exp $ */ #include "x86emu/x86emui.h" @@ -4538,7 +4538,11 @@ static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1)) imm = (s8)fetch_byte_imm(); DECODE_PRINTF2("PUSH\t%d\n", imm); TRACE_AND_STEP(); - push_word(imm); + if (M.x86.mode & SYSMODE_PREFIX_DATA) { + push_long((s32)imm); + } else { + push_word(imm); + } DECODE_CLEAR_SEGOVR(); END_OF_INSTR(); } @@ -9417,11 +9421,9 @@ Handles opcode 0xd5 ****************************************************************************/ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1)) { - u8 a; - START_OF_INSTR(); DECODE_PRINTF("AAD\n"); - a = fetch_byte_imm(); + (void) fetch_byte_imm(); TRACE_AND_STEP(); M.x86.R_AX = aad_word(M.x86.R_AX); DECODE_CLEAR_SEGOVR(); diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c index ae295f782..55f361677 100644 --- a/hw/xfree86/x86emu/ops2.c +++ b/hw/xfree86/x86emu/ops2.c @@ -37,7 +37,7 @@ * instructions. * ****************************************************************************/ -/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.5 2002/07/15 16:49:10 dawes Exp $ */ +/* $XFree86: xc/extras/x86emu/src/x86emu/ops2.c,v 1.6 2003/10/22 20:03:06 tsi Exp $ */ #include "x86emu/x86emui.h" @@ -145,6 +145,7 @@ static void x86emuOp2_long_jump(u8 op2) break; } DECODE_PRINTF(name); + (void)name; target = (s16) fetch_word_imm(); target += (s16) M.x86.R_IP; DECODE_PRINTF2("%04x\n", target); @@ -237,6 +238,7 @@ static void x86emuOp2_set_byte(u8 op2) break; } DECODE_PRINTF(name); + (void)name; FETCH_DECODE_MODRM(mod, rh, rl); switch (mod) { case 0: diff --git a/hw/xfree86/x86emu/x86emu/fpu_regs.h b/hw/xfree86/x86emu/x86emu/fpu_regs.h index 56e9a04d7..b975b87e0 100644 --- a/hw/xfree86/x86emu/x86emu/fpu_regs.h +++ b/hw/xfree86/x86emu/x86emu/fpu_regs.h @@ -35,14 +35,13 @@ * Description: Header file for FPU register definitions. * ****************************************************************************/ +/* $XFree86: xc/extras/x86emu/include/x86emu/fpu_regs.h,v 1.3 2003/10/28 16:01:40 tsi Exp $ */ #ifndef __X86EMU_FPU_REGS_H #define __X86EMU_FPU_REGS_H #ifdef X86_FPU_SUPPORT -#pragma pack(1) - /* Basic 8087 register can hold any of the following values: */ union x86_fpu_reg_u { @@ -87,8 +86,6 @@ struct x86_fpu_registers { short x86_fpu_tos, x86_fpu_bos; }; -#pragma pack() - /* * There are two versions of the following macro. * diff --git a/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h index 12426278d..3a4580138 100644 --- a/hw/xfree86/x86emu/x86emu/regs.h +++ b/hw/xfree86/x86emu/x86emu/regs.h @@ -35,15 +35,13 @@ * Description: Header file for x86 register definitions. * ****************************************************************************/ -/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.4 2002/09/16 18:05:18 eich Exp $ */ +/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.6 2003/10/28 16:01:40 tsi Exp $ */ #ifndef __X86EMU_REGS_H #define __X86EMU_REGS_H /*---------------------- Macros and type definitions ----------------------*/ -#pragma pack(1) - /* * General EAX, EBX, ECX, EDX type registers. Note that for * portability, and speed, the issue of byte swapping is not addressed @@ -305,8 +303,6 @@ typedef struct { X86EMU_regs x86; } X86EMU_sysEnv; -#pragma pack() - /*----------------------------- Global Variables --------------------------*/ #ifdef __cplusplus diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h index 847ce835d..3a0dc17fc 100644 --- a/hw/xfree86/x86emu/x86emu/types.h +++ b/hw/xfree86/x86emu/x86emu/types.h @@ -36,7 +36,7 @@ * ****************************************************************************/ -/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.5 2002/07/23 14:22:45 tsi Exp $ */ +/* $XFree86: xc/extras/x86emu/include/x86emu/types.h,v 1.7 2003/07/07 15:34:21 eich Exp $ */ #ifndef __X86EMU_TYPES_H #define __X86EMU_TYPES_H @@ -70,12 +70,13 @@ /* Taken from Xmd.h */ #undef NUM32 -#if defined(__alpha) || defined(__alpha__) || \ +#if defined (_LP64) || \ + defined(__alpha) || defined(__alpha__) || \ defined(__ia64__) || defined(ia64) || \ defined(__sparc64__) || \ defined(__s390x__) || \ (defined(__hppa__) && defined(__LP64)) || \ - defined(__x86_64__) || defined(x86_64) || \ + defined(__AMD64__) || defined(AMD64) || \ (defined(__sgi) && (_MIPS_SZLONG == 64)) #define NUM32 int #else diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index 015b539e5..83850767a 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.3 1998/12/06 06:08:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.4 2003/11/10 18:22:39 tsi Exp $ */ /* This is a lighter version of cfbBitBlt. We calculate the boxes @@ -161,7 +161,7 @@ XAABitBlt( /* Check to see if the region is empty */ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pGC->pScreen, &rgnDst); } else { REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); } diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c index 74dcdfd31..d3d1c8a5c 100644 --- a/hw/xfree86/xaa/xaaCpyPlane.c +++ b/hw/xfree86/xaa/xaaCpyPlane.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.13 2001/10/01 13:44:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.14 2003/11/10 18:22:40 tsi Exp $ */ /* A CopyPlane function that handles bitmap->screen copies and @@ -186,7 +186,7 @@ XAAPushPixelsSolidColorExpansion( if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; - nboxes = XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect); + nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect); pbox = pClipBoxes; while(nboxes--) { diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index 1c5ecf38e..b77be1ad6 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.3 2003/02/17 16:08:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.4 2003/11/10 18:22:40 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -47,7 +47,7 @@ XAACopyWindow( pwinRoot = WindowTable[pScreen->myNum]; - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c index 164887afe..5566f51e6 100644 --- a/hw/xfree86/xaa/xaaFillPoly.c +++ b/hw/xfree86/xaa/xaaFillPoly.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.16 2003/03/23 03:41:44 mvojkovi Exp $ */ /* * Copyright 1996 The XFree86 Project @@ -770,7 +770,11 @@ XAAFillPolygonStippled( pCache = (*infoRec->CacheMono8x8Pattern)( infoRec->pScrn, patx, paty); patx = pCache->x; paty = pCache->y; - } + } else { + pCache = &(infoRec->ScratchCacheInfoRec); + pCache->pat0 = patx; + pCache->pat1 = paty; + } RectFunc = Mono8x8PatternRectHelper; } diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c index 1d9cd54c1..cda56e327 100644 --- a/hw/xfree86/xaa/xaaFillRect.c +++ b/hw/xfree86/xaa/xaaFillRect.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.15 2001/12/13 18:01:51 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.16 2003/11/10 18:22:40 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -1018,7 +1018,7 @@ XAAClipAndRenderRects( int XAAGetRectClipBoxes( - RegionPtr prgnClip, + GCPtr pGC, BoxPtr pboxClippedBase, int nrectFill, xRectangle *prectInit @@ -1026,7 +1026,7 @@ XAAGetRectClipBoxes( int Right, Bottom; BoxPtr pextent, pboxClipped = pboxClippedBase; xRectangle *prect = prectInit; - + RegionPtr prgnClip = pGC->pCompositeClip; if (REGION_NUM_RECTS(prgnClip) == 1) { pextent = REGION_RECTS(prgnClip); diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c index 6da601faf..c3db7ff57 100644 --- a/hw/xfree86/xaa/xaaImage.c +++ b/hw/xfree86/xaa/xaaImage.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.20 2000/09/25 23:56:14 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.21 2003/11/10 18:22:41 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -444,8 +444,7 @@ XAAPutImage( if(!pClipBoxes) return; } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem; - nboxes = - XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect); + nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect); pbox = pClipBoxes; if(format == XYBitmap) { diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c index 914631b58..e1c57588a 100644 --- a/hw/xfree86/xaa/xaaNonTEText.c +++ b/hw/xfree86/xaa/xaaNonTEText.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.12 2000/04/07 19:11:10 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.14 2003/11/14 21:54:51 dawes Exp $ */ /******************************************************************** diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 9651ca6a3..d527b7c15 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14 2002/12/10 04:18:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.15 2003/11/10 18:22:41 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -57,7 +57,7 @@ XAACopyWindow8_32( if(doUnderlay) freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 82a2011a4..5cce3e7ed 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -3,7 +3,7 @@ Written by Mark Vojkovich */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.1 1999/03/28 15:33:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.2 2003/11/10 18:22:41 tsi Exp $ */ #include "misc.h" @@ -355,7 +355,7 @@ XAAOverCopyWindow( infoRec->ScratchGC.alu = GXcopy; infoRec->ScratchGC.planemask = ~0; - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; @@ -388,7 +388,7 @@ XAAOverCopyWindow( REGION_UNINIT(pScreen, &rgnDst); if(pWin->drawable.depth == 8) { - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); miSegregateChildren(pWin, &rgnDst, pScrn->depth); if(REGION_NOTEMPTY(pScreen, &rgnDst)) { REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index e6163b33a..c7756ba93 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.30 2000/09/25 23:56:14 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.33 2003/11/03 05:11:54 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -321,13 +321,11 @@ ConvertAllPartialsTo8x8( Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8); CacheLinkPtr pLink = ListPartial; CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor; - int MonosPerColor = 1; if(DoColor && DoMono) { /* we assume color patterns take more space than color ones */ if(MonoH > ColorH) ColorH = MonoH; if(MonoW > ColorW) ColorW = MonoW; - MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW); } /* Break up the area into as many Color and Mono slots as we can */ @@ -763,6 +761,7 @@ XAAInitPixmapCache( 1) Don't take up more than half the memory. 2) Don't bother if you can't get at least four. 3) Don't make more than MAX_512. + 4) Don't have any of there are no 256x256s. 256x256 - 1) Don't take up more than a quarter of the memory enless there @@ -786,6 +785,13 @@ XAAInitPixmapCache( else Target256 = ntotal >> 4; if(Target256 < 4) Target256 = 0; + if(Num512 && Num256 < 4) { + while(Num512 && Num256 < Target256) { + SubdivideList(&List512, &List256); + Num256 += 4; Num512--; + } + } + if(!Num512) { /* no room */ } else if((Num512 < 4) || (!Target512)) { while(Num512) { @@ -2044,7 +2050,7 @@ XAAWriteColor8x8PatternToCache( nw = w; memcpy(dstPtr, srcPtr, w * Bpp); while (nw != 8) { - memcpy(dstPtr + (nw * Bpp), srcPtr, nw * Bpp); + memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp); nw <<= 1; } } diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index 4b7e3d0f0..fecbbcfa0 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.17 2002/12/10 04:17:21 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.18 2003/04/23 18:35:34 eich Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -432,10 +432,11 @@ XAAComposite (CARD8 op, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) { - if(pSrc->pDrawable->type == DRAWABLE_WINDOW || + if((pSrc->pDrawable->type == DRAWABLE_WINDOW || pDst->pDrawable->type == DRAWABLE_WINDOW || IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) || - IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) { + IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) + && infoRec->pScrn->vtSema) { SYNC_CHECK(pDst->pDrawable); } (*GetPictureScreen(pScreen)->Composite) (op, @@ -666,10 +667,11 @@ XAAGlyphs (CARD8 op, !(*infoRec->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs)) { - if((pSrc->pDrawable->type == DRAWABLE_WINDOW) || + if(((pSrc->pDrawable->type == DRAWABLE_WINDOW) || (pDst->pDrawable->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) || - IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) { + IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) + && infoRec->pScrn->vtSema) { SYNC_CHECK(pDst->pDrawable); } (*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat, diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c index 512c6a260..b27a54e81 100644 --- a/hw/xfree86/xaa/xaaStateChange.c +++ b/hw/xfree86/xaa/xaaStateChange.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.2 2003/02/04 01:44:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.3 2003/08/22 19:27:31 eich Exp $ */ #include "misc.h" #include "xf86.h" @@ -1670,8 +1670,9 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) XAA_STATE_WRAP(CopyWindow); XAA_STATE_WRAP(SaveAreas); XAA_STATE_WRAP(RestoreAreas); +#ifdef RENDER XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture); XAA_STATE_WRAP(SetupForCPUToScreenTexture); - +#endif return TRUE; } diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c index 8037a3eaf..862f50ba0 100644 --- a/hw/xfree86/xaa/xaaStipple.c +++ b/hw/xfree86/xaa/xaaStipple.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.11 2001/10/28 03:34:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.12 2003/08/04 22:18:31 mvojkovi Exp $ */ #include "xaa.h" #include "xaalocal.h" @@ -762,20 +762,28 @@ StippleOver32( ){ CARD32* srcp; CARD32 bits; - int bitsleft, shift; + int bitsleft, shift, usable; while(dwords--) { - bitsleft = width - offset; - srcp = src + (offset >> 5); - shift = offset & 31; - - if(bitsleft < 32) - bits = SHIFT_L(*src,bitsleft) | - (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]); - else if(shift) - bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift); - else - bits = *srcp; + bitsleft = width - offset; + srcp = src + (offset >> 5); + shift = offset & 31; + usable = 32 - shift; + + if(bitsleft < 32) { + if(bitsleft <= usable) { + bits = SHIFT_L(*src,bitsleft) | + (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]); + } else { + bits = SHIFT_L(*src,bitsleft) | + (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) | + (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]); + } + } + else if(shift) + bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable); + else + bits = *srcp; #ifdef TRIPLE_BITS if(dwords >= 2) { @@ -805,20 +813,28 @@ StippleOver32_Inverted( ){ CARD32* srcp; CARD32 bits; - int bitsleft, shift; + int bitsleft, shift, usable; while(dwords--) { - bitsleft = width - offset; - srcp = src + (offset >> 5); - shift = offset & 31; - - if(bitsleft < 32) - bits = SHIFT_L(*src,bitsleft) | - (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]); - else if(shift) - bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift); - else - bits = *srcp; + bitsleft = width - offset; + srcp = src + (offset >> 5); + shift = offset & 31; + usable = 32 - shift; + + if(bitsleft < 32) { + if(bitsleft <= usable) { + bits = SHIFT_L(*src,bitsleft) | + (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]); + } else { + bits = SHIFT_L(*src,bitsleft) | + (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) | + (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]); + } + } + else if(shift) + bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable); + else + bits = *srcp; bits = ~bits; diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c index 7425f9d20..f999b425f 100644 --- a/hw/xfree86/xaa/xaaWideLine.c +++ b/hw/xfree86/xaa/xaaWideLine.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.11 2003/07/16 01:38:48 dawes Exp $ */ /* @@ -32,7 +32,7 @@ Original mi code written by Keith Packard. #include "X.h" #include "windowstr.h" #include "gcstruct.h" -#include "miscstruct.h" +#include "regionstr.h" #include "miwideline.h" #include "mi.h" #include "xf86str.h" diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 0c239c234..4504deffd 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.36 2003/02/17 16:08:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.37 2003/11/10 18:22:41 tsi Exp $ */ #ifndef _XAALOCAL_H #define _XAALOCAL_H @@ -1485,7 +1485,7 @@ void XAAMoveDWORDS( int XAAGetRectClipBoxes( - RegionPtr prgnClip, + GCPtr pGC, BoxPtr pboxClippedBase, int nrectFill, xRectangle *prectInit diff --git a/hw/xfree86/xf4bpp/emulTile.c b/hw/xfree86/xf4bpp/emulTile.c index a2d24f4d9..650c448b8 100644 --- a/hw/xfree86/xf4bpp/emulTile.c +++ b/hw/xfree86/xf4bpp/emulTile.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.4 2003/11/03 05:11:56 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -178,7 +178,6 @@ register int x0, y0, w, h ; int xSrc ; int ySrc ; { -ScreenPtr pScreen ; int xOffset ; int yOffset ; int width, height; @@ -186,7 +185,6 @@ int width, height; TRACE( ( "xf4bppTileRect(pTile=x%x,alu=x%x,planes=x%02x,x0=%d,y0=%d,w=%d,h=%d,xSrc=%d,ySrc=%d\n", pTile, alu, planes, x0, y0, w, h, xSrc, ySrc ) ) ; - pScreen = pTile->drawable.pScreen ; switch ( alu ) { case GXclear: /* 0x0 Zero 0 */ case GXinvert: /* 0xa NOT dst */ diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c index 14c2ccb66..4c4d8eab6 100644 --- a/hw/xfree86/xf4bpp/mfbfillarc.c +++ b/hw/xfree86/xf4bpp/mfbfillarc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.6 2003/11/03 05:11:56 tsi Exp $ */ /************************************************************ Copyright (c) 1989 X Consortium @@ -244,16 +244,16 @@ xf4bppPolyFillArcSolid xArc *parcs ) { - mfbPrivGC *priv; register xArc *arc; register int i; BoxRec box; RegionPtr cclip; +#if 0 + mfbPrivGC *priv; int rop; priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr; rop = priv->rop; -#if 0 if ((rop == RROP_NOP) || !(pGC->planemask & 1)) #else if ( !(pGC->planemask & 0x0F)) diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c index cb2e63125..a5d5b5b37 100644 --- a/hw/xfree86/xf4bpp/mfbimggblt.c +++ b/hw/xfree86/xf4bpp/mfbimggblt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.7 2003/02/18 21:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.9 2003/11/17 22:20:42 dawes Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -101,7 +101,6 @@ xoff, pdst, pglyph, and tmpSrc seem like the right things, though. /* Forward declarations -- GJA */ static void doImageGlyphBlt( -#if NeedFunctionPrototypes DrawablePtr, GC *, int, @@ -110,7 +109,6 @@ static void doImageGlyphBlt( CharInfoPtr *, unsigned char *, ExtentInfoRec * -#endif ); void @@ -352,7 +350,9 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) int glyphRow; /* first row of glyph not wholly clipped out */ int glyphCol; /* leftmost visible column of glyph */ +#if GETLEFTBITS_ALIGNMENT > 1 int getWidth; /* bits to get from glyph */ +#endif if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS)))) return; @@ -452,7 +452,9 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) glyphCol = (leftEdge - ppos[i].xpos) - (pci->metrics.leftSideBearing); +#if GETLEFTBITS_ALIGNMENT > 1 getWidth = w + glyphCol; +#endif xoff = xchar + (leftEdge - ppos[i].xpos); if (xoff > PLST) { diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c index dc85e3d92..c2717599f 100644 --- a/hw/xfree86/xf4bpp/mfbline.c +++ b/hw/xfree86/xf4bpp/mfbline.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */ /*********************************************************** Copyright (c) 1987 X Consortium @@ -92,9 +92,7 @@ actual clipping. */ #ifdef POLYSEGMENT static void DoV16SegmentSS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xSegment* -#endif ); void @@ -113,9 +111,7 @@ xf4bppSegmentSS (pDrawable, pGC, nseg, pSeg) #else static void DoV16LineSS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); void @@ -182,13 +178,14 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit) register int y1, y2; register int x1, x2; RegionPtr cclip; - int alu; +#ifndef POLYSEGMENT + int alu = pGC->alu; /* GJA */ +#endif if (!(pGC->planemask & 0x0F)) return; cclip = pGC->pCompositeClip; - alu = pGC->alu; /* GJA */ pboxInit = REGION_RECTS(cclip); nboxInit = REGION_NUM_RECTS(cclip); @@ -499,9 +496,7 @@ DoV16LineSS (pDrawable, pGC, mode, npt, pptInit) #ifdef POLYSEGMENT static void DoV16SegmentSD( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xSegment* -#endif ); void @@ -520,9 +515,7 @@ xf4bppSegmentSD (pDrawable, pGC, nseg, pSeg) #else static void DoV16LineSD( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); void @@ -803,10 +796,7 @@ dontStep: ; (y2 < pbox->y2)) { unsigned long _mask; - int ink; - ink = fgink; - if (dashIndex & 1) ink = bgink; _mask = mask[x2 & PIM]; addrl = mfbScanline(addrl, x2, y2, nlwidth); UPDRW(addrl,_mask); diff --git a/hw/xfree86/xf4bpp/ppcCpArea.c b/hw/xfree86/xf4bpp/ppcCpArea.c index e5202c267..86b7d6f6c 100644 --- a/hw/xfree86/xf4bpp/ppcCpArea.c +++ b/hw/xfree86/xf4bpp/ppcCpArea.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.5 2000/09/26 15:57:21 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.7 2003/11/10 18:22:42 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -71,31 +71,19 @@ vga16DoBitblt unsigned long planemask ) { - CARD32 *psrcBase, *pdstBase; - /* start of src and dst bitmaps */ int widthSrc, widthDst; /* add to get to same position in next line */ - BoxPtr pbox; int nbox; - BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; /* temporaries for shuffling rectangles */ DDXPointPtr pptTmp, pptNew1, pptNew2; /* shuffling boxes entails shuffling the source points too */ int w, h; - int xdir; /* 1 = left right, -1 = right left/ */ - int ydir; /* 1 = top down, -1 = bottom up */ - - MROP_DECLARE_REG() - int careful; - MROP_INITIALIZE(alu,planemask); - - cfbGetLongWidthAndPointer (pSrc, widthSrc, psrcBase) - - cfbGetLongWidthAndPointer (pDst, widthDst, pdstBase) + widthSrc = cfbGetLongWidth(pSrc); + widthDst = cfbGetLongWidth(pDst); /* XXX we have to err on the side of safety when both are windows, * because we don't know if IncludeInferiors is being used. @@ -114,7 +102,6 @@ vga16DoBitblt if (careful && (pptSrc->y < pbox->y1)) { /* walk source botttom to top */ - ydir = -1; widthSrc = -widthSrc; widthDst = -widthDst; @@ -151,17 +138,9 @@ vga16DoBitblt pptSrc = pptNew1; } } - else - { - /* walk source top to bottom */ - ydir = 1; - } if (careful && (pptSrc->x < pbox->x1)) { - /* walk source right to left */ - xdir = -1; - if (nbox > 1) { /* reverse order of rects in each band */ @@ -199,11 +178,6 @@ vga16DoBitblt pptSrc = pptNew2; } } - else - { - /* walk source left to right */ - xdir = 1; - } while(nbox--) { @@ -424,7 +398,7 @@ int dstx, dsty; /* Check to see if the region is empty */ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pGC->pScreen, &rgnDst); } else { diff --git a/hw/xfree86/xf4bpp/ppcFillRct.c b/hw/xfree86/xf4bpp/ppcFillRct.c index 7e1c866ef..af1ecb95e 100644 --- a/hw/xfree86/xf4bpp/ppcFillRct.c +++ b/hw/xfree86/xf4bpp/ppcFillRct.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -82,18 +82,10 @@ xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit) int numRects; int n; int xorg, yorg; - mfbPrivGC *priv; -/* int alu; */ -/* mfbFillAreaProcPtr pfn; */ -/* PixmapPtr ppix; */ if (!(pGC->planemask & 0x0F)) /* GJA */ return; - priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr; -/* alu = priv->ropFillArea; */ -/* pfn = priv->FillArea; */ -/* ppix = pGC->pRotatedPixmap; */ prgnClip = pGC->pCompositeClip; prect = prectInit; diff --git a/hw/xfree86/xf4bpp/ppcGCstr.h b/hw/xfree86/xf4bpp/ppcGCstr.h index 5f863fa73..341e17534 100644 --- a/hw/xfree86/xf4bpp/ppcGCstr.h +++ b/hw/xfree86/xf4bpp/ppcGCstr.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.3 2003/02/18 21:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.4 2003/11/17 22:20:42 dawes Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -79,17 +79,13 @@ typedef ppcPrivGC *ppcPrivGCPtr ; /* ppcCReduce.c */ void xf4bppGetReducedColorRrop( -#if NeedFunctionPrototypes GCPtr, int, ppcReducedRrop * -#endif ); /* vgaGC.c */ void xf4bppChangeGCtype( -#if NeedFunctionPrototypes GCPtr, ppcPrivGCPtr -#endif ); diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c index 43cc7bd33..f6999c561 100644 --- a/hw/xfree86/xf4bpp/ppcIO.c +++ b/hw/xfree86/xf4bpp/ppcIO.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.5 2001/10/28 03:34:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */ /* Copyright (c) 1990 X Consortium @@ -77,7 +77,7 @@ static VisualRec vgaVisuals[] = { } ; #endif -int +void xf4bppNeverCalled() { FatalError("xf4bppNeverCalled was nevertheless called\n"); diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c index 261c8e809..c009d696e 100644 --- a/hw/xfree86/xf4bpp/ppcPixFS.c +++ b/hw/xfree86/xf4bpp/ppcPixFS.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.4 2001/08/01 00:44:56 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -126,16 +126,16 @@ xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; n = nInit * miFindMaxBand(pGC->pCompositeClip) ; - if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) + if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) return ; - pwidthFree = pwidth ; + pwidth = pwidthFree ; - if ( !( ppt = (DDXPointRec *) + if ( !( pptFree = (DDXPointRec *) ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) { DEALLOCATE_LOCAL( pwidth ) ; return ; } - pptFree = ppt ; + ppt = pptFree ; n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit, ppt, pwidth, fSorted ) ; @@ -260,8 +260,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; @@ -359,8 +359,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ; @@ -462,8 +462,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; /* the following code is for 8 bits per pixel addressable memory only */ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c index e61fed342..f52343fc9 100644 --- a/hw/xfree86/xf4bpp/ppcPntWin.c +++ b/hw/xfree86/xf4bpp/ppcPntWin.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.4 2003/11/17 22:20:42 dawes Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -80,18 +80,14 @@ SOFTWARE. /* NOTE: These functions only work for visuals up to 31-bits deep */ static void xf4bppPaintWindowSolid( -#if NeedFunctionPrototypes WindowPtr, RegionPtr, int -#endif ); static void xf4bppPaintWindowTile( -#if NeedFunctionPrototypes WindowPtr, RegionPtr, int -#endif ); void diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c index 29d466f00..fc38cdcfe 100644 --- a/hw/xfree86/xf4bpp/ppcWinFS.c +++ b/hw/xfree86/xf4bpp/ppcWinFS.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.3 1999/06/06 08:49:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.4 2003/11/03 05:11:57 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -98,16 +98,16 @@ xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) return ; n = nInit * miFindMaxBand( pGC->pCompositeClip ) ; - if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) + if ( !( pwidthFree = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) ) return ; - pwidthFree = pwidth ; + pwidth = pwidthFree ; - if ( !( ppt = (DDXPointRec *) + if ( !( pptFree = (DDXPointRec *) ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) { DEALLOCATE_LOCAL( pwidth ) ; return ; } - pptFree = ppt ; + ppt = pptFree ; n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit, ppt, pwidth, fSorted ) ; @@ -164,8 +164,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; @@ -216,8 +216,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ; fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ; @@ -261,8 +261,8 @@ int fSorted ; if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop ) return ; - SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit, - ppt, pwidthFree, pptFree, fSorted ) ; + SETSPANPTRS( nInit, n, pwidthInit, pwidthFree, pptInit, + pptFree, pwidth, ppt, fSorted ) ; xSrc = pGC->patOrg.x + pDrawable->x ; ySrc = pGC->patOrg.y + pDrawable->y ; diff --git a/hw/xfree86/xf4bpp/vgaBitBlt.c b/hw/xfree86/xf4bpp/vgaBitBlt.c index 53eb3b314..660cc356b 100644 --- a/hw/xfree86/xf4bpp/vgaBitBlt.c +++ b/hw/xfree86/xf4bpp/vgaBitBlt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.6 2003/11/17 22:20:42 dawes Exp $ */ /* GJA -- span move routines */ @@ -101,33 +101,23 @@ static unsigned char rmasktab[] = { } static void aligned_blit( -#if NeedFunctionPrototypes WindowPtr, int, int, int, int, int, int, int, int -#endif ); static void aligned_blit_center( -#if NeedFunctionPrototypes WindowPtr, int, int, int, int, int, int -#endif ); static void shift( -#if NeedFunctionPrototypes WindowPtr, int, int, int, int, int, int, int -#endif ); static void shift_thin_rect( -#if NeedFunctionPrototypes WindowPtr, int, int, int, int, int, int, int -#endif ); static void shift_center( -#if NeedFunctionPrototypes WindowPtr, int, int, int, int, int, int, int -#endif ); void xf4bppBitBlt(pWin,alu,writeplanes,x0,y0,x1,y1,w,h) @@ -535,13 +525,10 @@ int h; int pad; int htmp, wtmp; /* Temporaries for indices over height and width */ volatile unsigned char tmp; /* Temporary result of the shifts */ - int bs; int bytecnt; volatile unsigned char *sp, *dp; - bs = (x1 - x0) & WMASK; - if ( l1 ) { bytecnt = (w - (WORDSZ - l1) - r1) >> WSHIFT; sp = SMEM( ((x0 + (WORDSZ - l1)) >> WSHIFT), y0); diff --git a/hw/xfree86/xf4bpp/vgaImages.c b/hw/xfree86/xf4bpp/vgaImages.c index 66c2c14e0..4357e4d8a 100644 --- a/hw/xfree86/xf4bpp/vgaImages.c +++ b/hw/xfree86/xf4bpp/vgaImages.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.5 2003/11/03 05:11:57 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -117,10 +117,7 @@ register unsigned char tmp1; default: break ; } -#ifndef PC98_EGC - if ( invert_existing_data ) - xf4bppFillSolid( pWin, VGA_ALLPLANES, GXinvert, planes, x, y, w, h ) ; -#endif + #ifdef PC98_EGC /* Setup EGC Registers */ switch(data_rotate_value) { @@ -153,6 +150,8 @@ register unsigned char tmp1; outw(EGC_FGC, 0x0000); tmp1 = 0; #else + if ( invert_existing_data ) + xf4bppFillSolid( pWin, VGA_ALLPLANES, GXinvert, planes, x, y, w, h ) ; /* Setup VGA Registers */ SetVideoSequencer( Mask_MapIndex, planes & VGA_ALLPLANES ) ; /* Set Raster Op */ @@ -205,6 +204,7 @@ if ( invert_source_data ) SetVideoGraphics( Bit_MaskIndex, currMask ) ; /* Read To Load vga Data Latches */ tmp = *( (VgaMemoryPtr) dst ) ; + (void) tmp; *( (VgaMemoryPtr) dst ) = ~ *src ; if ( currMask & RightmostBit ) { currMask = LeftmostBit ; @@ -256,6 +256,7 @@ else /* invert_source_data == FALSE */ SetVideoGraphics( Bit_MaskIndex, currMask ) ; /* GJA */ /* Read To Load vga Data Latches */ tmp = *( (VgaMemoryPtr) dst ) ; + (void) tmp; *( (VgaMemoryPtr) dst ) = *src ; if ( currMask & RightmostBit ) { currMask = LeftmostBit ; diff --git a/hw/xfree86/xf4bpp/vgaSolid.c b/hw/xfree86/xf4bpp/vgaSolid.c index ceb39ef77..b3711f852 100644 --- a/hw/xfree86/xf4bpp/vgaSolid.c +++ b/hw/xfree86/xf4bpp/vgaSolid.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -117,7 +117,7 @@ register const unsigned int notZero = ((unsigned char)(~0x0)); register int tmp ; #define SINGLE_STORE \ - tmp = *( (VgaMemoryPtr) destination ) ; \ + tmp = *( (VgaMemoryPtr) destination ) ; (void)tmp; \ ( *( (VgaMemoryPtr) destination ) = notZero ) ; \ destination++; stop_count-- ; @@ -282,6 +282,7 @@ if ((tmp = x0 & 07)) { for ( tmp = ly; tmp-- ; ) { tmp3 = *( (VgaMemoryPtr) dst ) ; + (void)tmp3; *( (VgaMemoryPtr) dst ) = tmp2 ; dst += BYTES_PER_LINE(pWin); } @@ -293,6 +294,7 @@ if ((tmp = x0 & 07)) { for ( tmp = ly; tmp-- ; ) { tmp3 = *( (VgaMemoryPtr) dst ) ; + (void)tmp3; *( (VgaMemoryPtr) dst ) = tmp2 ; dst += BYTES_PER_LINE(pWin); } @@ -333,6 +335,7 @@ if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */ for ( tmp = ly; tmp-- ; ) { tmp3 = *( (VgaMemoryPtr) dst ) ; + (void)tmp3; *( (VgaMemoryPtr) dst ) = tmp2 ; dst += BYTES_PER_LINE(pWin); } @@ -344,6 +347,7 @@ if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */ for ( tmp = ly; tmp-- ; ) { tmp3 = *( (VgaMemoryPtr) dst ) ; + (void)tmp3; *( (VgaMemoryPtr) dst ) = tmp2 ; dst += BYTES_PER_LINE(pWin) ; } diff --git a/hw/xfree86/xf4bpp/vgaStipple.c b/hw/xfree86/xf4bpp/vgaStipple.c index a4f3cef6b..f5ace74d0 100644 --- a/hw/xfree86/xf4bpp/vgaStipple.c +++ b/hw/xfree86/xf4bpp/vgaStipple.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.6 2003/11/03 05:11:57 tsi Exp $ */ /* * Copyright IBM Corporation 1987,1988,1989 * @@ -388,7 +388,9 @@ if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */ tmp2-- ; dst++ ) { register unsigned bitPattern ; +#ifndef PC98_EGC register VideoAdapterObject tmp3 ; +#endif /* * For Each Time Pattern Repeats In Y */ @@ -408,6 +410,7 @@ if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */ #ifndef PC98_EGC /* Read To Save */ tmp3 = *( (VgaMemoryPtr) xDst) ; + (void)tmp3; #endif /* Write Pattern */ *( (VgaMemoryPtr) xDst ) = bitPattern ; diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h index f9141e5e1..59458a258 100644 --- a/hw/xfree86/xf4bpp/xf4bpp.h +++ b/hw/xfree86/xf4bpp/xf4bpp.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.8 2003/02/18 21:29:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.10 2003/11/17 22:20:42 dawes Exp $ */ #ifndef __XF4BPP_H__ @@ -15,58 +15,45 @@ /* ppcArea.c */ void xf4bppFillArea( -#if NeedFunctionPrototypes WindowPtr, int, BoxPtr, GCPtr -#endif ); /* ppcBStore.c */ void xf4bppSaveAreas( -#if NeedFunctionPrototypes PixmapPtr, RegionPtr, int, int, WindowPtr -#endif ); void xf4bppRestoreAreas( -#if NeedFunctionPrototypes PixmapPtr, RegionPtr, int, int, WindowPtr -#endif ); /* ppcClip.c */ void xf4bppDestroyClip( -#if NeedFunctionPrototypes GCPtr -#endif ); void xf4bppChangeClip( -#if NeedFunctionPrototypes GCPtr, int, pointer, int -#endif ); void xf4bppCopyClip( -#if NeedFunctionPrototypes GCPtr, GCPtr -#endif ); /* ppcCpArea.c */ RegionPtr xf4bppCopyArea( -#if NeedFunctionPrototypes DrawablePtr, DrawablePtr, GCPtr, @@ -76,145 +63,115 @@ RegionPtr xf4bppCopyArea( int, int, int -#endif ); /* ppcDepth.c */ Bool xf4bppDepthOK( -#if NeedFunctionPrototypes DrawablePtr, int -#endif ); /* ppcFillRct.c */ void xf4bppPolyFillRect( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xRectangle * -#endif ); /* ppcWindowFS.c */ void xf4bppSolidWindowFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppStippleWindowFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppOpStippleWindowFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppTileWindowFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); /* xf4bppPixmapFS.c */ void xf4bppSolidPixmapFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppStipplePixmapFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppOpStipplePixmapFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); void xf4bppTilePixmapFS( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, DDXPointPtr, int *, int -#endif ); /* ppcGC.c */ Bool xf4bppCreateGC( -#if NeedFunctionPrototypes GCPtr -#endif ); void xf4bppDestroyGC( -#if NeedFunctionPrototypes GC * -#endif ); void xf4bppValidateGC( -#if NeedFunctionPrototypes GCPtr, unsigned long, DrawablePtr -#endif ); /* ppcGetSp.c */ void xf4bppGetSpans( -#if NeedFunctionPrototypes DrawablePtr, int, DDXPointPtr, int *, int, char * -#endif ); /* ppcImg.c */ void xf4bppGetImage( -#if NeedFunctionPrototypes DrawablePtr, int, int, @@ -223,110 +180,86 @@ void xf4bppGetImage( unsigned int, unsigned long, char * -#endif ); /* ppcLine.c */ void xf4bppScrnZeroLine( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); void xf4bppScrnZeroDash( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); void xf4bppScrnZeroSegs( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xSegment * -#endif ); /* ppcPixmap.c */ PixmapPtr xf4bppCreatePixmap( -#if NeedFunctionPrototypes ScreenPtr, int, int, int -#endif ); PixmapPtr xf4bppCopyPixmap( -#if NeedFunctionPrototypes PixmapPtr -#endif ); /* ppcPntWin.c */ void xf4bppPaintWindow( -#if NeedFunctionPrototypes WindowPtr, RegionPtr, int -#endif ); /* ppcPolyPnt.c */ void xf4bppPolyPoint( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, xPoint * -#endif ); /* ppcPolyRec.c */ void xf4bppPolyRectangle( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xRectangle * -#endif ); /* ppcQuery.c */ void xf4bppQueryBestSize( -#if NeedFunctionPrototypes int, unsigned short *, unsigned short *, ScreenPtr -#endif ); /* ppcRslvC.c */ void xf4bppResolveColor( -#if NeedFunctionPrototypes unsigned short *, unsigned short *, unsigned short *, VisualPtr -#endif ); Bool xf4bppInitializeColormap( -#if NeedFunctionPrototypes ColormapPtr -#endif ); /* ppcSetSp.c */ void xf4bppSetSpans( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, char *, @@ -334,45 +267,33 @@ void xf4bppSetSpans( int *, int, int -#endif ); /* ppcWindow.c */ void xf4bppCopyWindow( -#if NeedFunctionPrototypes WindowPtr, DDXPointRec, RegionPtr -#endif ); Bool xf4bppPositionWindow( -#if NeedFunctionPrototypes WindowPtr, int, int -#endif ); Bool xf4bppUnrealizeWindow( -#if NeedFunctionPrototypes WindowPtr, int, int -#endif ); Bool xf4bppDestroyWindow( -#if NeedFunctionPrototypes WindowPtr -#endif ); Bool xf4bppCreateWindowForXYhardware( -#if NeedFunctionPrototypes WindowPtr -#endif ); /* emulOpStip.c */ void xf4bppOpaqueStipple( -#if NeedFunctionPrototypes WindowPtr, PixmapPtr, unsigned long int, @@ -385,12 +306,10 @@ void xf4bppOpaqueStipple( int, int, int -#endif ); /* emulRepAre.c */ void xf4bppReplicateArea( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -399,12 +318,10 @@ void xf4bppReplicateArea( int, int, int -#endif ); /* emulTile.c */ void xf4bppTileRect( -#if NeedFunctionPrototypes WindowPtr, PixmapPtr, const int, @@ -415,20 +332,16 @@ void xf4bppTileRect( int, int, int -#endif ); /* vgaGC.c */ Mask xf4bppChangeWindowGC( -#if NeedFunctionPrototypes GCPtr, Mask -#endif ); /* vgaBitBlt.c */ void xf4bppBitBlt( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -438,12 +351,10 @@ void xf4bppBitBlt( int, int, int -#endif ); /* vgaImages.c */ void xf4bppDrawColorImage( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -453,10 +364,8 @@ void xf4bppDrawColorImage( int, const int, const unsigned long int -#endif ); void xf4bppReadColorImage( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -464,12 +373,10 @@ void xf4bppReadColorImage( int, unsigned char *, int -#endif ); /* vgaLine.c */ void xf4bppHorzLine( -#if NeedFunctionPrototypes WindowPtr, unsigned long int, int, @@ -477,10 +384,8 @@ void xf4bppHorzLine( int, int, int -#endif ); void xf4bppVertLine( -#if NeedFunctionPrototypes WindowPtr, unsigned long int, int, @@ -488,10 +393,8 @@ void xf4bppVertLine( int, int, int -#endif ); void xf4bppBresLine( -#if NeedFunctionPrototypes WindowPtr, unsigned long int, int, @@ -505,12 +408,10 @@ void xf4bppBresLine( int, int, unsigned long int -#endif ); /* vgaStipple.c */ void xf4bppFillStipple( -#if NeedFunctionPrototypes WindowPtr, const PixmapPtr, unsigned long int, @@ -522,12 +423,10 @@ void xf4bppFillStipple( int, const int, const int -#endif ); /* vgaSolid.c */ void xf4bppFillSolid( -#if NeedFunctionPrototypes WindowPtr, unsigned long int, const int, @@ -536,12 +435,10 @@ void xf4bppFillSolid( const int, int, const int -#endif ); /* offscreen.c */ void xf4bppOffBitBlt( -#if NeedFunctionPrototypes WindowPtr, const int, const int, @@ -551,10 +448,8 @@ void xf4bppOffBitBlt( int, int, int -#endif ); void xf4bppOffDrawColorImage( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -564,10 +459,8 @@ void xf4bppOffDrawColorImage( int, const int, const unsigned long int -#endif ); void xf4bppOffReadColorImage( -#if NeedFunctionPrototypes WindowPtr, int, int, @@ -575,10 +468,8 @@ void xf4bppOffReadColorImage( int, unsigned char *, int -#endif ); void xf4bppOffFillSolid( -#if NeedFunctionPrototypes WindowPtr, unsigned long int, const int, @@ -587,10 +478,8 @@ void xf4bppOffFillSolid( const int, int, const int -#endif ); void xf4bppOffDrawMonoImage( -#if NeedFunctionPrototypes WindowPtr, unsigned char *, int, @@ -600,10 +489,8 @@ void xf4bppOffDrawMonoImage( unsigned long int, int, unsigned long int -#endif ); void xf4bppOffFillStipple( -#if NeedFunctionPrototypes WindowPtr, const PixmapPtr, unsigned long int, @@ -615,12 +502,10 @@ void xf4bppOffFillStipple( int, const int, const int -#endif ); /* mfbimggblt.c */ void xf4bppImageGlyphBlt( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, @@ -628,24 +513,18 @@ void xf4bppImageGlyphBlt( unsigned int, CharInfoPtr *, pointer -#endif ); /* wm3.c */ int wm3_set_regs( -#if NeedFunctionPrototypes GC * -#endif ); /* ppcIO.c */ -int xf4bppNeverCalled( -#if NeedFunctionPrototypes +void xf4bppNeverCalled( void -#endif ); Bool xf4bppScreenInit( -#if NeedFunctionPrototypes ScreenPtr, pointer, int, @@ -653,68 +532,54 @@ Bool xf4bppScreenInit( int, int, int -#endif ); /* mfbfillarc.c */ void xf4bppPolyFillArc( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xArc * -#endif ); /* mfbzerarc.c */ void xf4bppZeroPolyArc( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xArc * -#endif ); /* mfbline.c */ void xf4bppSegmentSS ( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xSegment * -#endif ); void xf4bppLineSS ( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); void xf4bppSegmentSD ( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, xSegment * -#endif ); void xf4bppLineSD ( -#if NeedFunctionPrototypes DrawablePtr, GCPtr, int, int, DDXPointPtr -#endif ); /* mfbbres.c */ void xf4bppBresS( -#if NeedFunctionPrototypes PixelType *, int, int, @@ -726,12 +591,10 @@ void xf4bppBresS( int, int, int -#endif ); /* mfbbresd.c */ void xf4bppBresD( -#if NeedFunctionPrototypes DrawablePtr, int, int, int *, @@ -743,60 +606,47 @@ void xf4bppBresD( int, int, int, int, int, int, int, int, int, int -#endif ); /* mfbhrzvert.c */ void xf4bppHorzS( -#if NeedFunctionPrototypes PixelType *, int, int, int, int -#endif ); void xf4bppVertS( -#if NeedFunctionPrototypes PixelType *, int, int, int, int -#endif ); #ifdef PC98_EGC /* egc_asm.s */ unsigned char getbits_x( -#if NeedFunctionPrototypes int, unsigned int, pointer, unsigned int -#endif ); void wcopyr( -#if NeedFunctionPrototypes pointer, pointer, int, pointer -#endif ); void wcopyl( -#if NeedFunctionPrototypes pointer, pointer, int, pointer -#endif ); unsigned long int read8Z( -#if NeedFunctionPrototypes pointer -#endif ); #endif /* PC98_EGC */ diff --git a/hw/xfree86/xf8_16bpp/cfbwindow.c b/hw/xfree86/xf8_16bpp/cfbwindow.c index 3ad8a5809..757b0dc49 100644 --- a/hw/xfree86/xf8_16bpp/cfbwindow.c +++ b/hw/xfree86/xf8_16bpp/cfbwindow.c @@ -4,7 +4,7 @@ Written by Mark Vojkovich (mvojkovi@ucsd.edu) */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.4 2003/02/17 16:08:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.5 2003/11/10 18:22:42 tsi Exp $ */ #include "X.h" #include "scrnintstr.h" @@ -70,7 +70,7 @@ cfb8_16CopyWindow( int i, nbox, dx, dy; WindowPtr pRoot = WindowTable[pScreen->myNum]; - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; @@ -99,7 +99,7 @@ cfb8_16CopyWindow( REGION_UNINIT(pScreen, &rgnDst); if(pWin->drawable.depth == 8) { - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); miSegregateChildren(pWin, &rgnDst, pScrn->depth); if(REGION_NOTEMPTY(pScreen, &rgnDst)) { REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h index 733051ae0..30bc1a0fa 100644 --- a/hw/xfree86/xf8_32bpp/cfb8_32.h +++ b/hw/xfree86/xf8_32bpp/cfb8_32.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.5 2000/03/02 02:32:52 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.6 2003/07/16 01:38:50 dawes Exp $ */ #ifndef _CFB8_32_H #define _CFB8_32_H @@ -57,8 +57,7 @@ cfbDoBitblt8To32( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long planemask, - unsigned long bitPlane + unsigned long planemask ); void @@ -68,8 +67,7 @@ cfbDoBitblt32To8( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long planemask, - unsigned long bitPlane + unsigned long planemask ); @@ -177,8 +175,7 @@ cfbDoBitblt8To8GXcopy( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ); void @@ -188,8 +185,7 @@ cfbDoBitblt24To24GXcopy( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ); Bool cfb8_32CreateWindow(WindowPtr pWin); diff --git a/hw/xfree86/xf8_32bpp/cfbbstore.c b/hw/xfree86/xf8_32bpp/cfbbstore.c index 919fabf5f..581efb4f6 100644 --- a/hw/xfree86/xf8_32bpp/cfbbstore.c +++ b/hw/xfree86/xf8_32bpp/cfbbstore.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.2 1999/01/31 12:22:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */ #define PSZ 8 #include "cfb.h" @@ -49,7 +49,7 @@ cfb8_32SaveAreas( pScrPix = (PixmapPtr) pScreen->devPrivate; cfbDoBitblt32To8((DrawablePtr) pScrPix, (DrawablePtr)pPixmap, - GXcopy, prgnSave, pPtsInit, ~0L, 0); + GXcopy, prgnSave, pPtsInit, ~0L); DEALLOCATE_LOCAL (pPtsInit); } @@ -95,7 +95,7 @@ cfb8_32RestoreAreas( GXcopy, prgnRestore, pPtsInit, ~0); } else { cfbDoBitblt8To32((DrawablePtr)pPixmap, (DrawablePtr) pScrPix, - GXcopy, prgnRestore, pPtsInit, ~0L, 0); + GXcopy, prgnRestore, pPtsInit, ~0L); } DEALLOCATE_LOCAL (pPtsInit); diff --git a/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/hw/xfree86/xf8_32bpp/cfbcpyarea.c index 752e56db8..53af8f7d8 100644 --- a/hw/xfree86/xf8_32bpp/cfbcpyarea.c +++ b/hw/xfree86/xf8_32bpp/cfbcpyarea.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.5 2000/02/29 00:17:16 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -67,8 +67,7 @@ cfbDoBitblt8To32( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ){ BoxPtr pbox = REGION_RECTS(prgnDst); int nbox = REGION_NUM_RECTS(prgnDst); @@ -184,8 +183,7 @@ cfbDoBitblt32To8( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ){ BoxPtr pbox = REGION_RECTS(prgnDst); int nbox = REGION_NUM_RECTS(prgnDst); @@ -394,7 +392,15 @@ cfb8_32DoBitBlt( DrawablePtr pDst, RegionPtr prgnDst, DDXPointPtr pptSrc, - void (*DoBlt)() + void (*DoBlt)( + unsigned char *SrcPtr, + int SrcPitch, + unsigned char *DstPtr, + int DstPitch, + int nbox, + DDXPointPtr pptSrc, + BoxPtr pbox, + int xdir, int ydir) ){ int nbox, careful, SrcPitch, DstPitch; BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; @@ -519,8 +525,7 @@ cfbDoBitblt8To8GXcopy( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ){ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do8To8Blt); } @@ -533,8 +538,7 @@ cfbDoBitblt24To24GXcopy( int rop, RegionPtr prgnDst, DDXPointPtr pptSrc, - unsigned long pm, - unsigned long bitPlane + unsigned long pm ){ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt); } diff --git a/hw/xfree86/xf8_32bpp/cfbgcunder.c b/hw/xfree86/xf8_32bpp/cfbgcunder.c index d263b8b9e..d01b2b5cb 100644 --- a/hw/xfree86/xf8_32bpp/cfbgcunder.c +++ b/hw/xfree86/xf8_32bpp/cfbgcunder.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.5 2001/12/14 19:59:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.6 2003/07/16 01:38:50 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -66,6 +66,7 @@ SOFTWARE. #include "cfbmskbits.h" #include "cfb8bit.h" +#include "cfb8_32.h" #ifdef WriteBitGroup # define useTEGlyphBlt cfbImageGlyphBlt8 @@ -217,9 +218,9 @@ static GCOps cfbNonTEOps = { }; static GCOps * -cfb32MatchCommon_Underlay (pGC, devPriv) - GCPtr pGC; - cfbPrivGCPtr devPriv; +cfb32MatchCommon_Underlay( + GCPtr pGC, + cfbPrivGCPtr devPriv) { if (pGC->lineWidth != 0) return 0; diff --git a/hw/xfree86/xf8_32bpp/cfbimage.c b/hw/xfree86/xf8_32bpp/cfbimage.c index 1e8550851..e737e025e 100644 --- a/hw/xfree86/xf8_32bpp/cfbimage.c +++ b/hw/xfree86/xf8_32bpp/cfbimage.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.2 2000/02/25 00:21:40 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.3 2003/07/16 01:38:50 dawes Exp $ */ #include "X.h" #include "windowstr.h" @@ -63,7 +63,7 @@ cfb8_32GetImage ( box.y2 = h; REGION_INIT(pScreen, &rgnDst, &box, 1); cfbDoBitblt32To8(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst, - &ptSrc, planemask, 0); + &ptSrc, planemask); REGION_UNINIT(pScreen, &rgnDst); FreeScratchPixmapHeader(pPixmap); } diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c index ce2b8ae8f..7f123d36a 100644 --- a/hw/xfree86/xf8_32bpp/cfbscrinit.c +++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.11 2001/04/14 21:17:49 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.12 2003/07/16 01:38:50 dawes Exp $ */ #include "X.h" @@ -76,6 +76,20 @@ cfb8_32AllocatePrivates(ScreenPtr pScreen) return TRUE; } +static void DestroyColormapNoop( + ColormapPtr pColormap) +{ + /* NOOP */ +} + +static void StoreColorsNoop( + ColormapPtr pColormap, + int ndef, + xColorItem * pdef) +{ + /* NOOP */ +} + static Bool cfb8_32SetupScreen( ScreenPtr pScreen, @@ -108,11 +122,11 @@ cfb8_32SetupScreen( pScreen->UnrealizeFont = mfbUnrealizeFont; pScreen->CreateGC = cfb8_32CreateGC; pScreen->CreateColormap = miInitializeColormap; - pScreen->DestroyColormap = (void (*)())NoopDDA; + pScreen->DestroyColormap = DestroyColormapNoop; pScreen->InstallColormap = miInstallColormap; pScreen->UninstallColormap = miUninstallColormap; pScreen->ListInstalledColormaps = miListInstalledColormaps; - pScreen->StoreColors = (void (*)())NoopDDA; + pScreen->StoreColors = StoreColorsNoop; pScreen->ResolveColor = miResolveColor; pScreen->BitmapToRegion = mfbPixmapToRegion; diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c index 518166f41..c18b54399 100644 --- a/hw/xfree86/xf8_32bpp/cfbwindow.c +++ b/hw/xfree86/xf8_32bpp/cfbwindow.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.7 2003/02/17 16:08:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.9 2003/11/10 18:22:43 tsi Exp $ */ #include "X.h" @@ -67,7 +67,7 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc) if(doUnderlay) freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; @@ -92,10 +92,10 @@ cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc) if(doUnderlay) cfbDoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, - GXcopy, &rgnDst, pptSrc, ~0, 0); + GXcopy, &rgnDst, pptSrc, ~0); else cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, - GXcopy, &rgnDst, pptSrc, ~0, 0); + GXcopy, &rgnDst, pptSrc, ~0); DEALLOCATE_LOCAL(pptSrc); REGION_UNINIT(pScreen, &rgnDst); diff --git a/hw/xfree86/xf8_32wid/cfbwindow.c b/hw/xfree86/xf8_32wid/cfbwindow.c index 74db57649..b7ac739b3 100644 --- a/hw/xfree86/xf8_32wid/cfbwindow.c +++ b/hw/xfree86/xf8_32wid/cfbwindow.c @@ -7,7 +7,7 @@ Mark Vojkovich's work. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.2 2001/10/28 03:34:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.3 2003/11/10 18:22:43 tsi Exp $ */ #include "X.h" #include "scrnintstr.h" @@ -98,7 +98,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) BoxPtr pbox; int i, nbox, dx, dy, other_bpp; - REGION_INIT(pScreen, &rgnDst, NullBox, 0); + REGION_NULL(pScreen, &rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; @@ -136,7 +136,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) else other_bpp = 8; - REGION_INIT(pScreen, &rgnOther, NullBox, 0); + REGION_NULL(pScreen, &rgnOther); SegregateChildrenBpp(pWin, &rgnOther, 0, other_bpp, pWin->drawable.bitsPerPixel); pPixChildren = NULL; @@ -162,7 +162,7 @@ cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) ppt->y = pbox->y1 + dy; } - REGION_INIT(pScreen, &rgnPixmap, NullBox, 0); + REGION_NULL(pScreen, &rgnPixmap); REGION_COPY(pScreen, &rgnPixmap, &rgnOther); REGION_TRANSLATE(pScreen, &rgnPixmap, -(rgnOther.extents.x1), -(rgnOther.extents.y1)); |