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 {
58  void * ( * Malloc)(size_t size);
59 
69  void ( * Free)(void * memoryPointer);
70 
82  void * ( * Realloc)(void * memoryPointer, size_t size);
83 
97  bool ( * InitializeMutex)(zForceMutex ** zForceMutex);
98 
112  bool ( * LockMutex)(zForceMutex * zForceMutex);
113 
127  bool ( * UnlockMutex)(zForceMutex * zForceMutex);
128 
142  bool ( * DestroyMutex)(zForceMutex * zForceMutex);
143 
163  bool ( * InitializeSemaphore)
164  (zForceSemaphore ** zForceSemaphore, uint32_t initialValue);
165 
183  bool ( * WaitForSemaphore)(zForceSemaphore * zForceSemaphore,
184  uint32_t timeoutMs);
185 
200  bool ( * IncrementSemaphore)(zForceSemaphore * zForceSemaphore);
201 
216  bool ( * DestroySemaphore)(zForceSemaphore * zForceSemaphore);
217 
228  uint64_t ( * GetTimeMilliSeconds)(void);
229 
246  bool ( * CreateThread)(zForceThread ** zForceThread,
247  void ( * entryPoint)(void *),
248  void * arguments);
249 
264  bool ( * WaitForThreadExit)(zForceThread * zForceThread);
265 
276  void ( * Sleep)(uint32_t milliSeconds);
277 };
278 
279 DLLINTERNAL bool OsAbstractionLayer_Initialize (
280  OsAbstractionLayer * osAbstractionLayer,
281  OsAbstractionLayer * userSuppliedOsAbstractionLayer);
282 
283 DLLINTERNAL void OsAbstractionLayer_ThreadWrapper (
284  zForceThreadWrapper * wrapper);
285 
286 #endif // ZFORCE_OSABSTRACTIONLAYER_H
287 
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