svr4_genassym.c revision 50477
1/* $FreeBSD: head/sys/i386/svr4/svr4_genassym.c 50477 1999-08-28 01:08:13Z peter $ */
2/* Derived from:  Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */
3
4#include <sys/param.h>
5
6struct proc;
7
8#include <svr4/svr4.h>
9#include <svr4/svr4_signal.h>
10#include <svr4/svr4_ucontext.h>
11
12/* XXX: This bit sucks rocks, but gets rid of compiler errors.  Maybe I should
13 * fix the include files instead... */
14#define SVR4_MACHDEP_JUST_REGS
15#include <i386/svr4/svr4_machdep.h>
16
17#define	offsetof(type, member)	((size_t)(&((type *)0)->member))
18#define	OS(s, m)	((u_int)offsetof(struct s, m))
19
20int	main __P((void));
21int	printf __P((const char *, ...));
22
23int
24main()
25{
26	printf("#define\tSVR4_SIGF_HANDLER %u\n",
27	    OS(svr4_sigframe, sf_handler));
28	printf("#define\tSVR4_SIGF_UC %u\n", OS(svr4_sigframe, sf_uc));
29	printf("#define\tSVR4_UC_FS %u\n",
30			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS]));
31	printf("#define\tSVR4_UC_GS %u\n",
32			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS]));
33	printf("#define\tSVR4_UC_EFLAGS %u\n",
34			OS(svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL]));
35	return (0);
36}
37