From 918704376206af8ea06460eb25fcd3dc491f7f63 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Thu, 25 May 2017 18:27:30 +0000 Subject: [PATCH] [ACPICA] - 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 --- .../bus/acpi/acpica/include/platform/acgcc.h | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h index 0fde23b2c60..1512e5b6463 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h @@ -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__ */ -- 2.17.1