HbbTv  17.9.0
Open source HBBTV engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
hbbtv_sif_os.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2014 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
26 /* pre-processor mechanism so multiple inclusions don't cause compilation error*/
27 
28 #ifndef _HBBTV_SIF_OS_H
29 
30 #define _HBBTV_SIF_OS_H
31 
32 #include "techtype.h"
33 
34 /*---Constant and macro definitions for public use-----------------------------*/
35 #define HBBTV_OS_TIMEOUT_NOW 0
36 #define HBBTV_OS_TIMEOUT_NEVER 0xffff
37 
38 /*---Enumerations for public use-----------------------------------------------*/
39 
40 /*---Global type defs for public use-------------------------------------------*/
41 
42 /*---Global Function prototypes for public use---------------------------------*/
43 
49 void* HBBTV_OSAlloc(U32BIT size);
50 
55 void HBBTV_OSFree(void *ptr);
56 
61 void* HBBTV_OSCreateMutex(void);
62 
67 void HBBTV_OSDeleteMutex(void *mutex);
68 
73 void HBBTV_OSMutexLock(void *mutex);
74 
79 void HBBTV_OSMutexUnlock(void *mutex);
80 
86 void* HBBTV_OSCreateCountSemaphore(U32BIT value);
87 
92 void HBBTV_OSDeleteSemaphore(void *semaphore);
93 
98 void HBBTV_OSSemaphoreWait(void *semaphore);
99 
106 BOOLEAN HBBTV_OSSemaphoreWaitTimeout(void *semaphore, U16BIT timeout);
107 
112 void HBBTV_OSSemaphoreSignal(void *semaphore);
113 
123 void* HBBTV_OSCreateTask(void (*function)(void *), void *param, U32BIT stack, U8BIT priority,
124  U8BIT *name);
125 
130 void HBBTV_OSDestroyTask(void *task_id);
131 
136 void HBBTV_OSTaskDelay(U16BIT time);
137 
142 U32BIT HBBTV_OSGetClockMilliseconds(void);
143 
148 U32BIT HBBTV_OSGetTimeNow(void);
149 
156 void* HBBTV_OSCreateQueue(U16BIT msg_size, U16BIT msg_max);
157 
162 void HBBTV_OSDeleteQueue(void *queue);
163 
172 BOOLEAN HBBTV_OSReadQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout);
173 
182 BOOLEAN HBBTV_OSWriteQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout);
183 
184 #endif /* _HBBTV_SIF_OS_H */
void HBBTV_OSTaskDelay(U16BIT time)
Suspends current task for given period.
void HBBTV_OSDestroyTask(void *task_id)
Destroys the specified task.
void HBBTV_OSSemaphoreSignal(void *semaphore)
Clears specified semaphore.
void HBBTV_OSMutexUnlock(void *mutex)
Unlocks the specified mutex.
void * HBBTV_OSCreateQueue(U16BIT msg_size, U16BIT msg_max)
Creates a new message queue.
void HBBTV_OSFree(void *ptr)
Releases previously allocated memory.
void * HBBTV_OSCreateTask(void(*function)(void *), void *param, U32BIT stack, U8BIT priority, U8BIT *name)
Creates a new task.
void * HBBTV_OSCreateCountSemaphore(U32BIT value)
Creates a new counting semaphore, with the count set to value.
void * HBBTV_OSAlloc(U32BIT size)
Allocates the specified number of bytes.
void HBBTV_OSDeleteMutex(void *mutex)
Deletes an exisiting mutex.
BOOLEAN HBBTV_OSSemaphoreWaitTimeout(void *semaphore, U16BIT timeout)
Waits a specified timeout period for a specified semaphore to be cleared.
void HBBTV_OSMutexLock(void *mutex)
Locks the specified mutex.
U32BIT HBBTV_OSGetClockMilliseconds(void)
Returns the number of milliseconds since the system booted.
U32BIT HBBTV_OSGetTimeNow(void)
Returns the current time.
BOOLEAN HBBTV_OSWriteQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
Writes a message to specified queue.
System Wide Global Technical Data Type Definitions.
void HBBTV_OSDeleteSemaphore(void *semaphore)
Deletes an exisiting semaphore.
BOOLEAN HBBTV_OSReadQueue(void *queue, void *msg, U16BIT msg_size, U16BIT timeout)
Reads a message from specified queue.
void * HBBTV_OSCreateMutex(void)
Creates a new mutex.
void HBBTV_OSSemaphoreWait(void *semaphore)
Waits for specified semaphore to be cleared.
void HBBTV_OSDeleteQueue(void *queue)
Deletes the specified message queue.