2 Star 3 Fork 0

thor / unisim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
syscall.c 600 Bytes
一键复制 编辑 原始数据 按行查看 历史
thor 提交于 2013-11-26 05:39 . qsort pass
#include "syscall.h"
#include "sim.h"
#include "helper.h"
#include <stdlib.h>
#include <stdint.h>
int syscall(int callnum, int *res)
{
switch (callnum) {
case SYS_putint:
printf("SYS_putint: %d\n", R(0));
break;
case SYS_exit:
printf("SYS_exit: retval = %d\n", R(0));
exit(0);
break;
case SYS_udiv:
return (uint32_t)R(0) / (uint32_t)R(1);
case SYS_div:
return (int)R(0) / (int)R(1);
case SYS_mod:
return (int)R(0) % (int)R(1);
case SYS_umod:
return (uint32_t)R(0) % (uint32_t)R(1);
default:
printf("unimplemented syscall\n");
}
}
C
1
https://gitee.com/thor/unisim.git
git@gitee.com:thor/unisim.git
thor
unisim
unisim
master

搜索帮助