mirror of
https://github.com/reactos/reactos.git
synced 2025-06-13 04:28:30 +00:00
Make acpi compile with Visual C++
svn path=/branches/the-real-msvc/; revision=37048
This commit is contained in:
parent
79e9ba171b
commit
72b44f33d3
2 changed files with 81 additions and 3 deletions
67
drivers/bus/acpi/include/platform/acmsc.h
Normal file
67
drivers/bus/acpi/include/platform/acmsc.h
Normal 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__ */
|
|
@ -47,14 +47,25 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ReactOS uses GCC */
|
#if defined(__GNUC__)
|
||||||
|
|
||||||
#include "acgcc.h"
|
#include "acgcc.h"
|
||||||
|
|
||||||
#undef disable
|
#undef disable
|
||||||
#define disable() __asm__("cli\n\t");
|
#define disable() __asm__("cli\n\t")
|
||||||
#undef enable
|
#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
|
#undef DEBUGGER_THREADING
|
||||||
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue