Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/linuxemu/linux.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/* 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*);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].