FoenixMCP/src/m68k/bios_m68k.c
Peter Weingartner 52f1882a25 More syscalls and CLI beginning
Added more syscalls. Started the command line utility.
2021-09-19 19:16:41 -04:00

38 lines
1.1 KiB
C

/**
* Implementation of 68000 specific syscall routines.
*
* NOTE: these routines are not called directly but are instead called through TRAP#13
*/
#include "types.h"
#include "syscalls.h"
#include "log.h"
#include "dev/channel.h"
/*
* Determine the correct system function implementation and call it.
*/
int32_t syscall_dispatch(int32_t function, int32_t param0, int32_t param1, int32_t param2, int32_t param3, int32_t param4, int32_t param5) {
switch (function) {
case KFN_CHAN_WRITE_B:
return chan_write_b((short)param0, (uint8_t)param1);
case KFN_CHAN_WRITE:
return chan_write((short)param0, (const uint8_t *)param1, (short)param2);
case KFN_CHAN_READ_B:
return chan_read_b((short)param0);
case KFN_CHAN_READ:
return chan_read((short)param0, (const uint8_t *)param1, (short)param2);
case KFN_CHAN_READ_LINE:
return chan_readline((short)param0, (const uint8_t *)param1, (short)param2);
default:
DEBUG("syscall unknown function\n");
do {} while (1);
return -1;
}
}