This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GetCurrentFiber GetFiberData


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]