Macros | Functions
rtk/osal.c File Reference
#include <osal.h>
#include <kern.h>
#include <time.h>
#include <sys/time.h>
#include <config.h>
Include dependency graph for rtk/osal.c:

Go to the source code of this file.

Macros

#define timeradd(a, b, result)
 
#define timercmp(a, b, CMP)
 
#define timersub(a, b, result)
 
#define USECS_PER_SEC   1000000
 
#define USECS_PER_TICK   (USECS_PER_SEC / CFG_TICKS_PER_SECOND)
 

Functions

int gettimeofday (struct timeval *tp, void *tzp)
 
ec_timet osal_current_time (void)
 
void osal_free (void *ptr)
 
int osal_gettimeofday (struct timeval *tv, struct timezone *tz)
 
void * osal_malloc (size_t size)
 
int osal_thread_create (void *thandle, int stacksize, void *func, void *param)
 
int osal_thread_create_rt (void *thandle, int stacksize, void *func, void *param)
 
boolean osal_timer_is_expired (osal_timert *self)
 
void osal_timer_start (osal_timert *self, uint32 timeout_usec)
 
int osal_usleep (uint32 usec)
 
void udelay (uint32_t us)
 

Macro Definition Documentation

◆ timeradd

#define timeradd (   a,
  b,
  result 
)
Value:
do { \
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
if ((result)->tv_usec >= 1000000) \
{ \
++(result)->tv_sec; \
(result)->tv_usec -= 1000000; \
} \
} while (0)

Definition at line 16 of file rtk/osal.c.

◆ timercmp

#define timercmp (   a,
  b,
  CMP 
)
Value:
(((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec))

Definition at line 12 of file rtk/osal.c.

◆ timersub

#define timersub (   a,
  b,
  result 
)
Value:
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
if ((result)->tv_usec < 0) { \
--(result)->tv_sec; \
(result)->tv_usec += 1000000; \
} \
} while (0)

Definition at line 26 of file rtk/osal.c.

◆ USECS_PER_SEC

#define USECS_PER_SEC   1000000

Definition at line 36 of file rtk/osal.c.

◆ USECS_PER_TICK

#define USECS_PER_TICK   (USECS_PER_SEC / CFG_TICKS_PER_SECOND)

Definition at line 37 of file rtk/osal.c.

Function Documentation

◆ gettimeofday()

int gettimeofday ( struct timeval *  tp,
void *  tzp 
)

Definition at line 50 of file rtk/osal.c.

◆ osal_current_time()

ec_timet osal_current_time ( void  )

Definition at line 77 of file rtk/osal.c.

◆ osal_free()

void osal_free ( void *  ptr)

Definition at line 122 of file rtk/osal.c.

◆ osal_gettimeofday()

int osal_gettimeofday ( struct timeval *  tv,
struct timezone *  tz 
)

Definition at line 72 of file rtk/osal.c.

◆ osal_malloc()

void* osal_malloc ( size_t  size)

Definition at line 117 of file rtk/osal.c.

◆ osal_thread_create()

int osal_thread_create ( void *  thandle,
int  stacksize,
void *  func,
void *  param 
)

Definition at line 127 of file rtk/osal.c.

◆ osal_thread_create_rt()

int osal_thread_create_rt ( void *  thandle,
int  stacksize,
void *  func,
void *  param 
)

Definition at line 137 of file rtk/osal.c.

◆ osal_timer_is_expired()

boolean osal_timer_is_expired ( osal_timert self)

Definition at line 103 of file rtk/osal.c.

◆ osal_timer_start()

void osal_timer_start ( osal_timert self,
uint32  timeout_usec 
)

Definition at line 88 of file rtk/osal.c.

◆ osal_usleep()

int osal_usleep ( uint32  usec)
inline

Definition at line 66 of file rtk/osal.c.

◆ udelay()

void udelay ( uint32_t  us)

Definition at line 44 of file rtk/osal.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49