Coherent4.2.10/include/ieeefp.h
/* (-lgl
* Coherent 386 release 4.2
* Copyright (c) 1982, 1993 by Mark Williams Company.
* All rights reserved. May not be copied without permission.
* For copying permission and licensing info, write licensing@mwc.com
-lgl) */
#ifndef __IEEEFP_H__
#define __IEEEFP_H__
/*
* Describes the stack frame presented to a user signal handler,
* including (optional) floating point context.
*/
/*
* The following magic numbers index the "reg" part of a saved signal context.
* These numbers *must* correspond to the structure offsets in the
* <common/_gregset.h> header for this to work.
*/
#define SS 18
#define UESP 17
#define EFL 16
#define CS 15
#define EIP 14
#define ERR 13
#define TRAPNO 12
#define EAX 11
#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
/*
* "fpem" objects are for floating point emulation.
*
* The stackframe passed to a signal handler includes a pointer "fpsp".
* This pointer is a (struct _fpstate *) when a true coprocessor is in use.
* It is actually a (struct _fpemstate *), and must be cast thus, when
* the emulator is used.
* The declaration of "fpsp" is kept as (struct _fpstate *) for BCS
* compatibility.
*/
struct _fpem_reg {
char sign;
char tag;
long exp;
unsigned sigl;
unsigned sigh;
};
struct _fpstackframe {
long signo;
long regs[SS+1];
struct _fpstate *fpsp;
char *wsp;
};
struct _fpreg {
unsigned short significand[4];
unsigned short exponent;
};
struct _fpstate {
unsigned long cw,
sw,
tag,
ipoff,
cssel,
dataoff,
datasel;
struct _fpreg _st[8];
unsigned long status;
};
struct _fpemstate {
unsigned long cw,
sw,
tag,
ipoff,
cssel,
dataoff,
datasel,
top;
struct _fpem_reg regs[8]; /* pseudo regs */
unsigned char lookahead;
unsigned long status,
entry_eip;
};
/* For kernel context in u area, which keeps either emulator or ndp status. */
union _fpcontext {
struct _fpstate fpstate;
struct _fpemstate fpemstate;
};
#endif