Neonode zForce(TM) SDK

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

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
25 typedef struct zForceThreadWrapper zForceThreadWrapper;
29 struct zForceThreadWrapper
30 {
31 zForceThread * zForceThread;
32 void ( * EntryPoint)(void *);
33 void * Arguments;
34 };
35
39 typedef struct OsAbstractionLayer OsAbstractionLayer;
43 struct OsAbstractionLayer
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
zForceMutex
void zForceMutex
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:18
zForceThreadWrapper::Arguments
void * Arguments
Arguments for the entry function.
Definition: OsAbstractionLayer.h:33
zForceThreadWrapper::EntryPoint
void(* EntryPoint)(void *)
Entry function for the thread.
Definition: OsAbstractionLayer.h:32
OsAbstractionLayer
Overrides for OS Functions.
Definition: OsAbstractionLayer.h:43
zForceSemaphore
void zForceSemaphore
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:19
zForceThreadWrapper
Wrapper for threads.
Definition: OsAbstractionLayer.h:29
zForceThread
void zForceThread
Typecast to underlying (system) type.
Definition: OsAbstractionLayer.h:20
zForceThreadWrapper::zForceThread
zForceThread * zForceThread
Thread pointer.
Definition: OsAbstractionLayer.h:31