代码改变世界

Vxworks增加system call

2011-12-07 19:41  Jeff  阅读(1041)  评论(0编辑  收藏  举报
Vxworks中增加system call的伪代码.
比如用户层可以获取kernel中的time tick.
#include <syscall.h>
#include <syscallLib.h>
unsigned short gettimdsp(void);
SYSCALL_RTN_TBL_ENTRY msGetTbl[] =
{
{(FUNCPTR) gettimdsp, 1, "gettimdsp", 0}
};
unsigned short gettimdsp(void)
{
return timetck;
}
void usrAppInit (void)
{
syscallGroupRegister (2, "msgetforrtp", 2, (SYSCALL_RTN_TBL_ENTRY*)&msGetTbl, 0);
}