diff options
Diffstat (limited to 'domx/mm_osal/inc')
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_error.h | 175 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_events.h | 81 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_interfaces.h | 72 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_memory.h | 105 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_mutex.h | 71 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_osal.h | 68 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_pipes.h | 89 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_semaphores.h | 79 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_task.h | 89 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_trace.h | 217 | ||||
-rwxr-xr-x | domx/mm_osal/inc/timm_osal_types.h | 124 |
11 files changed, 1170 insertions, 0 deletions
diff --git a/domx/mm_osal/inc/timm_osal_error.h b/domx/mm_osal/inc/timm_osal_error.h new file mode 100755 index 0000000..37b20e7 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_error.h @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_timm_osal_error.h +* The osal header file defines the error codes +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_ERROR_H_ +#define _TIMM_OSAL_ERROR_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#include "timm_osal_types.h" + +/** A unique ID for each component*/ + typedef TIMM_OSAL_U16 TIMM_OSAL_COMPID; + +/** TIMM_OSAL_ERROR is a 32 bits unsigned integer. + * Each error code can be broken up into three fields as given below: + * - Type of error (2 bits): NO_ERROR: 00, WARNING: 01, FATAL_ERROR: 10 + * - Component ID (14 bits): A unique ID which indicates which of the component generated the error + * - Error ID (16 bits): The specific error generated by a component + */ + typedef TIMM_OSAL_U32 TIMM_OSAL_ERRORTYPE; + +#define TIMM_OSAL_OK 0 +#define TIMM_OSAL_WAR 1 +#define TIMM_OSAL_ERR 2 + + +/* Macro to process TIMM_OSAL_ERROR */ + +/** This macro tests if the provided M4OSA_ERR is a warning or not*/ +#define TIMM_OSAL_IS_WARNING(error) ((((error)>>30) == TIMM_OSAL_WAR) ? 1:0) + +/** This macro tests if the provided M4OSA_ERR is a fatal error or not*/ +#define TIMM_OSAL_IS_ERROR(error) ((((error)>>30) == TIMM_OSAL_ERR) ? 1:0) + +/** This macro returns an error code accroding to the 3 provided fields: + * @arg Type: (IN) [TIMM_OSAL_U32] Type of error to put in the error code + * @arg compID: (IN) [TIMM_OSAL_U32] CompID to put in the error code + * @arg errorID: (IN) [TIMM_OSAL_U32] ErrorID to put in the error code*/ +#define TIMM_OSAL_ERR_CREATE(type, compID, errorID)\ + (((type)<<30)+(((compID)&0x003FFF)<<16)+((errorID)&0x00FFFF)) + +/** This macro extracts the 3 fields from the error: + * @arg error: (IN) [TIMM_OSAL_ERRORTYPE] Error code + * @arg type: (OUT) [TIMM_OSAL_U32] Type of error in the error code + * @arg compID: (OUT) [TIMM_OSAL_U32] CompID to put in the error code + * @arg errorID: (OUT) [TIMM_OSAL_U32] ErrorID to put in the error code*/ +#define TIMM_OSAL_ERR_SPLIT(error, type, compID, errorID)\ + { type=(TIMM_OSAL_U32)((error)>>30);\ + compID=(TIMM_OSAL_U32)(((error)>>16)&0x003FFF);\ + (TIMM_OSAL_U32)(errorID=(error)&0x00FFFF); } + +/* Component IDs */ +#define TIMM_OSAL_COMP_GENERAL 0x00 +#define TIMM_OSAL_COMP_MEMORY 0x01 +#define TIMM_OSAL_COMP_PIPES 0x02 +#define TIMM_OSAL_COMP_EVENTS 0x03 +#define TIMM_OSAL_COMP_SEMAPHORES 0x04 +#define TIMM_OSAL_COMP_TASK 0x05 + +/* Definition of common error codes */ +/** there is no error*/ +#define TIMM_OSAL_ERR_NONE ((TIMM_OSAL_ERRORTYPE) 0x00000000) + + +/** There is no more memory available*/ +#define TIMM_OSAL_ERR_ALLOC ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000001)) +#define TIMM_OSAL_ERR_OUT_OF_RESOURCE ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000002)) + +/** Time out */ +#define TIMM_OSAL_WAR_TIMEOUT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_WAR,TIMM_OSAL_COMP_GENERAL,0x000003)) +#define TIMM_OSAL_ERR_PARAMETER ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000004)) +#define TIMM_OSAL_ERR_NOT_READY ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000005)) +#define TIMM_OSAL_ERR_OMX ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000006)) +#define TIMM_OSAL_ERR_PIPE_FULL ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000007)) +#define TIMM_OSAL_ERR_PIPE_EMPTY ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000008)) +#define TIMM_OSAL_ERR_PIPE_DELETED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000009)) +#define TIMM_OSAL_ERR_PIPE_RESET ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000A)) +#define TIMM_OSAL_ERR_GROUP_DELETED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000B)) +#define TIMM_OSAL_ERR_UNKNOWN ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000C)) + + +#define TIMM_OSAL_ERR_SEM_CREATE_FAILED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_SEMAPHORE,0x000001)) + +/*Added during Linux Porting*/ +#define TIMM_OSAL_ERR_NO_PERMISSIONS ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000D)) +#define TIMM_OSAL_ERR_RESOURCE_EXISTS ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000E)) +#define TIMM_OSAL_ERR_RESOURCE_REMOVED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000F)) +#define TIMM_OSAL_ERR_SYSTEM_LIMIT_EXCEEDED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000010)) +#define TIMM_OSAL_ERR_NOT_SUPPORTED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000011)) +#define TIMM_OSAL_ERR_SIGNAL_CAUGHT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000012)) +#define TIMM_OSAL_ERR_TIMEOUT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000013)) + + + +#define TIMM_OSAL_COMP_MSG_Q 0x06 +#define TIMM_OSAL_ERR_MSG_SIZE_MISMATCH ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_MSG_Q,0x000001)) +#define TIMM_OSAL_ERR_MSG_TYPE_NOT_FOUND ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_MSG_Q,0x000002)) + + +/* +#define GOTO_EXIT_IF(_Cond,_ErrorCode) { \ + if ((_Cond)) { \ + status = _ErrorCode; \ + printf ("Error :: %s : %s : %d :: Exiting because : %s\n", \ + __FILE__, __FUNCTION__, __LINE__, #_Cond); \ + goto EXIT; \ + } \ +} +*/ + +#define SWITCH_CASE(_Case, _ErrCode, _ErrMsg)\ + case _Case:\ + TIMM_OSAL_Error(_ErrMsg);\ + bReturnStatus = _ErrCode;\ + break; + +#define SWITCH_DEFAULT_CASE(_ErrCode, _ErrMsg )\ + default:\ + TIMM_OSAL_Error(_ErrMsg);\ + bReturnStatus = _ErrCode;\ + break; + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /*_TIMM_OSAL_ERROR_H_*/ diff --git a/domx/mm_osal/inc/timm_osal_events.h b/domx/mm_osal/inc/timm_osal_events.h new file mode 100755 index 0000000..20a4d84 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_events.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_defines.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_EVENTS_H_ +#define _TIMM_OSAL_EVENTS_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#include "timm_osal_types.h" + + typedef enum TIMM_OSAL_EVENT_OPERATION + { + TIMM_OSAL_EVENT_AND, + TIMM_OSAL_EVENT_AND_CONSUME, + TIMM_OSAL_EVENT_OR, + TIMM_OSAL_EVENT_OR_CONSUME + } TIMM_OSAL_EVENT_OPERATION; + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventCreate(TIMM_OSAL_PTR * pEvents); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventDelete(TIMM_OSAL_PTR pEvents); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventSet(TIMM_OSAL_PTR pEvents, + TIMM_OSAL_U32 uEventFlag, TIMM_OSAL_EVENT_OPERATION eOperation); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventRetrieve(TIMM_OSAL_PTR pEvents, + TIMM_OSAL_U32 uRequestedEvents, + TIMM_OSAL_EVENT_OPERATION eOperation, + TIMM_OSAL_U32 * pRetrievedEvents, TIMM_OSAL_U32 uTimeOut); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_EVENTS_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_interfaces.h b/domx/mm_osal/inc/timm_osal_interfaces.h new file mode 100755 index 0000000..dd3fd81 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_interfaces.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_memory.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_INTERFACES_H_ +#define _TIMM_OSAL_INTERFACES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* External interface +*******************************************************************************/ +#include "timm_osal_types.h" +#include "timm_osal_error.h" +#include "timm_osal_memory.h" +#include "timm_osal_pipes.h" +#include "timm_osal_events.h" +#include "timm_osal_semaphores.h" +#include "timm_osal_mutex.h" +#include "timm_osal_task.h" +#include "timm_osal_osal.h" + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_INTERFACES_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_memory.h b/domx/mm_osal/inc/timm_osal_memory.h new file mode 100755 index 0000000..ed21636 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_memory.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_memory.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_MEMORY_H_ +#define _TIMM_OSAL_MEMORY_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Includes +*******************************************************************************/ + +#include "timm_osal_types.h" +#include "timm_osal_error.h" + + +/* Enumeration Flag for Memory Segmenation Id */ + typedef enum TIMMOSAL_MEM_SEGMENTID + { + + TIMMOSAL_MEM_SEGMENT_EXT = 0, + TIMMOSAL_MEM_SEGMENT_INT, + TIMMOSAL_MEM_SEGMENT_UNCACHED + } TIMMOSAL_MEM_SEGMENTID; + + +/******************************************************************************* +* External interface +*******************************************************************************/ + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateMemoryPool(void); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteMemoryPool(void); + + TIMM_OSAL_PTR TIMM_OSAL_Malloc(TIMM_OSAL_U32 size, + TIMM_OSAL_BOOL bBlockContiguous, TIMM_OSAL_U32 unBlockAlignment, + TIMMOSAL_MEM_SEGMENTID tMemSegId); + + void TIMM_OSAL_Free(TIMM_OSAL_PTR pData); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memset(TIMM_OSAL_PTR pBuffer, + TIMM_OSAL_U8 uValue, TIMM_OSAL_U32 uSize); + + TIMM_OSAL_S32 TIMM_OSAL_Memcmp(TIMM_OSAL_PTR pBuffer1, + TIMM_OSAL_PTR pBuffer2, TIMM_OSAL_U32 uSize); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memcpy(TIMM_OSAL_PTR pBufDst, + TIMM_OSAL_PTR pBufSrc, TIMM_OSAL_U32 uSize); + + TIMM_OSAL_U32 TIMM_OSAL_GetMemCounter(void); + +#define TIMM_OSAL_MallocExtn(size, bBlockContiguous, unBlockAlignment, tMemSegId, hHeap) \ + TIMM_OSAL_Malloc(size, bBlockContiguous, unBlockAlignment, tMemSegId ) + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_DEFINES_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_mutex.h b/domx/mm_osal/inc/timm_osal_mutex.h new file mode 100755 index 0000000..1d12c91 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_mutex.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_defines.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_MUTEX_H_ +#define _TIMM_OSAL_MUTEX_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Includes +*******************************************************************************/ + +#include "timm_osal_types.h" + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexCreate(TIMM_OSAL_PTR * pMutex); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexDelete(TIMM_OSAL_PTR pMutex); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexObtain(TIMM_OSAL_PTR pMutex, + TIMM_OSAL_U32 uTimeOut); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexRelease(TIMM_OSAL_PTR pMutex); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_MUTEX_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_osal.h b/domx/mm_osal/inc/timm_osal_osal.h new file mode 100755 index 0000000..a4e0e9e --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_osal.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_osal.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_OSAL_H_ +#define _TIMM_OSAL_OSAL_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Includes +*******************************************************************************/ + +#include "timm_osal_types.h" + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_Init(void); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_Deinit(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_OSAL_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_pipes.h b/domx/mm_osal/inc/timm_osal_pipes.h new file mode 100755 index 0000000..79d7d61 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_pipes.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_defines.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_PIPES_H_ +#define _TIMM_OSAL_PIPES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#include "timm_osal_types.h" + +/* +* Defined for Pipe timeout value +*/ + TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreatePipe(TIMM_OSAL_PTR * pPipe, + TIMM_OSAL_U32 pipeSize, + TIMM_OSAL_U32 messageSize, TIMM_OSAL_U8 isFixedMessage); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeletePipe(TIMM_OSAL_PTR pPipe); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToPipe(TIMM_OSAL_PTR pPipe, + void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToFrontOfPipe(TIMM_OSAL_PTR pPipe, + void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_ReadFromPipe(TIMM_OSAL_PTR pPipe, + void *pMessage, + TIMM_OSAL_U32 size, + TIMM_OSAL_U32 * actualSize, TIMM_OSAL_S32 timeout); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_ClearPipe(TIMM_OSAL_PTR pPipe); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_IsPipeReady(TIMM_OSAL_PTR pPipe); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetPipeReadyMessageCount(TIMM_OSAL_PTR + pPipe, TIMM_OSAL_U32 * count); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_PIPES_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_semaphores.h b/domx/mm_osal/inc/timm_osal_semaphores.h new file mode 100755 index 0000000..86037d7 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_semaphores.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_defines.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_SEMAPHORE_H_ +#define _TIMM_OSAL_SEMAPHORE_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Includes +*******************************************************************************/ + +#include "timm_osal_types.h" + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreCreate(TIMM_OSAL_PTR * + pSemaphore, TIMM_OSAL_U32 uInitCount); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreDelete(TIMM_OSAL_PTR + pSemaphore); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreObtain(TIMM_OSAL_PTR + pSemaphore, TIMM_OSAL_U32 uTimeOut); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreRelease(TIMM_OSAL_PTR + pSemaphore); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreReset(TIMM_OSAL_PTR pSemaphore, + TIMM_OSAL_U32 uInitCount); + TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetSemaphoreCount(TIMM_OSAL_PTR + pSemaphore, TIMM_OSAL_U32 * count); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_SEMAPHORE_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_task.h b/domx/mm_osal/inc/timm_osal_task.h new file mode 100755 index 0000000..6f67a82 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_task.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_task.h +* The osal header file defines +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_TASK_H_ +#define _TIMM_OSAL_TASK_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Includes +*******************************************************************************/ + +#include "timm_osal_types.h" + +/******************************************************************************* +* Tasks +*******************************************************************************/ + +/** +* prototype for the task function +*/ + /*typedef void (*TIMM_OSAL_TaskProc)(TIMM_OSAL_U32 argc, TIMM_OSAL_PTR argv);*//*Nucleus */ + + typedef void *(*TIMM_OSAL_TaskProc) (void *arg); /*Linux */ + + + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateTask(TIMM_OSAL_PTR * pTask, + TIMM_OSAL_TaskProc pFunc, + TIMM_OSAL_U32 uArgc, + TIMM_OSAL_PTR pArgv, + TIMM_OSAL_U32 uStackSize, + TIMM_OSAL_U32 uPriority, TIMM_OSAL_S8 * pName); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteTask(TIMM_OSAL_PTR pTask); + + TIMM_OSAL_ERRORTYPE TIMM_OSAL_SleepTask(TIMM_OSAL_U32 mSec); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_TASK_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_trace.h b/domx/mm_osal/inc/timm_osal_trace.h new file mode 100755 index 0000000..412c5a9 --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_trace.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_trace.h +* The timm_osal_types header file defines the primative osal type definitions. +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_TRACES_H_ +#define _TIMM_OSAL_TRACES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/******************************************************************************* +* Traces +*******************************************************************************/ + + +/****************************************************************************** +* Debug Trace defines +******************************************************************************/ + + typedef enum TIMM_OSAL_TRACEGRP_TYPE + { + TIMM_OSAL_TRACEGRP_SYSTEM = 1, + TIMM_OSAL_TRACEGRP_OMXBASE = (1 << 1), + TIMM_OSAL_TRACEGRP_DOMX = (1 << 2), + TIMM_OSAL_TRACEGRP_OMXVIDEOENC = (1 << 3), + TIMM_OSAL_TRACEGRP_OMXVIDEODEC = (1 << 4), + TIMM_OSAL_TRACEGRP_OMXCAM = (1 << 5), + TIMM_OSAL_TRACEGRP_OMXIMGDEC = (1 << 6), + TIMM_OSAL_TRACEGRP_DRIVERS = (1 << 7), + TIMM_OSAL_TRACEGRP_SIMCOPALGOS = (1 << 8) + } TIMM_OSAL_TRACEGRP; + + typedef enum TIMM_OSAL_TRACE_LEVEL_TYPE + { + TIMM_OSAL_TRACE_LEVEL_ERROR = 1, + TIMM_OSAL_TRACE_LEVEL_WARNING = 2, + TIMM_OSAL_TRACE_LEVEL_PROFILING = 3, + TIMM_OSAL_TRACE_LEVEL_INFO = 4, + TIMM_OSAL_TRACE_LEVEL_DEBUG = 5, + TIMM_OSAL_TRACE_LEVEL_ENTERING = 6, + TIMM_OSAL_TRACE_LEVEL_EXITING = TIMM_OSAL_TRACE_LEVEL_ENTERING + } TIMM_OSAL_TRACE_LEVEL; + + +/** +* The OSAL debug trace level can be set at runtime by defining the environment +* variable TIMM_OSAL_DEBUG_TRACE_LEVEL=<Level>. The default level is 1 +* The debug levels are: +* Level 0 - No trace +* Level 1 - Error [Errors] +* Level 2 - Warning [Warnings that are useful to know about] +* Level 3 - Profiling [performance analysis trace that must not impact use case perf] +* Level 4 - Info [General information] +* Level 5 - Debug [most-commonly used statement for us developers] +* Level 6 - Trace ["ENTERING <function>" and "EXITING <function>" statements] +* +* Example: if TIMM_OSAL_DEBUG_TRACE_LEVEL=3, then level 1,2 and 3 traces messages +* are enabled. +*/ + +/** + * Information about the trace location/type, passed as a single pointer to + * internal trace function. Not part of the public API + */ + typedef struct + { + const char *file; + const char *function; + const int line; + const short level; + const short tracegrp; /* TIMM_OSAL_TRACEGRP */ + } __TIMM_OSAL_TRACE_LOCATION; + + +/** + * Trace level update function. Updates trace level if env variable + * or Android property is set. Env variable has precedence over it + */ + void TIMM_OSAL_UpdateTraceLevel(void); + +/** + * Trace implementation function. Not part of public API. Default + * implementation uses printf(), but you can use LD_PRELOAD to plug in + * alternative trace system at runtime. + */ + void __TIMM_OSAL_TraceFunction(const __TIMM_OSAL_TRACE_LOCATION * loc, + const char *fmt, ...); + +/** + * Internal trace macro. Not part of public API. + */ +#define __TIMM_OSAL_Trace(level, tracegrp, fmt, ...) \ + do { \ + static const __TIMM_OSAL_TRACE_LOCATION loc = { \ + __FILE__, __FUNCTION__, __LINE__, (level), (tracegrp) \ + }; \ + __TIMM_OSAL_TraceFunction(&loc, fmt "\n", ##__VA_ARGS__); \ + } while(0) + +/** +* TIMM_OSAL_Error() -- Fatal errors +*/ +#define TIMM_OSAL_Error(fmt,...) TIMM_OSAL_ErrorExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_Warning() -- Warnings that are useful to know about +*/ +#define TIMM_OSAL_Warning(fmt,...) TIMM_OSAL_WarningExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_Profiling() -- performance analysis trace that must not impact use case perf] +*/ +#define TIMM_OSAL_Profiling(fmt,...) TIMM_OSAL_ProfilingExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_Info() -- general information +*/ +#define TIMM_OSAL_Info(fmt,...) TIMM_OSAL_InfoExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_Debug() -- debug traces, most-commonly useful for developers +*/ +#define TIMM_OSAL_Debug(fmt,...) TIMM_OSAL_DebugExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_Entering() -- "ENTERING <function>" statements +* TIMM_OSAL_Exiting() -- "EXITING <function>" statements +*/ +#define TIMM_OSAL_Entering(fmt,...) TIMM_OSAL_EnteringExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) +#define TIMM_OSAL_Exiting(fmt,...) TIMM_OSAL_ExitingExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__) + +/******************************************************************************* +** New Trace to be used by Applications +*******************************************************************************/ + +/** +* TIMM_OSAL_ErrorExt() -- Fatal errors +*/ +#define TIMM_OSAL_ErrorExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_ERROR, tracegrp, "ERROR: " fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_WarningExt() -- Warnings that are useful to know about +*/ +#define TIMM_OSAL_WarningExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_WARNING, tracegrp, "WARNING: " fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_ProfilingExt() -- performance analysis trace that must not impact use case perf] +*/ +#define TIMM_OSAL_ProfilingExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_PROFILING, tracegrp, "PROFILING: " fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_InfoExt() -- general information +*/ +#define TIMM_OSAL_InfoExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_INFO, tracegrp, "INFO: " fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_DebugExt() -- most-commonly used statement for us developers +*/ +#define TIMM_OSAL_DebugExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_DEBUG, tracegrp, "TRACE: " fmt, ##__VA_ARGS__) + +/** +* TIMM_OSAL_EnteringExt() -- "ENTERING <function>" statements +* TIMM_OSAL_ExitingExt() -- "EXITING <function>" statements +*/ +#define TIMM_OSAL_EnteringExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_ENTERING, tracegrp, "ENTER: " fmt, ##__VA_ARGS__) +#define TIMM_OSAL_ExitingExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_EXITING, tracegrp, "EXIT: " fmt, ##__VA_ARGS__) + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_TRACES_H_ */ diff --git a/domx/mm_osal/inc/timm_osal_types.h b/domx/mm_osal/inc/timm_osal_types.h new file mode 100755 index 0000000..882148d --- /dev/null +++ b/domx/mm_osal/inc/timm_osal_types.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2010, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* +* @file timm_osal_types.h +* The timm_osal_types header file defines the primative osal type definitions. +* @path +* +*/ +/* -------------------------------------------------------------------------- */ +/* ========================================================================= + *! + *! Revision History + *! =================================== + *! 0.1: Created the first draft version, ksrini@ti.com + * ========================================================================= */ + +#ifndef _TIMM_OSAL_TYPES_H_ +#define _TIMM_OSAL_TYPES_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + + +#ifdef __KERNEL__ +#include <linux/types.h> +#else +#include <stdint.h> +#endif + + typedef int8_t TIMM_OSAL_S8; /*INT8 */ + typedef int16_t TIMM_OSAL_S16; /*INT16 */ + typedef int32_t TIMM_OSAL_S32; /*INT32 */ + +#define TIMM_OSAL_INT8_MIN 0xFF +#define TIMM_OSAL_INT8_MAX 0x7F + +#define TIMM_OSAL_INT16_MIN 0xFFFF +#define TIMM_OSAL_INT16_MAX 0x7FFF + +#define TIMM_OSAL_INT32_MIN 0xFFFFFFFF +#define TIMM_OSAL_INT32_MAX 0x7FFFFFFF + + typedef uint8_t TIMM_OSAL_U8; /*UINT8 */ + typedef uint16_t TIMM_OSAL_U16; /*UINT16 */ + typedef uint32_t TIMM_OSAL_U32; /*UINT32 */ + +#define TIMM_OSAL_UINT8_MIN 0 +#define TIMM_OSAL_UINT8_MAX 0xFF + +#define TIMM_OSAL_UINT16_MIN 0 +#define TIMM_OSAL_UINT16_MAX 0xFFFF + +#define TIMM_OSAL_UINT32_MIN 0 +#define TIMM_OSAL_UINT32_MAX 0xFFFFFFFF + + + typedef char TIMM_OSAL_CHAR; + /*CHAR*/ typedef void *TIMM_OSAL_HANDLE; + typedef void *TIMM_OSAL_PTR; + + typedef enum TIMM_OSAL_BOOL + { + TIMM_OSAL_FALSE = 0, + TIMM_OSAL_TRUE = !TIMM_OSAL_FALSE, + TIMM_OSAL_BOOL_MAX = 0x7FFFFFFF + } TIMM_OSAL_BOOL; + +#define TIMM_OSAL_SUSPEND 0xFFFFFFFFUL +#define TIMM_OSAL_NO_SUSPEND 0x0 +#define TIMM_OSAL_TIMED_OUT 0x7FFFFFFFUL + + +#define SUCCESS 0 +#define NO_SUCCESS -1 + +#define ERROR 1 +/* +#define TRUE 0 +#define FALSE 1 +*/ +#define URGENT_MESSAGE 2 +#define NORMAL_MESSAGE 1 + + +#define TIMM_OSAL_NULL 0 + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _TIMM_OSAL_TYPES_H_ */ |