| 1 | /* $Id: dev32.h,v 1.9 2002-12-16 02:25:06 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * dev32 - header file for 32-bit part of the driver.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1999 knut st. osmundsen
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 | #ifndef _dev32_h_
|
|---|
| 11 | #define _dev32_h_
|
|---|
| 12 |
|
|---|
| 13 | #ifdef __cplusplus
|
|---|
| 14 | extern "C" {
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | /*
|
|---|
| 18 | * Wrapper for declaration from dev1632.h used in this file.
|
|---|
| 19 | */
|
|---|
| 20 | #ifndef _dev1632_h_
|
|---|
| 21 | #define RP32INIT void
|
|---|
| 22 | #define PRP32INIT void *
|
|---|
| 23 | #define RP32GENIOCTL void
|
|---|
| 24 | #define PRP32GENIOCTL void *
|
|---|
| 25 | #define RP32GENIOCTL void
|
|---|
| 26 | #define PRP32GENIOCTL void *
|
|---|
| 27 | #define RP32OPENCLOSE void
|
|---|
| 28 | #define PRP32OPENCLOSE void *
|
|---|
| 29 | #define PKRNLINFO void *
|
|---|
| 30 | #endif
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | /*
|
|---|
| 34 | * Defines from reqpkt.h.
|
|---|
| 35 | */
|
|---|
| 36 | #define MAX_DISKDD_CMD 29
|
|---|
| 37 |
|
|---|
| 38 | #define STERR 0x8000 /* Bit 15 - Error */
|
|---|
| 39 | #define STINTER 0x0400 /* Bit 10 - Interim character */
|
|---|
| 40 | #define STBUI 0x0200 /* Bit 9 - Busy */
|
|---|
| 41 | #define STDON 0x0100 /* Bit 8 - Done */
|
|---|
| 42 | #define STECODE 0x00FF /* Error code */
|
|---|
| 43 | #define WRECODE 0x0000
|
|---|
| 44 |
|
|---|
| 45 | #define STATUS_DONE 0x0100
|
|---|
| 46 | #define STATUS_ERR_UNKCMD 0x8003
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 | #define RPF_Int13RP 0x01 /* Int 13 Request Packet */
|
|---|
| 50 | #define RPF_CallOutDone 0x02 /* Int 13 Callout completed */
|
|---|
| 51 | #define RPF_PktDiskIOTchd 0x04 /* Disk_IO has touched this packet */
|
|---|
| 52 | #define RPF_CHS_ADDRESSING 0x08 /* CHS Addressing used in RBA field */
|
|---|
| 53 | #define RPF_Internal 0x10 /* Internal request packet command */
|
|---|
| 54 | #define RPF_TraceComplete 0x20 /* Trace completion flag */
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | /*
|
|---|
| 58 | * Function prototypes.
|
|---|
| 59 | */
|
|---|
| 60 | ULONG _System GetKernelInfo32(PKRNLINFO pKrnlInfo);
|
|---|
| 61 | ULONG _System VerifyImportTab32(void);
|
|---|
| 62 | #ifdef _dev1632_h_
|
|---|
| 63 | ULONG _System LookupKrnlEntry32(PLKE32PARAM plke32Param);
|
|---|
| 64 | #endif
|
|---|
| 65 | #ifdef _OS2KLDR_H_
|
|---|
| 66 | PMTE _System GetOS2KrnlMTE(void); /* (devfirst.asm) */
|
|---|
| 67 | #endif
|
|---|
| 68 | ULONG _Optlink InitCallGate(void);
|
|---|
| 69 | ULONG _Optlink x86DisableWriteProtect(void);
|
|---|
| 70 | ULONG _Optlink x86RestoreWriteProtect(ULONG flWP);
|
|---|
| 71 | int interpretFunctionProlog32(char *pach);
|
|---|
| 72 | int interpretFunctionProlog16(char *pach);
|
|---|
| 73 | int InitkKrnlLibLog(void);
|
|---|
| 74 | int krnlInit(void);
|
|---|
| 75 | int krnlInit2(void);
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 | /*
|
|---|
| 80 | * Global variables
|
|---|
| 81 | */
|
|---|
| 82 | #ifdef _OS2KLDR_H_
|
|---|
| 83 | extern POTE pKrnlOTE; /* d32init.c */
|
|---|
| 84 | extern PSMTE pKrnlSMTE; /* d32init.c */
|
|---|
| 85 | #endif
|
|---|
| 86 |
|
|---|
| 87 | extern ULONG Device_Help;
|
|---|
| 88 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
|---|
| 89 | #pragma map( Device_Help , "_Device_Help" )
|
|---|
| 90 | #endif
|
|---|
| 91 |
|
|---|
| 92 | extern PULONG pulTKSSBase32;
|
|---|
| 93 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
|---|
| 94 | #pragma map( pulTKSSBase32 , "_pulTKSSBase32" )
|
|---|
| 95 | #endif
|
|---|
| 96 | extern USHORT CallGateGDT;
|
|---|
| 97 |
|
|---|
| 98 | #ifndef SSToDS
|
|---|
| 99 | /*
|
|---|
| 100 | * SSToDS( stack pointer )
|
|---|
| 101 | *
|
|---|
| 102 | * In RING-0 this translates pointers to stack memory in the
|
|---|
| 103 | * Stack Segment (SS) to pointers to stack memory in the
|
|---|
| 104 | * Data Segment (DS). SS is 16-bit compatible, DS is 32-bit flat.
|
|---|
| 105 | * It is vitally important to use this macro whenever creating
|
|---|
| 106 | * a pointer to stack memory which don't implies that is a pointer
|
|---|
| 107 | * relative to SS. For example when passing the pointer to an stack
|
|---|
| 108 | * variable into an function call; like the addToModule calls.
|
|---|
| 109 | *
|
|---|
| 110 | * Warning - At init-time you have ot make sure that the pulTKSSBase32 pointer is set!
|
|---|
| 111 | *
|
|---|
| 112 | * @returns 32-bit FLAT pointer.
|
|---|
| 113 | */
|
|---|
| 114 | #ifdef RING0
|
|---|
| 115 | #define SSToDS(a) ((PVOID)((ULONG)(a) + *pulTKSSBase32))
|
|---|
| 116 | #else
|
|---|
| 117 | #define SSToDS(a) ((PVOID)(a))
|
|---|
| 118 | #endif
|
|---|
| 119 |
|
|---|
| 120 | #endif /* SSToDS */
|
|---|
| 121 |
|
|---|
| 122 | #ifdef __cplusplus
|
|---|
| 123 | }
|
|---|
| 124 | #endif
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 | /*
|
|---|
| 128 | * START and END labels. NOTE: these are not bytes only assembly labels.
|
|---|
| 129 | */
|
|---|
| 130 | extern char DATA16START ;
|
|---|
| 131 | extern char DATA16_BSSSTART ;
|
|---|
| 132 | extern char DATA16_CONSTSTART;
|
|---|
| 133 | extern char DATA16_INITSTART ;
|
|---|
| 134 | extern char DATA16_INIT_BSSSTART ;
|
|---|
| 135 | extern char DATA16_INIT_CONSTSTART;
|
|---|
| 136 | extern char CODE16START ;
|
|---|
| 137 | extern char CODE16_INITSTART ;
|
|---|
| 138 | extern char CODE32START ;
|
|---|
| 139 | extern char DATA32START ;
|
|---|
| 140 | extern char BSS32START ;
|
|---|
| 141 | extern char CONST32_ROSTART ;
|
|---|
| 142 | extern char _VFTSTART ;
|
|---|
| 143 | extern char EH_DATASTART ;
|
|---|
| 144 |
|
|---|
| 145 | extern char CODE16END ;
|
|---|
| 146 | extern char DATA16END ;
|
|---|
| 147 | extern char DATA16_BSSEND ;
|
|---|
| 148 | extern char DATA16_CONSTEND;
|
|---|
| 149 | extern char DATA16_INITEND ;
|
|---|
| 150 | extern char DATA16_INIT_BSSEND ;
|
|---|
| 151 | extern char DATA16_INIT_CONSTEND;
|
|---|
| 152 | extern char CODE16END ;
|
|---|
| 153 | extern char CODE16_INITEND ;
|
|---|
| 154 | extern char CODE32END ;
|
|---|
| 155 | extern char DATA32END ;
|
|---|
| 156 | extern char BSS32END ;
|
|---|
| 157 | extern char CONST32_ROEND ;
|
|---|
| 158 | extern char _VFTEND ;
|
|---|
| 159 | extern char EH_DATAEND ;
|
|---|
| 160 |
|
|---|
| 161 | #endif
|
|---|