| 1 | /* $Id: probkrnl.h,v 1.13 2000-04-17 01:56:49 bird Exp $ | 
|---|
| 2 | * | 
|---|
| 3 | * Include file for ProbKrnl. | 
|---|
| 4 | * | 
|---|
| 5 | * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.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      18      /* When this is changed make sure to   */ | 
|---|
| 19 | /* update the arrays in d32init.c and  */ | 
|---|
| 20 | /* probkrnl.c */ | 
|---|
| 21 | #define MAX_LENGTH_NAME         32      /* Max length for the function. */ | 
|---|
| 22 |  | 
|---|
| 23 | /* Entry-Point Type flag */ | 
|---|
| 24 | #define EPT_PROC                0x00    /* procedure - overload procedure*/ | 
|---|
| 25 | #define EPT_PROCIMPORT          0x01    /* procedure 32bit - import only */ | 
|---|
| 26 | #define EPT_VARIMPORT           0x02    /* variable/non-procedure 32bit - not implemented yet */ | 
|---|
| 27 | #define EPT_32BIT               0x00    /* 16 bit entry-point  */ | 
|---|
| 28 | #define EPT_16BIT               0x80    /* 32 bit entry-point */ | 
|---|
| 29 | #define EPT_BIT_MASK            0x80    /* Mask bit entry-point */ | 
|---|
| 30 | #define EPT16BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_16BIT) | 
|---|
| 31 | #define EPT32BitEntry(a)    (((a).fType & EPT_BIT_MASK) == EPT_32BIT) | 
|---|
| 32 |  | 
|---|
| 33 | /* 32bit types */ | 
|---|
| 34 | #define EPT_PROC32              (EPT_PROC | EPT_32BIT) | 
|---|
| 35 | #define EPT_PROCIMPORT32        (EPT_PROCIMPORT | EPT_32BIT) | 
|---|
| 36 | #define EPT_VARIMPORT32         (EPT_VARIMPORT | EPT_32BIT) | 
|---|
| 37 |  | 
|---|
| 38 | /* 16bit types */ | 
|---|
| 39 | #define EPT_PROC16              (EPT_PROC | EPT_16BIT)        /* no implemented yet! */ | 
|---|
| 40 | #define EPT_PROCIMPORT16        (EPT_PROCIMPORT | EPT_16BIT)  /* far proc in calltab with a far jmp. */ | 
|---|
| 41 | #define EPT_VARIMPORT16         (EPT_VARIMPORT | EPT_16BIT) | 
|---|
| 42 |  | 
|---|
| 43 | /* Kernel type: SMP/UNI/W4 */ | 
|---|
| 44 | #define TYPE_UNI                0       /* Any UNI processor kernel except Warp 4 fp13 and above. */ | 
|---|
| 45 | #define TYPE_SMP                1       /* SMP Warp3 Adv. or Warp 4.5 SMP */ | 
|---|
| 46 | #define TYPE_W4                 2       /* Warp4 fp13 and above. */ | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | /******************************************************************************* | 
|---|
| 50 | *   Structures and Typedefs                                                    * | 
|---|
| 51 | *******************************************************************************/ | 
|---|
| 52 | #pragma pack(1) | 
|---|
| 53 | typedef struct tagIMPORTKRNLSYM | 
|---|
| 54 | { | 
|---|
| 55 | unsigned char       fFound;          /* This is set when name is found */ | 
|---|
| 56 | unsigned char       iObject;         /* Object number the name was found in*/ | 
|---|
| 57 | unsigned short int  cchName;         /* Length of the name (optmize search) (INPUT) */ | 
|---|
| 58 | unsigned char       achName[MAX_LENGTH_NAME]; /* Name (INPUT) */ | 
|---|
| 59 | unsigned long  int  offObject;       /* Offset into the object */ | 
|---|
| 60 | unsigned long  int  ulAddress;       /* 32-bit flat address */ | 
|---|
| 61 | unsigned short int  usSel;           /* Select of the object */ | 
|---|
| 62 | unsigned char       cbProlog;        /* Size of the prolog needing to be exchanged */ | 
|---|
| 63 | unsigned char       fType;           /* Entry-Point Type Flags */ | 
|---|
| 64 | } IMPORTKRNLSYM; | 
|---|
| 65 | #pragma pack() | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 | /* | 
|---|
| 69 | * Database of kernel symbols. | 
|---|
| 70 | */ | 
|---|
| 71 | #pragma pack(1) | 
|---|
| 72 | typedef struct | 
|---|
| 73 | { | 
|---|
| 74 | unsigned short usBuild;             /* Build number */ | 
|---|
| 75 | unsigned char  fchBldType;          /* R, H, A */ | 
|---|
| 76 | unsigned char  fchType;             /* TYPE_SMP, TYPE_UNI, TYPE_W4 */ | 
|---|
| 77 | unsigned char  cObjects;            /* Count of objects */ | 
|---|
| 78 | struct | 
|---|
| 79 | { | 
|---|
| 80 | unsigned char iObject;          /* Object number.  */ | 
|---|
| 81 | unsigned long offObject;        /* offset into object of the symbol. */ | 
|---|
| 82 | } aSyms[NBR_OF_KRNLIMPORTS]; | 
|---|
| 83 |  | 
|---|
| 84 | } KRNLDBENTRY, *PKRNLDBENTRY; | 
|---|
| 85 | #pragma pack() | 
|---|
| 86 |  | 
|---|
| 87 |  | 
|---|
| 88 |  | 
|---|
| 89 | /******************************************************************************* | 
|---|
| 90 | *   Global Variables                                                           * | 
|---|
| 91 | *   NOTE! These are only available at init time!                               * | 
|---|
| 92 | *******************************************************************************/ | 
|---|
| 93 | extern IMPORTKRNLSYM _aImportTab[NBR_OF_KRNLIMPORTS]; /* 'aImportTab' in PrbKrnl.c */ | 
|---|
| 94 | extern unsigned short int _usBuild;     /* 'ulBuild'         in PrbKrnl.c */ | 
|---|
| 95 | extern unsigned short int _usVerMajor;  /* 'usVerMajor'      in PrbKrnl.c */ | 
|---|
| 96 | extern unsigned short int _usVerMinor;  /* 'usVerMinor'      in PrbKrnl.c */ | 
|---|
| 97 | extern KRNLDBENTRY aKrnlSymDB[];        /* defined in symdb.c (for 16-bit usage) */ | 
|---|
| 98 | extern KRNLDBENTRY _aKrnlSymDB[];       /* defined in symdb.c (for 32-bit usage) */ | 
|---|
| 99 |  | 
|---|
| 100 |  | 
|---|
| 101 | #if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */ | 
|---|
| 102 | int ProbeKernel(PRPINITIN pReqPack); | 
|---|
| 103 | #endif | 
|---|
| 104 |  | 
|---|
| 105 | #endif | 
|---|
| 106 |  | 
|---|