/************************************************************************ | |
* °æÈ¨ËùÓÐ (C)2001,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£ | |
* | |
* ÎļþÃû³Æ£º base_api.h | |
* Îļþ±êʶ£º | |
* ÄÚÈÝÕªÒª£º | |
* | |
* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ | |
* --------------------------------------------------------------------- | |
* 2007/11/24 V0.5 ¹¨Òí create | |
************************************************************************/ | |
#ifndef BASE_API_H_ | |
#define BASE_API_H_ | |
/************************************************************************** | |
* Í·Îļþ°üº¬ * | |
**************************************************************************/ | |
#include "oss_api.h" | |
#include "base_pub.h" | |
/************************************************************************** | |
* ³£Á¿ * | |
**************************************************************************/ | |
/************************************************************************** | |
* ºê¶¨Òå * | |
**************************************************************************/ | |
/*KangShuJie 2008.04.03*/ | |
#ifndef CLOCK_TICK | |
#define CLOCK_TICK 4615385 | |
#endif | |
#define P_many_receiver 126 | |
#define P_no_receiver 125 | |
#define HISR_ENTRY_CONG(HISR_NAME,ENTRY,PRIO,STACK_SIZE) \ | |
{#HISR_NAME"HISR",ENTRY, &HISR_NAME##_HISR_control,STACK_SIZE,PRIO} | |
#define PROCESS_ENTRY(PROC_NAME,INSTANCE,ENTRY,PRIO,TIME_SLICE,STACK_SIZE) \ | |
#PROC_NAME":"#INSTANCE, ENTRY, &PROC_NAME##INSTANCE##_task, STACK_SIZE, \ | |
PRIO, TIME_SLICE, { ( P_##PROC_NAME + INSTANCE - 1 ), (queue_table+P_##PROC_NAME+INSTANCE-1) } | |
#define SIGNAL_NAME(SIG_NAME, SIG_IDNODE) \ | |
(XSIGTYPE)(SIG_NAME & (SIGREFTYPE)0xFFFFFFFF) | |
#define NU_SUSPEND 0xFFFFFFFFUL | |
#define NU_MAX_NAME 8 | |
#define SDL_pid SDL_PId | |
#define SDL_Pid SDL_PId | |
#define SIGREFTYPE UINT32 | |
#define XINPUTREFTYPE SIGREFTYPE | |
#define XSIGTYPE SIGREFTYPE | |
#define XSIGNALHEADERTYPE xSignalHeaderRec | |
/*SDLÈÎÎñ״̬*/ | |
#define xInput (xInputAction)0 | |
#define xSave (xInputAction)1 | |
#define xDiscard (xInputAction)2 | |
#define xEnablCond (xInputAction)3 | |
#define xPrioInput (xInputAction)4 | |
#define xNotInSignalSet (xInputAction)5 | |
#define SDL_NULL (SDL_PId)0 | |
#define STARTUP_SIGNAL_NAME SIGNAL_NAME(~0, 0) | |
#define OSS_TASKSELFID_BEGIN 0x00007f00 | |
#define MS_OS_CRITICAL_SECTION_SUPPORT 1 | |
/************************************************************************** | |
* Êý¾ÝÀàÐÍ * | |
**************************************************************************/ | |
/*Ïß³ÌÈë¿Úº¯ÊýÀàÐÍ*/ | |
typedef void (*ENTRY)(unsigned long, void *); | |
typedef void (*HISRENTRY)(void); | |
typedef struct s_queue *QID; | |
typedef QID SDL_PId; | |
typedef struct xSignalHeaderStruct *xSignalHeader; | |
typedef struct xTimerHeaderStruct *xTimerHeader; | |
/************************************************************************** | |
* Êý¾Ý½á¹¹ * | |
**************************************************************************/ | |
/*HISRÈÎÎñ¿ØÖÆ¿é*/ | |
typedef struct NU_HISR_STRUCT{ | |
UNSIGNED words[22]; | |
VOID(*hisrEntry)(VOID); | |
ZOSS_THREAD_ID hisrTaskId; | |
} NU_HISR; | |
/*Ïß³ÌÈë²Î£¬±£´æÕæÕýµÄÈë¿Úº¯ÊýºÍ²ÎÊý*/ | |
typedef struct entryCb{ | |
ENTRY entry; | |
unsigned long argc; | |
VOID *argv; | |
}EntryCB; | |
/*HISRÏß³ÌÈë²Î£¬±£´æÈë¿Úº¯Êý*/ | |
typedef struct hisrEntryCb{ | |
HISRENTRY entry; | |
}HisrEntryCB; | |
/*´æ·ÅSDLÈÎÎñµÄIDºÍͨѶID*/ | |
struct args{ | |
UINT32 self_id; | |
SDL_PId self; | |
}; | |
/*SDLÈÎÎñºÍÏ̵߳ǼDZí*/ | |
struct process_desc{ | |
CHAR *name; | |
VOID (*entry)(UNSIGNED, VOID *); | |
ZOSS_THREAD_ID task; | |
UNSIGNED stack_size; | |
UINT32 prio; | |
UNSIGNED time_slice; | |
struct args args; | |
}; | |
/*HISRÈÎÎñµÇ¼Ç±í*/ | |
struct hisr_desc{ | |
CHAR *name; | |
VOID (*entry)( VOID ); | |
NU_HISR *hcb; | |
UNSIGNED stack_size; | |
UINT32 prio; | |
}; | |
typedef struct NU_PROTECT_STRUCT | |
{ | |
UNSIGNED words[2]; | |
}NU_PROTECT; | |
/*ÐźÅÁ¿±êʶ*/ | |
typedef struct NU_SEMAPHORE_STRUCT{ | |
ZOSS_SEMAPHORE_ID sem_id; | |
UNSIGNED initial_count; | |
DATA_ELEMENT sm_fifo_suspend; | |
}NU_SEMAPHORE; | |
/*SDLÈÎÎñÏûϢͷ*/ | |
typedef struct xSignalHeaderStruct{ | |
xSignalHeader pred; | |
xSignalHeader succ; | |
SIGREFTYPE SignalCode; | |
UINT32 sender_id; | |
SDL_PId Sender; | |
}xSignalHeaderRec; | |
/*SDLÈÎÎñͨѶID*/ | |
typedef struct s_queue{ | |
#if 0 | |
ZOSS_THREAD_ID thread_id; | |
#endif | |
xSignalHeaderRec list; | |
ZOSS_SEMAPHORE_ID events; | |
ZOSS_MUTEX_ID mutex; | |
VOID *ECB; | |
}t_queue; | |
/*SDLÈÎÎñÏêϸÐÅÏ¢£¬Ã¿¸öSDLÈÎÎñ×Ô¼ºÎ¬»¤*/ | |
typedef struct process_vars{ | |
SDL_PId Offspring; | |
SDL_PId Parent; | |
SDL_PId Self; | |
SDL_PId Sender; | |
xSignalHeaderRec *yInSignalPtr; | |
xSignalHeaderRec SaveQ; | |
xSignalHeader CurrentInSaveQ; | |
UINT8 xState; | |
XINPUTREFTYPE RestartAddress; | |
UINT32 SelfId; | |
}t_process_vars; | |
/*SDLÈÎÎñ×´Ì¬×ªÒÆ±í*/ | |
typedef struct s_trans_desc{ | |
const xInputAction *ystah; | |
const XINPUTREFTYPE *ystai; | |
}t_trans_desc; | |
/*¶¨Ê±Æ÷¿ØÖƿ飬¿ÉÒÔµ±×÷ÏûϢͷʹÓÃ*/ | |
typedef struct xTimerHeaderStruct{ | |
xTimerHeader ee_succ; | |
xTimerHeader le_succ; | |
SIGREFTYPE SignalCode; | |
SDL_PId Sender; | |
SdlTimeSpec ee_time; | |
SdlTimeSpec le_time; | |
t_timer_param param; | |
}xTimerHeaderRec; | |
#if 0 | |
#define MAXIMUMTIMER 1024 | |
typedef struct _TimerContext | |
{ | |
char timerName[MAX_THREADNAME_LEN];/* ¶¨Ê±Æ÷Ãû³Æ ,×î´óֵͬÏß³ÌÃû*/ | |
ZOSS_TIMER_FUN timerFun; /* ¶¨Ê±Æ÷Ö´Ðлص÷º¯Êý */ | |
UINT32 input; /* »Øµ÷º¯ÊýÈë¿Ú²ÎÊý */ | |
UINT32 timer_expire; /* ¶¨Ê±Æ÷¶¨Ê±³¬Ê±Ê±¼ä */ | |
UINT32 auto_activate; /* ¶¨Ê±Æ÷ÊÇ·ñ¸Õ´´½¨ºÃ¾Í¼¤»î */ | |
BOOL active; /* µ±Ç°¶¨Ê±Æ÷ÊÇ·ñ´¦ÓÚ¼¤»î״̬ */ | |
UINT32 index; /* µ±Ç°ÏîÉÏÏÂÎĵÄË÷Òý */ | |
ZOSS_TIMER_ID timerid; /* ¶¨Ê±Æ÷µÄID */ | |
HANDLE threadHandle; /* ¶¨Ê±Æ÷ËùÔÚÏ̵߳ľä±ú */ | |
BOOL isInUse; /* µ±Ç°ÏîÉÏÏÂÎÄÊÇ·ñÒѾ±»Ê¹Óà */ | |
BOOL cycle; /* µ±Ç°¶¨Ê±Æ÷ÊÇÖÜÆÚÐԵϹÊÇÖ»Ö´ÐÐÒ»´Î */ | |
}TimerContext; | |
#endif | |
/************************************************************************** | |
* È«¾Öº¯ÊýÔÐÍ * | |
**************************************************************************/ | |
/*===========================================*/ | |
/*ϵͳ¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ£º nu_is_booting | |
* ¹¦ÄÜÃèÊö£º ¼ì²âÊÇ·ñ³õʼ»¯Íê³É | |
* ²ÎÊý˵Ã÷£º (IN) | |
(OUT) | |
* ·µ »Ø Öµ£º TURE: the system is booted | |
FALSE: not completed | |
* ÆäËü˵Ã÷£º | |
**************************************************************************/ | |
extern SINT32 nu_is_booting(VOID); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ£º SDL_Task_Start | |
* ¹¦ÄÜÃèÊö£º Æô¶¯SDL ÈÎÎñ | |
* ²ÎÊý˵Ã÷£º (IN) | |
process: | |
staticEntry: | |
(OUT) | |
* ·µ »Ø Öµ£º ³É¹¦·´»ØZOSS_SUCCESS£¬Ê§°Ü·´»ØZOSS_ERROR | |
* ÆäËü˵Ã÷£º | |
**************************************************************************/ | |
extern UINT32 SDL_Task_Start(struct process_desc *process); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ£º Non_SDL_Task_Start | |
* ¹¦ÄÜÃèÊö£º Æô¶¯SDL ÈÎÎñ | |
* ²ÎÊý˵Ã÷£º (IN) | |
process: | |
additionalEntry: | |
(OUT) | |
* ·µ »Ø Öµ£º ³É¹¦·´»ØZOSS_SUCCESS£¬Ê§°Ü·´»ØZOSS_ERROR | |
* ÆäËü˵Ã÷£º | |
**************************************************************************/ | |
extern UINT32 Non_SDL_Task_Start(struct process_desc *process); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ£º HIRS_Task_Start | |
* ¹¦ÄÜÃèÊö£º Æô¶¯HISR ÈÎÎñ | |
* ²ÎÊý˵Ã÷£º (IN) | |
hisr: | |
(OUT) | |
* ·µ »Ø Öµ£º ³É¹¦·´»ØZOSS_SUCCESS£¬Ê§°Ü·´»ØZOSS_ERROR | |
* ÆäËü˵Ã÷£º | |
**************************************************************************/ | |
extern UINT32 HIRS_Task_Start(struct hisr_desc *hisr); | |
/*===========================================*/ | |
/*HISRÈÎÎñ¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Create_HISR | |
* ¹¦ÄÜÃèÊö: ´´½¨HISRÏß³Ì | |
* ²ÎÊý˵Ã÷: hisr:HISRÖ¸Õë | |
name:Ïß³ÌÃû³Æ | |
hisr_entry:Ïß³ÌÈë¿Úº¯Êý | |
priority:ÓÅÏȼ¶ | |
stack_address:Õ»µØÖ· | |
stack_size:Õ»´óС | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Create_HISR(NU_HISR *hisr, CHAR *name, VOID (*hisr_entry)(VOID), | |
OPTION priority, VOID *stack_address, UNSIGNED stack_size); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Activate_HISR | |
* ¹¦ÄÜÃèÊö: ¼¤»îHISRÏß³Ì | |
* ²ÎÊý˵Ã÷: HISRÖ¸Õë | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Activate_HISR(NU_HISR *hisr); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Init_HISR_Sem | |
* ¹¦ÄÜÃèÊö: ³õʼ»¯HISRÏ̵߳ĿìËÙÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: | |
* ·µ »Ø Öµ: | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID NU_Init_HISR_Sem(VOID); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Wait_HISR_Sem | |
* ¹¦ÄÜÃèÊö: µÈ´ý¿ìËÙÐźÅÁ¿±»ÊÍ·Å | |
* ²ÎÊý˵Ã÷: | |
* ·µ »Ø Öµ: | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID NU_Wait_HISR_Sem(VOID); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Delete_HISR | |
* ¹¦ÄÜÃèÊö: ɾ³ýHISR | |
* ²ÎÊý˵Ã÷: ÎÞ | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
// P98C-YXS extern UINT32 NU_Delete_HISR(NU_HISR *hisr); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Current_HISR_Pointer | |
* ¹¦ÄÜÃèÊö: »ñµÃµ±Ç°HISRÖ¸Õë | |
* ²ÎÊý˵Ã÷: ÎÞ | |
* ·µ »Ø Öµ: »ñµÃµ±Ç°HISRÖ¸Õë | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
// P98C-YXS extern NU_HISR *NU_Current_HISR_Pointer(VOID); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Current_Task_Pointer | |
* ¹¦ÄÜÃèÊö: »ñµÃµ±Ç°ÈÎÎñÖ¸Õë | |
* ²ÎÊý˵Ã÷: ÎÞ | |
* ·µ »Ø Öµ: µ±Ç°ÈÎÎñÖ¸Õë | |
* ÆäËü˵Ã÷: ÖжÏÏ̷߳µ»Ø¿Õ | |
**************************************************************************/ | |
extern VOID *NU_Current_Task_Pointer(VOID); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Create_Semaphore | |
* ¹¦ÄÜÃèÊö: ´´½¨ÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: semaphore£ºÐźÅÁ¿Ö¸Õë | |
name:ÐźÅÁ¿Ãû³Æ | |
initial_count:³õʼֵ | |
suspend_type:ÀàÐÍ | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Create_Semaphore(NU_SEMAPHORE *semaphore, CHAR *name, | |
UNSIGNED initial_count, OPTION suspend_type); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Delete_Semaphore | |
* ¹¦ÄÜÃèÊö: ɾ³ýÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: semaphore:ÐźÅÁ¿Ö¸Õë | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Delete_Semaphore(NU_SEMAPHORE *semaphore); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Obtain_Semaphore | |
* ¹¦ÄÜÃèÊö: »ñµÃÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: semaphore:ÐźÅÁ¿Ö¸Õë | |
suspend:ÀàÐÍ | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Obtain_Semaphore(NU_SEMAPHORE *semaphore, UNSIGNED suspend); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Release_Semaphore | |
* ¹¦ÄÜÃèÊö: ÊÍ·ÅÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: semaphore:ÐźÅÁ¿Ö¸Õë | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Release_Semaphore(NU_SEMAPHORE *semaphore); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: NU_Reset_Semaphore | |
* ¹¦ÄÜÃèÊö: ÖØÉèÐźÅÁ¿ | |
* ²ÎÊý˵Ã÷: semaphore:ÐźÅÁ¿Ö¸Õë | |
initial_count:³õʼֵ | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØZOSS_SUCCESS£¬´íÎó·µ»ØZOSS_ERROR | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern UINT32 NU_Reset_Semaphore(NU_SEMAPHORE *semaphore, UNSIGNED initial_count); | |
/*===========================================*/ | |
/*Òì³£´¦ÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ£ºnu_exception | |
* ¹¦ÄÜÃèÊö£º Òì³£´¦Àí | |
* ²ÎÊý˵Ã÷£º (IN) | |
line_number:ÐÐÊý | |
filename:ÎļþÃû | |
un_status:״ֵ̬ | |
(OUT) | |
* ·µ »Ø Öµ£º ÎÞ | |
* ÆäËü˵Ã÷£º | |
**************************************************************************/ | |
// P98C-YXS extern VOID nu_exception (SINT32 line_number, CHAR *filename, STATUS nu_status); | |
/*===========================================*/ | |
/*ÄÚ´æ¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: ps_calloc | |
* ¹¦ÄÜÃèÊö: ·ÖÅäÒ»×é¿Õ¼ä | |
* ²ÎÊý˵Ã÷: (IN) | |
nel:¿éÊý | |
size:ÿ¿éµÄ´óС | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID *ps_calloc(size_t nel, size_t size); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: ps_malloc | |
* ¹¦ÄÜÃèÊö: ´Ó¶ÑÖзÖÅä¿Õ¼ä | |
* ²ÎÊý˵Ã÷: (IN) | |
size:´óС | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID *ps_malloc(size_t size); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: zrealloc | |
* ¹¦ÄÜÃèÊö: ´ÓзÖÅä¿Õ¼ä | |
* ²ÎÊý˵Ã÷: (IN) | |
block:ÔÓÐÄÚ´æÖ¸Õë | |
newsize:еĴóС | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID *zrealloc(void *block, size_t newsize); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: ps_free | |
* ¹¦ÄÜÃèÊö: Êͷſռä | |
* ²ÎÊý˵Ã÷: (IN) | |
memp:ÄÚ´æÖ¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID ps_free(void *memp); | |
#if 0 | |
extern VOID *malloc_dma_buffer(size_t size); | |
extern VOID free_dma_buffer(void *ptr); | |
#endif | |
/*===========================================*/ | |
/*ÏûÏ¢¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: alloc_sig_loc | |
* ¹¦ÄÜÃèÊö: ·ÖÅäÏûÏ¢¿Õ¼ä | |
* ²ÎÊý˵Ã÷: (IN) | |
size:´óС | |
file:ÎļþÃû | |
line:³õʼֵ | |
(OUT) | |
* ·µ »Ø Öµ: ÕýÈ··µ»ØÄÚ´æÖ¸Õ룬´íÎó·µ»ØNULL | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern xSignalHeaderRec *alloc_sig_loc(UINT32 size, CHAR *file, SINT32 line); | |
#define alloc_sig(_size) alloc_sig_loc ((_size), __FILE__, __LINE__) | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: free_sig_loc | |
* ¹¦ÄÜÃèÊö: ÊÍ·ÅÏûÏ¢¿Õ¼ä | |
* ²ÎÊý˵Ã÷: (IN) | |
signal_ptr:ÒªÊͷŵÄÄÚ´æÖ¸Õë | |
file:ÎļþÃû | |
line:³õʼֵ | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID free_sig_loc(xSignalHeaderRec *signal_ptr, CHAR *file, SINT32 line); | |
#define free_sig(_sig_ptr) free_sig_loc((_sig_ptr), __FILE__, __LINE__) | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: send_sig_loc | |
* ¹¦ÄÜÃèÊö: ÏòÒ»¸öSDLÏ̷߳¢ËÍÏûÏ¢ | |
* ²ÎÊý˵Ã÷: (IN) | |
signal_ptr:ÏûÏ¢¿é | |
rec_queue:½ÓÊÕ¶ÓÁÐÍ·Ö¸Õë | |
sig_name:ÐźÅÃû | |
file:ÎļþÃû | |
line:ÐÐÊý | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern void send_sig_loc( | |
xSignalHeaderRec *signal_ptr, t_queue *rec_queue, char *sig_name, char *file, int line ); | |
#define send_sig(_signal_ptr,_rec_queue ,_sig_name) \ | |
send_sig_loc ((_signal_ptr), (_rec_queue),(_sig_name), __FILE__, __LINE__) | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: send_sig_no_to_loc | |
* ¹¦ÄÜÃèÊö: ¸ù¾ÝÏûÏ¢ÂëÏòÒ»¸öSDLÏ̷߳¢ËÍÏûÏ¢ | |
* ²ÎÊý˵Ã÷: (IN) | |
signal_ptr:ÏûÏ¢¿é | |
signal_cod:ÏûÏ¢Âë | |
file:ÎļþÃû | |
line:ÐÐÊý | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: hehaijian for win debug | |
**************************************************************************/ | |
extern void send_sig_no_to_loc ( | |
xSignalHeaderRec *signal_ptr, unsigned signal_code, CHAR *file, SINT32 line ); | |
#define send_sig_no_to(_signal_ptr, _signal_code, _sig_name ) \ | |
send_sig_no_to_loc ((_signal_ptr), ( _signal_code), __FILE__, __LINE__) | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: send_startup_sig_loc | |
* ¹¦ÄÜÃèÊö: ÏòÒ»¸öSDLÏ̷߳¢ËÍÆô¶¯ÏûÏ¢ | |
* ²ÎÊý˵Ã÷: (IN) | |
rec_queue:ÏòÒ»¸öÏ̷߳¢ËÍÆô¶¯ÏûÏ¢ | |
file:ÎļþÃû | |
line:ÐÐÊý | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID send_startup_sig_loc ( | |
t_queue *rec_queue, CHAR *file, SINT32 line ); | |
#define send_startup_sig(_rec_queue) \ | |
send_startup_sig_loc ((_rec_queue), __FILE__, __LINE__) | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: receive_sig_loc | |
* ¹¦ÄÜÃèÊö: ½ÓÊÕÏûÏ¢ | |
* ²ÎÊý˵Ã÷: (IN) | |
queue:ÏûÏ¢¶ÓÁÐÍ· | |
file:ÎļþÃû | |
line:ÐÐÊý | |
(OUT) | |
* ·µ »Ø Öµ: ÏûÏ¢Ö¸Õë | |
* ÆäËü˵Ã÷: ÓÉSDLÈÎÎñµ÷Óà | |
**************************************************************************/ | |
extern xSignalHeaderRec *receive_sig_loc(t_queue *queue, CHAR *file, SINT32 line); | |
#define receive_sig(_queue) receive_sig_loc ((_queue), __FILE__, __LINE__) | |
/*===========================================*/ | |
/*SDL¶¨Ê±Æ÷¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Set_Dur | |
* ¹¦ÄÜÃèÊö: ´´½¨Ò»¸öSDL¶¨Ê±Æ÷ | |
* ²ÎÊý˵Ã÷: (IN) | |
Tick_Expr:¶¨Ê±Æ÷ÖÜÆÚ | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: ÏÈÕÒ¶¨Ê±Æ÷£¬Èç¹ûÕÒµ½Ôò»Ö¸´£¬·ñÔò´´½¨Ò»¸öÐ嵀 | |
**************************************************************************/ | |
extern VOID SDL_Set_Dur(SDL_Duration Tick_Expr, UINT32 timer_name, | |
t_timer_param timer_param, t_process_vars *yVarP,BYTE sample_id); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Set_Dur_Ex | |
* ¹¦ÄÜÃèÊö: ´´½¨Ò»¸öSDL¶¨Ê±Æ÷ | |
* ²ÎÊý˵Ã÷: (IN) | |
Earliest_Tick_Expr:¶¨Ê±Æ÷×îÔçÖÜÆÚ | |
Latest_Tick_Expr:¶¨Ê±Æ÷×îÍíÖÜÆÚ | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: ÏÈÕÒ¶¨Ê±Æ÷£¬Èç¹ûÕÒµ½ÔòÓÃÐÂÖÜÆÚ»Ö¸´£¬·ñÔò´´½¨Ò»¸öÐ嵀 | |
**************************************************************************/ | |
extern VOID SDL_Set_Dur_Ex(SDL_Duration Earliest_Tick_Expr, SDL_Duration Latest_Tick_Expr, | |
UINT32 timer_name, t_timer_param timer_param, t_process_vars *yVarP,BYTE sample_id); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Set | |
* ¹¦ÄÜÃèÊö: ´´½¨Ò»¸öSDL¶¨Ê±Æ÷ | |
* ²ÎÊý˵Ã÷: (IN) | |
Tick_Expr:¶¨Ê±Æ÷ÖÜÆÚ | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: ÏÈÕÒ¶¨Ê±Æ÷£¬Èç¹ûÕÒµ½Ôò»Ö¸´£¬·ñÔò´´½¨Ò»¸öÐ嵀 | |
**************************************************************************/ | |
// P98C-YXS extern VOID SDL_Set(SDL_Time Time, UINT32 timer_name, | |
// P98C-YXS t_timer_param timer_param, t_process_vars *yVarP); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Set_Ex | |
* ¹¦ÄÜÃèÊö: ´´½¨Ò»¸öSDL¶¨Ê±Æ÷ | |
* ²ÎÊý˵Ã÷: (IN) | |
Earliest_Tick_Expr:¶¨Ê±Æ÷×îÔçÖÜÆÚ | |
Latest_Tick_Expr:¶¨Ê±Æ÷×îÍíÖÜÆÚ | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: ÏÈÕÒ¶¨Ê±Æ÷£¬Èç¹ûÕÒµ½Ôò»Ö¸´£¬·ñÔò´´½¨Ò»¸öÐ嵀 | |
**************************************************************************/ | |
// P98C-YXS extern VOID SDL_Set_Ex(SDL_Time Earliest_Time, SDL_Time Latest_Time, UINT32 timer_name, | |
// P98C-YXS t_timer_param timer_param, t_process_vars *yVarP); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Reset | |
* ¹¦ÄÜÃèÊö: ɾ³ýÒ»¸öSDL¶¨Ê±Æ÷ | |
* ²ÎÊý˵Ã÷: (IN) | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern VOID SDL_Reset (UINT32 TimerName, t_timer_param timer_param, | |
t_process_vars *yVarP,BYTE sample_id); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Active | |
* ¹¦ÄÜÃèÊö: ¼ì²é¶¨Ê±Æ÷ÊÇ·ñ´æÔÚ | |
* ²ÎÊý˵Ã÷: (IN) | |
timer_name:¶¨Ê±Æ÷Ãû | |
timer_param:¶¨Ê±Æ÷²ÎÊý | |
yVarP:Ïß³ÌÐÅÏ¢Ö¸Õë | |
(OUT) | |
* ·µ »Ø Öµ: ´æÔÚ·µ»ØTRUE£¬·ñÔò·µ»ØFALSE | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
// P98C-YXS extern SDL_Boolean SDL_Active(UINT32 TimerName, t_timer_param timer_param, | |
// P98C-YXS t_process_vars *yVarP); | |
extern SDL_Time RetrieveClock(BYTE sample_id); | |
extern SDL_Duration SDL_Duration_Lit (SINT32 secs, SINT32 nsecs); | |
/*===========================================*/ | |
/*SDLÈÎÎñ¹ÜÀíÄ£¿é*/ | |
/*===========================================*/ | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Create | |
* ¹¦ÄÜÃèÊö: ´´½¨Ò»¸öSDLÈÎÎñ | |
* ²ÎÊý˵Ã÷: (IN) | |
task_entry:ÈÎÎñÈë¿Úº¯Êý | |
stack_size:¶ÑÕ»´óС | |
self_id:ÈÎÎñID | |
prio:ÓÅÏȼ¶ | |
task_name:ÈÎÎñÃû | |
startup_signal:³õʼ»¯ÏûÏ¢ | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: | |
**************************************************************************/ | |
extern SDL_PId SDL_Create ( | |
VOID ( *task_entry )( UNSIGNED argc, VOID *argv ), | |
SINT32 stack_size, | |
SINT32 self_id, | |
SINT32 prio, | |
CHAR *task_name, | |
xSignalHeader startup_signal | |
); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Stop | |
* ¹¦ÄÜÃèÊö: ɾ³ýÒ»¸öSDLÈÎÎñ | |
* ²ÎÊý˵Ã÷: (IN) | |
varp:Ïß³ÌÐÅÏ¢ | |
yInSignalPtr:ÏûÏ¢Ö¸Õë | |
self_if:ÈÎÎñID | |
(OUT) | |
* ·µ »Ø Öµ: ÎÞ | |
* ÆäËü˵Ã÷: ÔÚÈÎÎñÈë¿ÚÖе÷Óã¬Ò»°ãÓÃÀ´É¾³ý×Ô¼º | |
**************************************************************************/ | |
extern VOID SDL_Stop(t_process_vars *varp, xSignalHeaderRec *yInSignalPtr); | |
/************************************************************************** | |
* º¯ÊýÃû³Æ: SDL_Loop | |
* ¹¦ÄÜÃèÊö: Ñ»·½ÓÊÕÏûÏ¢ | |
* ²ÎÊý˵Ã÷: (IN) | |
proc_insig_tab:ÏûϢ״̬Êý×é | |
trans_tab:×´Ì¬×ªÒÆ¾ØÕó | |
yVarP:Ïß³ÌÐÅÏ¢½á¹¹ÌåÖ¸Õë | |
self_id:Ïß³ÌID | |
(OUT) | |
* ·µ »Ø Öµ: ÏûÏ¢Ö¸Õë | |
* ÆäËü˵Ã÷: ÓÐÎÊÌâ | |
**************************************************************************/ | |
extern xSignalHeaderRec *SDL_Loop(const XSIGTYPE *proc_insig_tab, | |
const t_trans_desc *trans_tab, | |
struct process_vars *yVarP, | |
char *file, int line); | |
#endif | |