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

Last change on this file since 660 was 188, checked in by sandervl, 24 years ago

joystick reactivated; version increase; Rudi's fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
1/* $Id: kee.h 188 2001-09-09 15:31:35Z sandervl $ */
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!!
103
104#ifdef __WATCOMC__
105ULONG KernThunkStackTo32(VOID);
106#pragma aux KernThunkStackTo32 "KernThunkStackTo32" modify exact [eax ecx edx] value [edx];
107#else
108ULONG APIENTRY KernThunkStackTo32(VOID);
109#endif
110
111
112/*ordinal 42*/
113VOID APIENTRY KernSerialize16BitDD(VOID);
114
115/*ordinal 43*/
116VOID APIENTRY KernUnserialize16BitDD(VOID);
117
118/*ordinal 44*/
119VOID APIENTRY KernArmHook(ULONG hook,ULONG data);
120
121/*ordinal 45*/
122APIRET APIENTRY KernAllocateContextHook(PVOID pfHandler,ULONG dummy,
123 PULONG pHook);
124
125/*ordinal 50*/
126APIRET APIENTRY KernCopyIn(PVOID trgt, PVOID src, ULONG size);
127
128/*ordinal 51*/
129APIRET APIENTRY KernCopyOut(PVOID trgt, PVOID src, ULONG size);
130
131
132/* same bits as with DevHlp_VMAlloc, see explanation there */
133#define KEE_VMA_16MB 0x00000001
134#define KEE_VMA_FIXED 0x00000002
135#define KEE_VMA_SWAP 0x00000004
136#define KEE_VMA_CONTIG 0x00000008
137#define KEE_VMA_PHYS 0x00000010
138#define KEE_VMA_PROCESS 0x00000020
139#define KEE_VMA_SGSCONT 0x00000040
140#define KEE_VMA_GETSEL 0x00000080
141#define KEE_VMA_RESERVE 0x00000100
142#define KEE_VMA_SHARED 0x00000400
143#define KEE_VMA_USEHIGHMEM 0x00000800
144
145/*ordinal 60*/
146APIRET APIENTRY KernVMAlloc(ULONG size, ULONG flags, PVOID* linaddr,
147 PVOID* physaddr, PSHORT sel);
148
149/*ordinal 61*/
150APIRET APIENTRY KernVMFree(PVOID linaddr);
151
152/* this is the lockhandle, like with DevHlp_VMLock */
153typedef struct {
154 UCHAR lock[12];
155} KEEVMLock;
156
157/* this is a page list element, like PageList_s in 16 bit Devhlp */
158typedef struct {
159 ULONG addr;
160 ULONG size;
161} KEEVMPageList;
162
163/* the same bits as with DevHlp_VMLock */
164#define KEE_VML_NOTBLOCK 0x00000001
165#define KEE_VML_CONTIG 0x00000002
166#define KEE_VML_16M 0x00000004
167#define KEE_VML_WRITEABLE 0x00000008
168#define KEE_VML_LONGLOCK 0x00000010
169#define KEE_VML_VERIFYONLY 0x00000020
170#define KEE_VML_unknown 0x80000000
171
172/*ordinal 62*/
173APIRET APIENTRY KernVMLock(ULONG flags,PVOID linaddr,ULONG size,
174 KEEVMLock* lock, KEEVMPageList* pglist,
175 PULONG pgsize);
176
177/*ordinal 63*/
178APIRET APIENTRY KernVMUnlock(KEEVMLock* lock);
179
180/*ordinal 64*/
181APIRET APIENTRY KernLinToPageList(PVOID linaddr,ULONG size,KEEVMPageList* list, ULONG *pgcnt);
182
183#define KEE_VMS_UNCOMMIT 0x00000001
184#define KEE_VMS_RESIDENT 0x00000002
185#define KEE_VMS_SWAPPABLE 0x00000004
186
187/*ordinal 65*/
188APIRET APIENTRY KernVMSetMem(ULONG flags, PVOID linaddr, ULONG size);
189
190/*ordinal 66*/
191ULONG KernSelToFlat(ULONG addr16);
192
193/*ordinal 70*/
194APIRET APIENTRY KernDynamicAPI(PVOID addr, ULONG cnt, ULONG dummy, PUSHORT sel);
195
196/*ordinal 80*/
197APIRET APIENTRY KernRASSysTrace(ULONG major,ULONG minor,PVOID buf, ULONG size);
198
199/*ordinal 81*/
200APIRET APIENTRY KernPerfSysTrace(ULONG major,ULONG minor,PVOID buf, ULONG size);
201
202/* this is actually a pointer to the SFT entry for the file */
203typedef ULONG KEEhfile;
204
205/*ordinal 100*/
206APIRET APIENTRY KernLockFile(HFILE hfd,KEEhfile* khfd);
207
208/*ordinal 101*/
209APIRET APIENTRY KernUnLockFile(KEEhfile khfd);
210
211/* this is the file size as returned by ordinal 102 */
212typedef QWORD KEEfilesize;
213
214/*ordinal 102*/
215APIRET APIENTRY KernGetFileSize(KEEhfile khfd,KEEfilesize* sz);
216
217/*ordinal 103*/
218APIRET APIENTRY KernTestFileCache(KEEhfile khfd);
219
220/*ordinal 104*/
221APIRET APIENTRY KernReadFileAt(KEEhfile khfd,PVOID buf, QWORD off,
222 ULONG nbytes, PULONG nread);
223
224typedef struct {
225 ULONG pagelistsz;
226 KEEVMPageList* pagelist;
227 ULONG physlistsz;
228 KEEVMPageList* physlist;
229} KEECachePages;
230
231/*ordinal 105*/
232APIRET APIENTRY KernReadFileAtCache(KEEhfile khfd,KEECachePages** ptr,
233 QWORD off, ULONG nbytes, PULONG nread);
234
235/*ordinal 106*/
236APIRET APIENTRY KernReturnFileCache(KEEhfile khfd,KEECachePages* ptr);
237
238typedef struct {
239 ULONG data[8];
240} KEEUnicodeStruct;
241
242/*ordinal 120*/
243APIRET APIENTRY KernCreateUconvObject(USHORT codepage, KEEUnicodeStruct* ucs);
244
245/*ordinal 121*/
246APIRET APIENTRY KernStrFromUcs(KEEUnicodeStruct* ucs, PCHAR trgt,
247 PCHAR usrc, ULONG trgtsize, ULONG srcsize);
248/*ordinal 122*/
249APIRET APIENTRY KernStrToUcs(KEEUnicodeStruct* ucs, PCHAR utrgt, PCHAR src,
250 ULONG trgtsize,ULONG srcsize);
251
252#ifdef __cplusplus
253}
254#endif
255
256
257#endif
Note: See TracBrowser for help on using the repository browser.