From fb0802113b4c57819cba15d64baf79bf4148607e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 1 Sep 2015 11:20:04 -0700 Subject: Remove readmask from screen block/wakeup handler With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson --- doc/Xinput.xml | 8 +------ doc/Xserver-spec.xml | 59 +++++++++++++++++----------------------------------- 2 files changed, 20 insertions(+), 47 deletions(-) (limited to 'doc') diff --git a/doc/Xinput.xml b/doc/Xinput.xml index 083b10908..0e7fbda72 100644 --- a/doc/Xinput.xml +++ b/doc/Xinput.xml @@ -210,7 +210,7 @@ A sample InitInput implementation is shown below. InitInput(argc,argv) { - int i, numdevs, ReadInput(); + int i, numdevs; DeviceIntPtr dev; LocalDevice localdevs[LOCAL_MAX_DEVS]; DeviceProc kbdproc, ptrproc, extproc; @@ -223,12 +223,6 @@ InitInput(argc,argv) open_input_devices (&numdevs, localdevs); - /************************************************************** - * Register a WakeupHandler to handle input when it is generated. - ***************************************************************/ - - RegisterBlockAndWakeupHandlers (NoopDDA, ReadInput, NULL); - /************************************************************** * Register the input devices with DIX. ***************************************************************/ diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml index 72a544b55..7867544e4 100644 --- a/doc/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -674,30 +674,22 @@ If WaitForSomething() decides it is about to do something that might block routine called BlockHandler().
- void BlockHandler(pTimeout, pReadmask) - pointer pTimeout; - pointer pReadmask; + void BlockHandler(void *pTimeout)
The types of the arguments are for agreement between the OS and DDX implementations, but the pTimeout is a pointer to the information -determining how long the block is allowed to last, and the -pReadmask is a pointer to the information describing the descriptors -that will be waited on. +determining how long the block is allowed to last. -In the sample server, pTimeout is a pointer, and pReadmask is -the address of the select() mask for reading. +In the sample server, pTimeout is a pointer. The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus:
- void xxxBlockHandler(pScreen, pTimeout, pReadmask) - ScreenPtr pScreen; - pointer pTimeout; - pointer pReadmask; + void xxxBlockHandler(ScreenPtr pScreen, void *pTimeout)
The arguments are a pointer to the Screen, and the arguments to the @@ -709,27 +701,20 @@ block, even if it didn't actually block, it must call the DIX routine WakeupHandler().
- void WakeupHandler(result, pReadmask) - int result; - pointer pReadmask; + void WakeupHandler(int result)
Once again, the types are not specified by DIX. The result is the -success indicator for the thing that (may have) blocked, -and the pReadmask is a mask of the descriptors that came active. -In the sample server, result is the result from select() (or equivalent -operating system function), and pReadmask is -the address of the select() mask for reading. +success indicator for the thing that (may have) blocked. +In the sample server, result is the result from select() (or equivalent +operating system function).
The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus:
- void xxxWakeupHandler(pScreen, result, pReadmask) - ScreenPtr pScreen; - unsigned long result; - pointer pReadmask; + void xxxWakeupHandler(ScreenPtr pScreen, int result)
The arguments are the Screen, of the Screen, and the arguments to @@ -741,8 +726,8 @@ block and wakeup handlers (only together) using:
Bool RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -752,8 +737,8 @@ memory. To remove a registered Block handler at other than server reset time
RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; + ServerBlockHandlerProcPtr blockHandler; + ServerWakeupHandlerProcPtr wakeupHandler; pointer blockData;
@@ -761,18 +746,15 @@ All three arguments must match the values passed to RegisterBlockAndWakeupHandlers.
-These registered block handlers are called after the per-screen handlers: +These registered block handlers are called before the per-screen handlers:
- void (*BlockHandler) (blockData, pptv, pReadmask) - pointer blockData; - OsTimerPtr pptv; - pointer pReadmask; + void (*ServerBlockHandler) (void *blockData, void *pTimeout)
-Sometimes block handlers need to adjust the time in a OSTimePtr structure, +Sometimes block handlers need to adjust the time referenced by pTimeout, which on UNIX family systems is generally represented by a struct timeval consisting of seconds and microseconds in 32 bit values. As a convenience to reduce error prone struct timeval computations which @@ -780,20 +762,17 @@ require modulus arithmetic and correct overflow behavior in the face of millisecond wrapping through 32 bits,
- void AdjustWaitForDelay(pointer /*waitTime*, unsigned long /* newdelay */) + void AdjustWaitForDelay(void *pTimeout, unsigned long newdelay)
has been provided.
Any wakeup handlers registered with RegisterBlockAndWakeupHandlers will -be called before the Screen handlers: +be called after the Screen handlers:
- void (*WakeupHandler) (blockData, err, pReadmask) - pointer blockData; - int err; - pointer pReadmask; + void (*ServerWakeupHandler) (void *blockData, int result)
-- cgit v1.2.3