| 1 | /* $Id: probkrnl.h,v 1.21 2001-02-23 02:57:54 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * Include file for ProbKrnl.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | #ifndef _ProbKrnl_h_
|
|---|
| 13 | #define _ProbKrnl_h_
|
|---|
| 14 |
|
|---|
| 15 | /*******************************************************************************
|
|---|
| 16 | * Defined Constants And Macros *
|
|---|
| 17 | *******************************************************************************/
|
|---|
| 18 | #define NBR_OF_KRNLIMPORTS 81 /* When this is changed make sure to */
|
|---|
| 19 | /* update the aImportTab in probkrnl.c */
|
|---|
| 20 | /* and make test faker in test.h and */
|
|---|
| 21 | /* the appropriate fake.c or fakea.asm.*/
|
|---|
| 22 | #define MAX_LENGTH_NAME 32 /* Max length for the function. */
|
|---|
| 23 |
|
|---|
| 24 | /* Entry-Point Type flag */
|
|---|
| 25 | #define EPT_PROC 0x00 /* procedure - overload procedure*/
|
|---|
| 26 | #define EPT_PROCIMPORT 0x01 /* procedure 32bit - import only */
|
|---|
| 27 | #define EPT_VARIMPORT 0x02 /* variable/non-procedure 32bit */
|
|---|
| 28 | #define EPT_NOT_REQ 0x04 /* Not required flag. */
|
|---|
| 29 | #define EPTNotReq(a) (((a).fType & (EPT_NOT_REQ)) == EPT_NOT_REQ)
|
|---|
| 30 | #define EPT_WRAPPED 0x40 /* Wrapped due - differs between builds */
|
|---|
| 31 | #define EPTWrapped(a) (((a).fType & (EPT_WRAPPED)) == EPT_WRAPPED)
|
|---|
| 32 | #define EPT_32BIT 0x00 /* 32 bit entry-point */
|
|---|
| 33 | #define EPT_16BIT 0x80 /* 16 bit entry-point */
|
|---|
| 34 | #define EPT_BIT_MASK 0x80 /* Mask bit entry-point */
|
|---|
| 35 | #define EPT16BitEntry(a) (((a).fType & EPT_BIT_MASK) == EPT_16BIT)
|
|---|
| 36 | #define EPT32BitEntry(a) (((a).fType & EPT_BIT_MASK) == EPT_32BIT)
|
|---|
| 37 |
|
|---|
| 38 | /* 32bit types */
|
|---|
| 39 | #define EPT_PROC32 (EPT_PROC | EPT_32BIT)
|
|---|
| 40 | #define EPT_PROCIMPORT32 (EPT_PROCIMPORT | EPT_32BIT)
|
|---|
| 41 | #define EPT_PROCIMPORTNR32 (EPT_PROCIMPORT | EPT_32BIT | EPT_NOT_REQ)
|
|---|
| 42 | #define EPT_VARIMPORT32 (EPT_VARIMPORT | EPT_32BIT)
|
|---|
| 43 | #define EPT_VARIMPORTNR32 (EPT_VARIMPORT | EPT_32BIT | EPT_NOT_REQ)
|
|---|
| 44 | #define EPT32Proc(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC32)
|
|---|
| 45 | #define EPT32ProcImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT32)
|
|---|
| 46 | #define EPT32ProcImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR32)
|
|---|
| 47 | #define EPT32VarImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT32)
|
|---|
| 48 | #define EPT32VarImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORTNR32)
|
|---|
| 49 |
|
|---|
| 50 | /* 16bit types */
|
|---|
| 51 | #define EPT_PROC16 (EPT_PROC | EPT_16BIT)
|
|---|
| 52 | #define EPT_PROCIMPORT16 (EPT_PROCIMPORT | EPT_16BIT) /* far proc in calltab with a far jmp. */
|
|---|
| 53 | #define EPT_PROCIMPORTNR16 (EPT_PROCIMPORT | EPT_16BIT | EPT_NOT_REQ)
|
|---|
| 54 | #define EPT_VARIMPORT16 (EPT_VARIMPORT | EPT_16BIT)
|
|---|
| 55 | #define EPT_VARIMPORTNR16 (EPT_VARIMPORT | EPT_16BIT | EPT_NOT_REQ)
|
|---|
| 56 | #define EPT16Proc(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC16)
|
|---|
| 57 | #define EPT16ProcImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT16)
|
|---|
| 58 | #define EPT16ProcImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR16)
|
|---|
| 59 | #define EPT16VarImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT16)
|
|---|
| 60 | #define EPT16VarImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORTNR16)
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | /* Kernel type: SMP/UNI/W4 (flags matches KF_* in options.h) */
|
|---|
| 64 | #if 0
|
|---|
| 65 | #define TYPE_UNI 0x00 /* Any UNI processor kernel except Warp 4 fp13 and above. */
|
|---|
| 66 | #define TYPE_SMP 0x01 /* SMP Warp3 Adv. or Warp 4.5 SMP */
|
|---|
| 67 | #define TYPE_W4 0x02 /* Warp4 fp13 and above. */
|
|---|
| 68 | #endif
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | /*******************************************************************************
|
|---|
| 72 | * Structures and Typedefs *
|
|---|
| 73 | *******************************************************************************/
|
|---|
| 74 | #pragma pack(1)
|
|---|
| 75 | typedef struct tagIMPORTKRNLSYM
|
|---|
| 76 | {
|
|---|
| 77 | unsigned char fFound; /* This is set when name is found */
|
|---|
| 78 | unsigned char iObject; /* Object number the name was found in*/
|
|---|
| 79 | unsigned short int cchName; /* Length of the name (optmize search) (INPUT) */
|
|---|
| 80 | unsigned char achName[MAX_LENGTH_NAME]; /* Name (INPUT) */
|
|---|
| 81 | unsigned char achExtra[4]; /* Parameter extra. */
|
|---|
| 82 | unsigned long int offObject; /* Offset into the object */
|
|---|
| 83 | unsigned long int ulAddress; /* 32-bit flat address */
|
|---|
| 84 | unsigned short int usSel; /* Select of the object */
|
|---|
| 85 | unsigned char cbProlog; /* Size of the prolog needing to be exchanged */
|
|---|
| 86 | unsigned char fType; /* Entry-Point Type Flags */
|
|---|
| 87 | } IMPORTKRNLSYM;
|
|---|
| 88 | #pragma pack()
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | /*
|
|---|
| 92 | * Database of kernel symbols.
|
|---|
| 93 | */
|
|---|
| 94 | #pragma pack(1)
|
|---|
| 95 | typedef struct
|
|---|
| 96 | {
|
|---|
| 97 | unsigned short usBuild; /* Build number */
|
|---|
| 98 | unsigned short fKernel; /* Kernel flag (KF_* defines in options.h). */
|
|---|
| 99 | unsigned char cObjects; /* Count of objects */
|
|---|
| 100 | struct
|
|---|
| 101 | {
|
|---|
| 102 | unsigned char iObject; /* Object number. */
|
|---|
| 103 | unsigned long offObject; /* offset into object of the symbol. */
|
|---|
| 104 | } aSyms[NBR_OF_KRNLIMPORTS];
|
|---|
| 105 |
|
|---|
| 106 | } KRNLDBENTRY, *PKRNLDBENTRY;
|
|---|
| 107 | #pragma pack()
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | /*******************************************************************************
|
|---|
| 112 | * Global Variables *
|
|---|
| 113 | * NOTE! These are only available at init time! *
|
|---|
| 114 | *******************************************************************************/
|
|---|
| 115 | extern IMPORTKRNLSYM DATA16_GLOBAL aImportTab[NBR_OF_KRNLIMPORTS]; /* Defined in ProbKrnl.c */
|
|---|
| 116 | extern char DATA16_GLOBAL szSymbolFile[60]; /* Defined in ProbKrnl.c */
|
|---|
| 117 | extern KRNLDBENTRY DATA16_INIT aKrnlSymDB[]; /* Defined in symdb.c (for 16-bit usage) */
|
|---|
| 118 |
|
|---|
| 119 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
|---|
| 120 | #pragma map( aImportTab , "_aImportTab" )
|
|---|
| 121 | #pragma map( szSymbolFile,"_szSymbolFile")
|
|---|
| 122 | #pragma map( aKrnlSymDB , "_aKrnlSymDB" )
|
|---|
| 123 | #endif
|
|---|
| 124 |
|
|---|
| 125 | /*
|
|---|
| 126 | * 16-bit init time functions.
|
|---|
| 127 | */
|
|---|
| 128 | #if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
|
|---|
| 129 | int ProbeKernel(PRPINITIN pReqPack);
|
|---|
| 130 | const char * GetErrorMsg(short sErr);
|
|---|
| 131 | #endif
|
|---|
| 132 |
|
|---|
| 133 | #endif
|
|---|
| 134 |
|
|---|