diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/utilities/utmath.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/utilities/utmath.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c index ce11f39..788e330 100644 --- a/sys/contrib/dev/acpica/components/utilities/utmath.c +++ b/sys/contrib/dev/acpica/components/utilities/utmath.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -122,9 +122,10 @@ AcpiUtShortDivide ( * and is generated by the second divide. */ ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor, - Quotient.Part.Hi, Remainder32); + Quotient.Part.Hi, Remainder32); + ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor, - Quotient.Part.Lo, Remainder32); + Quotient.Part.Lo, Remainder32); /* Return only what was requested */ @@ -200,9 +201,10 @@ AcpiUtDivide ( * and is generated by the second divide. */ ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo, - Quotient.Part.Hi, Partial1); + Quotient.Part.Hi, Partial1); + ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo, - Quotient.Part.Lo, Remainder.Part.Lo); + Quotient.Part.Lo, Remainder.Part.Lo); } else @@ -219,25 +221,24 @@ AcpiUtDivide ( do { - ACPI_SHIFT_RIGHT_64 (NormalizedDivisor.Part.Hi, - NormalizedDivisor.Part.Lo); - ACPI_SHIFT_RIGHT_64 (NormalizedDividend.Part.Hi, - NormalizedDividend.Part.Lo); + ACPI_SHIFT_RIGHT_64 ( + NormalizedDivisor.Part.Hi, NormalizedDivisor.Part.Lo); + ACPI_SHIFT_RIGHT_64 ( + NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo); } while (NormalizedDivisor.Part.Hi != 0); /* Partial divide */ - ACPI_DIV_64_BY_32 (NormalizedDividend.Part.Hi, - NormalizedDividend.Part.Lo, - NormalizedDivisor.Part.Lo, - Quotient.Part.Lo, Partial1); + ACPI_DIV_64_BY_32 ( + NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo, + NormalizedDivisor.Part.Lo, Quotient.Part.Lo, Partial1); /* - * The quotient is always 32 bits, and simply requires adjustment. - * The 64-bit remainder must be generated. + * The quotient is always 32 bits, and simply requires + * adjustment. The 64-bit remainder must be generated. */ - Partial1 = Quotient.Part.Lo * Divisor.Part.Hi; + Partial1 = Quotient.Part.Lo * Divisor.Part.Hi; Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo; Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1; @@ -263,7 +264,7 @@ AcpiUtDivide ( } } - Remainder.Full = Remainder.Full - Dividend.Full; + Remainder.Full = Remainder.Full - Dividend.Full; Remainder.Part.Hi = (UINT32) -((INT32) Remainder.Part.Hi); Remainder.Part.Lo = (UINT32) -((INT32) Remainder.Part.Lo); |