Neonode zForce(TM) SDK
OsAbstractionLayer.h
Go to the documentation of this file.
1 
12 #ifndef ZFORCE_OSABSTRACTIONLAYER_H
13 #define ZFORCE_OSABSTRACTIONLAYER_H
14 
15 #ifndef ZFORCECOMMON_H
16  #error Please include "zForceCommon.h" before this file.
17 #endif // ZFORCECOMMON_H
18 
19 typedef void zForceMutex;
20 typedef void zForceSemaphore;
21 typedef void zForceThread;
22 
31 {
33  void ( * EntryPoint)(void *);
34  void * Arguments;
35 };
36 
45 {
59  void * ( * Malloc)(size_t size);
60 
70  void ( * Free)(void * memoryPointer);
71 
86  void * ( * Realloc)(void * memoryPointer, size_t size);
87 
102  void * ( * MallocWithPattern)(size_t size, uint8_t pattern);
103 
117  bool ( * InitializeMutex)(zForceMutex ** zForceMutex);
118 
132  bool ( * LockMutex)(zForceMutex * zForceMutex);
133 
147  bool ( * UnlockMutex)(zForceMutex * zForceMutex);
148 
162  bool ( * DestroyMutex)(zForceMutex * zForceMutex);
163 
183  bool ( * InitializeSemaphore)
184  (zForceSemaphore ** zForceSemaphore, uint32_t initialValue);
185 
203  bool ( * WaitForSemaphore)(zForceSemaphore * zForceSemaphore,
204  uint32_t timeoutMs);
205 
220  bool ( * IncrementSemaphore)(zForceSemaphore * zForceSemaphore);
221 
236  bool ( * DestroySemaphore)(zForceSemaphore * zForceSemaphore);
237 
248  uint64_t ( * GetTimeMilliSeconds)(void);
249 
266  bool ( * CreateThread)(zForceThread ** zForceThread,
267  void ( * entryPoint)(void *),
268  void * arguments);
269 
284  bool ( * WaitForThreadExit)(zForceThread * zForceThread);
285 
296  void ( * Sleep)(uint32_t milliSeconds);
297 };
298 
299 DLLINTERNAL bool OsAbstractionLayer_Initialize (
300  OsAbstractionLayer * osAbstractionLayer,
301  OsAbstractionLayer * userSuppliedOsAbstractionLayer);
302 
303 DLLINTERNAL void OsAbstractionLayer_ThreadWrapper (
304  zForceThreadWrapper * wrapper);
305 
306 #endif // ZFORCE_OSABSTRACTIONLAYER_H
307 
void zForceMutex
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:19
void * Arguments
Arguments for the entry function.
Definition: OsAbstractionLayer.h:34
void(* EntryPoint)(void *)
Entry function for the thread.
Definition: OsAbstractionLayer.h:33
Overrides for OS Functions.
Definition: OsAbstractionLayer.h:44
void zForceSemaphore
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:20
Wrapper for threads.
Definition: OsAbstractionLayer.h:30
void zForceThread
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:21
zForceThread * zForceThread
Thread pointer.
Definition: OsAbstractionLayer.h:32