Author: hyperion Date: Wed Oct 29 07:56:17 2008 New Revision: 37048
URL: http://svn.reactos.org/svn/reactos?rev=37048&view=rev Log: Make acpi compile with Visual C++
Added: branches/the-real-msvc/drivers/bus/acpi/include/platform/acmsc.h (with props) Modified: branches/the-real-msvc/drivers/bus/acpi/include/platform/acwin.h
Added: branches/the-real-msvc/drivers/bus/acpi/include/platform/acmsc.h URL: http://svn.reactos.org/svn/reactos/branches/the-real-msvc/drivers/bus/acpi/i... ============================================================================== --- branches/the-real-msvc/drivers/bus/acpi/include/platform/acmsc.h (added) +++ branches/the-real-msvc/drivers/bus/acpi/include/platform/acmsc.h [iso-8859-1] Wed Oct 29 07:56:17 2008 @@ -1,0 +1,67 @@ +#ifndef __ACMSC_H__ +#define __ACMSC_H__ + +#define COMPILER_DEPENDENT_UINT64 unsigned __int64 + +#if defined(_M_IX86) + +#define ACPI_ASM_MACROS +#define causeinterrupt(level) +#define BREAKPOINT3 +#define halt() { __asm { sti } __asm { hlt } } +#define wbinvd() + +__forceinline void _ACPI_ACQUIRE_GLOBAL_LOCK(void * GLptr, unsigned char * Acq_) +{ + unsigned char Acq; + + __asm + { + mov ecx, [GLptr] + + L1: mov eax, [ecx] + mov edx, eax + and edx, ecx + bts edx, 1 + adc edx, 0 + lock cmpxchg [ecx], edx + jne L1 + cmp dl, 3 + sbb eax, eax + + mov [Acq], al + }; + + *Acq_ = Acq; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ + _ACPI_ACQUIRE_GLOBAL_LOCK((GLptr), (unsigned char *)&(Acq)) + +__forceinline void _ACPI_RELEASE_GLOBAL_LOCK(void * GLptr, unsigned char * Acq_) +{ + unsigned char Acq; + + __asm + { + mov ecx, [GLptr] + + L1: mov eax, [ecx] + mov edx, eax + and edx, ecx + lock cmpxchg [ecx], edx + jnz L1 + and eax, 1 + + mov [Acq], al + }; + + *Acq_ = Acq; +} + +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ + _ACPI_RELEASE_GLOBAL_LOCK((GLptr), (unsigned char *)&(Acq)) + +#endif + +#endif /* __ACMSC_H__ */
Propchange: branches/the-real-msvc/drivers/bus/acpi/include/platform/acmsc.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: branches/the-real-msvc/drivers/bus/acpi/include/platform/acwin.h URL: http://svn.reactos.org/svn/reactos/branches/the-real-msvc/drivers/bus/acpi/i... ============================================================================== --- branches/the-real-msvc/drivers/bus/acpi/include/platform/acwin.h [iso-8859-1] (original) +++ branches/the-real-msvc/drivers/bus/acpi/include/platform/acwin.h [iso-8859-1] Wed Oct 29 07:56:17 2008 @@ -47,14 +47,25 @@
#endif
-/* ReactOS uses GCC */ +#if defined(__GNUC__)
#include "acgcc.h"
#undef disable -#define disable() __asm__("cli\n\t"); +#define disable() __asm__("cli\n\t") #undef enable -#define enable() __asm__("sti\n\t"); +#define enable() __asm__("sti\n\t") + +#elif defined(_MSC_VER) + +#include "acmsc.h" + +#undef disable +#define disable() __asm { cli } +#undef enable +#define enable() __asm { sti } + +#endif
#undef DEBUGGER_THREADING #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED