svr4_genassym.c revision 43412
143412Snewton/* $Id$ */
243412Snewton/* Derived from:  Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */
343412Snewton
443412Snewton#include <sys/param.h>
543412Snewton
643412Snewtonstruct proc;
743412Snewton
843412Snewton#include <svr4/svr4.h>
943412Snewton#include <svr4/svr4_signal.h>
1043412Snewton#include <svr4/svr4_ucontext.h>
1143412Snewton
1243412Snewton/* XXX: This bit sucks rocks, but gets rid of compiler errors.  Maybe I should
1343412Snewton * fix the include files instead... */
1443412Snewton#define SVR4_MACHDEP_JUST_REGS
1543412Snewton#include <i386/svr4/svr4_machdep.h>
1643412Snewton
1743412Snewton#define	offsetof(type, member)	((size_t)(&((type *)0)->member))
1843412Snewton#define	OS(s, m)	((u_int)offsetof(struct s, m))
1943412Snewton
2043412Snewtonint	main __P((void));
2143412Snewtonint	printf __P((const char *, ...));
2243412Snewton
2343412Snewtonint
2443412Snewtonmain()
2543412Snewton{
2643412Snewton	printf("#define\tSVR4_SIGF_HANDLER %u\n",
2743412Snewton	    OS(svr4_sigframe, sf_handler));
2843412Snewton	printf("#define\tSVR4_SIGF_UC %u\n", OS(svr4_sigframe, sf_uc));
2943412Snewton	printf("#define\tSVR4_UC_FS %u\n",
3043412Snewton			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS]));
3143412Snewton	printf("#define\tSVR4_UC_GS %u\n",
3243412Snewton			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS]));
3343412Snewton	printf("#define\tSVR4_UC_EFLAGS %u\n",
3443412Snewton			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL]));
3543412Snewton	return (0);
3643412Snewton}
37