#include "unix.h"
#define MAIN


/* This data will be at 1000H */

/* Trap/Interrupt vector table */

/* This must be at a multiple of 4K  */

int  	bad_int(),
	acia_int(),
	uart_int(),
	clk_int(),
	ill_trap(),
	segv_trap(),
	stk_trap(),
 	unix();


struct vect vectable[26] = {

	{0, bad_int},
	{0, bad_int},
	{0, acia_int},
	{0, clk_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, bad_int},
	{0, uart_int},
	{0, bad_int},
	{0, bad_int},
	{0, ill_trap},
	{0, ill_trap},
	{0, stk_trap},
	{0, segv_trap},
	{0, unix},
	{0, ill_trap},
	{0, ill_trap},
	{0, ill_trap},
	{0, ill_trap},
	{0, ill_trap}
};


#include "extern.h"  /* This declares all the tables, etc */

int stdin, stdout, stderr;  /* Necessary for library, but never referenced */


/* Dispatch table for system calls */
int 	__exit(),
	_open(),
	_close(),
	_creat(),
	_mknod(),
	_link(),
	_unlink(),
	_read(),
	_write(),
	_seek(),
	_chdir(),
	_sync(),
	_access(),
	_chmod(),
	_chown(),
	_stat(),
	_fstat(),
	_dup(),
	_getpid(),
	_getppid(),
	_getuid(),
	_umask(),
	_getfsys(),
	_execve(),
	_wait(),
	_setuid(),
	_setgid(),
	_time(),
	_stime(),
	_ioctl(),
	_brk(),
	_sbrk(),
	_fork(),
	_mount(),
	_umount(),
	_signal(),
	_dup2(),
	_pause(),
	_alarm(),
	_kill(),
	_pipe(),
	_getgid(),
	_times();

int (*disp_tab[])() =
{	__exit,
	_open,
	_close,
	_creat,
	_mknod,
	_link,
	_unlink,
	_read,
	_write,
	_seek,
	_chdir,
	_sync,
	_access,
	_chmod,
	_chown,
	_stat,
	_fstat,
	_dup,
	_getpid,
	_getppid,
	_getuid,
	_umask,
	_getfsys,
	_execve,
	_wait,
	_setuid,
	_setgid,
	_time,
	_stime,
	_ioctl,
	_brk,
	_sbrk,
	_fork,
	_mount,
	_umount,
	_signal,
	_dup2,
	_pause,
	_alarm,
	_kill,
	_pipe,
	_getgid,
	_times
 };

int ncalls = sizeof(disp_tab) / sizeof(int(*)());

