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:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-01-24 04:02:31 +0300
committerDanny Smith <dannysmith@users.sourceforge.net>2006-01-24 04:02:31 +0300
commite5e6a33128cacd87f626f2beabc2dd6c82822a62 (patch)
tree4e6cf1f58034d992ce468689c0c788a9f92081cd /winsup/w32api/include
parent543c43d84de8ba2bf09cc733cde4e332441184a6 (diff)
2006-01-24 Danny Smith <dannysmith@users.sourceforge.net>
* include/ddk/winddk.h (KeGetCurrentKPCR): Support -masm=intel. 2006-01-24 Jiri Malak <Jiri.Malak@iol.cz> WATCOM compatibility changes. * include/ddk/ntddk.h (DECL_IMPORT): Define using __declspec, rather than __attribute__. (DECL_EXPORT): Likewise. * include/ddk/winddk.h (DDKAPI): Avoid using __attribute__. (DDKFASTAPI): Likewise. (DDKCDECLAPI): Likwise. (KeGetCurrentKPCR): Provide __WATCOMC__ syntax for inline code.
Diffstat (limited to 'winsup/w32api/include')
-rw-r--r--winsup/w32api/include/ddk/ntddk.h4
-rw-r--r--winsup/w32api/include/ddk/winddk.h28
2 files changed, 24 insertions, 8 deletions
diff --git a/winsup/w32api/include/ddk/ntddk.h b/winsup/w32api/include/ddk/ntddk.h
index fd78905fd..60a99ef37 100644
--- a/winsup/w32api/include/ddk/ntddk.h
+++ b/winsup/w32api/include/ddk/ntddk.h
@@ -59,11 +59,11 @@ typedef CONST char *PCSZ;
#endif
#ifndef DECL_IMPORT
-#define DECL_IMPORT __attribute__((dllimport))
+#define DECL_IMPORT __declspec(dllimport)
#endif
#ifndef DECL_EXPORT
-#define DECL_EXPORT __attribute__((dllexport))
+#define DECL_EXPORT __declspec(dllexport)
#endif
/* Windows NT status codes */
diff --git a/winsup/w32api/include/ddk/winddk.h b/winsup/w32api/include/ddk/winddk.h
index 6631f36e3..123a44a73 100644
--- a/winsup/w32api/include/ddk/winddk.h
+++ b/winsup/w32api/include/ddk/winddk.h
@@ -34,9 +34,9 @@ extern "C" {
/*
** Definitions specific to this Device Driver Kit
*/
-#define DDKAPI __attribute__((stdcall))
-#define DDKFASTAPI __attribute__((fastcall))
-#define DDKCDECLAPI __attribute__((cdecl))
+#define DDKAPI __stdcall
+#define DDKFASTAPI __fastcall
+#define DDKCDECLAPI __cdecl
#if defined(_NTOSKRNL_)
#ifndef NTOSAPI
@@ -114,18 +114,34 @@ typedef ULONG LOGICAL;
#define TAG(_a, _b, _c, _d) (ULONG) \
(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
+#ifdef __GNUC__
static __inline struct _KPCR * KeGetCurrentKPCR(
VOID)
{
ULONG Value;
- __asm__ __volatile__ ("movl %%fs:0x18, %0\n\t"
- : "=r" (Value)
- : /* no inputs */
+ __asm__ __volatile__ (
+#if (__GNUC__ >= 3)
+ /* support -masm=intel */
+ "mov{l} {%%fs:0x18, %0|%0, %%fs:0x18}\n\t"
+#else
+ "movl %%fs:0x18, %0\n\t"
+#endif
+ : "=r" (Value)
+ : /* no inputs */
);
return (struct _KPCR *) Value;
}
+#elif defined( __WATCOMC__ )
+
+extern struct _KPCR * KeGetCurrentKPCR( void );
+#pragma aux KeGetCurrentKPCR = \
+ "mov eax, fs:[0x18]" \
+ value [ eax ];
+
+#endif
+
/*
** Simple structures
*/