/**************************************************************************** * Copyright (c) 2006 DST Technologies Inc. All Rights Reserved. * * Module: OS LOCAL * * Description: OS APIs for Core internal use * Informations in this file apply to all OSes in use. * * Notes: This module contains local APIs for * - Processes * - NVM * - Video memory mapping * - PCI bus * - IRQ ***************************************************************************/ #ifndef OS_PRIVATE_H_ #define OS_PRIVATE_H_ /*========================== * OS include *=========================*/ #include "dsthalcommon.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INVALID_KHANDLE -1 #define DEBUG_OS 1 /*========================== * Shared prototypes *=========================*/ DS_S32 Os_KmodGetHandle (DS_U32 ChipIndex); void Os_KmodReleaseHandle (DS_S32 Handle); DS_U32 Os_PerformIoctl (DS_U32 Func, void *RetBuf); key_t Os_GetNameValue (DS_S8 *Name, DS_S8 NumVal); #if !DEBUG_OS #define INFO_MSG(...) #define DBG_MSG(...) #else #define INFO_MSG printf #define DBG_MSG printf #endif /*========================== * TASK Control Block *=========================*/ typedef enum tag_DS_TASK_STATUS { DS_TSTAT_READY = 0x0000, DS_TSTAT_PEND = 0x0001, DS_TSTAT_DELAY = 0x0002, DS_TSTAT_SUSPEND = 0x0004, DS_TSTAT_TIMEOUT = 0x0008, DS_TSTAT_INH_PRI = 0x0010, DS_TSTAT_DEAD = 0x0080, DS_TSTAT_RDY_MSK = 0x008f } DS_TASK_STATUS; typedef struct tag_DS_TASK_T { DS_U32 taskId; // task id (from pthread) int pid; // Process ID (from kernel) DS_U8 priority; // task priority DS_U8 status; // task status DS_U32 stacksize; // task stack size char name[256]; // task name max is 10 char! void (*funcPtr)(DS_U32); DS_U32 arg; // First task control block in list of tasks waiting on this task (for deletion purposes) struct tag_DS_TASK_T *first_susp; // Next task control block in list of tasks waiting on object struct tag_DS_TASK_T *nxt_susp; // Next task control block in list struct tag_DS_TASK_T *nxt_task; // the task waits this objects: DS_U32 *waiting; } DS_TASK_T; // Task Debug DB void link_susp_task(DS_TASK_T ** list_head, DS_TASK_T * new_entry); void unlink_susp_task(DS_TASK_T **list_head, DS_TASK_T * entry); int signal_for_my_task(DS_TASK_T **list_head, int pend_order); DS_TASK_T *taskFind(DS_U32 taskId, int lock); #endif /* OS_PRIVATE_H_ */