Author: tfaber
Date: Tue Nov 10 11:12:54 2015
New Revision: 69860
URL:
http://svn.reactos.org/svn/reactos?rev=69860&view=rev
Log:
[ACPICA]
- Mark ReactOS modifications as such
CORE-10509
Modified:
trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h
trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h
trunk/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h
trunk/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h
trunk/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h
trunk/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/acpi.h [iso-8859-1] Tue Nov 10 11:12:54
2015
@@ -116,11 +116,13 @@
#ifndef __ACPI_H__
#define __ACPI_H__
+#ifdef __REACTOS__
/*
* Header inclusion HACK (see modifications to actypes.h too).
*/
#include <ntddk.h>
#undef ACPI_BIOS_ERROR // ACPI_BIOS_ERROR is redefined in acoutput.h
+#endif /* __REACTOS__ */
/*
* Public include files for use by code that will interface to ACPICA.
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/actypes.h [iso-8859-1] Tue Nov 10
11:12:54 2015
@@ -196,11 +196,13 @@
*
******************************************************************************/
-// typedef unsigned char BOOLEAN;
-// typedef unsigned char UINT8;
-// typedef unsigned short UINT16;
-// typedef COMPILER_DEPENDENT_UINT64 UINT64;
-// typedef COMPILER_DEPENDENT_INT64 INT64;
+#ifndef __REACTOS__
+typedef unsigned char BOOLEAN;
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef COMPILER_DEPENDENT_UINT64 UINT64;
+typedef COMPILER_DEPENDENT_INT64 INT64;
+#endif /* __REACTOS__ */
/*! [End] no source code translation !*/
@@ -225,8 +227,10 @@
/*! [Begin] no source code translation (keep the typedefs as-is) */
-// typedef unsigned int UINT32;
-// typedef int INT32;
+#ifndef __REACTOS__
+typedef unsigned int UINT32;
+typedef int INT32;
+#endif /* __REACTOS__ */
/*! [End] no source code translation !*/
@@ -264,8 +268,10 @@
/*! [Begin] no source code translation (keep the typedefs as-is) */
-// typedef unsigned int UINT32;
-// typedef int INT32;
+#ifndef __REACTOS__
+typedef unsigned int UINT32;
+typedef int INT32;
+#endif /* __REACTOS__ */
/*! [End] no source code translation !*/
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h [iso-8859-1]
(original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h [iso-8859-1] Tue Nov 10
11:12:54 2015
@@ -290,7 +290,11 @@
/* Type of mutex supported by host. Default is binary semaphores. */
#ifndef ACPI_MUTEX_TYPE
+#ifdef __REACTOS__
#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX
+#else
+#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
+#endif /* __REACTOS__ */
#endif
/* Global Lock acquire/release */
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h [iso-8859-1]
(original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h [iso-8859-1] Tue Nov 10
11:12:54 2015
@@ -147,7 +147,7 @@
#undef strchr
#endif
-
+#ifdef __REACTOS__
/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
#ifdef ACPI_APPLICATION
@@ -207,5 +207,5 @@
n_lo >>= 1; \
}
-
+#endif /* __REACTOS__ */
#endif /* __ACGCC_H__ */
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h [iso-8859-1]
(original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h [iso-8859-1] Tue Nov
10 11:12:54 2015
@@ -202,6 +202,7 @@
}
#endif
+#ifdef __REACTOS__
/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
@@ -262,6 +263,7 @@
__asm mov Pnd, al \
}
+#endif /* __REACTOS__ */
/* warn C4100: unreferenced formal parameter */
#pragma warning(disable:4100)
Modified: trunk/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h [iso-8859-1]
(original)
+++ trunk/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h [iso-8859-1] Tue Nov 10
11:12:54 2015
@@ -118,12 +118,15 @@
/*! [Begin] no source code translation (Keep the include) */
-/* Windows uses VC or GCC */
-#if defined(_MSC_VER)
+/* Windows uses VC */
+#ifdef _MSC_VER
#include "acmsvc.h"
-#elif defined(__GNUC__)
+#endif
+#ifdef __REACTOS__
+#if !defined(_MSC_VER) && defined(__GNUC__)
#include "acgcc.h"
#endif
+#endif /* __REACTOS __ */
/*! [End] no source code translation !*/
#define ACPI_MACHINE_WIDTH 32
@@ -154,10 +157,71 @@
/*! [Begin] no source code translation */
+#ifndef __REACTOS__
+#ifdef ACPI_APPLICATION
+#define ACPI_FLUSH_CPU_CACHE()
+#else
+#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD}
+#endif
+#endif /* __REACTOS__ */
+
#ifdef _DEBUG
#define ACPI_SIMPLE_RETURN_MACROS
#endif
/*! [End] no source code translation !*/
+#ifndef __REACTOS__
+/*
+ * Global Lock acquire/release code
+ *
+ * Note: Handles case where the FACS pointer is null
+ */
+#define ACPI_ACQUIRE_GLOBAL_LOCK(FacsPtr, Acq) __asm \
+{ \
+ __asm mov eax, 0xFF \
+ __asm mov ecx, FacsPtr \
+ __asm or ecx, ecx \
+ __asm jz exit_acq \
+ __asm lea ecx, [ecx].GlobalLock \
+ \
+ __asm acq10: \
+ __asm mov eax, [ecx] \
+ __asm mov edx, eax \
+ __asm and edx, 0xFFFFFFFE \
+ __asm bts edx, 1 \
+ __asm adc edx, 0 \
+ __asm lock cmpxchg dword ptr [ecx], edx \
+ __asm jnz acq10 \
+ \
+ __asm cmp dl, 3 \
+ __asm sbb eax, eax \
+ \
+ __asm exit_acq: \
+ __asm mov Acq, al \
+}
+
+#define ACPI_RELEASE_GLOBAL_LOCK(FacsPtr, Pnd) __asm \
+{ \
+ __asm xor eax, eax \
+ __asm mov ecx, FacsPtr \
+ __asm or ecx, ecx \
+ __asm jz exit_rel \
+ __asm lea ecx, [ecx].GlobalLock \
+ \
+ __asm Rel10: \
+ __asm mov eax, [ecx] \
+ __asm mov edx, eax \
+ __asm and edx, 0xFFFFFFFC \
+ __asm lock cmpxchg dword ptr [ecx], edx \
+ __asm jnz Rel10 \
+ \
+ __asm cmp dl, 3 \
+ __asm and eax, 1 \
+ \
+ __asm exit_rel: \
+ __asm mov Pnd, al \
+}
+#endif /* __REACTOS__ */
+
#endif /* __ACWIN_H__ */