/* ------------------------------------------------------ */
/*  iRMX structure declarations   */
#pragma noalign (dosstatestruct)
typedef struct dosstatestruct {
          DWORD     edi;
          DWORD     esi;
          DWORD     ebp;
          DWORD     res1;
          DWORD     ebx;
          DWORD     edx;
          DWORD     ecx;
          DWORD     eax;
          DWORD     res2;
          DWORD     eip;
          DWORD     cs;
          DWORD     eflags;
          DWORD     esp;
          DWORD     ss;
          DWORD     es;
          DWORD     ds;
          DWORD     fs;
          DWORD     gs;
} DOSSTATESTRUC;

typedef struct flagsstruc {    unsigned cf:  1;
                    unsigned res1: 1;
                    unsigned pf:   1;
                    unsigned res2: 1;
                    unsigned af:   1;
                    unsigned res3: 1;
                    unsigned zf:   1;
                    unsigned sf:   1;
                    unsigned tf:   1;
                    unsigned ief:  1;
                    unsigned df:   1;
                    unsigned of:   1;
                    unsigned ioplf:     2;
                    unsigned ntf:  1;
                    unsigned res4: 1;
} FLAGSTRUCT;

#pragma noalign (WORDREGS)
struct WORDREGS{
                    WORD status;
                    WORD flags;
                    BYTE int_num;
                    BYTE tsr_flags;
                    WORD reg_ax;
                    WORD reg_bx;
                    WORD reg_cx;
                    WORD reg_dx;
                    WORD reg_di;
                    WORD reg_si;
                    WORD reg_ds;
                    WORD reg_es;
                    WORD reg_bp;
                    BYTE xfer_data;
                    BYTE src1_xfer_pair;
                    BYTE src2_xfer_pair;
                    BYTE dest1_xfer_pair;
                    BYTE dest2_xfer_pair;
                    BYTE far *src_p_1;
                    WORD src_count_1;
                    BYTE far *src_p_2;
                    WORD src_count_2;
                    BYTE far *dest_p_1;
                    WORD dest_count_1;
                    BYTE far *dest_p_2;
                    WORD dest_count_2;
     };
#pragma noalign (BYTEREGS)
struct BYTEREGS {
                    WORD status;
                    WORD flags;
                    BYTE int_num;
                    BYTE tsr_flags;
                    BYTE reg_al;
                    BYTE reg_ah;
                    BYTE reg_bl;
                    BYTE reg_bh;
                    BYTE reg_cl;
                    BYTE reg_ch;
                    BYTE reg_dl;
                    BYTE reg_dh;
                    WORD reg_di;
                    WORD reg_si;
                    WORD reg_ds;
                    WORD reg_es;
                    WORD reg_bp;
                    BYTE xfer_data;
                    BYTE src1_xfer_pair;
                    BYTE src2_xfer_pair;
                    BYTE dest1_xfer_pair;
                    BYTE dest2_xfer_pair;
                    BYTE far *src_p_1;
                    WORD src_count_1;
                    BYTE far *src_p_2;
                    WORD src_count_2;
                    BYTE far *dest_p_1;
                    WORD dest_count_1;
                    BYTE far *dest_p_2;
                    WORD dest_count_2;
               };
typedef union dosdatastruct   {
               struct WORDREGS x;
               struct BYTEREGS h;
               } DOSDATASTRUC;

/* ------------------------------------------------------ */
/* iRMX Nucleus interface functions /*
#pragma fixedparams("rqesetvm86extension")
#pragma fixedparams("rqedosrequest")

extern void rqesetvm86extension(BYTE,
     void (far *)(void),
     void (far *)(void),
     WORD far *);

extern void rqedosrequest(DOSDATASTRUC far *,
     WORD,
     WORD far *);
