blob: c573a949cd1914561d94156461153f001ecb27b9 (
plain) (
tree)
|
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "cpu.h"
#include "mem.h"
#include "syscall.h"
#define arg(n) load(GPR[StP] + 4*n)
void do_syscall(void)
{
switch (arg(0)) {
case SYS_exit:
exit(arg(1));
break;
case SYS_print:
printf("%"PRIu32"\n", arg(1));
break;
default:
push(-1);
}
}
|