diff options
Diffstat (limited to 'sys/contrib/dev/acpica/utmath.c')
-rw-r--r-- | sys/contrib/dev/acpica/utmath.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/sys/contrib/dev/acpica/utmath.c b/sys/contrib/dev/acpica/utmath.c index 5d81a98..9c9cd62 100644 --- a/sys/contrib/dev/acpica/utmath.c +++ b/sys/contrib/dev/acpica/utmath.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmath - Integer math support routines - * $Revision: 13 $ + * $Revision: 14 $ * ******************************************************************************/ @@ -134,7 +134,7 @@ * * FUNCTION: AcpiUtShortDivide * - * PARAMETERS: InDividend - Pointer to the dividend + * PARAMETERS: Dividend - 64-bit dividend * Divisor - 32-bit divisor * OutQuotient - Pointer to where the quotient is returned * OutRemainder - Pointer to where the remainder is returned @@ -149,19 +149,18 @@ ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER *InDividend, + ACPI_INTEGER Dividend, UINT32 Divisor, ACPI_INTEGER *OutQuotient, UINT32 *OutRemainder) { - UINT64_OVERLAY Dividend; + UINT64_OVERLAY DividendOvl; UINT64_OVERLAY Quotient; UINT32 Remainder32; ACPI_FUNCTION_TRACE ("UtShortDivide"); - Dividend.Full = *InDividend; /* Always check for a zero divisor */ @@ -171,13 +170,15 @@ AcpiUtShortDivide ( return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } + DividendOvl.Full = Dividend; + /* * The quotient is 64 bits, the remainder is always 32 bits, * and is generated by the second divide. */ - ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor, + ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor, Quotient.Part.Hi, Remainder32); - ACPI_DIV_64_BY_32 (Remainder32, Dividend.Part.Lo, Divisor, + ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor, Quotient.Part.Lo, Remainder32); /* Return only what was requested */ @@ -199,8 +200,8 @@ AcpiUtShortDivide ( * * FUNCTION: AcpiUtDivide * - * PARAMETERS: InDividend - Pointer to the dividend - * InDivisor - Pointer to the divisor + * PARAMETERS: InDividend - Dividend + * InDivisor - Divisor * OutQuotient - Pointer to where the quotient is returned * OutRemainder - Pointer to where the remainder is returned * @@ -212,8 +213,8 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER *InDividend, - ACPI_INTEGER *InDivisor, + ACPI_INTEGER InDividend, + ACPI_INTEGER InDivisor, ACPI_INTEGER *OutQuotient, ACPI_INTEGER *OutRemainder) { @@ -233,14 +234,14 @@ AcpiUtDivide ( /* Always check for a zero divisor */ - if (*InDivisor == 0) + if (InDivisor == 0) { ACPI_REPORT_ERROR (("AcpiUtDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } - Divisor.Full = *InDivisor; - Dividend.Full = *InDividend; + Divisor.Full = InDivisor; + Dividend.Full = InDividend; if (Divisor.Part.Hi == 0) { /* @@ -359,7 +360,7 @@ AcpiUtDivide ( ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER *InDividend, + ACPI_INTEGER InDividend, UINT32 Divisor, ACPI_INTEGER *OutQuotient, UINT32 *OutRemainder) @@ -380,11 +381,11 @@ AcpiUtShortDivide ( if (OutQuotient) { - *OutQuotient = *InDividend / Divisor; + *OutQuotient = InDividend / Divisor; } if (OutRemainder) { - *OutRemainder = (UINT32) *InDividend % Divisor; + *OutRemainder = (UINT32) InDividend % Divisor; } return_ACPI_STATUS (AE_OK); @@ -392,8 +393,8 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER *InDividend, - ACPI_INTEGER *InDivisor, + ACPI_INTEGER InDividend, + ACPI_INTEGER InDivisor, ACPI_INTEGER *OutQuotient, ACPI_INTEGER *OutRemainder) { @@ -402,7 +403,7 @@ AcpiUtDivide ( /* Always check for a zero divisor */ - if (*InDivisor == 0) + if (InDivisor == 0) { ACPI_REPORT_ERROR (("AcpiUtDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); @@ -413,11 +414,11 @@ AcpiUtDivide ( if (OutQuotient) { - *OutQuotient = *InDividend / *InDivisor; + *OutQuotient = InDividend / InDivisor; } if (OutRemainder) { - *OutRemainder = *InDividend % *InDivisor; + *OutRemainder = InDividend % InDivisor; } return_ACPI_STATUS (AE_OK); |