#ifndef _aplmt_system_sysapi_h_
#define _aplmt_system_sysapi_h_
/*----------------------------------------------------------------------------
** SUMMARY: System Primitives Interfaces (SYSMT)
**
** DESCRIPTION:
**  This file provides the interface for system-wide primitives.
**
**
** CONFIGURATION 
** -------------
**  COMPILE:        none.
**
**  APPLICATION:    none.
**
**  PLATFORM:       Data Types:    
**                      PLATFORM_APLMT_SYSTIME_T
**
**  NOTES:
**  1. Unless explicitly stated otherwise, NONE of the following methods may be 
**     called from interrupt service routines.
**  2. Unless explicitly stated otherwise, NONE of the following methods may be 
**     called before the platform's kernel is running.
**  3. Unless explicitly stated otherwise, all of the following methods ARE 
**     thread-safe.
**  4. For efficency/optimization some methods are 'inlined'.  The inlining
**     is done by using the preprocessor/macros.  The application should
**     treat all methods as function calls and not rely on the fact they may
**     be currently defined as macros.
----------------------------------------------------------------------------*/


#include "apl/types/types.h"            /* For: basic types */



#ifdef __cplusplus
extern "C" {
#endif

/*-------------- TYPES -----------------------------------------------------*/
/** Size/Range of the System Time */
#define AplmtSysTime                       PLATFORM_APLMT_SYSTIME_T


/*-------------- INLINE PLATFORM IMPLEMENTATION ----------------------------*/
#include "platform/sysapi.h"       




/*-------------- PUBLIC/PUBLISHED API --------------------------------------*/
/** This puts the current thread to sleep (i.e. yeild the CPU) for the 
    specified number of milliseconds.   The resolution of the sleep
    timer is platform dependent is not guarantied to have the granularity
    less than or equal to 1 millisecond.  
    NOTES:
        o It should be noted that sleep() method is NOT strictly reserved 
          for multi-threaded applications.  It is perfectly valid/reasonable 
          for a singled-threaded applicaiton to call sleep().  However, it
          does require an underlying OS (unless of course if it is implemented
          as a busy-wait loop). 

    Prototype:
        void Aplmt_sleepMsec(AplmtSysTime delayInMilliseconds);
 */
#define Aplmt_sleepMsec                             _Aplmt_sleepMsec

/** This method returns the system time in millesconds. System time is 
    measured in ticks since power-up.  The resolution of the system timer
    is platform dependent is not guarantied to have the granularity
    less than or equal to 1 millisecond.

    Prototype:
        AplmtSysTime Aplmt_getSystemTimeMsec(void);
 */
#define Aplmt_getSystemTimeMsec                     _Aplmt_getSystemTimeMsec



#ifdef __cplusplus
}
#endif
/*--------------------------------------------------------------------------*/
#endif  /* end _aplmt_system_sysapi_h_ */
