| 1 | /* $Id: dev16.h,v 1.3 1999-11-10 01:45:32 bird Exp $
|
|---|
| 2 | * dev16 - 16-bit specific. Should not be used in 32-bit C/C++.
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright (c) 1999 knut st. osmundsen
|
|---|
| 5 | *
|
|---|
| 6 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 | #ifndef _d16_h_
|
|---|
| 10 | #define _d16_h_
|
|---|
| 11 |
|
|---|
| 12 | #ifndef VMDHA_USEHIGHMEM /* macro from dhcalls.h where LIN and PLIN normally is declared. */
|
|---|
| 13 | typedef ULONG LIN;
|
|---|
| 14 | typedef ULONG FAR *PLIN;
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | /*
|
|---|
| 18 | * Ring 0 init IOCtl (dev1 -> dev0)
|
|---|
| 19 | */
|
|---|
| 20 | #define D16_IOCTL_CAT 0xC0
|
|---|
| 21 | #define D16_IOCTL_RING0INIT 0x40
|
|---|
| 22 | typedef struct _D16R0INITDATA
|
|---|
| 23 | {
|
|---|
| 24 | USHORT Status;
|
|---|
| 25 | } D16R0INITDATA;
|
|---|
| 26 | typedef D16R0INITDATA FAR *PD16R0INITDATA;
|
|---|
| 27 |
|
|---|
| 28 | typedef struct _D16R0INITPARAM
|
|---|
| 29 | {
|
|---|
| 30 | PRPINITIN pRpInitIn;
|
|---|
| 31 | } D16R0INITPARAM;
|
|---|
| 32 | typedef D16R0INITPARAM FAR *PD16R0INITPARAM;
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | /*
|
|---|
| 36 | * Get Kernel OTEs. No params. Data is KRNLOBJTABLE (dev1632.h).
|
|---|
| 37 | */
|
|---|
| 38 | #define D16_IOCTL_GETKRNLOTES 0x41
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | /*
|
|---|
| 42 | * Get Kernel OTEs. No params. No data. aProcTab is used.
|
|---|
| 43 | */
|
|---|
| 44 | #define D16_IOCTL_VERIFYPROCTAB 0x42
|
|---|
| 45 |
|
|---|
| 46 | /**
|
|---|
| 47 | * Regards goes to Matthieu Willm for (parts of) this!
|
|---|
| 48 | */
|
|---|
| 49 | #ifdef INCL_16
|
|---|
| 50 | typedef void FAR * FPVOID;
|
|---|
| 51 | #else
|
|---|
| 52 | typedef ULONG FPVOID;
|
|---|
| 53 | #endif
|
|---|
| 54 | typedef struct _DosTable /* dt */
|
|---|
| 55 | {
|
|---|
| 56 | UCHAR cul; /* count of entries (dwords) in this table.*/
|
|---|
| 57 | FPVOID fph_HardError;
|
|---|
| 58 | FPVOID fph_UCase;
|
|---|
| 59 | ULONG UnknownOrReserved1;
|
|---|
| 60 | ULONG UnknownOrReserved2;
|
|---|
| 61 | ULONG UnknownOrReserved3;
|
|---|
| 62 | FPVOID fph_MemMapAlias;
|
|---|
| 63 | FPVOID fph_MemUnmapAlias;
|
|---|
| 64 | FPVOID fph_GoProtAll;
|
|---|
| 65 | FPVOID fph_GoRealAll;
|
|---|
| 66 | FPVOID fph_doshlp_RedirDev;
|
|---|
| 67 | ULONG UnknownOrReserved4;
|
|---|
| 68 | ULONG UnknownOrReserved5;
|
|---|
| 69 | FPVOID fph_SFFromSFN;
|
|---|
| 70 | FPVOID fph_SegGetInfo;
|
|---|
| 71 | FPVOID fph_AsgCheckDrive;
|
|---|
| 72 | ULONG UnknownOrReserved6;
|
|---|
| 73 | ULONG UnknownOrReserved7;
|
|---|
| 74 | } DOSTABLE, FAR *PDOSTABLE , NEAR *NPDOSTABLE;
|
|---|
| 75 |
|
|---|
| 76 | typedef struct _DosTable2 /* dt2 */
|
|---|
| 77 | {
|
|---|
| 78 | UCHAR cul; /* count of entries (dwords) in this table.*/
|
|---|
| 79 | FPVOID fpErrMap24;
|
|---|
| 80 | FPVOID fpErrMap24End;
|
|---|
| 81 | FPVOID fpErr_Table_24;
|
|---|
| 82 | FPVOID fpCDSAddr;
|
|---|
| 83 | FPVOID fpGDT_RDR1;
|
|---|
| 84 | FPVOID fpInterrupLevel;
|
|---|
| 85 | FPVOID fp_cInDos;
|
|---|
| 86 | ULONG UnknownOrReserved1;
|
|---|
| 87 | ULONG UnknownOrReserved2;
|
|---|
| 88 | ULONG R0FlatCS;
|
|---|
| 89 | ULONG R0FlatDS;
|
|---|
| 90 | LIN pTKSSBase;
|
|---|
| 91 | LIN pintSwitchStack;
|
|---|
| 92 | LIN pprivatStack;
|
|---|
| 93 | FPVOID fpPhysDiskTablePtr;
|
|---|
| 94 | LIN pforceEMHandler;
|
|---|
| 95 | LIN pReserveVM;
|
|---|
| 96 | LIN p_pgpPageDir;
|
|---|
| 97 | ULONG UnknownOrReserved3;
|
|---|
| 98 | } DOSTABLE2, FAR *PDOSTABLE2 , NEAR *NPDOSTABLE2;
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | /*
|
|---|
| 102 | * init functions
|
|---|
| 103 | */
|
|---|
| 104 | USHORT NEAR dev0Init(PRPINITIN pRpIn, PRPINITOUT pRpOut);
|
|---|
| 105 | USHORT NEAR dev1Init(PRPINITIN pRpIn, PRPINITOUT pRpOut);
|
|---|
| 106 | USHORT NEAR R0Init16(PRP_GENIOCTL pRp);
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 | /*
|
|---|
| 110 | * Thunking "functions" prototypes
|
|---|
| 111 | */
|
|---|
| 112 | USHORT NEAR CallR0Init32(LIN pRpInit);
|
|---|
| 113 | USHORT NEAR CallGetOTEs32(ULONG addressOTEBuf);
|
|---|
| 114 | USHORT NEAR CallVerifyProcTab32(void);
|
|---|
| 115 |
|
|---|
| 116 | /*
|
|---|
| 117 | * These are only for use in the 'aDevHdrs'.
|
|---|
| 118 | */
|
|---|
| 119 | extern void NEAR strategyAsm0(void);
|
|---|
| 120 | extern void NEAR strategyAsm1(void);
|
|---|
| 121 |
|
|---|
| 122 | /*
|
|---|
| 123 | * Global data.
|
|---|
| 124 | */
|
|---|
| 125 | extern DDHDR aDevHdrs[2];
|
|---|
| 126 | extern PFN Device_Help;
|
|---|
| 127 | extern ULONG TKSSBase16;
|
|---|
| 128 | extern USHORT R0FlatCS16;
|
|---|
| 129 | extern USHORT R0FlatDS16;
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 | /*
|
|---|
| 133 | * Stack to Flat DS - 16-bit version.
|
|---|
| 134 | */
|
|---|
| 135 | /*#define SSToDS_16(pStackVar) ((LIN)(getTKSSBaseValue() + (ULONG)(USHORT)(pStackVar)))*/
|
|---|
| 136 | #define SSToDS_16(pStackVar) (SSToDS_16a((void NEAR *)pStackVar))
|
|---|
| 137 |
|
|---|
| 138 | extern LIN SSToDS_16a(void NEAR *pStackVar);
|
|---|
| 139 |
|
|---|
| 140 | /*
|
|---|
| 141 | * START and END labels. NOTE: these are not bytes only assembly labels.
|
|---|
| 142 | */
|
|---|
| 143 | extern char PASCAL CODE16START ;
|
|---|
| 144 | extern char PASCAL DATA16START ;
|
|---|
| 145 | extern char PASCAL DATA16START ;
|
|---|
| 146 | extern char PASCAL DATA16_BSSSTART ;
|
|---|
| 147 | extern char PASCAL DATA16_CONSTSTART;
|
|---|
| 148 | extern char PASCAL CODE16START ;
|
|---|
| 149 | extern char PASCAL CODE32START ;
|
|---|
| 150 | extern char PASCAL DATA32START ;
|
|---|
| 151 | extern char PASCAL BSS32START ;
|
|---|
| 152 | extern char PASCAL CONST32_ROSTART ;
|
|---|
| 153 |
|
|---|
| 154 | extern char PASCAL CODE16END ;
|
|---|
| 155 | extern char PASCAL DATA16END ;
|
|---|
| 156 | extern char PASCAL DATA16END ;
|
|---|
| 157 | extern char PASCAL DATA16_BSSEND ;
|
|---|
| 158 | extern char PASCAL DATA16_CONSTEND;
|
|---|
| 159 | extern char PASCAL CODE16END ;
|
|---|
| 160 | extern char PASCAL CODE32END ;
|
|---|
| 161 | extern char PASCAL DATA32END ;
|
|---|
| 162 | extern char PASCAL BSS32END ;
|
|---|
| 163 | extern char PASCAL CONST32_ROEND ;
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 | #endif
|
|---|