aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-06 09:31:01 +0200
committermarha <marha@users.sourceforge.net>2012-07-06 09:31:01 +0200
commit405ae9defaaa03d4d305b6264a744107c3dd460d (patch)
treee119a54d876fa737d859718afbde7ef507702631 /xorg-server/hw/xfree86
parent3a5976985ab1ca641b095a72730f1f3d3bd5f9bc (diff)
parent336bad93d146931c160d8517edfdf0bee49ad9f7 (diff)
downloadvcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.tar.gz
vcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.tar.bz2
vcxsrv-405ae9defaaa03d4d305b6264a744107c3dd460d.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/dix/dispatch.c xorg-server/dix/privates.c xorg-server/hw/kdrive/ephyr/ephyr.c xorg-server/hw/kdrive/src/kinput.c
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c1
-rw-r--r--xorg-server/hw/xfree86/common/xf86Cursor.c12
-rw-r--r--xorg-server/hw/xfree86/common/xf86Events.c14
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c9
-rw-r--r--xorg-server/hw/xfree86/common/xf86PM.c12
-rw-r--r--xorg-server/hw/xfree86/loader/loader.c6
-rw-r--r--xorg-server/hw/xfree86/loader/loader.h1
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c2
-rw-r--r--xorg-server/hw/xfree86/os-support/shared/sigio.c24
9 files changed, 36 insertions, 45 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index b22b617a4..3ec40fe9b 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -2329,6 +2329,7 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout)
current = dev;
free(*dev);
+ *dev = NULL;
do {
*current = *(current + 1);
diff --git a/xorg-server/hw/xfree86/common/xf86Cursor.c b/xorg-server/hw/xfree86/common/xf86Cursor.c
index c01cfd138..65a9e8264 100644
--- a/xorg-server/hw/xfree86/common/xf86Cursor.c
+++ b/xorg-server/hw/xfree86/common/xf86Cursor.c
@@ -199,7 +199,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen);
ScreenPtr pCursorScreen;
Bool Switched;
- int px, py, was_blocked;
+ int px, py;
DeviceIntPtr dev, it;
if (!pScr->vtSema || !mode || !pScr->SwitchMode)
@@ -228,7 +228,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
if (pScreen == pCursorScreen)
miPointerGetPosition(dev, &px, &py);
- was_blocked = xf86BlockSIGIO();
+ OsBlockSIGIO();
Switched = (*pScr->SwitchMode) (pScr, mode);
if (Switched) {
pScr->currentMode = mode;
@@ -267,7 +267,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
pScr->frameY1 = pScr->virtualY - 1;
}
}
- xf86UnblockSIGIO(was_blocked);
+ OsReleaseSIGIO();
if (pScr->AdjustFrame)
(*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0);
@@ -469,13 +469,11 @@ xf86CrossScreen(ScreenPtr pScreen, Bool entering)
static void
xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
- int sigstate;
-
- sigstate = xf86BlockSIGIO();
+ OsBlockSIGIO();
miPointerWarpCursor(pDev, pScreen, x, y);
xf86Info.currentScreen = pScreen;
- xf86UnblockSIGIO(sigstate);
+ OsReleaseSIGIO();
}
void *
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c
index 4fcad4000..47429ecfe 100644
--- a/xorg-server/hw/xfree86/common/xf86Events.c
+++ b/xorg-server/hw/xfree86/common/xf86Events.c
@@ -254,7 +254,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
while (pInfo) {
if (pInfo->read_input && pInfo->fd >= 0 &&
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
- int sigstate = xf86BlockSIGIO();
+ OsBlockSIGIO();
/*
* Remove the descriptior from the set because more than one
@@ -263,7 +263,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
FD_CLR(pInfo->fd, &devicesWithInput);
pInfo->read_input(pInfo);
- xf86UnblockSIGIO(sigstate);
+ OsReleaseSIGIO();
}
pInfo = pInfo->next;
}
@@ -397,9 +397,9 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
for (i = keyc->xkbInfo->desc->min_key_code;
i < keyc->xkbInfo->desc->max_key_code; i++) {
if (key_is_down(pDev, i, KEY_POSTED)) {
- sigstate = xf86BlockSIGIO();
+ OsBlockSIGIO();
QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
- xf86UnblockSIGIO(sigstate);
+ OsReleaseSIGIO();
}
}
}
@@ -457,7 +457,7 @@ xf86VTSwitch(void)
}
}
- prevSIGIO = xf86BlockSIGIO();
+ OsBlockSIGIO();
for (i = 0; i < xf86NumScreens; i++)
xf86Screens[i]->LeaveVT(xf86Screens[i]);
@@ -492,7 +492,7 @@ xf86VTSwitch(void)
for (ih = InputHandlers; ih; ih = ih->next)
xf86EnableInputHandler(ih);
- xf86UnblockSIGIO(prevSIGIO);
+ OsReleaseSIGIO();
}
else {
@@ -549,7 +549,7 @@ xf86VTSwitch(void)
for (ih = InputHandlers; ih; ih = ih->next)
xf86EnableInputHandler(ih);
- xf86UnblockSIGIO(prevSIGIO);
+ OsReleaseSIGIO();
}
}
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index 84c866944..1f5a382b7 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -394,7 +394,7 @@ InstallSignalHandlers(void)
void
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
{
- int i, j, k, scr_index, was_blocked = 0;
+ int i, j, k, scr_index;
char **modulelist;
pointer *optionlist;
Pix24Flags screenpix24, pix24;
@@ -806,7 +806,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ);
#endif
xf86AccessEnter();
- was_blocked = xf86BlockSIGIO();
+ OsBlockSIGIO();
}
}
@@ -879,7 +879,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
}
xf86VGAarbiterWrapFunctions();
- xf86UnblockSIGIO(was_blocked);
+ OsReleaseSIGIO();
xf86InitOrigins();
@@ -964,6 +964,7 @@ OsVendorInit(void)
}
#endif
#endif
+ OsReleaseSIGIO();
beenHere = TRUE;
}
@@ -1022,7 +1023,7 @@ AbortDDX(enum ExitCode error)
{
int i;
- xf86BlockSIGIO();
+ OsBlockSIGIO();
/*
* try to restore the original video state
diff --git a/xorg-server/hw/xfree86/common/xf86PM.c b/xorg-server/hw/xfree86/common/xf86PM.c
index 1830640d5..15257cb81 100644
--- a/xorg-server/hw/xfree86/common/xf86PM.c
+++ b/xorg-server/hw/xfree86/common/xf86PM.c
@@ -92,8 +92,6 @@ eventName(pmEvent event, const char **str)
}
}
-static int sigio_blocked_for_suspend;
-
static void
suspend(pmEvent event, Bool undo)
{
@@ -109,7 +107,7 @@ suspend(pmEvent event, Bool undo)
DisableDevice(pInfo->dev, TRUE);
pInfo = pInfo->next;
}
- sigio_blocked_for_suspend = xf86BlockSIGIO();
+ OsBlockSIGIO();
for (i = 0; i < xf86NumScreens; i++) {
if (xf86Screens[i]->PMEvent)
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
@@ -137,7 +135,7 @@ resume(pmEvent event, Bool undo)
xf86Screens[i]->EnterVT(xf86Screens[i]);
}
}
- xf86UnblockSIGIO(sigio_blocked_for_suspend);
+ OsReleaseSIGIO();
for (i = 0; i < xf86NumScreens; i++) {
if (xf86Screens[i]->EnableDisableFBAccess)
(*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
@@ -153,7 +151,7 @@ resume(pmEvent event, Bool undo)
static void
DoApmEvent(pmEvent event, Bool undo)
{
- int i, was_blocked;
+ int i;
switch (event) {
#if 0
@@ -184,13 +182,13 @@ DoApmEvent(pmEvent event, Bool undo)
}
break;
default:
- was_blocked = xf86BlockSIGIO();
+ OsBlockSIGIO();
for (i = 0; i < xf86NumScreens; i++) {
if (xf86Screens[i]->PMEvent) {
xf86Screens[i]->PMEvent(xf86Screens[i], event, undo);
}
}
- xf86UnblockSIGIO(was_blocked);
+ OsReleaseSIGIO();
break;
}
}
diff --git a/xorg-server/hw/xfree86/loader/loader.c b/xorg-server/hw/xfree86/loader/loader.c
index edaefb8f9..5fbea38f8 100644
--- a/xorg-server/hw/xfree86/loader/loader.c
+++ b/xorg-server/hw/xfree86/loader/loader.c
@@ -160,6 +160,12 @@ LoaderSymbol(const char *name)
return NULL;
}
+void *
+LoaderSymbolFromModule(void *handle, const char *name)
+{
+ return dlsym(handle, name);
+}
+
void
LoaderUnload(const char *name, void *handle)
{
diff --git a/xorg-server/hw/xfree86/loader/loader.h b/xorg-server/hw/xfree86/loader/loader.h
index 5cadd5ad6..c89c6410a 100644
--- a/xorg-server/hw/xfree86/loader/loader.h
+++ b/xorg-server/hw/xfree86/loader/loader.h
@@ -72,5 +72,6 @@ extern unsigned long LoaderOptions;
/* Internal Functions */
void *LoaderOpen(const char *, int *, int *);
+void *LoaderSymbolFromModule(void *, const char *);
#endif /* _LOADER_H */
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index 72020a58c..dd2057318 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -956,7 +956,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
*errmin = 0;
goto LoadModule_fail;
}
- initdata = LoaderSymbol(p);
+ initdata = LoaderSymbolFromModule(ret->handle, p);
if (initdata) {
ModuleSetupProc setup;
ModuleTearDownProc teardown;
diff --git a/xorg-server/hw/xfree86/os-support/shared/sigio.c b/xorg-server/hw/xfree86/os-support/shared/sigio.c
index 231d6c04f..f3c153b89 100644
--- a/xorg-server/hw/xfree86/os-support/shared/sigio.c
+++ b/xorg-server/hw/xfree86/os-support/shared/sigio.c
@@ -136,7 +136,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
struct sigaction sa;
struct sigaction osa;
int i;
- int blocked;
int installed = FALSE;
if (!xf86Info.useSIGIO)
@@ -146,7 +145,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
if (!xf86SigIOFuncs[i].f) {
if (xf86IsPipe(fd))
return 0;
- blocked = xf86BlockSIGIO();
+ OsBlockSIGIO();
#ifdef O_ASYNC
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
@@ -174,7 +173,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
}
#endif
if (!installed) {
- xf86UnblockSIGIO(blocked);
+ OsReleaseSIGIO();
return 0;
}
sigemptyset(&sa.sa_mask);
@@ -190,7 +189,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
if (fd >= xf86SigIOMaxFd)
xf86SigIOMaxFd = fd + 1;
FD_SET(fd, &xf86SigIOMask);
- xf86UnblockSIGIO(blocked);
+ OsReleaseSIGIO();
return 1;
}
/* Allow overwriting of the closure and callback */
@@ -263,26 +262,13 @@ xf86RemoveSIGIOHandler(int fd)
int
xf86BlockSIGIO(void)
{
- sigset_t set, old;
- int ret;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_BLOCK, &set, &old);
- ret = sigismember(&old, SIGIO);
- return ret;
+ return OsBlockSIGIO();
}
void
xf86UnblockSIGIO(int wasset)
{
- sigset_t set;
-
- if (!wasset) {
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_UNBLOCK, &set, NULL);
- }
+ OsReleaseSIGIO();
}
void