/*
 * reg.h
 * 
 * Copyright (c) 1997 QNX Software Systems Limited (QSSL).  All rights reserved
 * 
 * This software is the confidential and proprietary information QSSL.
 * ("Confidential Information").  You shall not
 * disclose such Confidential Information. 
 * 
 */

#ifndef _SYS_REG_H_
#define _SYS_REG_H_

#ifdef __cplusplus
extern "C" {
#endif

#define SS	18
#define UESP	17
#define EFL	16
#define CS	15
#define EIP	14
#define ERR	13
#define TRAPNO	12
#define EAX	12
#define ECX	10
#define EDX	9
#define EBX	8
#define ESP	7
#define EBP	6
#define ESI	5
#define EDI	4
#define DS	3
#define ES	2
#define FS	1
#define GS	0

#define PC	EIP
#define USP	UESP
#define SP	ESP
#define PS	EFL
#define R0	EAX
#define R1	EDX

#define NGREG	19
typedef int	 greg_t;
typedef greg_t	 gregset_t[NGREG];

typedef struct fpu {
    union {
	struct fpchip_state {
	    int state[27];	/* saved 387 state */
	    int status;		/* not supported */
	} fpchip_state;
	char	fpregs[108];
    } fp_reg_set;
} fpregset_t;

typedef struct {
    gregset_t	 gregs;
    fpregset_t	 fpregs;
} mcontext_t;

#ifdef __cplusplus
};
#endif

#endif 

