GLAST/LAT >
DAQ and FSW >
FSW >
Doxygen Index >
PBS / V2-10-14
Constituent: pbs     Tag: rad750
Interface Data Structures File List Data Fields Globals
SPIN.ih.xx-ppc-gcc File Reference
Implements the PPC/GCC version of the inline SPIN routines. More...
#include "PBS/impl/SPIN_time.h.xx-ppc-gcc"
#include "PBS/impl/PTS.h.xx-ppc-gcc"
Include dependency graph for SPIN.ih.xx-ppc-gcc:
|
Defines |
#define | SPIN_PTUS_TO_NSECS(_ptus) PTS_PTUS_TO_NSECS(_ptus) |
| Converts a short range processor spin time to nanoseconds.
|
#define | SPIN_NSECS_TO_PTUS(_nsecs) PTS_NSECS_TO_PTUS(_nsecs) |
| Converts a short range nanoseconds to a processor spin time.
|
Functions |
SPIN__EXP_FNC SPIN_time | SPIN__curtime (void) |
| Returns the current time in units of PTUs.
|
SPIN__EXP_FNC unsigned int | SPIN__nsecs_to_ptus (unsigned int nsecs) |
| Converts a number of nanoseconds to PTUs.
|
SPIN__EXP_FNC unsigned int | SPIN__ptus_to_nsecs (unsigned int ptus) |
Detailed Description
Implements the PPC/GCC version of the inline SPIN routines.
- Author:
- JJRussell - russell@slac.stanford.edu
CVS $Id: SPIN.ih.xx-ppc-gcc,v 1.4 2004/12/07 16:13:08 russell Exp $
ABSTRACT
Provides a PPC independent way of spinning for a specified number of nanoseconds. These routines are provided in the form of inline functions. They use the time base registers as the timing mechanism. These have resolutions on the order of 4 x the memory speed (ie ~60nanoseconds). See the generic interface file 'SPIN.ih' for documentation.
Define Documentation
#define SPIN_NSECS_TO_PTUS |
( |
_nsecs |
|
) |
PTS_NSECS_TO_PTUS(_nsecs) |
|
|
Converts a short range nanoseconds to a processor spin time.
- Parameters:
-
| _nsecs | The short range time, in nanoseconds, to convert to a processor time. |
- Returns:
- The processor time in ticks (32-bit result)
- Note:
- On some platforms, this macro merely calls SPIN__ptus_to_nsecs() will on other platforms this macro is called by SPIN__ptus_to_nsecs(). There is an advantage of always using the macro, however. On those platforms where the conversion factors are known at compile time, the conversion of a constant number of nsecs by this macro will be done at compile time.
|
#define SPIN_PTUS_TO_NSECS |
( |
_ptus |
|
) |
PTS_PTUS_TO_NSECS(_ptus) |
|
|
Converts a short range processor spin time to nanoseconds.
- Parameters:
-
| _ptus | The short range processor spin time to convert. |
- Returns:
- The processor spin time in nanoseconds (32-bit result)
This is macro most likely use is in converting the result a spin overrun back into nanoseconds.
- Note:
- On some platforms, this macro merely calls SPIN__ptus_to_nsecs() will on other platforms this macro is called by SPIN__ptus_to_nsecs(). There is an advantage of always using the macro, however. On those platforms where the conversion factors are known at compile time, the conversion of a constant number of ptus by this macro will be done at compile time.
|
Function Documentation
SPIN__EXP_FNC SPIN_time SPIN__curtime |
( |
void |
|
) |
|
|
|
Returns the current time in units of PTUs.
- Return values:
-
| The | current time in units of PTUs. |
This gets the current time. For performance reasons, the units are in PTUs and the range is generally limited to 32 bits, although this is a platform dependent statement.
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. |
SPIN__EXP_FNC unsigned int SPIN__nsecs_to_ptus |
( |
unsigned int |
nsecs |
) |
|
|
|
Converts a number of nanoseconds to PTUs.
- Parameters:
-
| nsecs | The number of nanoseconds to convert to a PTUs |
- Returns:
- The equivalent time in PTUs.
This routine converts nanoseconds into Processor Timer Units. This is usually a one time call which must be made to convert the natural time units of nanoseconds to the units the SPIN routines work in. |
SPIN__EXP_FNC unsigned int SPIN__ptus_to_nsecs |
( |
unsigned int |
ptus |
) |
|
|
|
- Parameters:
-
| ptus | The number of PTUs to convert to nanoseconds |
- Returns:
- The equivalent time in units of nanoseconds.
This routine is the complement of the SPIN__nsecs_to_ptus(). It is useful only when converting the return value of the SPIN__spin routines back to physically meaningful units, ie nanaseconds. It certainly will not be as heavily used as SPIN__nsecs_to_ptus(). |
Generated on Wed Feb 14 17:56:56 2007 by
1.4.4