Neonode zForce(TM) SDK
OsAbstractionLayer.h
Go to the documentation of this file.
1 
12 #if !defined(ZFORCE_OSABSTRACTIONLAYER_H) && !defined(CONTAINS_OSABSTRACTIONLAYER)
13 
14 #ifndef ZFORCECOMMON_H
15  #error Please include "zForceCommon.h" before this file.
16 #endif // ZFORCECOMMON_H
17 
18 typedef void zForceMutex;
19 typedef void zForceSemaphore;
20 typedef void zForceThread;
21 
30 {
32  void ( * EntryPoint)(void *);
33  void * Arguments;
34 };
35 
44 {
45 #endif // !defined(ZFORCE_OSABSTRACTIONLAYER_H) && !defined(CONTAINS_OSABSTRACTIONLAYER)
46 #if !defined(ZFORCE_OSABSTRACTIONLAYER_H) || defined(CONTAINS_OSABSTRACTIONLAYER)
47 
60  void * ( * Malloc)(size_t size);
61 
71  void ( * Free)(void * memoryPointer);
72 
87  void * ( * Realloc)(void * memoryPointer, size_t size);
88 
103  void * ( * MallocWithPattern)(size_t size, uint8_t pattern);
104 
118  bool ( * InitializeMutex)(zForceMutex ** zForceMutex);
119 
133  bool ( * LockMutex)(zForceMutex * zForceMutex);
134 
148  bool ( * UnlockMutex)(zForceMutex * zForceMutex);
149 
163  bool ( * DestroyMutex)(zForceMutex * zForceMutex);
164 
184  bool ( * InitializeSemaphore)
185  (zForceSemaphore ** zForceSemaphore, uint32_t initialValue);
186 
204  bool ( * WaitForSemaphore)(zForceSemaphore * zForceSemaphore,
205  uint32_t timeoutMs);
206 
221  bool ( * IncrementSemaphore)(zForceSemaphore * zForceSemaphore);
222 
237  bool ( * DestroySemaphore)(zForceSemaphore * zForceSemaphore);
238 
249  uint64_t ( * GetTimeMilliSeconds)(void);
250 
267  bool ( * CreateThread)(zForceThread ** zForceThread,
268  void ( * entryPoint)(void *),
269  void * arguments);
270 
285  bool ( * WaitForThreadExit)(zForceThread * zForceThread);
286 
297  void ( * Sleep)(uint32_t milliSeconds);
298 #endif // !defined(ZFORCE_OSABSTRACTIONLAYER_H) || defined(CONTAINS_OSABSTRACTIONLAYER)
299 #if !defined(ZFORCE_OSABSTRACTIONLAYER_H) && !defined(CONTAINS_OSABSTRACTIONLAYER)
300 };
301 
302 #ifdef __cplusplus
303 extern "C"
304 {
305 #endif // __cplusplus
306 
307 DLLINTERNAL bool OsAbstractionLayer_Initialize (OsAbstractionLayer * osAbstractionLayer,
308  OsAbstractionLayer * userSuppliedOsAbstractionLayer);
309 
310 DLLINTERNAL void OsAbstractionLayer_ThreadWrapper (zForceThreadWrapper * wrapper);
311 
312 #ifdef __cplusplus
313 }
314 #endif // __cplusplus
315 
316 #define ZFORCE_OSABSTRACTIONLAYER_H
317 #endif // !defined(ZFORCE_OSABSTRACTIONLAYER_H) && !defined(CONTAINS_OSABSTRACTIONLAYER)
318 
void zForceMutex
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:18
void * Arguments
Arguments for the entry function.
Definition: OsAbstractionLayer.h:33
void(* EntryPoint)(void *)
Entry function for the thread.
Definition: OsAbstractionLayer.h:32
Overrides for OS Functions.
Definition: OsAbstractionLayer.h:43
void zForceSemaphore
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:19
Wrapper for threads.
Definition: OsAbstractionLayer.h:29
void zForceThread
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:20
zForceThread * zForceThread
Thread pointer.
Definition: OsAbstractionLayer.h:31