1 | /* $Id: probkrnl.h,v 1.17 2000-12-11 06:34:45 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 52 /* 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 EPT32Proc(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC32)
|
---|
44 | #define EPT32ProcImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT32)
|
---|
45 | #define EPT32ProcImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR32)
|
---|
46 | #define EPT32VarImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT32)
|
---|
47 |
|
---|
48 | /* 16bit types */
|
---|
49 | #define EPT_PROC16 (EPT_PROC | EPT_16BIT) /* no implemented yet! */
|
---|
50 | #define EPT_PROCIMPORT16 (EPT_PROCIMPORT | EPT_16BIT) /* far proc in calltab with a far jmp. */
|
---|
51 | #define EPT_PROCIMPORTNR16 (EPT_PROCIMPORT | EPT_16BIT | EPT_NOT_REQ)
|
---|
52 | #define EPT_VARIMPORT16 (EPT_VARIMPORT | EPT_16BIT)
|
---|
53 | #define EPT16Proc(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROC16)
|
---|
54 | #define EPT16ProcImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORT16)
|
---|
55 | #define EPT16ProcImportNR(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_PROCIMPORTNR16)
|
---|
56 | #define EPT16VarImport(a) (((a).fType & ~(EPT_WRAPPED)) == EPT_VARIMPORT16)
|
---|
57 |
|
---|
58 |
|
---|
59 | /* Kernel type: SMP/UNI/W4 (flags matches KF_* in options.h) */
|
---|
60 | #if 0
|
---|
61 | #define TYPE_UNI 0x00 /* Any UNI processor kernel except Warp 4 fp13 and above. */
|
---|
62 | #define TYPE_SMP 0x01 /* SMP Warp3 Adv. or Warp 4.5 SMP */
|
---|
63 | #define TYPE_W4 0x02 /* Warp4 fp13 and above. */
|
---|
64 | #endif
|
---|
65 |
|
---|
66 |
|
---|
67 | /*******************************************************************************
|
---|
68 | * Structures and Typedefs *
|
---|
69 | *******************************************************************************/
|
---|
70 | #pragma pack(1)
|
---|
71 | typedef struct tagIMPORTKRNLSYM
|
---|
72 | {
|
---|
73 | unsigned char fFound; /* This is set when name is found */
|
---|
74 | unsigned char iObject; /* Object number the name was found in*/
|
---|
75 | unsigned short int cchName; /* Length of the name (optmize search) (INPUT) */
|
---|
76 | unsigned char achName[MAX_LENGTH_NAME]; /* Name (INPUT) */
|
---|
77 | unsigned char achExtra[4]; /* Parameter extra. */
|
---|
78 | unsigned long int offObject; /* Offset into the object */
|
---|
79 | unsigned long int ulAddress; /* 32-bit flat address */
|
---|
80 | unsigned short int usSel; /* Select of the object */
|
---|
81 | unsigned char cbProlog; /* Size of the prolog needing to be exchanged */
|
---|
82 | unsigned char fType; /* Entry-Point Type Flags */
|
---|
83 | } IMPORTKRNLSYM;
|
---|
84 | #pragma pack()
|
---|
85 |
|
---|
86 |
|
---|
87 | /*
|
---|
88 | * Database of kernel symbols.
|
---|
89 | */
|
---|
90 | #pragma pack(1)
|
---|
91 | typedef struct
|
---|
92 | {
|
---|
93 | unsigned short usBuild; /* Build number */
|
---|
94 | unsigned short fKernel; /* Kernel flag (KF_* defines in options.h). */
|
---|
95 | unsigned char cObjects; /* Count of objects */
|
---|
96 | struct
|
---|
97 | {
|
---|
98 | unsigned char iObject; /* Object number. */
|
---|
99 | unsigned long offObject; /* offset into object of the symbol. */
|
---|
100 | } aSyms[NBR_OF_KRNLIMPORTS];
|
---|
101 |
|
---|
102 | } KRNLDBENTRY, *PKRNLDBENTRY;
|
---|
103 | #pragma pack()
|
---|
104 |
|
---|
105 |
|
---|
106 |
|
---|
107 | /*******************************************************************************
|
---|
108 | * Global Variables *
|
---|
109 | * NOTE! These are only available at init time! *
|
---|
110 | *******************************************************************************/
|
---|
111 | extern IMPORTKRNLSYM DATA16_GLOBAL aImportTab[NBR_OF_KRNLIMPORTS]; /* Defined in ProbKrnl.c */
|
---|
112 | extern char DATA16_GLOBAL szSymbolFile[60]; /* Defined in ProbKrnl.c */
|
---|
113 | extern KRNLDBENTRY DATA16_INIT aKrnlSymDB[]; /* Defined in symdb.c (for 16-bit usage) */
|
---|
114 |
|
---|
115 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
---|
116 | #pragma map( aImportTab , "_aImportTab" )
|
---|
117 | #pragma map( szSymbolFile,"_szSymbolFile")
|
---|
118 | #pragma map( aKrnlSymDB , "_aKrnlSymDB" )
|
---|
119 | #endif
|
---|
120 |
|
---|
121 | /*
|
---|
122 | * 16-bit init time functions.
|
---|
123 | */
|
---|
124 | #if defined(INCL_16) && defined(MAX_DISKDD_CMD) /* 16-bit only */
|
---|
125 | int ProbeKernel(PRPINITIN pReqPack);
|
---|
126 | const char * GetErrorMsg(short sErr);
|
---|
127 | #endif
|
---|
128 |
|
---|
129 | #endif
|
---|
130 |
|
---|