This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
GetCurrentFiber GetFiberData
- To: cygwin at cygwin dot com
- Subject: GetCurrentFiber GetFiberData
- From: Holger Vogt <holger dot vogt at uni-duisburg dot de>
- Date: Sun, 27 May 2001 18:26:19 +0200
- Reply-To: holger dot vogt at uni-duisburg dot de
A test case
PVOID mainfiber = ConvertThreadToFiber((PVOID)0x1);
PVOID test = GetCurrentFiber();
PVOID test1 = GetFiberData();
deliveres the following data:
mainfiber 0x8e000c
test 0x1
test1 0x8e000c.
This is wrong. The correct results should read
mainfiber 0x8e000c
test 0x8e000c
test1 0x1.
The function names GetCurrentFiber and GetFiberData seem to be mixed up
in winnt.h.
The corrected section in winnt.h should read:
extern __inline PVOID GetFiberData(void)
{
void* ret;
__asm__ volatile ("\n\
movl %%fs:0x10,%0\n\
movl (%0),%0\n\
" : "=r" (ret) /* allow use of reg eax, ebx, ecx, edx, esi, edi
*/
:
);
return ret;
}
extern __inline PVOID GetCurrentFiber(void)
{
void* ret;
__asm__ volatile ("\n\
movl %%fs:0x10,%0\n\
" : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
:
);
return ret;
}
Please check and correct, if o.k.
Holger
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple