diff --git a/include/fvid2_utils.h b/include/fvid2_utils.h
index 5b7c33cc7962a6cfe83440dc29ce2d7c76541f9c..f584a00c1c44b1f1af9dd97722b21d3c40c02c39 100755 (executable)
--- a/include/fvid2_utils.h
+++ b/include/fvid2_utils.h
/* Include Files */
/* ========================================================================== */
+#include <ti/csl/csl_types.h>
#include <ti/osal/osal.h>
#ifdef __cplusplus
#define FVID2UTILS_NUM_TIMESTAMP_LOG (100U)
/**
- * struct Fvid2Utils_LinkListType
+ * \anchor Fvid2Utils_LinkListType
+ * \name Link List Type
+ * @{
+ */
+/**
* \brief Enums for the type of link list to be created.
*/
-typedef enum
-{
- FVID2UTILS_LLT_DOUBLE,
- /**< Double link list. */
- FVID2UTILS_LLT_CIRCULAR
- /**< Circular link list using double link list. */
-} Fvid2Utils_LinkListType;
+typedef uint32_t Fvid2Utils_LinkListType;
+#define FVID2UTILS_LLT_DOUBLE (0U)
+/**< Double link list. */
+#define FVID2UTILS_LLT_CIRCULAR (1U)
+/**< Circular link list using double link list. */
+/* @} */
/**
- * struct Fvid2Utils_LinkAddMode
+ * \anchor Fvid2Utils_LinkAddMode
+ * \name Link Add Mode
+ * @{
+ */
+/**
* \brief Enums for the different modes of adding a node to a link list.
*/
-typedef enum
-{
- FVID2UTILS_LAM_TOP,
- /**< Add nodes to the top of the list. */
- FVID2UTILS_LAM_BOTTOM,
- /**< Add nodes to the bottom of the list. */
- FVID2UTILS_LAM_PRIORITY
- /**< Add nodes to the list based on ascending order of priority.
- * Nodes with the same priority are always added to the bottom of the
- * existing nodes with same priority. */
-} Fvid2Utils_LinkAddMode;
-
-/**
- * struct Fvid2Utils_LinkAddMode
+typedef uint32_t Fvid2Utils_LinkAddMode;
+#define FVID2UTILS_LAM_TOP (0U)
+/**< Add nodes to the top of the list. */
+#define FVID2UTILS_LAM_BOTTOM (1U)
+/**< Add nodes to the bottom of the list. */
+#define FVID2UTILS_LAM_PRIORITY (2U)
+/**< Add nodes to the list based on ascending order of priority.
+ * Nodes with the same priority are always added to the bottom of the
+ * existing nodes with same priority. */
+/* @} */
+
+/**
+ * \anchor Fvid2Utils_NodDir
+ * \name Node Direction
+ * @{
+ */
+/**
* \brief Enums for the different modes of adding a node to a link list.
*/
-typedef enum
-{
- FVID2UTILS_NODE_DIR_HEAD,
- /**< Add nodes to the top of the list. */
- FVID2UTILS_NODE_DIR_TAIL
- /**< Add nodes to the bottom of the list. */
-} Fvid2Utils_NodDir;
+typedef uint32_t Fvid2Utils_NodDir;
+#define FVID2UTILS_NODE_DIR_HEAD (0U)
+/**< Add nodes to the top of the list. */
+#define FVID2UTILS_NODE_DIR_TAIL (1U)
+/**< Add nodes to the bottom of the list. */
+/* @} */
/* ========================================================================== */
/* Structure Declarations */
/* ========================================================================== */
/* Function Declarations */
/* ========================================================================== */
+/**
+ * Fvid2Utils_init
+ * \brief Initializes the Util objects and create pool semaphore
+ *
+ * \returns Returns 0 on success else returns error value
+ */
+int32_t Fvid2Utils_init(void);
+
+/**
+ * Fvid2Utils_deInit
+ * \brief De-Initializes the Util objects by removing pool semaphore
+ *
+ * \param arg Not used currently. Meant for future purpose
+ *
+ * \return Returns 0 on success else returns error value
+ */
+int32_t Fvid2Utils_deInit(void *arg);
/**
* Fvid2Utils_memset
* \param ch Byte value to fill with.
* \param byteCount Number of bytes to fill.
*
- * \return The destination memory pointer.
+ * \return None.
*/
-void *Fvid2Utils_memset(void *mem, uint8_t ch, uint32_t byteCount);
+void Fvid2Utils_memset(void *mem, uint8_t ch, size_t byteCount);
/**
* Fvid2Utils_memsetw
* \param src Source memory pointer.
* \param byteCount Number of bytes to copy.
*
- * \return The destination memory pointer.
+ * \return None
*/
-void *Fvid2Utils_memcpy(void *dest, const void *src, uint32_t byteCount);
+void Fvid2Utils_memcpy(void *dest, const void *src, size_t byteCount);
/**
* Fvid2Utils_memcmp
*
* \param llobj pointer to object of type Fvid2UtilsLinkListObj
*
- * \return Returns FVID2_SOK on success else returns error value.
+ * \return None
*/
-int32_t Fvid2Utils_destructLinkList(Fvid2UtilsLinkListObj *llobj);
+void Fvid2Utils_destructLinkList(Fvid2UtilsLinkListObj *llobj);
/**
* Fvid2Utils_linkNodePri
*
* \param llobj pointer to object of type Fvid2UtilsLinkListObj
*
- * \return Returns FVID2_SOK on success else returns error value.
+ * \return None
*/
-int32_t Fvid2Utils_destructQ(Fvid2UtilsLinkListObj *llobj);
+void Fvid2Utils_destructQ(Fvid2UtilsLinkListObj *llobj);
/**
* Fvid2Utils_queue
uint32_t cnt;
/* NULL pointer check */
- GT_assert(traceMask, (NULL != params));
- GT_assert(traceMask, (NULL != mem));
- GT_assert(traceMask, (NULL != flag));
+ GT_assert(traceMask, (NULL_PTR != params));
+ GT_assert(traceMask, (NULL_PTR != mem));
+ GT_assert(traceMask, (NULL_PTR != flag));
/* Init pool parameters */
params->mem = mem;
{
uint32_t cnt;
uintptr_t cookie;
- uint32_t tempVal;
+ uintptr_t tempVal;
void *allocMem = NULL;
/* NULL pointer check */
- GT_assert(traceMask, (NULL != params));
+ GT_assert(traceMask, (NULL_PTR != params));
/* Check if the requested size if within each fixed size element */
GT_assert(traceMask, (size <= params->elemSize));
GT_assert(traceMask, (0U != size));
{
if ((uint32_t) FALSE == params->flag[cnt])
{
- tempVal = ((uint32_t) params->mem) + (params->elemSize * cnt);
+ tempVal = ((uintptr_t) params->mem) + (((uintptr_t) params->elemSize) * ((uintptr_t) cnt));
allocMem = (void *) (tempVal);
params->flag[cnt] = (uint32_t) TRUE;
uint32_t traceMask)
{
uint32_t cnt;
- uint32_t tempVal;
+ uintptr_t tempVal;
int32_t retVal = FVID2_EFAIL;
uintptr_t cookie;
/* NULL pointer check */
- GT_assert(traceMask, (NULL != params));
- GT_assert(traceMask, (NULL != mem));
+ GT_assert(traceMask, (NULL_PTR != params));
+ GT_assert(traceMask, (NULL_PTR != mem));
/* Disable global interrupts */
cookie = HwiP_disable();
for (cnt = 0U; cnt < params->numElem; cnt++)
{
- tempVal = ((uint32_t) params->mem) + (params->elemSize * cnt);
+ tempVal = ((uintptr_t) params->mem) + (((uintptr_t)params->elemSize) * ((uintptr_t)cnt));
if ((void *) (tempVal) == mem)
{
/* Check if the memory is already allocated */
static inline void Fvid2Utils_initTsPrfLog(Fvid2Utils_TsPrfLog *tsPrf)
{
/* NULL pointer check */
- GT_assert(GT_DEFAULT_MASK, (NULL != tsPrf));
+ GT_assert(GT_DEFAULT_MASK, (NULL_PTR != tsPrf));
Fvid2Utils_memset(tsPrf, 0, sizeof (Fvid2Utils_TsPrfLog));
/* Min can't be init to 0, set a higher value so that actual min gets
static inline void Fvid2Utils_startTsPrfLog(Fvid2Utils_TsPrfLog *tsPrf)
{
/* NULL pointer check */
- GT_assert(GT_DEFAULT_MASK, (NULL != tsPrf));
+ GT_assert(GT_DEFAULT_MASK, (NULL_PTR != tsPrf));
tsPrf->startTime = Osal_getTimestamp64();
uint64_t endTime, diff;
/* NULL pointer check */
- GT_assert(GT_DEFAULT_MASK, (NULL != tsPrf));
+ GT_assert(GT_DEFAULT_MASK, (NULL_PTR != tsPrf));
endTime = Osal_getTimestamp64();
diff = endTime - tsPrf->startTime;