/* two ways to say what a system call is */
#define SYSCALL(x) void x(struct Ureg *ureg)
typedef void(*Syscall)(struct Ureg*);
/* macros for use within system calls */
#define ARG1 ((ureg)->bx)
#define ARG2 ((ureg)->cx)
#define ARG3 ((ureg)->dx)
#define ARG4 ((ureg)->si)
#define ARG5 ((ureg)->di)
#define RETURN(X) { ureg->ax = (ulong) (X); return; }
/* a mechanically generated list of names. */
extern char *syscallname[];
/*
* provided by systab.c, which is mechanically
* generated from systab
*/
extern Syscall syscalltab[];
/* the current end of bss, for brk */
extern void *bss;
/* an assembly hack */
void jumpstack(ulong addr, ulong *stack);
/* debugging */
#define DPRINT if(!debug) {} else print
extern int debug;
/* error.c translate from plan9 errors to linux ones */
int mkerror(void);
/* elf loader, elf.c */
ulong elfload(void*);
void elfdump(void*);
|