Line | |
---|
1 | /* extern (library) versions of inline functions defined in winnt.h */
|
---|
2 |
|
---|
3 | #if defined(__GNUC__)
|
---|
4 |
|
---|
5 | void* GetCurrentFiber(void)
|
---|
6 | {
|
---|
7 | void* ret;
|
---|
8 | __asm__ volatile (
|
---|
9 | "movl %%fs:0x10,%0"
|
---|
10 | : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
|
---|
11 | );
|
---|
12 | return ret;
|
---|
13 | }
|
---|
14 |
|
---|
15 | void* GetFiberData(void)
|
---|
16 | {
|
---|
17 | void* ret;
|
---|
18 | __asm__ volatile (
|
---|
19 | "movl %%fs:0x10,%0\n"
|
---|
20 | "movl (%0),%0"
|
---|
21 | : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
|
---|
22 | );
|
---|
23 | return ret;
|
---|
24 | }
|
---|
25 |
|
---|
26 | #elif !defined (__WATCOMC__)
|
---|
27 |
|
---|
28 | void* GetCurrentFiber(void)
|
---|
29 | {
|
---|
30 | void* res;
|
---|
31 | _asm {
|
---|
32 | mov eax, dword ptr fs:0x10
|
---|
33 | mov res, eax
|
---|
34 | };
|
---|
35 | return res;
|
---|
36 | }
|
---|
37 |
|
---|
38 | void* GetFiberData(void)
|
---|
39 | {
|
---|
40 | void* res;
|
---|
41 | _asm {
|
---|
42 | mov eax, dword ptr fs:0x10
|
---|
43 | mov eax, [eax]
|
---|
44 | mov res, eax
|
---|
45 | };
|
---|
46 | return res;
|
---|
47 | }
|
---|
48 |
|
---|
49 | #endif /* __GNUC__ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.