Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/w32api/lib/kernel32.c')
-rw-r--r--winsup/w32api/lib/kernel32.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/winsup/w32api/lib/kernel32.c b/winsup/w32api/lib/kernel32.c
index c7c4b1807..d66a5064b 100644
--- a/winsup/w32api/lib/kernel32.c
+++ b/winsup/w32api/lib/kernel32.c
@@ -1,5 +1,7 @@
/* extern (library) versions of inline functions defined in winnt.h */
+#if defined(__GNUC__)
+
void* GetCurrentFiber(void)
{
void* ret;
@@ -23,3 +25,27 @@ void* GetFiberData(void)
return ret;
}
+#else
+
+void* GetCurrentFiber(void)
+{
+ void* res;
+ _asm {
+ mov eax, dword ptr fs:0x10
+ mov res, eax
+ };
+ return res;
+}
+
+void* GetFiberData(void)
+{
+ void* res;
+ _asm {
+ mov eax, dword ptr fs:0x10
+ mov eax, [eax]
+ mov res, eax
+ };
+ return res;
+}
+
+#endif /* __GNUC__ */