GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

WUT.c.px-xxx-xxx File Reference

WakeUp Timer facility. More...

#include <errno.h>
#include <stdio.h>
#include <sys/time.h>
#include <PBS/BUG.h>
#include <PBS/TASK.h>
#include <PBS/TASK.ih>
#include <TASK_pvtdefs.h>
#include <impl/TOV_pvtdefs.h.px-xxx-xxx>
#include <PBI/Alias.h>

Classes

struct  _WCB_qlt
 WakeUp Control Block Que Locking and Timeout Control. More...
struct  _WCB_specific
 The platform specific piece of the WUT control structure. More...
struct  _WCB
 WakeUp Control Block. More...

Defines

#define WUT_K_TASK_PRIORITY   TASK_K_PRIORITY_LIMITS_MAX - 2
 Priority of the WUT handler task.

Typedefs

typedef struct _WCB_qlt WCB_qlt
 Typedef for struct _WCB_qlt.
typedef struct _WCB_specific WCB_specific
 Typedef for struct _WCB_specific.

Functions

static __inline void wut_period_set (unsigned int period)
 Noop on host systems.
STATIC void wut_spc_init (WCB *wcb)
 Initializes the processor specific portion of the control block.
STATIC void WUT_sys_handler (WCB *wcb)
 The timer interrupt/task handler.
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 void wut_sys_kill (void *prm, WUT_tmr *wut)
 Kills off the WUT task handler.
STATIC int wut_sys_connect (WCB *wcb)
 Platform dependent part of the WUT system connection process.
STATIC int wut_sys_shutdown (WCB *wcb)
 Platform dependent shutdown of the WUT system.
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.
int WUT_dec_get ()
 Gets the current time left till the next timer expiration.

Variables

WCB Wcb
 Statically allocate control block as a facilty private structure.


Detailed Description

WakeUp Timer facility.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: WUT.c.px-xxx-xxx,v 1.13 2011/03/24 23:05:47 apw Exp $
  

The POSIX implementation of the WakeUp Timers (WUT) facility.


Typedef Documentation

Typedef for struct _WCB_qlt.

This structure contains all the control variables for the WakeUp Timer facility used to control the locking timeouts. It is a private platform dependent structure.


Function Documentation

STATIC void arm_handler ( WCB wcb,
TOV  tov 
) [inline]

Seeds the timer interrupt to handle expire a tov.

Parameters:
wcb The WUT control block
tov The expiration timeout value

References BUG_check(), _WCB_qlt::cv, _WCB_specific::qlt, and _WCB::spc.

Referenced by add_wut().

STATIC void arm_handler_nxt_wut ( WCB wcb,
const WUT_tmr wut 
) [inline]

Seeds the timer interrupt to handle expire at the timeout associated with the specified WUT timer entry.

Parameters:
wcb The WUT control block
wut The WUT timer entry.

References BUG_check(), _WCB_qlt::cv, _WCB_specific::qlt, and _WCB::spc.

Referenced by WUT_cancel().

STATIC int cmp_lt_tov ( TOV  tov_a,
TOV  tov_b 
) [inline]

Platform implementation dependent routine to compare to timeout values.

Parameters:
tov_a The first of the two timeout values to compare
tov_b The second of the two timeout values to compare
Returns:
non-zero if tov_a < tov_b, else 0

References _TOV_u::tov, and _TOV_u::ts.

Referenced by add_wut(), find(), and WUT_sys_handler().

STATIC int lock_que ( WCB wcb  )  [inline]

Platform implementation dependent routine to lock the WUT timer que.

Parameters:
wcb Pointer to the WUT control block
Returns:
A key to be used to unlock the que.

References BUG_check(), _WCB_qlt::mutex, _WCB_specific::qlt, and _WCB::spc.

Referenced by add_wut(), WUT_cancel(), and wut_sys_kill().

STATIC void unlock_que ( WCB wcb,
int  key 
) [inline]

Platform implementation dependent routine to unlock the WUT timer que.

Parameters:
wcb Pointer to the WUT control block
key The key used to unlock the que (returned from lock_que()

References BUG_check(), _WCB_qlt::mutex, _WCB_specific::qlt, and _WCB::spc.

Referenced by add_wut(), WUT_cancel(), and wut_sys_kill().

int WUT_dec_get ( void   ) 

Gets the current time left till the next timer expiration.

This primarily used as a debugging aid.

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.

Parameters:
keepalive The keepalive control structure.
wut The WUT timer entry
Return values:
WUT_K_STATE_CHANGE_YES 
VXWORKS Implementation Note
On the PowerPC platform, this routine is used to keep the decrement counter within its limited range, ensuring that no timer entry attempts to seed it with a value beyond it's limits. It is also used to update the VxWork's system clock by calling tickAnnounce().
Return Value
The return value reflects the fact the timer entries state has been changed by the callback routine (its been restarted).

References _WUT_keepalive_ctx::period, remove_key(), _WUT_tmr::tov, TOV_add_nsecx(), WUT_K_STATE_CHANGE_YES, and WUT_restart().

Referenced by WUT_sys_connect(), and WUT_sys_reset().

static __inline void wut_period_set ( unsigned int  period  )  [static]

Noop on host systems.

Parameters:
period Ignored

Referenced by WUT_sys_reset().

STATIC void wut_spc_init ( WCB wcb  ) 

Initializes the processor specific portion of the control block.

Parameters:
wcb The WUT control block

Referenced by WUT_sys_init().

STATIC int wut_sys_connect ( WCB wcb  ) 

Platform dependent part of the WUT system connection process.

Parameters:
wcb The WUT control block
Returns:
Status

References _WCB_qlt::cv, _WCB_qlt::mutex, _WCB_specific::qlt, _WCB::spc, TASK_attr_init(), TASK_attr_priority_set(), TASK_spawn(), _WCB_specific::tcb, WUT_K_TASK_PRIORITY, and WUT_sys_handler().

Referenced by WUT_sys_connect().

STATIC void WUT_sys_handler ( WCB wcb  ) 

void wut_sys_kill ( void *  prm,
WUT_tmr wut 
)

STATIC int wut_sys_shutdown ( WCB wcb  ) 

Platform dependent shutdown of the WUT system.

Parameters:
wcb The WUT control block
Returns:
Status

References _WCB::spc, TASK_join(), _WCB_specific::tcb, TOV_from_nsecs(), WUT_INIT, WUT_start(), and wut_sys_kill().

Referenced by WUT_sys_shutdown().


Generated on Sat Apr 9 18:27:08 2011 by  doxygen 1.5.8