GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / sun-gcc
#include <PBI/Attribute.h>
#include <PBI/Inline.h>
#include <PBS/SPIN_time.h>
Defines | |
#define | SPIN__EXP_PROTO INLINE_USR_EXP_PROTO |
Export Prototype specification. | |
#define | SPIN__EXP_FNC INLINE_USR_EXP_FNC |
Internal Prototype specification. | |
#define | SPIN__LCL_PROTO INLINE_USR_LCL_PROTO |
Export Function declaration. | |
#define | SPIN__LCL_FNC INLINE_USR_LCL_FNC |
Internal Function declaration. | |
Functions | |
SPIN__EXP_PROTO unsigned int | SPIN__nsecs_to_ptus (unsigned int nanoseconds) ATTR_UNUSED_OK |
Converts a number of nanoseconds to PTUs. | |
SPIN__EXP_PROTO unsigned int | SPIN__ptus_to_nsecs (unsigned int ptus) ATTR_UNUSED_OK |
SPIN__EXP_PROTO SPIN_time | SPIN__curtime (void) ATTR_UNUSED_OK |
Returns the current time in units of PTUs. | |
SPIN__EXP_PROTO int | SPIN__wait (SPIN_time begin_ptu, unsigned int ptus) ATTR_UNUSED_OK |
Allows one to wait a specified time period after a start time. | |
SPIN__EXP_PROTO int | SPIN__check (SPIN_time begin_ptu, unsigned int ptus) ATTR_UNUSED_OK |
Checks whether the requested amount of time has elapsed. | |
SPIN__EXP_PROTO int | SPIN__spin (unsigned int ptus) ATTR_UNUSED_OK |
Places the CPU into a spin loop until the specified number of PTUs has elapsed. |
CVS $Id: SPIN.ih,v 1.5 2011/03/24 23:05:44 apw Exp $
These are the inline versions of the SPIN routines. The inline and non-inline versions maybe used in any combination. For complete documentation refer to SPIN.h and SPIN.c.
int SPIN__check | ( | SPIN_time | begin_ptu, | |
unsigned int | ptus | |||
) |
Checks whether the requested amount of time has elapsed.
is that this routine is used in a polling mode.
begin_ptu | The start time | |
ptus | The number of PTUs to wait |
Note that in order to keep the interpretation of the return value uniform over the SPIN routines, the amount of time till expiration is returned as a negative number. A positive number indicates the amount of time past the expiration time.
SPIN_time SPIN__curtime | ( | void | ) |
Returns the current time in units of PTUs.
The | current time in units of PTUs. |
The customary use of this routine is to strobe the starting time, then use the return value along with SPIN__check() or SPIN__wait() to allow a specified amount of time to elapsed from the starting time.
int SPIN__nsecs_to_ptus | ( | unsigned int | nsecs | ) |
Converts a number of nanoseconds to PTUs.
nsecs | The number of nanoseconds to convert to a PTUs |
References SPIN_NSECS_TO_PTUS.
unsigned int SPIN__ptus_to_nsecs | ( | unsigned int | ptus | ) |
ptus | The number of PTUs to convert to nanoseconds |
References SPIN_PTUS_TO_NSECS.
int SPIN__spin | ( | unsigned int | ptusToSpin | ) |
Places the CPU into a spin loop until the specified number of PTUs has elapsed.
ptusToSpin | The number of PTUs to spin. |
int SPIN__wait | ( | SPIN_time | begin_ptu, | |
unsigned int | ptus | |||
) |
Allows one to wait a specified time period after a start time.
begin_ptu | The start time | |
ptus | The number of PTUs to wait |