nemu/src/syscall.c

14 lines
511 B
C
Raw Normal View History

2022-07-05 19:20:34 +02:00
#include <syscall.h>
#include <stdio.h>
int syscall_handle(cpu_status_t* status, uint32_t origin){
uint32_t id = status->r[0];
2022-07-11 09:21:36 +02:00
printf("\e[32mpc: %8x syscall %8x\e[39m\n", origin, (uint32_t)status->r[0]);
if(id == 0x3fa) NULL;
if(id == 0x144) syscall_bdisp_allclr_ddvram(status);
if(id == 0x807) syscall_locate(status);
2022-07-11 09:21:36 +02:00
if(id == 0x808) syscall_print(status);
if(id == 0x135) syscall_get_vram_address(status);
if(id == 0xacd) syscall_malloc(status);
2022-07-06 09:23:01 +02:00
status->pc = status->pr;
2022-07-05 19:20:34 +02:00
}