Make acpi compile with Visual C++

svn path=/branches/the-real-msvc/; revision=37048
This commit is contained in:
KJK::Hyperion 2008-10-29 12:56:17 +00:00
parent 79e9ba171b
commit 72b44f33d3
2 changed files with 81 additions and 3 deletions

View file

@ -0,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__ */

View file

@ -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