Mercurial > sos > sos
view src/os/scall.c @ 115:4473e746fe5a
Restructured the include directory somewhat
author | Jonathan Pevarnek <pevarnj@gmail.com> |
---|---|
date | Sat, 11 Jun 2011 16:40:48 -0400 |
parents | d971d4288a5a |
children | 32560561ccea |
line wrap: on
line source
#include <os/scall.h> #include <os/svcNums.h> #include <os/fs.h> #include <os/svc.h> /* #include <stdio.h> #include <string.h> */ u64 svc_handler(u64 callCode, u64 a, u64 b, u64 c, u64 d) { Psw psw; u64 registers[16]; savecontext(&psw, registers); switch(callCode) { case SVC_EXIT: setcontext(&shellPsw, shellRegisters); break; case SVC_PRINT: //print registers[2] = putline((char*)a, (u32)b); break; case SVC_READ: registers[2] = getline((char*)a, (u32)b); break; case SVC_FINFO: registers[2] = getFInfo(a, (void*) b); break; default: registers[2] = -1; //TODO HACK break; } setcontext(&psw, registers); return -1; //the code should never get here }