GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-5
Constituent: pbs     Tag: rad750
#include "PBS/WUT.h"
#include "PBS/WUT_tmr.h"
#include "PBS/TOV.h"
#include "PBS/FPA.h"
#include "PBS/MBA.h"
#include "PBS/Q.h"
#include "PBS/Q.ih"
#include "PBS/PTS.h"
#include "WCT_pvtdefs.h"
#include "WUT_debug.c"
Include dependency graph for WUT.c:
Data Structures | |
struct | _WCB_common |
WakeUp Control Block. More... | |
struct | _WUT_keepalive |
Captures the keepalive timer entry and context parameter. More... | |
struct | _WUT_keepalive_ctx |
Callback structure for the keepalive callbacks. More... | |
Defines | |
#define | WUT_DEBUG |
Used to include debugging code. | |
#define | STATIC static |
Kludge for Doxygen,. | |
#define | MEMBER_OFFSET(_structure, _member) ((int) &(((_structure *) 0) -> _member)) |
Calculates the offset, in bytes, of the specified _member in _structure. | |
#define | WUT_M_KEY 1 |
WUT key used to allow some normally prohibited actions. | |
Typedefs | |
typedef _WUT_keepalive_ctx | WUT_keepalive_ctx |
Typedef for WUT_keepalive_ctx. | |
typedef _WUT_keepalive | WUT_keepalive |
Typedef for struct _WUT_keepalive. | |
typedef _WCB_common | WCB_common |
Typedef for struct _WCB. | |
typedef _WCB | WCB |
Typedef for struct _WCB. | |
Functions | |
STATIC WUT_tmr * | add_key (const WUT_tmr *wut) |
Adds an special key to the timer entry handle. Operations which are normally prohibited are allowed in special circumstances. | |
STATIC int | has_key (const WUT_tmr *wut) |
Tests whether the WUT timer entry has the special key attached. | |
STATIC WUT_tmr * | remove_key (const WUT_tmr *wut) |
Removes the special key from a WUT timer entry. | |
STATIC WUT_tmr * | get_wut (const Q_node *node) |
Returns a pointer to top of the WUT timer structure. | |
STATIC WUT_state | add_wut (WUT_tmr *wut, register TOV tov) |
Adds the specified WUT timer entry into the active que. | |
STATIC const Q_node * | find (const Q_head *que, register TOV tov) |
Scans the que to find the last timer entry with a timeout value smaller than tov. | |
STATIC int | cmp_lt_tov (TOV tov_a, TOV tov_b) |
Platform implementation dependent routine to compare to timeout values. | |
STATIC int | lock_que (WCB *wcb) |
Platform implementation dependent routine to lock the WUT timer que. | |
STATIC void | unlock_que (WCB *wcb, int key) |
Platform implementation dependent routine to unlock the WUT timer que. | |
STATIC void | arm_handler (WCB *wcb, TOV tov) |
Seeds the timer interrupt to handle expire a tov. | |
STATIC void | arm_handler_nxt_wut (WCB *wcb, const WUT_tmr *wut) |
Seeds the timer interrupt to handle expire at the timeout associated with the specified WUT timer entry. | |
STATIC int | wut_sys_connect (WCB *wcb) |
Platform dependent part of the WUT system connection process. | |
STATIC int | wut_sys_shutdown (WCB *wcb) |
Platform specific shutdown procedure. | |
WUT_cb_status | WUT_keepalive_rtn (WUT_keepalive_ctx *keepalive, WUT_tmr *wut) |
Simple WUT timer callback routine used to drive the VxWorks system clock. | |
WUT_cb_status | WUT_keepalive_update (WUT_keepalive_ctx *keepalive, WUT_tmr *wut) |
Simple WUT timer callback routine used to update the WCT clock. | |
STATIC void | init_wut (void *unused, WUT_tmr *wut, int pckt_size, int pcb_offset) |
Initializes each timer entry as it is added to the Free Packet Pool. | |
WUT_state | WUT_cancel (WUT_tmr *wut) |
Cancels a WUT timer entry. | |
WUT_tmr * | WUT_create () |
Allocate a WUT timer entry. | |
WUT_state | WUT_destroy (WUT_tmr *wut) |
Destroys, ie frees, an unused WUT timer entry. | |
WUT_state | WUT_expire (WUT_tmr *wut) |
Marks a wut timer as expire. | |
WUT_state | WUT_restart (WUT_tmr *wut, register TOV tov) |
Restarts a WUT timer entry. | |
WUT_state | WUT_start (WUT_tmr *wut, register TOV tov, WUT_cb_routine cb, void *prm) |
Establishes and starts a WUT timer entry. | |
WUT_state | WUT_state_get (const WUT_tmr *wut) |
Gets the current state of the WUT timer entry. | |
TOV | WUT_tov_get (const WUT_tmr *wut) |
Gets the current TOV of the WUT timer entry. | |
int | WUT_overrun (const WUT_tmr *wut) |
Returns how 'on-time' the timer ISR was serviced. | |
unsigned int | WUT_frequency () |
Gets frequency, in Hertz of the WUT clock. | |
int | WUT_sys_adjust (long long int dnsecx) |
Adjusts all the current entries on the WUT timer que in response to a change in the base time. | |
int | WUT_sys_init (int count) |
One time WUT services initialization routine. | |
int | WUT_sys_connect (unsigned int keepalive, unsigned int update) |
One time WUT connection routine to start WUT system. | |
int | WUT_sys_reset (unsigned int keepalive, unsigned int update) |
Resets the keepalive and update times. | |
int | WUT_sys_shutdown () |
Shuts down the WUT routine. |
CVS $Id: WUT.c,v 1.10 2005/05/12 19:42:58 russell Exp $
|
Calculates the offset, in bytes, of the specified _member in _structure.
|
|
Kludge for Doxygen,.
|
|
WUT key used to allow some normally prohibited actions.
|
|
Typedef for struct _WCB.
|
|
Typedef for struct _WCB.
|
|
Typedef for WUT_keepalive_ctx.
|
|
Adds an special key to the timer entry handle. Operations which are normally prohibited are allowed in special circumstances.
|
|
Adds the specified WUT timer entry into the active que.
|
Here is the call graph for this function:
|
Seeds the timer interrupt to handle expire a tov.
|
Here is the call graph for this function:
|
Seeds the timer interrupt to handle expire at the timeout associated with the specified WUT timer entry.
|
Here is the call graph for this function:
|
Platform implementation dependent routine to compare to timeout values.
|
|
Scans the que to find the last timer entry with a timeout value smaller than tov.
|
Here is the call graph for this function:
|
Returns a pointer to top of the WUT timer structure.
|
|
Tests whether the WUT timer entry has the special key attached.
|
|
Initializes each timer entry as it is added to the Free Packet Pool.
|
|
Platform implementation dependent routine to lock the WUT timer que.
|
Here is the call graph for this function:
|
Removes the special key from a WUT timer entry.
|
|
Platform implementation dependent routine to unlock the WUT timer que.
|
Here is the call graph for this function:
|
Cancels a WUT timer entry.
|
Here is the call graph for this function:
|
Allocate a WUT timer entry.
|
Here is the call graph for this function:
|
Destroys, ie frees, an unused WUT timer entry.
|
Here is the call graph for this function:
|
Marks a wut timer as expire.
|
Here is the call graph for this function:
|
Gets frequency, in Hertz of the WUT clock.
|
Here is the call graph for this function:
|
Simple WUT timer callback routine used to drive the VxWorks system clock.
|
Here is the call graph for this function:
|
Simple WUT timer callback routine used to update the WCT clock.
|
Here is the call graph for this function:
|
Returns how 'on-time' the timer ISR was serviced.
|
|
Restarts a WUT timer entry.
|
Here is the call graph for this function:
|
Establishes and starts a WUT timer entry.
|
Here is the call graph for this function:
|
Gets the current state of the WUT timer entry.
|
Here is the call graph for this function:
|
Adjusts all the current entries on the WUT timer que in response to a change in the base time.
|
Here is the call graph for this function:
|
One time WUT connection routine to start WUT system.
It also has another role, that of making sure that no timer ISR becomes active 'too far' from the last update of the system clock. This means that value one places in the decrement counter is never very large. Imagine that no keepalive timer ISR existed and the user requested a wakeup timer 1 day from now. When the timer was requested, WUT would calculate the number of decrement counter ticks until expiration. Two bad things happen without the keepalive:
By providing a keepalive counter in 50-100Hz range, problem 1 is avoided, and problem 2 is lessened. The extrapolation error can be no more than that accumulated in the time period between wall clock updates. Since it is expected that the GPS time will update the wall clock at a 1Hz and the short term processor clock stability is about 10-6 to 10-5, the extrapolation error 1-10usecs. |
Here is the call graph for this function:
|
Platform dependent part of the WUT system connection process.
|
Here is the call graph for this function:
|
One time WUT services initialization routine.
|
Here is the call graph for this function:
|
Resets the keepalive and update times.
|
Here is the call graph for this function:
|
Shuts down the WUT routine.
|
Here is the call graph for this function:
|
Platform specific shutdown procedure. The decrement counter is set to the maximum expiration, effectively providing enough time to restore the original VxWorks exception handler. |
|
Gets the current TOV of the WUT timer entry.
|
Here is the call graph for this function: