代码改变世界

Vxworks增加system call

2011-12-07 19:41 by Jeff, ... 阅读, ... 评论, 收藏, 编辑
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);
}