| 1 | /* $Id: dev32.h,v 1.11 2001-02-21 07:46:10 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 PKRNLINFO void *
|
|---|
| 26 | #endif
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | /*
|
|---|
| 30 | * Defines from reqpkt.h.
|
|---|
| 31 | */
|
|---|
| 32 | #define MAX_DISKDD_CMD 29
|
|---|
| 33 |
|
|---|
| 34 | #define STERR 0x8000 /* Bit 15 - Error */
|
|---|
| 35 | #define STINTER 0x0400 /* Bit 10 - Interim character */
|
|---|
| 36 | #define STBUI 0x0200 /* Bit 9 - Busy */
|
|---|
| 37 | #define STDON 0x0100 /* Bit 8 - Done */
|
|---|
| 38 | #define STECODE 0x00FF /* Error code */
|
|---|
| 39 | #define WRECODE 0x0000
|
|---|
| 40 |
|
|---|
| 41 | #define STATUS_DONE 0x0100
|
|---|
| 42 | #define STATUS_ERR_UNKCMD 0x8003
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | #define RPF_Int13RP 0x01 /* Int 13 Request Packet */
|
|---|
| 46 | #define RPF_CallOutDone 0x02 /* Int 13 Callout completed */
|
|---|
| 47 | #define RPF_PktDiskIOTchd 0x04 /* Disk_IO has touched this packet */
|
|---|
| 48 | #define RPF_CHS_ADDRESSING 0x08 /* CHS Addressing used in RBA field */
|
|---|
| 49 | #define RPF_Internal 0x10 /* Internal request packet command */
|
|---|
| 50 | #define RPF_TraceComplete 0x20 /* Trace completion flag */
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 | /*
|
|---|
| 54 | * Function prototypes.
|
|---|
| 55 | */
|
|---|
| 56 | #if !defined(__cplusplus) && defined(RING0)
|
|---|
| 57 | USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit);
|
|---|
| 58 | USHORT _loadds _Far32 _Pascal GetKernelInfo32(PKRNLINFO pKrnlInfo);
|
|---|
| 59 | USHORT _loadds _Far32 _Pascal VerifyImportTab32(void);
|
|---|
| 60 | USHORT _loadds _Far32 _Pascal ElfIOCtl(PRP32GENIOCTL pRpIOCtl);
|
|---|
| 61 | USHORT _loadds _Far32 _Pascal Win32kIOCtl(PRP32GENIOCTL pRpIOCtl);
|
|---|
| 62 | #endif
|
|---|
| 63 | #ifdef _OS2KLDR_H_
|
|---|
| 64 | PMTE _System GetOS2KrnlMTE(void); /* (devfirst.asm) */
|
|---|
| 65 | #endif
|
|---|
| 66 | ULONG _Optlink InitCallGate(void);
|
|---|
| 67 | ULONG _Optlink x86DisableWriteProtect(void);
|
|---|
| 68 | ULONG _Optlink x86RestoreWriteProtect(ULONG flWP);
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 | /*
|
|---|
| 73 | * Global variables
|
|---|
| 74 | */
|
|---|
| 75 | extern PULONG pulTKSSBase32;
|
|---|
| 76 | extern USHORT CallGateGDT;
|
|---|
| 77 |
|
|---|
| 78 | /*
|
|---|
| 79 | * SSToDS( stack pointer )
|
|---|
| 80 | *
|
|---|
| 81 | * In RING-0 this translates pointers to stack memory in the
|
|---|
| 82 | * Stack Segment (SS) to pointers to stack memory in the
|
|---|
| 83 | * Data Segment (DS). SS is 16-bit compatible, DS is 32-bit flat.
|
|---|
| 84 | * It is vitally important to use this macro whenever creating
|
|---|
| 85 | * a pointer to stack memory which don't implies that is a pointer
|
|---|
| 86 | * relative to SS. For example when passing the pointer to an stack
|
|---|
| 87 | * variable into an function call; like the addToModule calls.
|
|---|
| 88 | *
|
|---|
| 89 | * Warning - At init-time you have ot make sure that the pulTKSSBase32 pointer is set!
|
|---|
| 90 | *
|
|---|
| 91 | * @returns 32-bit FLAT pointer.
|
|---|
| 92 | */
|
|---|
| 93 | #ifdef RING0
|
|---|
| 94 | #define SSToDS(a) ((PVOID)((ULONG)(a) + *pulTKSSBase32))
|
|---|
| 95 | #else
|
|---|
| 96 | #define SSToDS(a) ((PVOID)(a))
|
|---|
| 97 | #endif
|
|---|
| 98 |
|
|---|
| 99 | #ifdef __cplusplus
|
|---|
| 100 | }
|
|---|
| 101 | #endif
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 | /*
|
|---|
| 105 | * START and END labels. NOTE: these are not bytes only assembly labels.
|
|---|
| 106 | */
|
|---|
| 107 | extern char DATA16START ;
|
|---|
| 108 | extern char DATA16_BSSSTART ;
|
|---|
| 109 | extern char DATA16_CONSTSTART;
|
|---|
| 110 | extern char DATA16_INITSTART ;
|
|---|
| 111 | extern char DATA16_INIT_BSSSTART ;
|
|---|
| 112 | extern char DATA16_INIT_CONSTSTART;
|
|---|
| 113 | extern char CODE16START ;
|
|---|
| 114 | extern char CODE16_INITSTART ;
|
|---|
| 115 | extern char CODE32START ;
|
|---|
| 116 | extern char DATA32START ;
|
|---|
| 117 | extern char BSS32START ;
|
|---|
| 118 | extern char CONST32_ROSTART ;
|
|---|
| 119 | extern char _VFTSTART ;
|
|---|
| 120 | extern char EH_DATASTART ;
|
|---|
| 121 |
|
|---|
| 122 | extern char CODE16END ;
|
|---|
| 123 | extern char DATA16END ;
|
|---|
| 124 | extern char DATA16_BSSEND ;
|
|---|
| 125 | extern char DATA16_CONSTEND;
|
|---|
| 126 | extern char DATA16_INITEND ;
|
|---|
| 127 | extern char DATA16_INIT_BSSEND ;
|
|---|
| 128 | extern char DATA16_INIT_CONSTEND;
|
|---|
| 129 | extern char CODE16END ;
|
|---|
| 130 | extern char CODE16_INITEND ;
|
|---|
| 131 | extern char CODE32END ;
|
|---|
| 132 | extern char DATA32END ;
|
|---|
| 133 | extern char BSS32END ;
|
|---|
| 134 | extern char CONST32_ROEND ;
|
|---|
| 135 | extern char _VFTEND ;
|
|---|
| 136 | extern char EH_DATAEND ;
|
|---|
| 137 |
|
|---|
| 138 | #endif
|
|---|