GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / dev > lcbd / rhel4-32
#include <LCBD/LCBD_nut.h>
#include <LCBD/LCBD_msgs.h>
#include <LCBD_p.h>
#include <PBS/TASK.h>
#include <PBS/FORK.h>
#include <PBS/Q.ih>
#include <PBS/LI.ih>
#include <PBS/MTX.ih>
#include <string.h>
#include <PBS/INT.ih>
Functions | |
static unsigned int | notify (FORK_cb_prm prm, FORK_msg_hdr *msg_hdr) |
Fork callback routine used to notify users of transitions. | |
static int | wait (void *nut) |
Callback routine for TASK_block in the LCBD_nut_notifyW. | |
static unsigned int | fork (LCBD_nut *nut, LCBD lcb, LCBD_state state) |
Notification callback routine that dispatchs to a FORK que. | |
static unsigned int | post (LCBD_nut *nut, LCBD lcb, LCBD_state state) |
Internal LCBD notification callback routine to post a NUT block to a pending que. | |
static unsigned int | wake (LCBD_nut *nut, LCBD lcb, LCBD_state state) |
LCBD_nut_notifyW callback routine for notification. | |
unsigned int | LCBD_nut_handler_create (LCBD lcb, int priority) |
Creates the notification handler task. | |
unsigned int | LCBD_nut_que_install (LCBD lcb, FORK_que *que) |
Installs the specified fork que. | |
LCBD_state | LCBD_nut_notifyW (LCBD lcb, unsigned int states) |
Wait until the LCB driver is in one of the list of specified states. | |
unsigned int | LCBD_nut_fork (LCBD lcb, unsigned int states, LCBD_nut *nut, FORK_que *que, FORK_cb_rtn rtn) |
Ques a NUT block using a fork callback as the synchronization mechanism. | |
unsigned int | LCBD_nut_head_create (LCBD_nut_head *head) |
Creates and initializes a NUT head posting que. | |
unsigned int | LCBD_nut_head_destroy (LCBD_nut_head *head) |
Initializes a NUT head posting que. | |
unsigned int | LCBD_nut_post (LCBD lcb, unsigned int states, LCBD_nut *nut, LCBD_nut_head *nut_head) |
Posts a NUT block using a que as a synchronization mechanism. | |
LCBD_nut * | LCBD_nut_pendW (LCBD_nut_head *head) |
Pends for the next notification block on this que head. | |
unsigned int | LCBD_nut_notify (LCBD lcb, LCBD_nut *nut) |
Ques a notification block. | |
unsigned int | LCBD_nut_cancel (LCBD lcb, LCBD_nut *nut) |
Cancels the specified user notification block. | |
unsigned int | lcbd_nut_handler_destroy (LCBD lcb, unsigned int *exit_status) |
Destroys the notification service task. | |
unsigned int | lcbd_nut_post (LCBD lcb) |
Posts a message to the notify service task. |
static unsigned int fork | ( | LCBD_nut * | nut, | |
LCBD | lcb, | |||
LCBD_state | state | |||
) | [static] |
Notification callback routine that dispatchs to a FORK que.
nut | The NUT block to post | |
lcb | The LCB driver handle | |
state | The current driver state |
References _LCBD_nut_que::msg, _LCBD_nut::prm, _LCBD_nut::que, _LCBD_nut::rsvd, and _LCBD_nut::state.
Referenced by LCBD_fork_bind(), and LCBD_nut_fork().
unsigned int LCBD_nut_cancel | ( | LCBD | lcb, | |
LCBD_nut * | nut | |||
) |
Cancels the specified user notification block.
lcb | The LCB driver handle | |
nut | The notification user of transition block to cancel |
References LCBD_OK, _LCBD_nut_que::qnode, and _LCBD_nut::que.
unsigned int LCBD_nut_fork | ( | LCBD | lcb, | |
unsigned int | states, | |||
LCBD_nut * | nut, | |||
FORK_que * | que, | |||
FORK_cb_rtn | rtn | |||
) |
Ques a NUT block using a fork callback as the synchronization mechanism.
lcb | The LCB driver handle | |
states | The states to wait on | |
nut | The NUT block to post | |
que | The FORK que to post to | |
rtn | The FORK dispatch routine |
References fork(), LCBD_nut_notify(), _LCBD_nut::prm, _LCBD_nut::rsvd, _LCBD_nut::rtn, and _LCBD_nut::states.
unsigned int LCBD_nut_handler_create | ( | LCBD | lcb, | |
int | priority | |||
) |
Creates the notification handler task.
lcb | The LCB driver handle | |
priority | The priority of the created task. This may be specified as LCBD_K_DEFAULT_PRIORITY, in which case the driver will assign a defaulty task priority. |
References _LCBD_ncb::fork, lcbd_create_handler(), LCBD_NUT_K_DEFAULT_PRIORITY, _LCBD_ncb::mutex, _LCBD_ncb::que, and _LCBD_ncb::seq.
unsigned int lcbd_nut_handler_destroy | ( | LCBD | lcb, | |
unsigned int * | exit_status | |||
) |
Destroys the notification service task.
lcb | The LCB driver handle | |
exit_status | Pointer to receive the exit status of the notification routine. |
References lcbd_nut_post(), and LCBD_OK.
Referenced by destroy_sw().
unsigned int LCBD_nut_head_create | ( | LCBD_nut_head * | head | ) |
Creates and initializes a NUT head posting que.
head | The NUT head to initialize |
unsigned int LCBD_nut_head_destroy | ( | LCBD_nut_head * | head | ) |
Initializes a NUT head posting que.
head | The NUT head to initialize |
unsigned int LCBD_nut_notify | ( | LCBD | lcb, | |
LCBD_nut * | nut | |||
) |
Ques a notification block.
lcb | The LCB driver handle | |
nut | The Notify User of Transition control structure. |
References lcbd_nut_post(), _LCBD_nut_que::qnode, _LCBD_nut::que, and _LCBD_nut::states.
Referenced by LCBD_nut_fork(), LCBD_nut_post(), and wait().
LCBD_state LCBD_nut_notifyW | ( | LCBD | lcb, | |
unsigned int | states | |||
) |
Wait until the LCB driver is in one of the list of specified states.
LCBD_STATE_ERROR | if an error occurred |
lcb | The LCB driver handle | |
states | A bit list of the acceptable states. When the driver is in one of these states, it returns. |
References LCBD_STATE_ERROR, _LCBD_nut::prm, _LCBD_nut::rtn, _LCBD_nut::state, _LCBD_nut::states, wait(), and wake().
LCBD_nut * LCBD_nut_pendW | ( | LCBD_nut_head * | head | ) |
Pends for the next notification block on this que head.
head | The que head to pend on |
unsigned int lcbd_nut_post | ( | LCBD | lcb | ) |
Posts a message to the notify service task.
lcb | The LCB driver handle |
References LCBD_OK, and notify().
Referenced by handle_clks(), lcbd_nut_handler_destroy(), and LCBD_nut_notify().
unsigned int LCBD_nut_post | ( | LCBD | lcb, | |
unsigned int | states, | |||
LCBD_nut * | nut, | |||
LCBD_nut_head * | nut_head | |||
) |
Posts a NUT block using a que as a synchronization mechanism.
lcb | The LCB driver handle | |
states | The states to wait on | |
nut | The NUT block to post | |
nut_head | The head of the que to post to |
References LCBD_nut_notify(), post(), _LCBD_nut::rsvd, _LCBD_nut::rtn, and _LCBD_nut::states.
unsigned int LCBD_nut_que_install | ( | LCBD | lcb, | |
FORK_que * | que | |||
) |
Installs the specified fork que.
lcb | The driver handle | |
que | The FORK que to post notification messages to |
References _LCBD_hcb::fcb, _LCBD_ncb::fork, LCBD_OK, _LCBD_ncb::mutex, _LCBD_hcb::que, _LCBD_ncb::que, and _LCBD_ncb::semaphore.
static unsigned int notify | ( | FORK_cb_prm | prm, | |
FORK_msg_hdr * | msg_hdr | |||
) | [static] |
Fork callback routine used to notify users of transitions.
FORK_C_CONTINUE |
prm | The fork callback parameter, here it is the LCB driver handle | |
msg_hdr | The message |
References check(), LCBD_NUT_FATE_M_KEEP, LCBD_NUT_FATE_M_STOP, LCBD_STATE_UNLOADING, _LCBD_ncb::mutex, _LCBD_nut_que::qnode, _LCBD_nut::que, _LCBD_ncb::que, _LCBD_nut::rtn, and _LCBD_nut::states.
Referenced by lcbd_nut_post().
static unsigned int post | ( | LCBD_nut * | nut, | |
LCBD | lcb, | |||
LCBD_state | state | |||
) | [static] |
Internal LCBD notification callback routine to post a NUT block to a pending que.
nut | The NUT block to post | |
lcb | The LCB driver handle | |
state | The current driver state |
References _LCBD_nut_que::lnode, _LCBD_nut::que, _LCBD_nut::rsvd, and _LCBD_nut::state.
Referenced by LCBD_nut_post(), LCBD_post_bind(), and retire().
static int wait | ( | void * | nut | ) | [static] |
Callback routine for TASK_block in the LCBD_nut_notifyW.
nut | The Notify User of Transition control structure |
References LCBD_nut_notify(), and _LCBD_nut::prm.
Referenced by LCBD_nut_notifyW().
static unsigned int wake | ( | LCBD_nut * | nut, | |
LCBD | lcb, | |||
LCBD_state | state | |||
) | [static] |
LCBD_nut_notifyW callback routine for notification.
0,indicating | to the servicing routine (notify) that this callback routine should be removed from the list. |
nut | The NUT block | |
lcb | The LCB driver handle | |
state | The state that initiated the wake-up |
References _LCBD_nut::prm, and _LCBD_nut::state.
Referenced by LCBD_nut_notifyW(), LCBD_qioW(), and LCBD_submitW().