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.
This commit is contained in:
parent
543c43d84d
commit
e5e6a33128
|
@ -1,3 +1,18 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2006-01-23 Brandon Sneed <brandon@redf.net>
|
2006-01-23 Brandon Sneed <brandon@redf.net>
|
||||||
|
|
||||||
* setupapi.def: Add all CM_* functions defined in ddk/cfgmgr32.h
|
* setupapi.def: Add all CM_* functions defined in ddk/cfgmgr32.h
|
||||||
|
|
|
@ -59,11 +59,11 @@ typedef CONST char *PCSZ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DECL_IMPORT
|
#ifndef DECL_IMPORT
|
||||||
#define DECL_IMPORT __attribute__((dllimport))
|
#define DECL_IMPORT __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DECL_EXPORT
|
#ifndef DECL_EXPORT
|
||||||
#define DECL_EXPORT __attribute__((dllexport))
|
#define DECL_EXPORT __declspec(dllexport)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Windows NT status codes */
|
/* Windows NT status codes */
|
||||||
|
|
|
@ -34,9 +34,9 @@ extern "C" {
|
||||||
/*
|
/*
|
||||||
** Definitions specific to this Device Driver Kit
|
** Definitions specific to this Device Driver Kit
|
||||||
*/
|
*/
|
||||||
#define DDKAPI __attribute__((stdcall))
|
#define DDKAPI __stdcall
|
||||||
#define DDKFASTAPI __attribute__((fastcall))
|
#define DDKFASTAPI __fastcall
|
||||||
#define DDKCDECLAPI __attribute__((cdecl))
|
#define DDKCDECLAPI __cdecl
|
||||||
|
|
||||||
#if defined(_NTOSKRNL_)
|
#if defined(_NTOSKRNL_)
|
||||||
#ifndef NTOSAPI
|
#ifndef NTOSAPI
|
||||||
|
@ -114,18 +114,34 @@ typedef ULONG LOGICAL;
|
||||||
#define TAG(_a, _b, _c, _d) (ULONG) \
|
#define TAG(_a, _b, _c, _d) (ULONG) \
|
||||||
(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
|
(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
static __inline struct _KPCR * KeGetCurrentKPCR(
|
static __inline struct _KPCR * KeGetCurrentKPCR(
|
||||||
VOID)
|
VOID)
|
||||||
{
|
{
|
||||||
ULONG Value;
|
ULONG Value;
|
||||||
|
|
||||||
__asm__ __volatile__ ("movl %%fs:0x18, %0\n\t"
|
__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)
|
: "=r" (Value)
|
||||||
: /* no inputs */
|
: /* no inputs */
|
||||||
);
|
);
|
||||||
return (struct _KPCR *) Value;
|
return (struct _KPCR *) Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined( __WATCOMC__ )
|
||||||
|
|
||||||
|
extern struct _KPCR * KeGetCurrentKPCR( void );
|
||||||
|
#pragma aux KeGetCurrentKPCR = \
|
||||||
|
"mov eax, fs:[0x18]" \
|
||||||
|
value [ eax ];
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Simple structures
|
** Simple structures
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue