Specifications
Writing a User-Level Device Drive
r
17-21
able and re-enable rescheduling and to determine the number of rescheduling locks in
effect. These macros are briefly described as follows:
resched_lock increment the number of rescheduling locks held by the calling
thread, and disable rescheduling
resched_unlock decrement the number of rescheduling locks held by the calling
thread. If the resulting number of rescheduling locks is zero,
rescheduling is re-enabled.
resched_nlocks return the number of rescheduling locks currently held by the
calling thread
Procedures for using rescheduling variables, the resched_cntl(2) system call, and
the rescheduling control macros are fully explained in the PowerUX Real-Time Guide.
Reference information on the system call is provided in the corresponding system manual
page.
You can use the rescheduling control tools in a user-level driver to prevent preemption of
the running process while a spin lock is locked at program level if the spin lock is not to be
locked at interrupt level.
The Server System Calls 17
PowerUX condition synchronization tools are based on the idea of a client-server relation-
ship between cooperating threads. A client thread is one that requests service from another
thread. A server thread is one that satisfies a client’s request for service. A set of client
system calls has been developed to enable you to manipulate threads acting as clients. A
set of server system calls has been developed to enable you to manipulate threads acting as
servers. The server calls can also be viewed simply as providing a very fast means of
blocking a process until another process decides to unblock it.
The server system calls are used by user-level interrupt routines. They can be used for
other synchronization purposes by a user-level device driver and by an application
program that is using a user-level driver. They are briefly described as follows:
server_block block the calling thread only if no wake-up request has occurred
since the last return from server_block
server_wake1 wake a single server that is blocked in the server_block
system call; if the specified server is not blocked in this call, the
wake-up request is applied to the server’s next call to
server_block
server_wakevec wake a group of servers that are blocked in the server_block
system call; if a specified server is not blocked in this call, the
wake-up request is applied to the server’s next call to
server_block
Procedures for using the server system calls are fully explained in the PowerUX Real-
Time Guide. Reference information is provided in the server_block(2) system man-
ual page.