/*static char *SCCSID = "@(#)sysinvar.h	6.1 90/11/17";*/
/*static char *SCCSID = "@(#)sysinvar.h	13.12 90/04/12";*/
/*	sysinvar.h - Initialization variable structure for SYSINIT/MSINIT.
 *
 *----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
 *
 *	     C	A  V  E	 A  T	  P  R	O  G  R	 A  M  M  E  R
 *
 *
 *	The DOS boot sequence uses these structures for communication
 *	between SYSINIT and MSINIT.  Care should be taken to make sure
 *	that any changes made to the interface are reflected here.
 *
 */
struct MsInitVars_s {
	struct arena FAR  *mi_pArenaInfo;	/* Pointer to arena array */
	struct a_BPB FAR  *mi_pbpb;		/* Pointer to boot BPB */
	unsigned char	   mi_Drive;		/* Default Drive */
	unsigned char	   mi_BootFlags;	/* boot flags */
	unsigned short	   mi_DosHlpSeg;	/* DosHlp segment */
	unsigned short	   mi_DosHlpLen;	/* Length of DosHlp segment */
	unsigned FAR	  *mi_DosHlpAddr;	/* Pointer to DosHlp Table */
	unsigned char	   mi_BreakChar;	/* debugger break char */
	unsigned char	   mi_PadByte;		/* pad byte to fix alignment */
	unsigned	   mi_OEMDDStra;	/* OEMHLP$ strategy offset */
};

struct arena_s {
	unsigned long	a_paddr;	/* physical address */
	unsigned long	a_size;		/* byte granular size */
	unsigned long	a_laddr;	/* virtual address */
	unsigned short	a_sel;		/* selector */
	unsigned short	a_aflags;	/* arena flags */
	unsigned long	a_oflags;	/* flags (object table entry-style) */
	unsigned short	a_owner;	/* owner */
};

#define AF_INVALID	 0x0001		/* physical address range is invalid */
#define AF_FREE		 0x0002		/* physical address range is free */
#define AF_LADDR	 0x0004		/* a_laddr field is valid */
#define	AF_PADDR	 0x0008		/* object has sparse physical mapping */
#define AF_DOSHLP	 0x0010		/* source is DOSHLP */
#define AF_FSD		 0x0020		/* source is FSD */
#define AF_RIPL		 0x0030		/* source is RIPL */
#define AF_OS2KRNL	 0x0040		/* source is kernel load image */
#define AF_OS2LDR	 0x0050		/* source is os2ldr */
#define AF_SRCMASK	 0x0070		/* object source mask */
#define	AF_MAPPED	 0x0080		/* used locally in page mgr init */
#define AF_OBJMASK	 0x1f00		/* kernel object table index mask */
#define	AF_FAST		 0x2000		/* physical memory is fast */
#define AF_PEND		 0x4000		/* physical end of arena */
#define AF_VEND		 0x8000		/* virtual end of arena */
/*#define AF_RESERVED	 0x0000*/

#define AF_OBJSHIFT	 8		/* kernel object table index shift */

/*
 * The following constants define the DosHlp selectors.  The code selector
 * is tiled at the first page boundary above the real mode IDT and the ROM
 * data area at 40:0.
 */

#define DOSHLP_CODESEL	0x0100
#define DOSHLP_DATASEL	(DOSHLP_CODESEL + 8)
/*
 *
 *	     C	A  V  E	 A  T	  P  R	O  G  R	 A  M  M  E  R
 *
 *----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
 */
