Commit 9d15912a authored by Keith Packard's avatar Keith Packard Committed by Adam Jackson

Remove fd_set from Block/Wakeup handler API

This removes the last uses of fd_set from the server interfaces
outside of the OS layer itself.
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent fb080211
......@@ -63,14 +63,11 @@ static void ClientAwaken(ClientPtr /* client */ ,
static int SertafiedDelete(void * /* value */ ,
XID /* id */
);
static void SertafiedBlockHandler(void * /* data */ ,
OSTimePtr /* wt */ ,
void * /* LastSelectMask */
);
static void SertafiedWakeupHandler(void * /* data */ ,
int /* i */ ,
void * /* LastSelectMask */
);
static void SertafiedBlockHandler(void *data,
void *timeout);
static void SertafiedWakeupHandler(void *data,
int i);
int
ClientSleepUntil(ClientPtr client,
......@@ -154,7 +151,7 @@ SertafiedDelete(void *value, XID id)
}
static void
SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask)
SertafiedBlockHandler(void *data, void *wt)
{
SertafiedPtr pReq, pNext;
unsigned long delay;
......@@ -186,7 +183,7 @@ SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask)
}
static void
SertafiedWakeupHandler(void *data, int i, void *LastSelectMask)
SertafiedWakeupHandler(void *data, int i)
{
SertafiedPtr pReq, pNext;
TimeStamp now;
......
......@@ -2556,8 +2556,8 @@ static XSyncValue *pnext_time;
*** Server Block Handler
*** code inspired by multibuffer extension (now deprecated)
*/
/*ARGSUSED*/ static void
ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask)
/*ARGSUSED*/ static void
ServertimeBlockHandler(void *env, void *wt)
{
XSyncValue delay;
unsigned long timeout;
......@@ -2582,8 +2582,8 @@ ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask)
/*
*** Wakeup Handler
*/
/*ARGSUSED*/ static void
ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask)
/*ARGSUSED*/ static void
ServertimeWakeupHandler(void *env, int rc)
{
if (pnext_time) {
GetTime();
......@@ -2658,7 +2658,7 @@ IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return)
}
static void
IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask)
IdleTimeBlockHandler(void *pCounter, void *wt)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
......@@ -2751,7 +2751,7 @@ IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, X
}
static void
IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask)
IdleTimeWakeupHandler(void *pCounter, int rc)
{
SyncCounter *counter = pCounter;
IdleCounterPriv *priv = SysCounterGetPrivate(counter);
......
......@@ -197,7 +197,7 @@ RemoveFontWakeup(FontPathElementPtr fpe)
}
static void
FontWakeup(void *data, int count, void *LastSelectMask)
FontWakeup(void *data, int count)
{
int i;
FontPathElementPtr fpe;
......@@ -1918,8 +1918,7 @@ _client_auth_generation(ClientPtr client)
static int fs_handlers_installed = 0;
static unsigned int last_server_gen;
static void
fs_block_handler(void *blockData, OSTimePtr timeout, void *readmask)
static void fs_block_handler(void *blockData, void *timeout)
{
FontBlockHandlerProcPtr block_handler = blockData;
......@@ -2004,7 +2003,7 @@ _init_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler)
static void
_remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler,
Bool all)
Bool all)
{
if (all) {
/* remove the handlers if no one else is using them */
......
......@@ -360,8 +360,8 @@ NoopDDA(void)
}
typedef struct _BlockHandler {
BlockHandlerProcPtr BlockHandler;
WakeupHandlerProcPtr WakeupHandler;
ServerBlockHandlerProcPtr BlockHandler;
ServerWakeupHandlerProcPtr WakeupHandler;
void *blockData;
Bool deleted;
} BlockHandlerRec, *BlockHandlerPtr;
......@@ -378,14 +378,14 @@ static Bool handlerDeleted;
* \param pReadMask nor how it represents the det of descriptors
*/
void
BlockHandler(void *pTimeout, void *pReadmask)
BlockHandler(void *pTimeout)
{
int i, j;
++inHandler;
for (i = 0; i < numHandlers; i++)
if (!handlers[i].deleted)
(*handlers[i].BlockHandler) (handlers[i].blockData, pTimeout, pReadmask);
(*handlers[i].BlockHandler) (handlers[i].blockData, pTimeout);
for (i = 0; i < screenInfo.numGPUScreens; i++)
(*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], pTimeout);
......@@ -413,7 +413,7 @@ BlockHandler(void *pTimeout, void *pReadmask)
* \param pReadmask the resulting descriptor mask
*/
void
WakeupHandler(int result, void *pReadmask)
WakeupHandler(int result)
{
int i, j;
......@@ -424,7 +424,7 @@ WakeupHandler(int result, void *pReadmask)
(*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], result);
for (i = numHandlers - 1; i >= 0; i--)
if (!handlers[i].deleted)
(*handlers[i].WakeupHandler) (handlers[i].blockData, result, pReadmask);
(*handlers[i].WakeupHandler) (handlers[i].blockData, result);
if (handlerDeleted) {
for (i = 0; i < numHandlers;)
if (handlers[i].deleted) {
......@@ -444,8 +444,8 @@ WakeupHandler(int result, void *pReadmask)
* get called until next time
*/
Bool
RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler,
WakeupHandlerProcPtr wakeupHandler,
RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData)
{
BlockHandlerPtr new;
......@@ -467,8 +467,8 @@ RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler,
}
void
RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler,
WakeupHandlerProcPtr wakeupHandler,
RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData)
{
int i;
......
......@@ -99,13 +99,13 @@ dmxSyncCallback(OsTimerPtr timer, CARD32 time, void *arg)
}
static void
dmxSyncBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask)
dmxSyncBlockHandler(void *blockData, void *timeout)
{
TimerForce(dmxSyncTimer);
}
static void
dmxSyncWakeupHandler(void *blockData, int result, void *pReadMask)
dmxSyncWakeupHandler(void *blockData, int result)
{
}
......
......@@ -630,7 +630,7 @@ dmxCollectAll(DMXInputInfo * dmxInput)
}
static void
dmxBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask)
dmxBlockHandler(void *blockData, void *timeout)
{
DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData];
static unsigned long generation = 0;
......@@ -658,7 +658,7 @@ dmxSwitchReturn(void *p)
}
static void
dmxWakeupHandler(void *blockData, int result, void *pReadMask)
dmxWakeupHandler(void *blockData, int result)
{
DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData];
int i;
......
......@@ -471,7 +471,7 @@ vfbSaveScreen(ScreenPtr pScreen, int on)
/* this flushes any changes to the screens out to the mmapped file */
static void
vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask)
vfbBlockHandler(void *blockData, void *timeout)
{
int i;
......@@ -492,7 +492,7 @@ vfbBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask)
}
static void
vfbWakeupHandler(void *blockData, int result, void *pReadmask)
vfbWakeupHandler(void *blockData, int result)
{
}
......
......@@ -242,7 +242,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
/* ARGSUSED */
void
xf86Wakeup(void *blockData, int err, void *pReadmask)
xf86Wakeup(void *blockData, int err)
{
if (xf86VTSwitchPending())
xf86VTSwitch();
......
......@@ -871,7 +871,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
xf86Resetting = FALSE;
xf86Initialising = FALSE;
RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, xf86Wakeup,
RegisterBlockAndWakeupHandlers((ServerBlockHandlerProcPtr) NoopDDA, xf86Wakeup,
NULL);
}
......
......@@ -137,7 +137,7 @@ DoShowOptions(void)
/* xf86Events.c */
extern _X_EXPORT void
xf86Wakeup(void *blockData, int err, void *pReadmask);
xf86Wakeup(void *blockData, int err);
extern _X_HIDDEN int
xf86SigWrapper(int signo);
extern _X_EXPORT void
......
......@@ -1667,7 +1667,7 @@ DRIDestroyInfoRec(DRIInfoPtr DRIInfo)
}
void
DRIWakeupHandler(void *wakeupData, int result, void *pReadmask)
DRIWakeupHandler(void *wakeupData, int result)
{
int i;
......@@ -1681,7 +1681,7 @@ DRIWakeupHandler(void *wakeupData, int result, void *pReadmask)
}
void
DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask)
DRIBlockHandler(void *blockData, void *pTimeout)
{
int i;
......
......@@ -263,11 +263,9 @@ extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen);
extern _X_EXPORT void DRIWakeupHandler(void *wakeupData,
int result, void *pReadmask);
extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result);
extern _X_EXPORT void DRIBlockHandler(void *blockData,
OSTimePtr pTimeout, void *pReadmask);
extern _X_EXPORT void DRIBlockHandler(void *blockData, void *timeout);
extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result);
......
......@@ -32,14 +32,14 @@ is" without express or implied warranty.
#include "Handlers.h"
void
xnestBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadMask)
xnestBlockHandler(void *blockData, void *timout)
{
xnestCollectExposures();
XFlush(xnestDisplay);
}
void
xnestWakeupHandler(void *blockData, int result, void *pReadMask)
xnestWakeupHandler(void *blockData, int result)
{
xnestCollectEvents();
}
......@@ -15,8 +15,7 @@ is" without express or implied warranty.
#ifndef XNESTHANDLERS_H
#define XNESTHANDLERS_H
void xnestBlockHandler(void *blockData, OSTimePtr pTimeout,
void *pReadMask);
void xnestWakeupHandler(void *blockData, int result, void *pReadMask);
void xnestBlockHandler(void *blockData, void *timeout);
void xnestWakeupHandler(void *blockData, int result);
#endif /* XNESTHANDLERS_H */
......@@ -507,12 +507,12 @@ socket_handler(int fd, int ready, void *data)
}
static void
wakeup_handler(void *data, int err, void *pRead)
wakeup_handler(void *data, int err)
{
}
static void
block_handler(void *data, OSTimePtr pTimeout, void *pRead)
block_handler(void *data, void *timeout)
{
struct xwl_screen *xwl_screen = data;
......
......@@ -208,28 +208,28 @@ extern _X_EXPORT int AlterSaveSetForClient(ClientPtr /*client */ ,
extern _X_EXPORT void DeleteWindowFromAnySaveSet(WindowPtr /*pWin */ );
extern _X_EXPORT void BlockHandler(void *pTimeout,
void *pReadmask);
extern _X_EXPORT void BlockHandler(void *timeout);
extern _X_EXPORT void WakeupHandler(int result,
void *pReadmask);
extern _X_EXPORT void WakeupHandler(int result);
void
EnableLimitedSchedulingLatency(void);
EnableLimitedSchedulingLatency(void);
void
DisableLimitedSchedulingLatency(void);
DisableLimitedSchedulingLatency(void);
typedef void (*WakeupHandlerProcPtr) (void *blockData,
int result,
void *pReadmask);
typedef void (*ServerBlockHandlerProcPtr) (void *blockData,
void *timeout);
extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler,
WakeupHandlerProcPtr wakeupHandler,
typedef void (*ServerWakeupHandlerProcPtr) (void *blockData,
int result);
extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData);
extern _X_EXPORT void RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler,
WakeupHandlerProcPtr wakeupHandler,
extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
ServerWakeupHandlerProcPtr wakeupHandler,
void *blockData);
extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
......
......@@ -603,7 +603,7 @@ RootlessQueueRedisplay(ScreenPtr pScreen)
* on select().
*/
static void
RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask)
RootlessBlockHandler(void *pbdata, void *ptimeout)
{
ScreenPtr pScreen = pbdata;
RootlessScreenRec *screenRec = SCREENREC(pScreen);
......@@ -616,7 +616,7 @@ RootlessBlockHandler(void *pbdata, OSTimePtr pTimeout, void *pReadmask)
}
static void
RootlessWakeupHandler(void *data, int i, void *LastSelectMask)
RootlessWakeupHandler(void *data, int result)
{
// nothing here
}
......
......@@ -208,7 +208,7 @@ WaitForSomething(int *pClientsReady)
XFD_COPYSET(&AllSockets, &LastSelectMask);
}
BlockHandler((void *) &wt, (void *) &LastSelectMask);
BlockHandler(&wt);
if (NewOutputPending)
FlushAllOutput();
/* keep this check close to select() call to minimize race */
......@@ -223,7 +223,7 @@ WaitForSomething(int *pClientsReady)
i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
}
selecterr = GetErrno();
WakeupHandler(i, (void *) &LastSelectMask);
WakeupHandler(i);
if (i <= 0) { /* An error or timeout occurred */
if (dispatchException)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment