aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-30 09:49:59 +0000
committermarha <marha@users.sourceforge.net>2010-09-30 09:49:59 +0000
commitf952d0d771de6d9b8ecc3cbbe3624203723bbb25 (patch)
tree6dd2d11e017529c66f2489000136201829dc3b9d /xorg-server/hw/xfree86
parentf6ba83c963bf48dfa349ab8c54d1968c4c69f7b8 (diff)
downloadvcxsrv-f952d0d771de6d9b8ecc3cbbe3624203723bbb25.tar.gz
vcxsrv-f952d0d771de6d9b8ecc3cbbe3624203723bbb25.tar.bz2
vcxsrv-f952d0d771de6d9b8ecc3cbbe3624203723bbb25.zip
xserver libX11 xkeyboard-config git update 30/9/2010
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c19
-rw-r--r--xorg-server/hw/xfree86/common/xf86Module.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.h1
-rw-r--r--xorg-server/hw/xfree86/common/xf86str.h1
-rw-r--r--xorg-server/hw/xfree86/dixmods/extmod/Makefile.am60
-rw-r--r--xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c86
-rw-r--r--xorg-server/hw/xfree86/dixmods/extmod/xf86dgaext.h10
-rw-r--r--xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c146
-rw-r--r--xorg-server/hw/xfree86/dri/xf86dri.c70
-rw-r--r--xorg-server/hw/xfree86/fbdevhw/fbdevhw.c10
-rw-r--r--xorg-server/hw/xfree86/i2c/bt829_module.c49
-rw-r--r--xorg-server/hw/xfree86/i2c/fi1236_module.c57
-rw-r--r--xorg-server/hw/xfree86/i2c/msp3430_module.c57
-rw-r--r--xorg-server/hw/xfree86/i2c/tda8425_module.c57
-rw-r--r--xorg-server/hw/xfree86/i2c/tda9850_module.c57
-rw-r--r--xorg-server/hw/xfree86/i2c/tda9885_module.c57
-rw-r--r--xorg-server/hw/xfree86/i2c/uda1380_module.c57
-rw-r--r--xorg-server/hw/xfree86/int10/xf86int10module.c107
-rw-r--r--xorg-server/hw/xfree86/loader/Makefile.am60
-rw-r--r--xorg-server/hw/xfree86/loader/dlloader.c178
-rw-r--r--xorg-server/hw/xfree86/loader/dlloader.h33
-rw-r--r--xorg-server/hw/xfree86/loader/loader.c188
-rw-r--r--xorg-server/hw/xfree86/loader/loader.h23
-rw-r--r--xorg-server/hw/xfree86/loader/loaderProcs.h187
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c79
-rw-r--r--xorg-server/hw/xfree86/modes/xf86RandR12.c12
-rw-r--r--xorg-server/hw/xfree86/shadowfb/shadow.c53
-rw-r--r--xorg-server/hw/xfree86/vbe/vbe_module.c54
28 files changed, 589 insertions, 1181 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index 51a503eb9..e4d07ec12 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -125,7 +125,6 @@ xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags)
xnfalloc(sizeof(InputDriverRec));
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
- xf86InputDriverList[xf86NumInputDrivers - 1]->refCount = 0;
}
void
@@ -284,7 +283,6 @@ xf86AllocateInput(InputDriverPtr drv, int flags)
return NULL;
new->drv = drv;
- drv->refCount++;
new->module = DuplicateModule(drv->module, NULL);
for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
@@ -320,9 +318,6 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
if (pInp->module)
UnloadModule(pInp->module);
- if (pInp->drv)
- pInp->drv->refCount--;
-
/* This should *really* be handled in drv->UnInit(dev) call instead, but
* if the driver forgets about it make sure we free it or at least crash
* with flying colors */
@@ -776,6 +771,9 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
scrp->weight.red = scrp->weight.blue = 5;
scrp->weight.green = 6;
break;
+ case 18:
+ scrp->weight.red = scrp->weight.green = scrp->weight.blue = 6;
+ break;
case 24:
scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8;
break;
@@ -1180,10 +1178,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
if (enable)
{
/*
- * Restore the screen pixmap devPrivate field
- */
- pspix->devPrivate = pScrnInfo->pixmapPrivate;
- /*
* Restore all of the clip lists on the screen
*/
if (!xf86Resetting)
@@ -1196,13 +1190,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
* Empty all of the clip lists on the screen
*/
xf86SetRootClip (pScreen, FALSE);
- /*
- * save the screen pixmap devPrivate field and
- * replace it with NULL so accidental references
- * to the frame buffer are caught
- */
- pScrnInfo->pixmapPrivate = pspix->devPrivate;
- pspix->devPrivate.ptr = NULL;
}
}
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h
index f85c54dc9..266a4dafe 100644
--- a/xorg-server/hw/xfree86/common/xf86Module.h
+++ b/xorg-server/hw/xfree86/common/xf86Module.h
@@ -82,7 +82,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h
index d78c22333..1e5671574 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.h
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.h
@@ -103,7 +103,6 @@ typedef struct _InputDriverRec {
struct _LocalDeviceRec *pInfo,
int flags);
pointer module;
- int refCount;
} InputDriverRec, *InputDriverPtr;
/* This is to input devices what the ScrnInfoRec is to screens. */
diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h
index 58438db76..9d52661a7 100644
--- a/xorg-server/hw/xfree86/common/xf86str.h
+++ b/xorg-server/hw/xfree86/common/xf86str.h
@@ -765,7 +765,6 @@ typedef struct _ScrnInfoRec {
/* Allow screens to be enabled/disabled individually */
Bool vtSema;
- DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
/* hw cursor moves at SIGIO time */
Bool silkenMouse;
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am b/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am
index d93e63afa..c0b7ddc02 100644
--- a/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/xorg-server/hw/xfree86/dixmods/extmod/Makefile.am
@@ -1,30 +1,30 @@
-sdk_HEADERS = dgaproc.h
-
-extsmoduledir = $(moduledir)/extensions
-extsmodule_LTLIBRARIES = libextmod.la
-
-if DGA
-DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h
-endif
-
-if XV
-XV_SRCS = xvmod.c xvmodproc.h
-endif
-
-if XF86VIDMODE
-XF86VMODE_SRCS = xf86vmode.c
-endif
-
-AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@
-INCLUDES = @XORG_INCS@ \
- -I$(top_srcdir)/dbe \
- -I$(top_srcdir)/hw/xfree86/loader \
- -I$(top_srcdir)/miext/shadow
-
-libextmod_la_LDFLAGS = -avoid-version
-libextmod_la_SOURCES = modinit.c \
- modinit.h \
- $(DGA_SRCS) \
- $(XF86VMODE_SRCS) \
- $(XV_SRCS)
-libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la
+sdk_HEADERS = dgaproc.h
+
+extsmoduledir = $(moduledir)/extensions
+extsmodule_LTLIBRARIES = libextmod.la
+
+if DGA
+DGA_SRCS = xf86dga2.c dgaproc.h
+endif
+
+if XV
+XV_SRCS = xvmod.c xvmodproc.h
+endif
+
+if XF86VIDMODE
+XF86VMODE_SRCS = xf86vmode.c
+endif
+
+AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@
+INCLUDES = @XORG_INCS@ \
+ -I$(top_srcdir)/dbe \
+ -I$(top_srcdir)/hw/xfree86/loader \
+ -I$(top_srcdir)/miext/shadow
+
+libextmod_la_LDFLAGS = -avoid-version
+libextmod_la_SOURCES = modinit.c \
+ modinit.h \
+ $(DGA_SRCS) \
+ $(XF86VMODE_SRCS) \
+ $(XV_SRCS)
+libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c
index 453ade80b..060e5a4d7 100644
--- a/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -25,7 +25,6 @@
#include <X11/extensions/xf86dgaproto.h>
#include "swaprep.h"
#include "dgaproc.h"
-#include "xf86dgaext.h"
#include "protocol-versions.h"
#include <string.h>
@@ -34,24 +33,6 @@
#define DGA_PROTOCOL_OLD_SUPPORT 1
-static DISPATCH_PROC(ProcXDGADispatch);
-static DISPATCH_PROC(SProcXDGADispatch);
-static DISPATCH_PROC(ProcXDGAQueryVersion);
-static DISPATCH_PROC(ProcXDGAQueryModes);
-static DISPATCH_PROC(ProcXDGASetMode);
-static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
-static DISPATCH_PROC(ProcXDGACloseFramebuffer);
-static DISPATCH_PROC(ProcXDGASetViewport);
-static DISPATCH_PROC(ProcXDGAInstallColormap);
-static DISPATCH_PROC(ProcXDGASelectInput);
-static DISPATCH_PROC(ProcXDGAFillRectangle);
-static DISPATCH_PROC(ProcXDGACopyArea);
-static DISPATCH_PROC(ProcXDGACopyTransparentArea);
-static DISPATCH_PROC(ProcXDGAGetViewportStatus);
-static DISPATCH_PROC(ProcXDGASync);
-static DISPATCH_PROC(ProcXDGASetClientVersion);
-static DISPATCH_PROC(ProcXDGAChangePixmapMode);
-static DISPATCH_PROC(ProcXDGACreateColormap);
static void XDGAResetProc(ExtensionEntry *extEntry);
@@ -85,36 +66,6 @@ typedef struct {
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
-void
-XFree86DGAExtensionInit(INITARGS)
-{
- ExtensionEntry* extEntry;
-
- if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-
- if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-
- if ((extEntry = AddExtension(XF86DGANAME,
- XF86DGANumberEvents,
- XF86DGANumberErrors,
- ProcXDGADispatch,
- SProcXDGADispatch,
- XDGAResetProc,
- StandardMinorOpcode))) {
- int i;
-
- DGAReqCode = (unsigned char)extEntry->base;
- DGAErrorBase = extEntry->errorBase;
- DGAEventBase = extEntry->eventBase;
- for (i = KeyPress; i <= MotionNotify; i++)
- SetCriticalEvent (DGAEventBase + i);
- }
-}
-
-
-
static void
XDGAResetProc (ExtensionEntry *extEntry)
{
@@ -663,15 +614,6 @@ ProcXDGACreateColormap(ClientPtr client)
#ifdef DGA_PROTOCOL_OLD_SUPPORT
-static DISPATCH_PROC(ProcXF86DGADirectVideo);
-static DISPATCH_PROC(ProcXF86DGAGetVidPage);
-static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
-static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
-static DISPATCH_PROC(ProcXF86DGASetVidPage);
-static DISPATCH_PROC(ProcXF86DGASetViewPort);
-static DISPATCH_PROC(ProcXF86DGAInstallColormap);
-static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
-static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
static int
@@ -1063,3 +1005,31 @@ XFree86DGARegister(INITARGS)
{
XDGAEventBase = &DGAEventBase;
}
+
+void
+XFree86DGAExtensionInit(INITARGS)
+{
+ ExtensionEntry* extEntry;
+
+ if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+ return;
+
+ if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
+ if ((extEntry = AddExtension(XF86DGANAME,
+ XF86DGANumberEvents,
+ XF86DGANumberErrors,
+ ProcXDGADispatch,
+ SProcXDGADispatch,
+ XDGAResetProc,
+ StandardMinorOpcode))) {
+ int i;
+
+ DGAReqCode = (unsigned char)extEntry->base;
+ DGAErrorBase = extEntry->errorBase;
+ DGAEventBase = extEntry->eventBase;
+ for (i = KeyPress; i <= MotionNotify; i++)
+ SetCriticalEvent (DGAEventBase + i);
+ }
+}
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86dgaext.h b/xorg-server/hw/xfree86/dixmods/extmod/xf86dgaext.h
deleted file mode 100644
index 2b1737305..000000000
--- a/xorg-server/hw/xfree86/dixmods/extmod/xf86dgaext.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _XF86DGAEXT_H_
-#define _XF86DGAEXT_H_
-
-extern DISPATCH_PROC(ProcXF86DGADispatch);
-
-#endif /* _XF86DGAEXT_H_ */
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
index 31bb311b3..25980b02b 100644
--- a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -65,48 +65,6 @@ typedef struct {
#define VM_SETPRIV(c,p) \
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
-static DISPATCH_PROC(ProcXF86VidModeDispatch);
-static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(ProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(ProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(ProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(ProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(ProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(ProcXF86VidModeModModeLine);
-static DISPATCH_PROC(ProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(ProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(ProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(ProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(ProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(ProcXF86VidModeSetGamma);
-static DISPATCH_PROC(ProcXF86VidModeGetGamma);
-static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
-static DISPATCH_PROC(SProcXF86VidModeDispatch);
-static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(SProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(SProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(SProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(SProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(SProcXF86VidModeModModeLine);
-static DISPATCH_PROC(SProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(SProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(SProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(SProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(SProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(SProcXF86VidModeSetGamma);
-static DISPATCH_PROC(SProcXF86VidModeGetGamma);
-static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
#if 0
static unsigned char XF86VidModeReqCode = 0;
@@ -159,58 +117,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
# define DEBUG_P(x) /**/
#endif
-void
-XFree86VidModeExtensionInit(void)
-{
- ExtensionEntry* extEntry;
- ScreenPtr pScreen;
- int i;
- Bool enabled = FALSE;
-
- DEBUG_P("XFree86VidModeExtensionInit");
-
- if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-#ifdef XF86VIDMODE_EVENTS
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-#endif
-
-#ifdef XF86VIDMODE_EVENTS
- EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
-#endif
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if (VidModeExtensionInit(pScreen))
- enabled = TRUE;
- }
- /* This means that the DDX doesn't want the vidmode extension enabled */
- if (!enabled)
- return;
-
- if (
-#ifdef XF86VIDMODE_EVENTS
- EventType &&
-#endif
- (extEntry = AddExtension(XF86VIDMODENAME,
- XF86VidModeNumberEvents,
- XF86VidModeNumberErrors,
- ProcXF86VidModeDispatch,
- SProcXF86VidModeDispatch,
- NULL,
- StandardMinorOpcode))) {
-#if 0
- XF86VidModeReqCode = (unsigned char)extEntry->base;
-#endif
- VidModeErrorBase = extEntry->errorBase;
-#ifdef XF86VIDMODE_EVENTS
- XF86VidModeEventBase = extEntry->eventBase;
- EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
-#endif
- }
-}
-
static int
ClientMajorVersion(ClientPtr client)
{
@@ -2166,3 +2072,55 @@ SProcXF86VidModeDispatch(ClientPtr client)
return VidModeErrorBase + XF86VidModeClientNotLocal;
}
}
+
+void
+XFree86VidModeExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+ ScreenPtr pScreen;
+ int i;
+ Bool enabled = FALSE;
+
+ DEBUG_P("XFree86VidModeExtensionInit");
+
+ if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+ return;
+#ifdef XF86VIDMODE_EVENTS
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+#endif
+
+#ifdef XF86VIDMODE_EVENTS
+ EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
+#endif
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ if (VidModeExtensionInit(pScreen))
+ enabled = TRUE;
+ }
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!enabled)
+ return;
+
+ if (
+#ifdef XF86VIDMODE_EVENTS
+ EventType &&
+#endif
+ (extEntry = AddExtension(XF86VIDMODENAME,
+ XF86VidModeNumberEvents,
+ XF86VidModeNumberErrors,
+ ProcXF86VidModeDispatch,
+ SProcXF86VidModeDispatch,
+ NULL,
+ StandardMinorOpcode))) {
+#if 0
+ XF86VidModeReqCode = (unsigned char)extEntry->base;
+#endif
+ VidModeErrorBase = extEntry->errorBase;
+#ifdef XF86VIDMODE_EVENTS
+ XF86VidModeEventBase = extEntry->eventBase;
+ EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
+#endif
+ }
+}
diff --git a/xorg-server/hw/xfree86/dri/xf86dri.c b/xorg-server/hw/xfree86/dri/xf86dri.c
index 40914ed19..cd1085b36 100644
--- a/xorg-server/hw/xfree86/dri/xf86dri.c
+++ b/xorg-server/hw/xfree86/dri/xf86dri.c
@@ -64,23 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static int DRIErrorBase;
-static DISPATCH_PROC(ProcXF86DRIQueryVersion);
-static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(ProcXF86DRIOpenConnection);
-static DISPATCH_PROC(ProcXF86DRICloseConnection);
-static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
-static DISPATCH_PROC(ProcXF86DRICreateContext);
-static DISPATCH_PROC(ProcXF86DRIDestroyContext);
-static DISPATCH_PROC(ProcXF86DRICreateDrawable);
-static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
-static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
-static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
-static DISPATCH_PROC(ProcXF86DRIDispatch);
-static DISPATCH_PROC(ProcXF86DRIAuthConnection);
-
-static DISPATCH_PROC(SProcXF86DRIQueryVersion);
-static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(SProcXF86DRIDispatch);
+
static void XF86DRIResetProc(ExtensionEntry* extEntry);
@@ -88,32 +72,6 @@ static unsigned char DRIReqCode = 0;
extern void XFree86DRIExtensionInit(void);
-void
-XFree86DRIExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
-#ifdef XF86DRI_EVENTS
- EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
-#endif
-
- if (
- DRIExtensionInit() &&
-#ifdef XF86DRI_EVENTS
- EventType && ScreenPrivateIndex != -1 &&
-#endif
- (extEntry = AddExtension(XF86DRINAME,
- XF86DRINumberEvents,
- XF86DRINumberErrors,
- ProcXF86DRIDispatch,
- SProcXF86DRIDispatch,
- XF86DRIResetProc,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- }
-}
-
/*ARGSUSED*/
static void
XF86DRIResetProc (
@@ -677,3 +635,29 @@ SProcXF86DRIDispatch (
return DRIErrorBase + XF86DRIClientNotLocal;
}
}
+
+void
+XFree86DRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+#ifdef XF86DRI_EVENTS
+ EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
+#endif
+
+ if (
+ DRIExtensionInit() &&
+#ifdef XF86DRI_EVENTS
+ EventType && ScreenPrivateIndex != -1 &&
+#endif
+ (extEntry = AddExtension(XF86DRINAME,
+ XF86DRINumberEvents,
+ XF86DRINumberErrors,
+ ProcXF86DRIDispatch,
+ SProcXF86DRIDispatch,
+ XF86DRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ }
+}
diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
index 1b0702644..49d0bd044 100644
--- a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c
@@ -21,8 +21,6 @@
#define PAGE_MASK (~(getpagesize() - 1))
-static MODULESETUPPROTO(fbdevhwSetup);
-
static XF86ModuleVersionInfo fbdevHWVersRec =
{
"fbdevhw",
@@ -39,16 +37,10 @@ static XF86ModuleVersionInfo fbdevHWVersRec =
_X_EXPORT XF86ModuleData fbdevhwModuleData = {
&fbdevHWVersRec,
- fbdevhwSetup,
+ NULL,
NULL
};
-static pointer
-fbdevhwSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- return (pointer)1;
-}
-
#include <fcntl.h>
#include <errno.h>
#include <sys/mman.h>
diff --git a/xorg-server/hw/xfree86/i2c/bt829_module.c b/xorg-server/hw/xfree86/i2c/bt829_module.c
index c885b8e10..12801fbf3 100644
--- a/xorg-server/hw/xfree86/i2c/bt829_module.c
+++ b/xorg-server/hw/xfree86/i2c/bt829_module.c
@@ -1,28 +1,21 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(bt829Setup);
-
-static XF86ModuleVersionInfo bt829VersRec =
-{
- "bt829",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData bt829ModuleData = { &bt829VersRec, bt829Setup, NULL };
-
-static pointer
-bt829Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo bt829VersRec =
+{
+ "bt829",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData bt829ModuleData = { &bt829VersRec, NULL, NULL };
diff --git a/xorg-server/hw/xfree86/i2c/fi1236_module.c b/xorg-server/hw/xfree86/i2c/fi1236_module.c
index 4016ad0d4..7375e0fb9 100644
--- a/xorg-server/hw/xfree86/i2c/fi1236_module.c
+++ b/xorg-server/hw/xfree86/i2c/fi1236_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(fi1236Setup);
-
-static XF86ModuleVersionInfo fi1236VersRec =
-{
- "fi1236",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData fi1236ModuleData = {
- &fi1236VersRec,
- fi1236Setup,
- NULL
-};
-
-static pointer
-fi1236Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo fi1236VersRec =
+{
+ "fi1236",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData fi1236ModuleData = {
+ &fi1236VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/i2c/msp3430_module.c b/xorg-server/hw/xfree86/i2c/msp3430_module.c
index 66b14a277..c5c24635f 100644
--- a/xorg-server/hw/xfree86/i2c/msp3430_module.c
+++ b/xorg-server/hw/xfree86/i2c/msp3430_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(msp3430Setup);
-
-static XF86ModuleVersionInfo msp3430VersRec =
-{
- "msp3430",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData msp3430ModuleData = {
- &msp3430VersRec,
- msp3430Setup,
- NULL
-};
-
-static pointer
-msp3430Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo msp3430VersRec =
+{
+ "msp3430",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData msp3430ModuleData = {
+ &msp3430VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/i2c/tda8425_module.c b/xorg-server/hw/xfree86/i2c/tda8425_module.c
index 7906e5ea5..936281460 100644
--- a/xorg-server/hw/xfree86/i2c/tda8425_module.c
+++ b/xorg-server/hw/xfree86/i2c/tda8425_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(tda8425Setup);
-
-static XF86ModuleVersionInfo tda8425VersRec =
-{
- "tda8425",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData tda8425ModuleData = {
- &tda8425VersRec,
- tda8425Setup,
- NULL
-};
-
-static pointer
-tda8425Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo tda8425VersRec =
+{
+ "tda8425",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData tda8425ModuleData = {
+ &tda8425VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/i2c/tda9850_module.c b/xorg-server/hw/xfree86/i2c/tda9850_module.c
index 84f7e861e..239cff4fd 100644
--- a/xorg-server/hw/xfree86/i2c/tda9850_module.c
+++ b/xorg-server/hw/xfree86/i2c/tda9850_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(tda9850Setup);
-
-static XF86ModuleVersionInfo tda9850VersRec =
-{
- "tda9850",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData tda9850ModuleData = {
- &tda9850VersRec,
- tda9850Setup,
- NULL
-};
-
-static pointer
-tda9850Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo tda9850VersRec =
+{
+ "tda9850",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData tda9850ModuleData = {
+ &tda9850VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/i2c/tda9885_module.c b/xorg-server/hw/xfree86/i2c/tda9885_module.c
index 0ce85bba3..51eaca7e8 100644
--- a/xorg-server/hw/xfree86/i2c/tda9885_module.c
+++ b/xorg-server/hw/xfree86/i2c/tda9885_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(tda9885Setup);
-
-static XF86ModuleVersionInfo tda9885VersRec =
-{
- "tda9885",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData tda9885ModuleData = {
- &tda9885VersRec,
- tda9885Setup,
- NULL
-};
-
-static pointer
-tda9885Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo tda9885VersRec =
+{
+ "tda9885",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData tda9885ModuleData = {
+ &tda9885VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/i2c/uda1380_module.c b/xorg-server/hw/xfree86/i2c/uda1380_module.c
index 895f8c6f2..203055d46 100644
--- a/xorg-server/hw/xfree86/i2c/uda1380_module.c
+++ b/xorg-server/hw/xfree86/i2c/uda1380_module.c
@@ -1,32 +1,25 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86Module.h"
-
-static MODULESETUPPROTO(uda1380Setup);
-
-static XF86ModuleVersionInfo uda1380VersRec =
-{
- "uda1380",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData uda1380ModuleData = {
- &uda1380VersRec,
- uda1380Setup,
- NULL
-};
-
-static pointer
-uda1380Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo uda1380VersRec =
+{
+ "uda1380",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData uda1380ModuleData = {
+ &uda1380VersRec,
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/int10/xf86int10module.c b/xorg-server/hw/xfree86/int10/xf86int10module.c
index b4e5865da..52bf0eeb1 100644
--- a/xorg-server/hw/xfree86/int10/xf86int10module.c
+++ b/xorg-server/hw/xfree86/int10/xf86int10module.c
@@ -1,64 +1,43 @@
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86.h"
-#include "xf86str.h"
-#include "xf86Pci.h"
-#include "xf86int10.h"
-
-#ifndef MOD_NAME
-# define MOD_NAME int10
-#endif
-
-#define stringify(x) #x
-#define STRING(x) stringify(x)
-#define concat(x,y) x ## y
-#define combine(a,b) concat(a,b)
-#define NAME(x) combine(MOD_NAME,x)
-
-static MODULESETUPPROTO(NAME(Setup));
-
-static XF86ModuleVersionInfo NAME(VersRec) =
-{
- STRING(NAME( )),
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 0, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData NAME(ModuleData) = {
- &NAME(VersRec),
- NAME(Setup),
- NULL
-};
-
-static pointer
-NAME(Setup)(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- static Bool setupDone = FALSE;
-
- if (!setupDone) {
- setupDone = TRUE;
- /*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- }
- /*
- * The return value must be non-NULL on success even though there
- * is no TearDownProc.
- */
- return (pointer)1;
-}
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#include "xf86str.h"
+#include "xf86Pci.h"
+#include "xf86int10.h"
+
+#ifndef MOD_NAME
+# define MOD_NAME int10
+#endif
+
+#define stringify(x) #x
+#define STRING(x) stringify(x)
+#define concat(x,y) x ## y
+#define combine(a,b) concat(a,b)
+#define NAME(x) combine(MOD_NAME,x)
+
+static XF86ModuleVersionInfo NAME(VersRec) =
+{
+ STRING(NAME( )),
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData NAME(ModuleData) = {
+ &NAME(VersRec),
+ NULL,
+ NULL
+};
diff --git a/xorg-server/hw/xfree86/loader/Makefile.am b/xorg-server/hw/xfree86/loader/Makefile.am
index d3c17d173..acacda650 100644
--- a/xorg-server/hw/xfree86/loader/Makefile.am
+++ b/xorg-server/hw/xfree86/loader/Makefile.am
@@ -1,31 +1,29 @@
-noinst_LTLIBRARIES = libloader.la
-
-INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
- -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
- -I$(srcdir)/../ramdac
-
-#AM_LDFLAGS = -r
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
-
-EXTRA_DIST = \
- dlloader.h \
- loader.h \
- loaderProcs.h \
- sdksyms.sh
-
-libloader_la_SOURCES = \
- loader.c \
- loaderProcs.h \
- loadext.c \
- loadmod.c \
- dlloader.c \
- os.c \
- sdksyms.c
-libloader_la_LIBADD = $(DLOPEN_LIBS)
-
-CLEANFILES = sdksyms.c sdksyms.dep
-
-sdksyms.dep sdksyms.c: sdksyms.sh
- CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
-
-sinclude sdksyms.dep
+noinst_LTLIBRARIES = libloader.la
+
+INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
+ -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \
+ -I$(srcdir)/../ramdac
+
+#AM_LDFLAGS = -r
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
+
+EXTRA_DIST = \
+ loader.h \
+ loaderProcs.h \
+ sdksyms.sh
+
+libloader_la_SOURCES = \
+ loader.c \
+ loaderProcs.h \
+ loadext.c \
+ loadmod.c \
+ os.c \
+ sdksyms.c
+libloader_la_LIBADD = $(DLOPEN_LIBS)
+
+CLEANFILES = sdksyms.c sdksyms.dep
+
+sdksyms.dep sdksyms.c: sdksyms.sh
+ CPP='$(CPP)' AWK='$(AWK)' $(srcdir)/sdksyms.sh $(top_srcdir) $(AM_CFLAGS) $(CFLAGS) $(INCLUDES)
+
+sinclude sdksyms.dep
diff --git a/xorg-server/hw/xfree86/loader/dlloader.c b/xorg-server/hw/xfree86/loader/dlloader.c
deleted file mode 100644
index 18dcb76c6..000000000
--- a/xorg-server/hw/xfree86/loader/dlloader.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 1997 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 the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of the
- * XFree86 Project, Inc. not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission. The Xfree86 Project, Inc. makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied
- * warranty.
- *
- * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * Once upon a time, X had multiple loader backends, three of which were
- * essentially libdl reimplementations. This was nonsense so we chucked
- * it, but we still retain the factorization between loader API and
- * platform implementation. This file is the libdl implementation, and
- * currently the only backend. If you find yourself porting to a platform
- * without working libdl - hpux, win32, some forsaken a.out host, etc. -
- * make a new backend rather than hacking up this file.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dlfcn.h>
-
-#include <X11/Xos.h>
-#include "os.h"
-
-#include "loader.h"
-#include "dlloader.h"
-
-#if defined(DL_LAZY)
-#define DLOPEN_LAZY DL_LAZY
-#elif defined(RTLD_LAZY)
-#define DLOPEN_LAZY RTLD_LAZY
-#elif defined(__FreeBSD__)
-#define DLOPEN_LAZY 1
-#else
-#define DLOPEN_LAZY 0
-#endif
-
-#if defined(LD_GLOBAL)
-#define DLOPEN_GLOBAL LD_GLOBAL
-#elif defined(RTLD_GLOBAL)
-#define DLOPEN_GLOBAL RTLD_GLOBAL
-#else
-#define DLOPEN_GLOBAL 0
-#endif
-
-#if defined(CSRG_BASED) && !defined(__ELF__)
-#define DLSYM_PREFIX "_"
-#else
-#define DLSYM_PREFIX ""
-#endif
-
-/* Hooray, yet another open coded linked list! FIXME */
-typedef struct DLModuleList {
- void *module;
- struct DLModuleList *next;
-} DLModuleList;
-
-static DLModuleList *dlModuleList = NULL;
-
-static void *
-DLFindSymbolLocal(pointer module, const char *name)
-{
- void *p;
- char *n;
-
- static const char symPrefix[] = DLSYM_PREFIX;
-
- if (sizeof(symPrefix) > 1) {
- n = malloc(strlen(symPrefix) + strlen(name) + 1);
- sprintf(n, "%s%s", symPrefix, name);
- name = n;
- }
-
- p = dlsym(module, name);
-
- if (sizeof(symPrefix) > 1)
- free(n);
-
- return p;
-}
-
-static void *global_scope = NULL;
-
-void *
-DLFindSymbol(const char *name)
-{
- DLModuleList *l;
- void *p;
-
- p = dlsym(RTLD_DEFAULT, name);
- if (p != NULL)
- return p;
-
- for (l = dlModuleList; l != NULL; l = l->next) {
- p = DLFindSymbolLocal(l->module, name);
- if (p)
- return p;
- }
-
- if (!global_scope)
- global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL);
-
- if (global_scope)
- return DLFindSymbolLocal(global_scope, name);
-
- return NULL;
-}
-
-void *
-DLLoadModule(loaderPtr modrec, int flags)
-{
- void * dlfile;
- DLModuleList *l;
- int dlopen_flags;
-
- if (flags & LD_FLAG_GLOBAL)
- dlopen_flags = DLOPEN_LAZY | DLOPEN_GLOBAL;
- else
- dlopen_flags = DLOPEN_LAZY;
- dlfile = dlopen(modrec->name, dlopen_flags);
- if (dlfile == NULL) {
- ErrorF("dlopen: %s\n", dlerror());
- return NULL;
- }
-
- l = malloc(sizeof(DLModuleList));
- l->module = dlfile;
- l->next = dlModuleList;
- dlModuleList = l;
-
- return (void *)dlfile;
-}
-
-void
-DLUnloadModule(void *modptr)
-{
- DLModuleList *l, *p;
-
- /* remove it from dlModuleList. */
- if (dlModuleList->module == modptr) {
- l = dlModuleList;
- dlModuleList = l->next;
- free(l);
- } else {
- p = dlModuleList;
- for (l = dlModuleList->next; l != NULL; l = l->next) {
- if (l->module == modptr) {
- p->next = l->next;
- free(l);
- break;
- }
- p = l;
- }
- }
- dlclose(modptr);
-}
diff --git a/xorg-server/hw/xfree86/loader/dlloader.h b/xorg-server/hw/xfree86/loader/dlloader.h
deleted file mode 100644
index 8ae610f02..000000000
--- a/xorg-server/hw/xfree86/loader/dlloader.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 1997 Metro Link, Inc.
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#ifndef _DLLOADER_H
-#define _DLLOADER_H
-
-extern void *DLLoadModule(loaderPtr, int flags);
-extern void DLUnloadModule(void *);
-extern void *DLFindSymbol(const char *name);
-
-#endif
diff --git a/xorg-server/hw/xfree86/loader/loader.c b/xorg-server/hw/xfree86/loader/loader.c
index 7ea934a89..32c4431de 100644
--- a/xorg-server/hw/xfree86/loader/loader.c
+++ b/xorg-server/hw/xfree86/loader/loader.c
@@ -54,18 +54,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
-#if defined(UseMMAP) || (defined(linux) && defined(__ia64__))
-#include <sys/mman.h>
-#endif
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
-#if defined(linux) && \
- (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
- || defined(__amd64__))
-#include <malloc.h>
-#endif
#include <stdarg.h>
#include "os.h"
@@ -75,44 +67,34 @@
#include "xf86Priv.h"
#include "compiler.h"
-extern void *xorg_symbols[];
-
-#define MAX_HANDLE 256
-static int refCount[MAX_HANDLE];
-
-static int moduleseq = 0;
-
-/* Prototypes for static functions. */
-static loaderPtr listHead = NULL;
+#ifdef HAVE_DLFCN_H
-static loaderPtr
-_LoaderListPush(void)
-{
- loaderPtr item = calloc(1, sizeof(struct _loader));
-
- item->next = listHead;
- listHead = item;
+#include <dlfcn.h>
+#include <X11/Xos.h>
- return item;
-}
+#if defined(DL_LAZY)
+#define DLOPEN_LAZY DL_LAZY
+#elif defined(RTLD_LAZY)
+#define DLOPEN_LAZY RTLD_LAZY
+#elif defined(__FreeBSD__)
+#define DLOPEN_LAZY 1
+#else
+#define DLOPEN_LAZY 0
+#endif
-static loaderPtr
-_LoaderListPop(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr *bptr = &listHead; /* pointer to previous node */
+#if defined(LD_GLOBAL)
+#define DLOPEN_GLOBAL LD_GLOBAL
+#elif defined(RTLD_GLOBAL)
+#define DLOPEN_GLOBAL RTLD_GLOBAL
+#else
+#define DLOPEN_GLOBAL 0
+#endif
- while (item) {
- if (item->handle == handle) {
- *bptr = item->next; /* remove this from the list */
- return item;
- }
- bptr = &(item->next);
- item = item->next;
- }
+#else
+#error i have no dynamic linker and i must scream
+#endif
- return 0;
-}
+extern void *xorg_symbols[];
void
LoaderInit(void)
@@ -149,134 +131,60 @@ LoaderInit(void)
path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */
else
path = xcrtpath; /* get the libcrt.a we compiled with */
- LoaderOpen (path, "libcrt", 0, &errmaj, &errmin, &wasLoaded);
+ LoaderOpen (path, &errmaj, &errmin, &wasLoaded, 0);
}
#endif
}
/* Public Interface to the loader. */
-int
-LoaderOpen(const char *module, const char *cname, int handle,
- int *errmaj, int *errmin, int *wasLoaded, int flags)
+void *
+LoaderOpen(const char *module, int *errmaj, int *errmin)
{
- loaderPtr tmp;
- int new_handle;
+ void *ret;
#if defined(DEBUG)
ErrorF("LoaderOpen(%s)\n", module);
#endif
- /* Is the module already loaded? */
- if (handle >= 0) {
- tmp = listHead;
- while (tmp) {
-#ifdef DEBUGLIST
- ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module, module,
- &(tmp->name), tmp->name, tmp->name);
-#endif
- 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;
- }
- }
-
- /*
- * OK, it's a new one. Add it.
- */
xf86Msg(X_INFO, "Loading %s\n", module);
- if (wasLoaded)
- *wasLoaded = 0;
- /*
- * Find a free handle.
- */
- new_handle = 1;
- while (new_handle < MAX_HANDLE && refCount[new_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;
- }
-
- refCount[new_handle] = 1;
-
- tmp = _LoaderListPush();
- tmp->name = strdup(module);
- tmp->cname = strdup(cname);
- tmp->handle = new_handle;
- tmp->module = moduleseq++;
-
- if ((tmp->private = DLLoadModule(tmp, flags)) == NULL) {
- xf86Msg(X_ERROR, "Failed to load %s\n", module);
- _LoaderListPop(new_handle);
- refCount[new_handle] = 0;
+ if (!(ret = dlopen(module, DLOPEN_LAZY | DLOPEN_GLOBAL))) {
+ xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
if (errmaj)
*errmaj = LDR_NOLOAD;
if (errmin)
*errmin = LDR_NOLOAD;
- return -1;
+ return NULL;
}
- return new_handle;
-}
-
-int
-LoaderHandleOpen(int handle)
-{
- if (handle < 0 || handle >= MAX_HANDLE)
- return -1;
-
- if (!refCount[handle])
- return -1;
-
- refCount[handle]++;
- return handle;
+ return ret;
}
void *
-LoaderSymbol(const char *sym)
+LoaderSymbol(const char *name)
{
- return (DLFindSymbol(sym));
-}
+ static void *global_scope = NULL;
+ void *p;
-int
-LoaderUnload(int handle)
-{
- loaderRec fakeHead;
- loaderPtr tmp = &fakeHead;
+ p = dlsym(RTLD_DEFAULT, name);
+ if (p != NULL)
+ return p;
- if (handle < 0 || handle >= MAX_HANDLE)
- return -1;
+ if (!global_scope)
+ global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL);
- /*
- * check the reference count, only free it if it goes to zero
- */
- if (--refCount[handle])
- return 0;
- /*
- * find the loaderRecs associated with this handle.
- */
+ if (global_scope)
+ return dlsym(global_scope, name);
- while ((tmp = _LoaderListPop(handle)) != NULL) {
- xf86Msg(X_INFO, "Unloading %s\n", tmp->name);
- DLUnloadModule(tmp->private);
- free(tmp->name);
- free(tmp->cname);
- free(tmp);
- }
+ return NULL;
+}
- return 0;
+void
+LoaderUnload(const char *name, void *handle)
+{
+ xf86Msg(X_INFO, "Unloading %s\n", name);
+ dlclose(handle);
}
unsigned long LoaderOptions = 0;
diff --git a/xorg-server/hw/xfree86/loader/loader.h b/xorg-server/hw/xfree86/loader/loader.h
index 77267f847..a53970b6e 100644
--- a/xorg-server/hw/xfree86/loader/loader.h
+++ b/xorg-server/hw/xfree86/loader/loader.h
@@ -57,23 +57,6 @@
#include <X11/Xfuncproto.h>
#include <X11/Xmd.h>
-/* LoadModule proc flags; LD_FLAG_GLOBAL adds symbols to global
- * namespace, default is to keep symbols local to module. */
-#define LD_FLAG_GLOBAL 1
-
-typedef struct _loader *loaderPtr;
-
-/* 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 */
- loaderPtr next;
-} loaderRec;
-
/* Compiled-in version information */
typedef struct {
int xf86Version;
@@ -88,10 +71,6 @@ extern const ModuleVersions LoaderVersionInfo;
extern unsigned long LoaderOptions;
/* Internal Functions */
-int LoaderOpen(const char *, const char *, int, int *, int *, int *, int);
-int LoaderHandleOpen(int);
-
-/* Loader backends. */
-#include "dlloader.h"
+void * LoaderOpen(const char *, int *, int *);
#endif /* _LOADER_H */
diff --git a/xorg-server/hw/xfree86/loader/loaderProcs.h b/xorg-server/hw/xfree86/loader/loaderProcs.h
index a7925ecee..133d5aae9 100644
--- a/xorg-server/hw/xfree86/loader/loaderProcs.h
+++ b/xorg-server/hw/xfree86/loader/loaderProcs.h
@@ -1,93 +1,94 @@
-/*
- * Copyright 1995-1998 by Metro Link, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Metro Link, Inc. not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Metro Link, Inc. makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * 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).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#ifndef _LOADERPROCS_H
-#define _LOADERPROCS_H
-
-#include "xf86Module.h"
-
-typedef struct module_desc {
- struct module_desc *child;
- struct module_desc *sib;
- struct module_desc *parent;
- char *name;
- int handle;
- ModuleSetupProc SetupProc;
- ModuleTearDownProc TearDownProc;
- void *TearDownData; /* returned from SetupProc */
- const XF86ModuleVersionInfo *VersionInfo;
-} ModuleDesc, *ModuleDescPtr;
-
-/* External API for the loader */
-
-void LoaderInit(void);
-
-ModuleDescPtr LoadDriver(const char *, const char *, int, pointer, int *,
- int *);
-ModuleDescPtr LoadModule(const char *, const char *, const char **,
- const char **, pointer, const XF86ModReqInfo *,
- int *, int *);
-ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
-void UnloadDriver(ModuleDescPtr);
-void LoaderSetPath(const char *path);
-void LoaderSortExtensions(void);
-
-int LoaderUnload(int);
-unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
-
-void LoaderResetOptions(void);
-void LoaderSetOptions(unsigned long);
-
-/* Options for LoaderSetOptions */
-#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
-
-#endif /* _LOADERPROCS_H */
+/*
+ * Copyright 1995-1998 by Metro Link, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * 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).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef _LOADERPROCS_H
+#define _LOADERPROCS_H
+
+#include "xf86Module.h"
+
+typedef struct module_desc {
+ struct module_desc *child;
+ struct module_desc *sib;
+ struct module_desc *parent;
+ char *name;
+ char *path;
+ void *handle;
+ ModuleSetupProc SetupProc;
+ ModuleTearDownProc TearDownProc;
+ void *TearDownData; /* returned from SetupProc */
+ const XF86ModuleVersionInfo *VersionInfo;
+} ModuleDesc, *ModuleDescPtr;
+
+/* External API for the loader */
+
+void LoaderInit(void);
+
+ModuleDescPtr LoadDriver(const char *, const char *, int, pointer, int *,
+ int *);
+ModuleDescPtr LoadModule(const char *, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
+void UnloadDriver(ModuleDescPtr);
+void LoaderSetPath(const char *path);
+void LoaderSortExtensions(void);
+
+void LoaderUnload(const char *, void *);
+unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
+
+void LoaderResetOptions(void);
+void LoaderSetOptions(unsigned long);
+
+/* Options for LoaderSetOptions */
+#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
+
+#endif /* _LOADERPROCS_H */
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index 82739e46e..395cdf104 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -83,8 +83,7 @@ static char *LoaderGetCanonicalName(const char *, PatternPtr);
static void RemoveChild(ModuleDescPtr);
static ModuleDescPtr doLoadModule(const char *, const char *, const char **,
const char **, pointer,
- const XF86ModReqInfo *, int *, int *,
- int flags);
+ const XF86ModReqInfo *, int *, int *);
const ModuleVersions LoaderVersionInfo = {
XORG_VERSION_CURRENT,
@@ -765,7 +764,7 @@ LoadSubModule(pointer _parent, const char *module,
}
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
- modreq, errmaj, errmin, LD_FLAG_GLOBAL);
+ modreq, errmaj, errmin);
if (submod && submod != (ModuleDescPtr) 1) {
parent->child = AddSibling(parent->child, submod);
submod->parent = parent;
@@ -776,18 +775,10 @@ LoadSubModule(pointer _parent, const char *module,
static ModuleDescPtr
NewModuleDesc(const char *name)
{
- ModuleDescPtr mdp = malloc(sizeof(ModuleDesc));
+ ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc));
- if (mdp) {
- mdp->child = NULL;
- mdp->sib = NULL;
- mdp->parent = NULL;
+ if (mdp)
mdp->name = xstrdup(name);
- mdp->handle = -1;
- mdp->SetupProc = NULL;
- mdp->TearDownProc = NULL;
- mdp->TearDownData = NULL;
- }
return mdp;
}
@@ -796,6 +787,7 @@ ModuleDescPtr
DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
{
ModuleDescPtr ret;
+ int errmaj, errmin;
if (!mod)
return NULL;
@@ -804,10 +796,11 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
if (ret == NULL)
return NULL;
- if (LoaderHandleOpen(mod->handle) == -1)
- return NULL;
+ if (!(ret->handle = LoaderOpen(mod->path, &errmaj, &errmin))) {
+ free(ret);
+ return NULL;
+ }
- ret->handle = mod->handle;
ret->SetupProc = mod->SetupProc;
ret->TearDownProc = mod->TearDownProc;
ret->TearDownData = NULL;
@@ -815,6 +808,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
ret->sib = DuplicateModule(mod->sib, parent);
ret->parent = parent;
ret->VersionInfo = mod->VersionInfo;
+ ret->path = strdup(mod->path);
return ret;
}
@@ -830,7 +824,7 @@ static ModuleDescPtr
doLoadModule(const char *module, const char *path, const char **subdirlist,
const char **patternlist, pointer options,
const XF86ModReqInfo * modreq,
- int *errmaj, int *errmin, int flags)
+ int *errmaj, int *errmin)
{
XF86ModuleData *initdata = NULL;
char **pathlist = NULL;
@@ -839,7 +833,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
char **path_elem = NULL;
char *p = NULL;
ModuleDescPtr ret = NULL;
- int wasLoaded = 0;
PatternPtr patterns = NULL;
int noncanonical = 0;
char *m = NULL;
@@ -926,10 +919,10 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
*errmin = 0;
goto LoadModule_fail;
}
- ret->handle = LoaderOpen(found, name, 0,
- errmaj, errmin, &wasLoaded, flags);
+ ret->handle = LoaderOpen(found, errmaj, errmin);
if (ret->handle < 0)
goto LoadModule_fail;
+ ret->path = strdup(found);
/* drop any explicit suffix from the module name */
p = strchr(name, '.');
@@ -960,26 +953,24 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
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;
- }
- }
+ 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;
+ }
if (setup)
ret->SetupProc = setup;
if (teardown)
@@ -1067,7 +1058,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist,
const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
{
return doLoadModule(module, path, subdirlist, patternlist, options,
- modreq, errmaj, errmin, LD_FLAG_GLOBAL);
+ modreq, errmaj, errmin);
}
void
@@ -1089,12 +1080,13 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
if ((mod->TearDownProc) && (mod->TearDownData))
mod->TearDownProc(mod->TearDownData);
- LoaderUnload(mod->handle);
+ LoaderUnload(mod->name, mod->handle);
if (mod->child)
UnloadModuleOrDriver(mod->child);
if (mod->sib)
UnloadModuleOrDriver(mod->sib);
+ free(mod->path);
free(mod->name);
free(mod);
}
@@ -1111,13 +1103,14 @@ UnloadSubModule(pointer _mod)
if ((mod->TearDownProc) && (mod->TearDownData))
mod->TearDownProc(mod->TearDownData);
- LoaderUnload(mod->handle);
+ LoaderUnload(mod->name, mod->handle);
RemoveChild(mod);
if (mod->child)
UnloadModuleOrDriver(mod->child);
+ free(mod->path);
free(mod->name);
free(mod);
}
diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c
index 92f34a222..0f4c40c09 100644
--- a/xorg-server/hw/xfree86/modes/xf86RandR12.c
+++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c
@@ -511,7 +511,6 @@ xf86RandR12SetMode (ScreenPtr pScreen,
WindowPtr pRoot = pScreen->root;
DisplayModePtr currentMode = NULL;
Bool ret = TRUE;
- PixmapPtr pspix = NULL;
if (pRoot)
(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
@@ -560,14 +559,6 @@ xf86RandR12SetMode (ScreenPtr pScreen,
pScreen->mmHeight = oldmmHeight;
scrp->currentMode = currentMode;
}
- /*
- * Get the new Screen pixmap ptr as SwitchMode might have called
- * ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back...
- * Unfortunately.
- */
- pspix = (*pScreen->GetScreenPixmap) (pScreen);
- if (pspix->devPrivate.ptr)
- scrp->pixmapPrivate = pspix->devPrivate;
/*
* Make sure the layout is correct
@@ -677,7 +668,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
WindowPtr pRoot = pScreen->root;
- PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
+ PixmapPtr pScrnPix;
Bool ret = FALSE;
int c;
@@ -714,6 +705,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
}
}
+ pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
pScreen->width = pScrnPix->drawable.width = width;
pScreen->height = pScrnPix->drawable.height = height;
randrp->mmWidth = pScreen->mmWidth = mmWidth;
diff --git a/xorg-server/hw/xfree86/shadowfb/shadow.c b/xorg-server/hw/xfree86/shadowfb/shadow.c
index 741d6a1b7..26b92b5d6 100644
--- a/xorg-server/hw/xfree86/shadowfb/shadow.c
+++ b/xorg-server/hw/xfree86/shadowfb/shadow.c
@@ -36,15 +36,6 @@ static void ShadowCopyWindow(
RegionPtr prgn
);
static Bool ShadowCreateGC(GCPtr pGC);
-static Bool ShadowModifyPixmapHeader(
- PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData
-);
static Bool ShadowEnterVT(int index, int flags);
static void ShadowLeaveVT(int index, int flags);
@@ -189,7 +180,6 @@ ShadowFBInit2 (
pScreen->CloseScreen = ShadowCloseScreen;
pScreen->CopyWindow = ShadowCopyWindow;
pScreen->CreateGC = ShadowCreateGC;
- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
pScrn->EnterVT = ShadowEnterVT;
pScrn->LeaveVT = ShadowLeaveVT;
@@ -310,49 +300,6 @@ ShadowCopyWindow(
}
}
-static Bool
-ShadowModifyPixmapHeader(
- PixmapPtr pPixmap,
- int width,
- int height,
- int depth,
- int bitsPerPixel,
- int devKind,
- pointer pPixData
-)
-{
- ScreenPtr pScreen;
- ScrnInfoPtr pScrn;
- ShadowScreenPtr pPriv;
- Bool retval;
- PixmapPtr pScreenPix;
-
- if (!pPixmap)
- return FALSE;
-
- pScreen = pPixmap->drawable.pScreen;
- pScrn = xf86Screens[pScreen->myNum];
-
- pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
-
- if (pPixmap == pScreenPix && !pScrn->vtSema)
- pScreenPix->devPrivate = pScrn->pixmapPrivate;
-
- pPriv = GET_SCREEN_PRIVATE(pScreen);
-
- pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
- retval = (*pScreen->ModifyPixmapHeader)(pPixmap,
- width, height, depth, bitsPerPixel, devKind, pPixData);
- pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
-
- if (pPixmap == pScreenPix && !pScrn->vtSema)
- {
- pScrn->pixmapPrivate = pScreenPix->devPrivate;
- pScreenPix->devPrivate.ptr = 0;
- }
- return retval;
-}
-
static void
ShadowComposite(
CARD8 op,
diff --git a/xorg-server/hw/xfree86/vbe/vbe_module.c b/xorg-server/hw/xfree86/vbe/vbe_module.c
index cf37ef951..5aba16f51 100644
--- a/xorg-server/hw/xfree86/vbe/vbe_module.c
+++ b/xorg-server/hw/xfree86/vbe/vbe_module.c
@@ -1,31 +1,23 @@
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86.h"
-#include "xf86str.h"
-#include "vbe.h"
-
-static MODULESETUPPROTO(vbeSetup);
-
-static XF86ModuleVersionInfo vbeVersRec =
-{
- "vbe",
- MODULEVENDORSTRING,
- MODINFOSTRING1,
- MODINFOSTRING2,
- XORG_VERSION_CURRENT,
- 1, 1, 0,
- ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
- ABI_VIDEODRV_VERSION,
- MOD_CLASS_NONE,
- {0,0,0,0}
-};
-
-_X_EXPORT XF86ModuleData vbeModuleData = { &vbeVersRec, vbeSetup, NULL };
-
-static pointer
-vbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
-{
- return (pointer)1;
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#include "xf86str.h"
+#include "vbe.h"
+
+static XF86ModuleVersionInfo vbeVersRec =
+{
+ "vbe",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XORG_VERSION_CURRENT,
+ 1, 1, 0,
+ ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+_X_EXPORT XF86ModuleData vbeModuleData = { &vbeVersRec, NULL, NULL };