From 5b9d54bf972e1b9af3833e29dbc89298fcbe5d7b Mon Sep 17 00:00:00 2001 From: Earnie Boyd Date: Fri, 10 Aug 2001 11:51:03 +0000 Subject: [PATCH] * lib/test.c (Win32_Winsock): Replace with __USE_W32_SOCKETS. Add more includes of w32api headers. * include/winnt.h (GetCurrentFiber): Change __inline to __inline__. Swap asm code with that of GetFiberData. (GetFiberData): Ditto. * lib/kernels.c: New file, containing library versions of GetCurrentFiber and GetFiberData. * lib/makefile.in: Add kernel32.o as static object to libkernal32.a. --- winsup/w32api/ChangeLog | 14 +++++++++++ winsup/w32api/include/winnt.h | 32 +++++++++++++------------ winsup/w32api/lib/Makefile.in | 5 ++-- winsup/w32api/lib/test.c | 45 +++++++++++++++++++++++++++++++++-- 4 files changed, 77 insertions(+), 19 deletions(-) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index 04c2bcbdc..a5750beb9 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,17 @@ +2001-08-10 Danny Smith + + * lib/test.c (Win32_Winsock): Replace with __USE_W32_SOCKETS. + Add more includes of w32api headers. + +2001-08-10 Danny Smith + + * include/winnt.h (GetCurrentFiber): Change __inline to __inline__. + Swap asm code with that of GetFiberData. + (GetFiberData): Ditto. + * lib/kernels.c: New file, containing library versions of + GetCurrentFiber and GetFiberData. + * lib/makefile.in: Add kernel32.o as static object to libkernal32.a. + 2001-08-08 Danny Smith * include/winuser.h (GET_WHEEL_DELTA_WPARAM): Add macro. diff --git a/winsup/w32api/include/winnt.h b/winsup/w32api/include/winnt.h index ff11ca385..0fed6db4d 100644 --- a/winsup/w32api/include/winnt.h +++ b/winsup/w32api/include/winnt.h @@ -2507,27 +2507,29 @@ typedef struct _REPARSE_POINT_INFORMATION { WORD ReparseDataLength; WORD UnparsedNameLength; } REPARSE_POINT_INFORMATION, *PREPARSE_POINT_INFORMATION; -extern __inline PVOID GetCurrentFiber(void) +extern __inline__ PVOID GetCurrentFiber(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 GetFiberData(void) -{ - void* ret; - __asm__ volatile ("\n\ - movl %%fs:0x10,%0\n\ - " : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */ + __asm__ volatile ( + "movl %%fs:0x10,%0" + : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */ : ); return ret; } + +extern __inline__ PVOID GetFiberData(void) +{ + void* ret; + __asm__ volatile ( + "movl %%fs:0x10,%0\n" + "movl (%0),%0" + : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */ + : + ); + return ret; +} + #endif #ifdef __cplusplus } diff --git a/winsup/w32api/lib/Makefile.in b/winsup/w32api/lib/Makefile.in index dcbe95d00..5bec36c7e 100644 --- a/winsup/w32api/lib/Makefile.in +++ b/winsup/w32api/lib/Makefile.in @@ -94,9 +94,10 @@ DEF_FILES = $(notdir $(wildcard $(srcdir)/*.def)) IMPLIBS = $(addprefix lib,$(subst .def,.a,$(DEF_FILES))) EXTRA_LIBS=libuuid.a libscrnsave.a libscrnsavw.a libdxguid.a liblargeint.a LIBS = $(IMPLIBS) $(EXTRA_LIBS) -EXTRA_OBJS=uuid.o shell32.o dxguid.o scrnsave.o scrnsavw.o largeint.o $(UUID_OBJS) dinput.o +EXTRA_OBJS=uuid.o shell32.o dxguid.o scrnsave.o scrnsavw.o largeint.o \ + $(UUID_OBJS) dinput.o kernel32.o SOURCES = scrnsave.c shell32.c uuid.c largeint.c dinput.c dxguid.c \ -res.rc test.c +res.rc test.c kernel32.c DISTFILES = Makefile.in $(DEF_FILES) $(SOURCES) diff --git a/winsup/w32api/lib/test.c b/winsup/w32api/lib/test.c index 9aa6dd978..8295aa037 100644 --- a/winsup/w32api/lib/test.c +++ b/winsup/w32api/lib/test.c @@ -1,5 +1,6 @@ /* Perform simple test of headers to avoid typos and such */ -#define Win32_Winsock +#define __USE_W32_SOCKETS +#include #include #ifdef __OBJC__ @@ -25,9 +26,49 @@ #include #include -#ifndef __OBJC__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef __OBJC__ /* problems with BOOL */ #include #include +#include +#include +#include +#include +#include +#include +#include +#include + #else #undef BOOL #endif