samp_osa_exp.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:2k
- /*
- file: samp_osa_api.c
- decription: implements SAMP osa APIs for use by UI task.
- */
- #include "config.h"
- #ifdef TEST_HARNASS // for test only.//////////////////////////////////////////////////////////////////////////////
- #include "IncludeSysDefs.h"
- #include "playcoresampsamp_gen.h"
- #include "playcoresampschedulersamp_api.h"
- SAMP(ErrCode) SAMP_EXP(OS_TaskCreate) (PRIORITY Priority, size_t Stacksize, void(*Entry)(void),IDENT *Id)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Priority ;
- SAMP_API_PARAM[1] = (UINT32)Stacksize ;
- SAMP_API_PARAM[2] = (UINT32)Entry ;
- SAMP_API_PARAM[3] = (UINT32)Id ;
- SAMP_APICallRequest (OSA_TASK_CREATE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(OS_TaskDelete) (IDENT Id)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Id ;
- SAMP_APICallRequest (OSA_TASK_DELETE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(OS_SemCreate) (UNITS Units,IDENT *Id)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Units ;
- SAMP_API_PARAM[1] = (UINT32)Id ;
- SAMP_APICallRequest (OSA_SEM_CREATE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(OS_SemDelete) (IDENT Id)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Id ;
- SAMP_APICallRequest (OSA_SEM_DELETE, &err) ;
- return err;
- }
- SAMP(ErrCode) SAMP_EXP(OS_SemV) (IDENT Id)
- {
- SAMP(ErrCode) err;
- SAMP_API_PARAM[0] = (UINT32)Id ;
- SAMP_APICallRequest (OSA_SEM_V, &err) ;
- return err;
- }
- #endif//////////////////////////////////////////////////////////////////////////////////////////////////