[ACPICA]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 25 May 2017 18:27:30 +0000 (18:27 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 25 May 2017 18:27:30 +0000 (18:27 +0000)
- Fix our broken support for the Windows-GCC configuration (again) by providing proper implementations of ACPI_DIV_64_BY_32 and ACPI_SHIFT_RIGHT_64.
CORE-13316 #resolve

svn path=/trunk/; revision=74656

reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h

index 0fde23b..1512e5b 100644 (file)
@@ -126,20 +126,17 @@ do {                                                        \
 } while(0)
 
 
-/*
- * Note: This is also taken from our old adaptation.
- *       See acmsvc.h for where it came originally.
- */
-#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
-{                           \
-    q32 = n_hi / d32;       \
-    r32 = n_lo / d32;       \
+#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32)                \
+{                                                                   \
+    asm("divl %4;"                                                  \
+        :"=a"(q32),"=d"(r32):"a"(n_lo),"d"(n_hi),"rm"(d32):"cc");   \
 }
 
-#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
-{                           \
-    n_hi >>= 1;    \
-    n_lo >>= 1;    \
+#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo)                     \
+{                                                           \
+    asm("shrl $1, %0;"                                      \
+        "rcrl $1, %1;"                                      \
+        :"=rm"(n_hi),"=rm"(n_lo):"0"(n_hi),"1"(n_lo):"cc"); \
 }
 
 #endif /* __REACTOS__ */