source: sbliveos2/trunk/include/kee.h@ 163

Last change on this file since 163 was 142, checked in by ktk, 25 years ago

Import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.9 KB
Line 
1/* $Id: kee.h 142 2000-04-23 14:55:46Z ktk $ */
2
3/* Released to the public domain. All rights perverse */
4/*
5 * This is not an official IBM header file, and never was.
6 * It is published in the hope that some day IBM will document
7 * the new KEE32 32 bit driver API properly.
8 * There is no warranty that the declarations and symbols are correct
9 * and match corresponding official symbols correctly, however the
10 * information herein has been collected and analysed carefully. It
11 * represents the authors's current knowledge about this API.
12 */
13
14#ifndef __KEE_H__
15#define __KEE_H__
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/* The spinlock data type. KEE spinlock functions either put 0 (unused)
22 * or 0xff (used) into the variable, and 0xff000000 when the lock is
23 * acquired.
24 */
25typedef ULONG KEESpinLock;
26
27/*ordinal 10 */
28APIRET APIENTRY KernAllocSpinLock(KEESpinLock* sl);
29
30/*ordinal 11*/
31/* XXX I suppose this routine should receive a KEESpinLock*, but
32 * so far, it just returns NO_ERROR, and not even clearing the Spinlock
33 * ownership. I think this is a bug in 14.039F_SMP
34 */
35APIRET APIENTRY KernFreeSpinLock(/*KEESpinLock* sl*/);
36
37/*ordinal 12*/
38VOID APIENTRY KernAcquireSpinLock(KEESpinLock* sl);
39
40/*ordinal 13*/
41VOID APIENTRY KernReleaseSpinLock(KEESpinLock* sl);
42
43typedef struct {
44 ULONG mtx[2];
45} KEEMutexLock;
46
47/*ordinal 20*/
48APIRET APIENTRY KernAllocMutexLock(KEEMutexLock* ml);
49
50/*ordinal 21*/
51/* XXX Like ordinal 11, I think this should really do something. Actually,
52 * it just returns NO_ERROR. At least, it accesses the argument. But
53 * it doesn't do anything. Again, likely an error in 14.039F_SMP
54 */
55APIRET APIENTRY KernFreeMutexLock(KEEMutexLock* ml);
56
57/*ordinal 22*/
58VOID APIENTRY KernRequestSharedMutex(KEEMutexLock* ml);
59
60/*ordinal 23*/
61VOID APIENTRY KernReleaseSharedMutex(KEEMutexLock* ml);
62
63/*ordinal 24*/
64INT APIENTRY KernTryRequestSharedMutex(KEEMutexLock* ml);
65
66/*ordinal 25*/
67VOID APIENTRY KernRequestExclusiveMutex(KEEMutexLock* ml);
68
69/*ordinal 26*/
70VOID APIENTRY KernReleaseExclusiveMutex(KEEMutexLock* ml);
71
72/*ordinal 27*/
73INT APIENTRY KernTryRequestExclusiveMutex(KEEMutexLock* ml);
74
75#define KEE_BLOCK_NOSIGNALS 0x00000001
76#define KEE_BLOCK_SPINLOCK 0x00000002
77#define KEE_BLOCK_EXMUTEXLOCK 0x00000004
78#define KEE_BLOCK_SHMUTEXLOCK 0x00000008
79#define KEE_BLOCK_NOACQUIRE 0x00000010
80
81/*ordinal 30*/
82APIRET APIENTRY KernBlock(ULONG id, ULONG timeout, ULONG flags,
83 PVOID ptr, PULONG retdata);
84
85#define KEE_WAKE_SINGLE 0x00000001
86#define KEE_WAKE_PRIOINCR 0x00000004
87#define KEE_WAKE_RETDATA 0x00000008
88
89/*ordinal 31*/
90APIRET APIENTRY KernWakeup(ULONG id, ULONG flags, PULONG ptr, ULONG retdata);
91
92/*ordinal 40*/
93// Returns: flat base of kernel stack in eax
94//NOTE: esp and ebp are modified when this function returns
95// --> can cause problems if compiler uses i.e. ebp for storing a value!!
96ULONG APIENTRY KernThunkStackTo16(VOID);
97
98/*ordinal 41*/
99// Returns: flat base of kernel stack in edx
100// 16 bits stack selector in eax (not during interrupts (bug??))
101//NOTE: esp and ebp are modified when this function returns
102// --> can cause problems if compiler uses i.e. ebp for storing a value!!
103ULONG APIENTRY KernThunkStackTo32(VOID);
104#pragma aux KernThunkStackTo32 "KernThunkStackTo32" modify exact [edx];
105
106/*ordinal 42*/
107VOID APIENTRY KernSerialize16BitDD(VOID);
108
109/*ordinal 43*/
110VOID APIENTRY KernUnserialize16BitDD(VOID);
111
112/*ordinal 44*/
113VOID APIENTRY KernArmHook(ULONG hook,ULONG data);
114
115/*ordinal 45*/
116APIRET APIENTRY KernAllocateContextHook(PVOID pfHandler,ULONG dummy,
117 PULONG pHook);
118
119/*ordinal 50*/
120APIRET APIENTRY KernCopyIn(PVOID trgt, PVOID src, ULONG size);
121
122/*ordinal 51*/
123APIRET APIENTRY KernCopyOut(PVOID trgt, PVOID src, ULONG size);
124
125
126/* same bits as with DevHlp_VMAlloc, see explanation there */
127#define KEE_VMA_16MB 0x00000001
128#define KEE_VMA_FIXED 0x00000002
129#define KEE_VMA_SWAP 0x00000004
130#define KEE_VMA_CONTIG 0x00000008
131#define KEE_VMA_PHYS 0x00000010
132#define KEE_VMA_PROCESS 0x00000020
133#define KEE_VMA_SGSCONT 0x00000040
134#define KEE_VMA_GETSEL 0x00000080
135#define KEE_VMA_RESERVE 0x00000100
136#define KEE_VMA_SHARED 0x00000400
137#define KEE_VMA_USEHIGHMEM 0x00000800
138
139/*ordinal 60*/
140APIRET APIENTRY KernVMAlloc(ULONG size, ULONG flags, PVOID* linaddr,
141 PVOID* physaddr, PSHORT sel);
142
143/*ordinal 61*/
144APIRET APIENTRY KernVMFree(PVOID linaddr);
145
146/* this is the lockhandle, like with DevHlp_VMLock */
147typedef struct {
148 UCHAR lock[12];
149} KEEVMLock;
150
151/* this is a page list element, like PageList_s in 16 bit Devhlp */
152typedef struct {
153 ULONG addr;
154 ULONG size;
155} KEEVMPageList;
156
157/* the same bits as with DevHlp_VMLock */
158#define KEE_VML_NOTBLOCK 0x00000001
159#define KEE_VML_CONTIG 0x00000002
160#define KEE_VML_16M 0x00000004
161#define KEE_VML_WRITEABLE 0x00000008
162#define KEE_VML_LONGLOCK 0x00000010
163#define KEE_VML_VERIFYONLY 0x00000020
164#define KEE_VML_unknown 0x80000000
165
166/*ordinal 62*/
167APIRET APIENTRY KernVMLock(ULONG flags,PVOID linaddr,ULONG size,
168 KEEVMLock* lock, KEEVMPageList* pglist,
169 PULONG pgsize);
170
171/*ordinal 63*/
172APIRET APIENTRY KernVMUnlock(KEEVMLock* lock);
173
174/*ordinal 64*/
175APIRET APIENTRY KernLinToPageList(PVOID linaddr,ULONG size,KEEVMPageList* list, ULONG *pgcnt);
176
177#define KEE_VMS_UNCOMMIT 0x00000001
178#define KEE_VMS_RESIDENT 0x00000002
179#define KEE_VMS_SWAPPABLE 0x00000004
180
181/*ordinal 65*/
182APIRET APIENTRY KernVMSetMem(ULONG flags, PVOID linaddr, ULONG size);
183
184/*ordinal 66*/
185ULONG KernSelToFlat(ULONG addr16);
186
187/*ordinal 70*/
188APIRET APIENTRY KernDynamicAPI(PVOID addr, ULONG cnt, ULONG dummy, PUSHORT sel);
189
190/*ordinal 80*/
191APIRET APIENTRY KernRASSysTrace(ULONG major,ULONG minor,PVOID buf, ULONG size);
192
193/*ordinal 81*/
194APIRET APIENTRY KernPerfSysTrace(ULONG major,ULONG minor,PVOID buf, ULONG size);
195
196/* this is actually a pointer to the SFT entry for the file */
197typedef ULONG KEEhfile;
198
199/*ordinal 100*/
200APIRET APIENTRY KernLockFile(HFILE hfd,KEEhfile* khfd);
201
202/*ordinal 101*/
203APIRET APIENTRY KernUnLockFile(KEEhfile khfd);
204
205/* this is the file size as returned by ordinal 102 */
206typedef QWORD KEEfilesize;
207
208/*ordinal 102*/
209APIRET APIENTRY KernGetFileSize(KEEhfile khfd,KEEfilesize* sz);
210
211/*ordinal 103*/
212APIRET APIENTRY KernTestFileCache(KEEhfile khfd);
213
214/*ordinal 104*/
215APIRET APIENTRY KernReadFileAt(KEEhfile khfd,PVOID buf, QWORD off,
216 ULONG nbytes, PULONG nread);
217
218typedef struct {
219 ULONG pagelistsz;
220 KEEVMPageList* pagelist;
221 ULONG physlistsz;
222 KEEVMPageList* physlist;
223} KEECachePages;
224
225/*ordinal 105*/
226APIRET APIENTRY KernReadFileAtCache(KEEhfile khfd,KEECachePages** ptr,
227 QWORD off, ULONG nbytes, PULONG nread);
228
229/*ordinal 106*/
230APIRET APIENTRY KernReturnFileCache(KEEhfile khfd,KEECachePages* ptr);
231
232typedef struct {
233 ULONG data[8];
234} KEEUnicodeStruct;
235
236/*ordinal 120*/
237APIRET APIENTRY KernCreateUconvObject(USHORT codepage, KEEUnicodeStruct* ucs);
238
239/*ordinal 121*/
240APIRET APIENTRY KernStrFromUcs(KEEUnicodeStruct* ucs, PCHAR trgt,
241 PCHAR usrc, ULONG trgtsize, ULONG srcsize);
242/*ordinal 122*/
243APIRET APIENTRY KernStrToUcs(KEEUnicodeStruct* ucs, PCHAR utrgt, PCHAR src,
244 ULONG trgtsize,ULONG srcsize);
245
246#ifdef __cplusplus
247}
248#endif
249
250
251#endif
Note: See TracBrowser for help on using the repository browser.