[KERNEL32/NDK]

Move definition of FIBER to NDK

svn path=/trunk/; revision=67472
This commit is contained in:
Timo Kreuzer 2015-04-28 21:27:16 +00:00
parent 6a0d45da07
commit 58de1d8ba9
3 changed files with 26 additions and 32 deletions

View file

@ -3,7 +3,7 @@
* PROJECT: ReactOS System Libraries
* FILE: lib/kernel32/thread/fiber.c
* PURPOSE: Fiber Implementation
* PROGRAMMERS:
* PROGRAMMERS:
* Alex Ionescu (alex@relsoft.net)
* KJK::Hyperion <noog@libero.it>
*/
@ -12,19 +12,16 @@
#define NDEBUG
#include <debug.h>
typedef struct _FIBER /* Field offsets: */
{ /* 32 bit 64 bit */
/* this must be the first field */
PVOID Parameter; /* 0x00 0x00 */
PEXCEPTION_REGISTRATION_RECORD ExceptionList; /* 0x04 0x08 */
PVOID StackBase; /* 0x08 0x10 */
PVOID StackLimit; /* 0x0C 0x18 */
PVOID DeallocationStack; /* 0x10 0x20 */
CONTEXT Context; /* 0x14 0x28 */
ULONG GuaranteedStackBytes; /* 0x2E0 */
PVOID FlsData; /* 0x2E4 */
PACTIVATION_CONTEXT_STACK ActivationContextStack; /* 0x2E8 */
} FIBER, *PFIBER;
#ifdef _M_IX86
C_ASSERT(FIELD_OFFSET(FIBER, ExceptionList) == 0x04);
C_ASSERT(FIELD_OFFSET(FIBER, StackBase) == 0x08);
C_ASSERT(FIELD_OFFSET(FIBER, StackLimit) == 0x0C);
C_ASSERT(FIELD_OFFSET(FIBER, DeallocationStack) == 0x10);
C_ASSERT(FIELD_OFFSET(FIBER, Context) == 0x14);
C_ASSERT(FIELD_OFFSET(FIBER, GuaranteedStackBytes) == 0x2E0);
C_ASSERT(FIELD_OFFSET(FIBER, FlsData) == 0x2E4);
C_ASSERT(FIELD_OFFSET(FIBER, ActivationContextStack) == 0x2E8);
#endif // _M_IX86
/* PRIVATE FUNCTIONS **********************************************************/
@ -76,7 +73,7 @@ ConvertFiberToThread(VOID)
*/
LPVOID
WINAPI
ConvertThreadToFiberEx(LPVOID lpParameter,
ConvertThreadToFiberEx(LPVOID lpParameter,
DWORD dwFlags)
{
PTEB Teb;

View file

@ -27,21 +27,6 @@ enum
};
#endif
// FIXME: where to put this?
typedef struct _FIBER /* Field offsets: */
{ /* 32 bit 64 bit */
/* this must be the first field */
PVOID Parameter; /* 0x00 0x00 */
PEXCEPTION_REGISTRATION_RECORD ExceptionList; /* 0x04 0x08 */
PVOID StackBase; /* 0x08 0x10 */
PVOID StackLimit; /* 0x0C 0x18 */
PVOID DeallocationStack; /* 0x10 0x20 */
CONTEXT Context; /* 0x14 0x28 */
ULONG GuaranteedStackBytes; /* 0x2E0 */
PVOID FlsData; /* 0x2E4 */
PVOID /* PACTIVATION_CONTEXT_STACK */ ActivationContextStack; /* 0x2E8 */
} FIBER, *PFIBER;
typedef struct
{
char Type;
@ -75,10 +60,8 @@ __attribute__ ((section(".asmdef")))
ASMGENDATA Table[] =
{
#if defined (_M_IX86) || defined (_M_AMD64)
/* PORTABLE CONSTANTS ********************************************************/
#include "ksx.template.h"
#endif
/* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/
#ifdef _M_IX86

View file

@ -168,6 +168,20 @@ Author:
#define KI_EXCEPTION_INTERNAL 0x10000000
#define KI_EXCEPTION_ACCESS_VIOLATION (KI_EXCEPTION_INTERNAL | 0x04)
typedef struct _FIBER /* Field offsets: */
{ /* 32 bit 64 bit */
/* this must be the first field */
PVOID Parameter; /* 0x00 0x00 */
struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList; /* 0x04 0x08 */
PVOID StackBase; /* 0x08 0x10 */
PVOID StackLimit; /* 0x0C 0x18 */
PVOID DeallocationStack; /* 0x10 0x20 */
CONTEXT Context; /* 0x14 0x28 */
ULONG GuaranteedStackBytes; /* 0x2E0 */
PVOID FlsData; /* 0x2E4 */
struct _ACTIVATION_CONTEXT_STACK *ActivationContextStack;/* 0x2E8 */
} FIBER, *PFIBER;
#ifndef NTOS_MODE_USER
//
// Number of dispatch codes supported by KINTERRUPT