diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 3dde65178..a022484ba 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -1316,7 +1316,7 @@ should be terminated with a newline.
After printing the message arguments, FatalError() must be implemented
-such that the server will call AbortDDX() to give the ddx layer
+such that the server will call ddxGiveUp(EXIT_ERR_ABORT) to give the ddx layer
a chance to reset the hardware, and then
terminate the server; it must not return.
@@ -4653,15 +4653,14 @@ An Example implementation is miPushPixels() in Xserver/mi/mipushpxl.c.
Shutdown Procedures
- void AbortDDX(enum ExitCode error)
void ddxGiveUp(enum ExitCode error)
Some hardware may require special work to be done before the server
exits so that it is not left in an intermediate state. As explained
-in the OS layer, FatalError() will call AbortDDX() just before
+in the OS layer, FatalError() will call ddxGiveUp() just before
terminating the server. In addition, ddxGiveUp() will be called just
-before terminating the server on a "clean" death. What AbortDDX() and
-ddxGiveUP do is left unspecified, only that stubs must exist in the
+before terminating the server on a "clean" death. What
+ddxGiveUp does is left unspecified, only that it must exist in the
ddx layer. It is up to local implementors as to what they should
accomplish before termination.
@@ -4923,7 +4922,6 @@ mi and fb implementations.
ALLOCATE_LOCALos
-AbortDDXhd
AddCallbackdix
AddEnabledDeviceos
AddInputDevicedix
diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 07154d648..4fef30273 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -805,11 +805,12 @@ dmxSetDefaultFontPath(const char *fp)
defaultFontPath = dmxFontPath;
}
-/** This function is called in Xserver/os/utils.c from \a AbortServer().
- * We must ensure that backend and console state is restored in the
- * event the server shutdown wasn't clean. */
+/** This function is called in Xserver/dix/main.c from \a main() when
+ * dispatchException & DE_TERMINATE (which is the only way to exit the
+ * main loop without an interruption), and from AbortServer on
+ * abnormal exit. */
void
-AbortDDX(enum ExitCode error)
+ddxGiveUp(enum ExitCode error)
{
int i;
@@ -829,15 +830,6 @@ ddxBeforeReset(void)
}
#endif
-/** This function is called in Xserver/dix/main.c from \a main() when
- * dispatchException & DE_TERMINATE (which is the only way to exit the
- * main loop without an interruption. */
-void
-ddxGiveUp(enum ExitCode error)
-{
- AbortDDX(error);
-}
-
/** This function is called in Xserver/os/osinit.c from \a OsInit(). */
void
OsVendorInit(void)
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 6e8168323..77114dc46 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -163,16 +163,10 @@ KdEnableScreen(ScreenPtr pScreen)
return TRUE;
}
-void
-AbortDDX(enum ExitCode error)
-{
- KdDisableScreens();
-}
-
void
ddxGiveUp(enum ExitCode error)
{
- AbortDDX(error);
+ KdDisableScreens();
}
static Bool kdDumbDriver;
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index df4d2701b..070cede35 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -201,12 +201,6 @@ ddxGiveUp(enum ExitCode error)
}
}
-void
-AbortDDX(enum ExitCode error)
-{
- ddxGiveUp(error);
-}
-
#ifdef __APPLE__
void
DarwinHandleGUI(int argc, char *argv[])
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 44e759166..4347f6d2f 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -822,7 +822,7 @@ DoConfigure(void)
bail:
OsCleanup(TRUE);
- AbortDDX(EXIT_ERR_CONFIGURE);
+ ddxGiveUp(EXIT_ERR_CONFIGURE);
fflush(stderr);
exit(0);
}
@@ -875,7 +875,7 @@ DoShowOptions(void)
}
bail:
OsCleanup(TRUE);
- AbortDDX(EXIT_ERR_DRIVERS);
+ ddxGiveUp(EXIT_ERR_DRIVERS);
fflush(stderr);
exit(0);
}
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index ef8d4faf6..6c25eda73 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -809,6 +809,29 @@ ddxGiveUp(enum ExitCode error)
{
int i;
+ if (error == EXIT_ERR_ABORT) {
+ input_lock();
+
+ /* try to restore the original video state */
+#ifdef DPMSExtension /* Turn screens back on */
+ if (DPMSPowerLevel != DPMSModeOn)
+ DPMSSet(serverClient, DPMSModeOn);
+#endif
+ if (xf86Screens) {
+ for (i = 0; i < xf86NumScreens; i++)
+ if (xf86Screens[i]->vtSema) {
+ /*
+ * if we are aborting before ScreenInit() has finished we
+ * might not have been wrapped yet. Therefore enable screen
+ * explicitly.
+ */
+ xf86VGAarbiterLock(xf86Screens[i]);
+ (xf86Screens[i]->LeaveVT) (xf86Screens[i]);
+ xf86VGAarbiterUnlock(xf86Screens[i]);
+ }
+ }
+ }
+
xf86VGAarbiterFini();
if (xf86OSPMClose)
@@ -832,48 +855,6 @@ ddxGiveUp(enum ExitCode error)
xf86CloseLog(error);
}
-/*
- * AbortDDX --
- * DDX - specific abort routine. Called by AbortServer(). The attempt is
- * made to restore all original setting of the displays. Also all devices
- * are closed.
- */
-
-void
-AbortDDX(enum ExitCode error)
-{
- int i;
-
- input_lock();
-
- /*
- * try to restore the original video state
- */
-#ifdef DPMSExtension /* Turn screens back on */
- if (DPMSPowerLevel != DPMSModeOn)
- DPMSSet(serverClient, DPMSModeOn);
-#endif
- if (xf86Screens) {
- for (i = 0; i < xf86NumScreens; i++)
- if (xf86Screens[i]->vtSema) {
- /*
- * if we are aborting before ScreenInit() has finished
- * we might not have been wrapped yet. Therefore enable
- * screen explicitely.
- */
- xf86VGAarbiterLock(xf86Screens[i]);
- (xf86Screens[i]->LeaveVT) (xf86Screens[i]);
- xf86VGAarbiterUnlock(xf86Screens[i]);
- }
- }
-
- /*
- * This is needed for an abnormal server exit, since the normal exit stuff
- * MUST also be performed (i.e. the vt must be left in a defined state)
- */
- ddxGiveUp(error);
-}
-
void
OsVendorFatalError(const char *f, va_list args)
{
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 99ca90249..42ef16aba 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -90,7 +90,7 @@
#ifndef NO_OSLIB_PROTOTYPES
/*
* This is to prevent re-entrancy to FatalError() when aborting.
- * Anything that can be called as a result of AbortDDX() should use this
+ * Anything that can be called as a result of ddxGiveUp() should use this
* instead of FatalError().
*/
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index b45685216..8edf03372 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -126,21 +126,11 @@ CloseInput(void)
mieqFini();
}
-/*
- * DDX - specific abort routine. Called by AbortServer().
- */
-void
-AbortDDX(enum ExitCode error)
-{
- xnestDoFullGeneration = True;
- xnestCloseDisplay();
-}
-
-/* Called by GiveUp(). */
void
ddxGiveUp(enum ExitCode error)
{
- AbortDDX(error);
+ xnestDoFullGeneration = True;
+ xnestCloseDisplay();
}
#ifdef __APPLE__
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index d8027c9b6..6a143369e 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -826,17 +826,3 @@ ddxGiveUp(enum ExitCode error)
{
LogClose(error);
}
-
-/*
- * AbortDDX --
- * DDX - specific abort routine. Called by AbortServer(). The attempt is
- * made to restore all original setting of the displays. Also all devices
- * are closed.
- */
-_X_NORETURN
-void
-AbortDDX(enum ExitCode error)
-{
- ErrorF(" AbortDDX\n");
- OsAbort();
-}
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 4b27ee627..605c9f56b 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -48,12 +48,6 @@ ddxGiveUp(enum ExitCode error)
{
}
-void
-AbortDDX(enum ExitCode error)
-{
- ddxGiveUp(error);
-}
-
void
OsVendorInit(void)
{
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 9560c5684..98385a8c4 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -240,16 +240,6 @@ ddxGiveUp(enum ExitCode error)
winDebug("ddxGiveUp - End\n");
}
-/* See Porting Layer Definition - p. 57 */
-void
-AbortDDX(enum ExitCode error)
-{
-#if CYGDEBUG
- winDebug("AbortDDX\n");
-#endif
- ddxGiveUp(error);
-}
-
#ifdef __CYGWIN__
/* hasmntopt is currently not implemented for cygwin */
static const char *
diff --git a/include/os.h b/include/os.h
index 947f3c2af..6d209cd21 100644
--- a/include/os.h
+++ b/include/os.h
@@ -550,8 +550,6 @@ enum ExitCode {
EXIT_ERR_DRIVERS = 3,
};
-extern _X_EXPORT void
-AbortDDX(enum ExitCode error);
extern _X_EXPORT void
ddxGiveUp(enum ExitCode error);
extern _X_EXPORT int
diff --git a/os/log.c b/os/log.c
index a3b28ccb4..8576955fc 100644
--- a/os/log.c
+++ b/os/log.c
@@ -871,7 +871,7 @@ AbortServer(void)
CloseWellKnownConnections();
OsCleanup(TRUE);
AbortDevices();
- AbortDDX(EXIT_ERR_ABORT);
+ ddxGiveUp(EXIT_ERR_ABORT);
fflush(stderr);
if (CoreDump)
OsAbort();