Classes | Macros | Typedefs | Functions | Variables
macosx/fosi.h File Reference
#include <stdio.h>
#include <pthread.h>
#include <mach/mach_init.h>
#include <mach/task.h>
#include <errno.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <mach/semaphore.h>
Include dependency graph for macosx/fosi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RTOS_TASK
 

Macros

#define _DARWIN_C_SOURCE
 
#define CLOCK_REALTIME   0
 
#define HAVE_FOSI_API
 
#define ORO_SCHED_OTHER   SCHED_OTHER /** Posix normal scheduler */
 
#define ORO_SCHED_RT   SCHED_FIFO /** Posix FIFO scheduler */
 
#define ORO_WAIT_ABS
 
#define ORO_WAIT_REL
 
#define rtos_printf   printf
 

Typedefs

typedef long long NANO_TIME
 
typedef struct rt_mutex_impl_t rt_mutex_impl_t
 
typedef rt_mutex_impl_trt_mutex_t
 
typedef semaphore_t rt_sem_t
 
typedef long long TICK_TIME
 
typedef struct timespec TIME_SPEC
 

Functions

static int clock_gettime (int clk_id, struct timespec *tp)
 
static long long nano2ticks (long long nano)
 
static void rtos_disable_rt_warning ()
 
static void rtos_enable_rt_warning ()
 
static NANO_TIME rtos_get_time_ns (void)
 
static NANO_TIME rtos_get_time_ticks ()
 
int rtos_mutex_destroy (rt_mutex_t *m)
 
int rtos_mutex_init (rt_mutex_t *m)
 
int rtos_mutex_lock (rt_mutex_t *m)
 
int rtos_mutex_unlock (rt_mutex_t *m)
 
static int rtos_nanosleep (const TIME_SPEC *rqtp, TIME_SPEC *rmtp)
 
static int rtos_sem_destroy (rt_sem_t *m)
 
static int rtos_sem_init (rt_sem_t *m, int value)
 
static int rtos_sem_signal (rt_sem_t *m)
 
static int rtos_sem_trywait (rt_sem_t *m)
 
static int rtos_sem_wait (rt_sem_t *m)
 
static int rtos_sem_wait_timed (rt_sem_t *m, NANO_TIME delay)
 
static int rtos_sem_wait_until (rt_sem_t *m, NANO_TIME abs_time)
 
static long long ticks2nano (long long count)
 
static TIME_SPEC ticks2timespec (TICK_TIME hrt)
 

Variables

static const NANO_TIME InfiniteNSecs = LLONG_MAX
 
static const double InfiniteSeconds = DBL_MAX
 
static const TICK_TIME InfiniteTicks = LLONG_MAX
 

Macro Definition Documentation

#define _DARWIN_C_SOURCE

Definition at line 40 of file macosx/fosi.h.

#define CLOCK_REALTIME   0

Definition at line 101 of file macosx/fosi.h.

#define HAVE_FOSI_API

Definition at line 42 of file macosx/fosi.h.

#define ORO_SCHED_OTHER   SCHED_OTHER /** Posix normal scheduler */

Definition at line 88 of file macosx/fosi.h.

#define ORO_SCHED_RT   SCHED_FIFO /** Posix FIFO scheduler */

Definition at line 87 of file macosx/fosi.h.

#define ORO_WAIT_ABS
Value:
0

Definition at line 68 of file macosx/fosi.h.

#define ORO_WAIT_REL
Value:
1

Definition at line 70 of file macosx/fosi.h.

#define rtos_printf   printf

Definition at line 279 of file macosx/fosi.h.

Typedef Documentation

typedef long long NANO_TIME

Definition at line 61 of file macosx/fosi.h.

Definition at line 262 of file macosx/fosi.h.

Definition at line 264 of file macosx/fosi.h.

typedef semaphore_t rt_sem_t

Definition at line 169 of file macosx/fosi.h.

typedef long long TICK_TIME

Definition at line 62 of file macosx/fosi.h.

typedef struct timespec TIME_SPEC

Definition at line 97 of file macosx/fosi.h.

Function Documentation

static int clock_gettime ( int  clk_id,
struct timespec *  tp 
)
inlinestatic

Definition at line 102 of file macosx/fosi.h.

static long long nano2ticks ( long long  nano)
inlinestatic

Definition at line 153 of file macosx/fosi.h.

static void rtos_disable_rt_warning ( void  )
inlinestatic

Definition at line 274 of file macosx/fosi.h.

static void rtos_enable_rt_warning ( void  )
inlinestatic

Definition at line 270 of file macosx/fosi.h.

static NANO_TIME rtos_get_time_ns ( void  )
inlinestatic

Definition at line 126 of file macosx/fosi.h.

static NANO_TIME rtos_get_time_ticks ( void  )
inlinestatic

This function should return ticks, but we use ticks == nsecs in userspace

Definition at line 142 of file macosx/fosi.h.

int rtos_mutex_destroy ( rt_mutex_t m)

Definition at line 305 of file macosx/fosi_internal.cpp.

int rtos_mutex_init ( rt_mutex_t m)

Definition at line 298 of file macosx/fosi_internal.cpp.

int rtos_mutex_lock ( rt_mutex_t m)

Definition at line 314 of file macosx/fosi_internal.cpp.

int rtos_mutex_unlock ( rt_mutex_t m)

Definition at line 322 of file macosx/fosi_internal.cpp.

static int rtos_nanosleep ( const TIME_SPEC rqtp,
TIME_SPEC rmtp 
)
inlinestatic

Definition at line 147 of file macosx/fosi.h.

static int rtos_sem_destroy ( rt_sem_t m)
inlinestatic

Definition at line 176 of file macosx/fosi.h.

static int rtos_sem_init ( rt_sem_t m,
int  value 
)
inlinestatic

Definition at line 171 of file macosx/fosi.h.

static int rtos_sem_signal ( rt_sem_t m)
inlinestatic

Definition at line 181 of file macosx/fosi.h.

static int rtos_sem_trywait ( rt_sem_t m)
inlinestatic

Definition at line 207 of file macosx/fosi.h.

static int rtos_sem_wait ( rt_sem_t m)
inlinestatic

Definition at line 186 of file macosx/fosi.h.

static int rtos_sem_wait_timed ( rt_sem_t m,
NANO_TIME  delay 
)
inlinestatic

Definition at line 191 of file macosx/fosi.h.

static int rtos_sem_wait_until ( rt_sem_t m,
NANO_TIME  abs_time 
)
inlinestatic
Todo:
avoid race condition where arg_time < now

Definition at line 212 of file macosx/fosi.h.

static long long ticks2nano ( long long  count)
inlinestatic

Definition at line 158 of file macosx/fosi.h.

static TIME_SPEC ticks2timespec ( TICK_TIME  hrt)
inlinestatic

Definition at line 118 of file macosx/fosi.h.

Variable Documentation

const NANO_TIME InfiniteNSecs = LLONG_MAX
static

Definition at line 65 of file macosx/fosi.h.

const double InfiniteSeconds = DBL_MAX
static

Definition at line 66 of file macosx/fosi.h.

const TICK_TIME InfiniteTicks = LLONG_MAX
static

Definition at line 64 of file macosx/fosi.h.



rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:38