/*static char *SCCSID = "@(#)dossymc.h  6.1 90/11/17";*/
/*      SCCSID = @(#)dossymc.h  13.6 90/02/10 */

/*************************************************************************/
/*                                                                       */
/*      OS/2 2.0 Master Symbol Definitions                               */
/*                                                                       */
/*                                                                       */
/*              includes standard macro definitions                      */
/*                                                                       */
/*************************************************************************/

/* ASM
Debug   =       FALSE
DOS3_2  =       FALSE           ; DOS 3.2 switch
*/

#define MAJOR_VERSION   20       // Use decimal numbers here!  40 = version 4
#define MINOR_VERSION   40       // Use decimal numbers here!  30 = release 3
                                 // do not precede with 0 (or even 00) h2INC will puke!
#define REVISION_LETTER 0       // 71936; defined revision level 0 for r207 tree

// Control character definitions

#define c_DEL   0x7F            //    ASCII rubout or delete previous char
#define c_BS    0x08            // ^H ASCII backspace
#define c_CR    0x0D            // ^M ASCII carriage return
#define c_LF    0x0A            // ^J ASCII linefeed
#define c_ETB   0x17            // ^W ASCII end of transmission
#define c_NAK   0x15            // ^U ASCII negative acknowledge
#define c_ETX   0x03            // ^C ASCII end of text
#define c_HT    0x09            // ^I ASCII tab


/*----+----+----+----+----+----+----+----+----+----+----+----+----+----+----*/
//
//           C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R
//
// Certain structures, constants and system  calls  below  are  private to
// the DOS  and are  extremely  version-dependent.  They may change at any
// time at  the implementors'  whim.   As  a  result,  they  must  not  be
// documented to the  general  public.   If  an  extreme case arises, they
// must be documented with this warning.
//
// Those structures and constants that are subject to  the  above  will be
// marked and bracketed with the flag:
//
//           C  A  V  E  A  T     P  R  O  G  R  A  M  M  E  R
//
/*----+----+----+----+----+----+----+----+----+----+----+----+----+----+----*/

// User stack inside of system call

//      Location of user registers when saved on stack during
//      system call.
//
//      these offsets are relative to User_SS and User_SP.
//
//      Note that the routines PUSH_ALL and POP_ALL do the work;
//      their code must correspond to these definitions.

struct  user_environ {
        ushort_t        user_AX ;
        ushort_t        user_BX ;
        ushort_t        user_CX ;
        ushort_t        user_DX ;
        ushort_t        user_SI ;
        ushort_t        user_DI ;
        ushort_t        user_BP ;
        ushort_t        user_DS ;
        ushort_t        user_ES ;
        ushort_t        user_IP ;
        ushort_t        user_CS ;
        ushort_t        user_F ;
};


//**    Per process limits

#define FILPERPROC      20              // Default number of file handles

#define maxVPB          5               // maximum concurrent searches.

/***    CharType equates
 *
 *      The following equates are used in the CharType array.
 */

#define fChk    1
#define fDelim  2
#define fSpChk  4
#define fFCB    8
#define fDBCS   0x10                // lead byte of DBCS character
#define fNewChar 0x20               // character legal for IFSs, not for FAT FS


// Task Definitions

// Bit meanings for TCBForcedActions.
// BUGBUG: These flags are obsolete!!!!  Use TK_FF_... in tkexport.h!!!!

#define FF_BUF          0x001           // Buffer must be released
#define FF_DES          0x002           // Destroy process

// Bit meanings for the per task variable CP_Flgs
// Meaning:
//      fCP_DBCS  if clear the codepage associated with the process
//                has DBCS characters -- the extra code to check
//                for lead bytes and trailing bytes must done.
//                if set the codepage is not DBCS.
//

#define fCP_DBCS                0x01            // Clear => DBCS activity

// Parameters to DirecIOAllowed routine.  If DO_DIRECT_WRITE is passed,
// the behavior bits of the process are checked to see if it is allowed
// to direct disk I/O.

#define DO_DIRECT_READ          0       // Process wants to do a read
#define DO_DIRECT_WRITE         1       // Process wants to do a write



// *** Bit definitions for DOS_FLAG ***
/*
 Bit 0 - this is set when a $open call is made from $exec. This is used in
         $open to indicate to the redirector that this open is being made
         by an exec call.

 Bit 1 - Added SWITCHES=/W for suppressing mandatory loading of WINA20.386

 Bit 2 - Support for copy protected apps. Defined bit 2 of DOS_FLAG.
         added A20OFF_FLAG for MS PASCAL 3.2 compatibility support
         for DOS5.X running in HMA.

 The start up code of MS PASCAL 3.2 programs depend on the 1M address wrap
 if they load below 64K. This is a likely possiblity in DOS 5.x with DOS in
 the HMA. By default DOS will turn A20 OFF before Xferring control to the
 user program in the case of an Exec call. The next call to DOS will turn
 A20 line ON. It has been observed that MS PASCAL 3.2 start up does an int
 21 ah=25h call before executing the faulty code. This will turn A20 On.
 In order to support this we will set Bit 2 of this flag in the DOS exec
 call (msproc.asm) if DOS is running in the HMA. In $set_interrupt_vector in
 getset.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
 by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
 is non zero then A20 will be turned OFF before returning to the user.
 Bit 2 will be unconditionally cleared here.

 Mace utilities MKEYRATE.COM version 1.0 copyright 1987 is an execpacked
 program converted to a com file. Therefore if DOS is loaded high and if
 this program is loaded below 64K it will blurt out "packed file is corrupt".
 This program does an int 21 ah=49h before executing the buggy execpacked
 code. This int21 call turns a20 on and hence the problem. In $dealloc
 alloc.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
 by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
 is non zero then A20 will be turned OFF before returning to the user.
 Bit 2 will be unconditionally cleared here.
*/

#define EXECOPEN                1       // bit 0 of DOS_FLAG
#define SUPPRESS_WINA20         2       // bit 1 of DOS_FLAG
#define EXECA20OFF              4       // bit 2 of DOS_FLAG

