GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-2 > lcbd / sun-gcc
#include <LCBD/LCBD_drv.h>
#include <PBS/Q.h>
#include <PBS/LI.h>
#include <PBS/FORK.h>
Classes | |
union | _LCBD_nut_que |
Union of the possible data structures the LCBD_nut can be linked to. More... | |
struct | _LCBD_nut |
The notification user of transients block. More... | |
Defines | |
#define | LCBD_OK 0 |
Success return code, note that this is not an LCBD message code, but may be used as one. | |
#define | LCBD_NUT_K_DEFAULT_PRIORITY -1 |
Instructs the notification service task creation routine LCBD_nut_handler_create to use a system defined default priority. | |
Typedefs | |
typedef enum _LCBD_NUT_FATE_M | LCBD_NUT_FATE_M |
Typedef for enum _LCBD_NUT_FATE_M. | |
typedef struct _LCBD_nut | LCBD_nut |
Typedef for struct _LCBD_nut. | |
typedef unsigned int(* | LCBD_nut_cb )(LCBD_nut *nut, LCBD lcb, LCBD_state state) |
Signature for the callback routine to notify the user of a state transition. | |
typedef union _LCBD_nut_que | LCBD_nut_que |
Typedef for union _LCBD_nut_que. | |
typedef LI_head | LCBD_nut_head |
Typedef for the type of que head that LCBD_nut_post posts to and LCBD_nut_pendW pulls from. | |
Enumerations | |
enum | _LCBD_NUT_FATE_M { LCBD_NUT_FATE_M_KEEP = (1 << 0), LCBD_NUT_FATE_M_STOP = (1 << 1) } |
Enumerates the option bits that can be set on the return value of the user notification routine. More... | |
Functions | |
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. | |
unsigned int | LCBD_nut_cancel (LCBD lcb, LCBD_nut *nut) |
Cancels the specified user notification block. | |
unsigned int | LCBD_nut_notify (LCBD lcb, LCBD_nut *nut) |
Ques a notification block. | |
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_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 *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_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. | |
static __inline void | LCBD__nut_fill (LCBD_nut *nut, unsigned int states, LCBD_nut_cb rtn, void *prm0, void *prm1) |
Convenience routine to fill in a NUT block. |
// Submit a synchronous transaction SUBMIT_AGAIN: status = LCBD_submitW (xcb); // Check if OK if (status != LCBD_OK) { // Check if failed because the driver is OFFLINE if (status == LCBD_OFFLINE) { // Wait till the driver is ONLINE or someone unloads it state = LCBD_nut_queW (lcb, (LCBD_STATE_M_ONLINE | LCBD_STATE_M_UNLOADING); // Check if someone unloaded the driver if (state == LCBD_STATE_UNLOADING) return GIVE_UP; // Driver must be online (or at least it was at sometime) goto SUBMIT_AGAIN; } }
#define LCBD_NUT_K_DEFAULT_PRIORITY -1 |
Instructs the notification service task creation routine LCBD_nut_handler_create to use a system defined default priority.
Referenced by LCBD_nut_handler_create().
Typedef for struct _LCBD_nut.
unsigned int(* LCBD_nut_cb)(LCBD_nut *nut, LCBD lcb, LCBD_state state) |
Signature for the callback routine to notify the user of a state transition.
nut | The user's notification block | |
lcb | Handle to the LCB driver | |
state | The end state causing the transition |
Typedef for enum _LCBD_NUT_FATE_M.
Typedef for union _LCBD_nut_que.
enum _LCBD_NUT_FATE_M |
Enumerates the option bits that can be set on the return value of the user notification routine.
static __inline void LCBD__nut_fill | ( | LCBD_nut * | nut, | |
unsigned int | states, | |||
LCBD_nut_cb | rtn, | |||
void * | prm0, | |||
void * | prm1 | |||
) | [static] |
Convenience routine to fill in a NUT block.
nut | The NUT block to fill in | |
states | The states to wait on | |
rtn | Notification callback routine | |
prm0 | Arbritary user parameter | |
prm1 | Arbritary user parameter |
References _LCBD_nut::prm, _LCBD_nut::rtn, and _LCBD_nut::states.
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_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, | |
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.