#ifndef sigcont_h
#define sigcont_h 1


#ifndef __TYPES_H_INCLUDED
#include <sys/types.h>
#endif

typedef struct _sigcontext SIGCONTEXT;
struct _sigcontext {
        ulong_t   sc_mask;
        ulong_t   sc_gs:16,:16; /* register set at fault time */
        ulong_t   sc_fs:16,:16;
        ulong_t   sc_es:16,:16;
        ulong_t   sc_ds:16,:16;
        ulong_t   sc_di;
        ulong_t   sc_si;
        ulong_t   sc_bp;
        ulong_t   :32;          /* hole from pushad */
        ulong_t   sc_bx;
        ulong_t   sc_dx;
        ulong_t   sc_cx;
        ulong_t   sc_ax;
        ulong_t   sc_ip;
        ulong_t   sc_cs:16, :16;
        ulong_t   sc_fl;
        ulong_t   sc_sp;
        ulong_t   sc_ss:16, :16;
        ulong_t   sc_info;       /* fault specific info */
        ushort_t  sc_errc;       /* error code pushed by processor */
        uchar_t   sc_fault;      /* actual fault # */
        uchar_t   sc_flags;      /* signal handler flags: */
#define SC_ONSTACK 1
};

enum sc_errc_enum {
	TRAP_ZDIV    = 0,
	TRAP_DEBUG   = 1,
	TRAP_NMI     = 2,
	TRAP_BRKPT   = 3,
	TRAP_OFLOW   = 4,
	TRAP_BOUNDS  = 5,
	TRAP_BADOP   = 6,
	TRAP_NONDP   = 7,
	TRAP_DFAULT  = 8,
	TRAP_NDPSEGV = 9,
	TRAP_BADTSS  = 10,
	TRAP_NOTPRESENT=11,
	TRAP_NOSTACK = 12,
	TRAP_GPF     = 13,
	TRAP_PAGE    = 14,
	TRAP_FPERROR = 16,
};

#define __ERRC_VALID (1<<TRAP_DFAULT | 1<<TRAP_BADTSS |\
        1<<TRAP_NOTPRESENT | 1<<TRAP_NOSTACK | 1<<TRAP_GPF | 1<<TRAP_PAGE )

#define __INFO_VALID (1<<TRAP_PAGE)


#endif
