******************************************************************************/
/*
- * Copyright (C) 2000 - 2004, R. Byron Moore
+ * Copyright (C) 2000 - 2005, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
*
* FUNCTION: acpi_ut_short_divide
*
- * PARAMETERS: in_dividend - Pointer to the dividend
+ * PARAMETERS: Dividend - 64-bit dividend
* Divisor - 32-bit divisor
* out_quotient - Pointer to where the quotient is returned
* out_remainder - Pointer to where the remainder is returned
acpi_status
acpi_ut_short_divide (
- acpi_integer *in_dividend,
+ acpi_integer dividend,
u32 divisor,
acpi_integer *out_quotient,
u32 *out_remainder)
{
- union uint64_overlay dividend;
+ union uint64_overlay dividend_ovl;
union uint64_overlay quotient;
u32 remainder32;
ACPI_FUNCTION_TRACE ("ut_short_divide");
- dividend.full = *in_dividend;
/* Always check for a zero divisor */
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
+ dividend_ovl.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, dividend_ovl.part.hi, divisor,
quotient.part.hi, remainder32);
- ACPI_DIV_64_BY_32 (remainder32, dividend.part.lo, divisor,
+ ACPI_DIV_64_BY_32 (remainder32, dividend_ovl.part.lo, divisor,
quotient.part.lo, remainder32);
/* Return only what was requested */
*
* FUNCTION: acpi_ut_divide
*
- * PARAMETERS: in_dividend - Pointer to the dividend
- * in_divisor - Pointer to the divisor
+ * PARAMETERS: in_dividend - Dividend
+ * in_divisor - Divisor
* out_quotient - Pointer to where the quotient is returned
* out_remainder - Pointer to where the remainder is returned
*
acpi_status
acpi_ut_divide (
- acpi_integer *in_dividend,
- acpi_integer *in_divisor,
+ acpi_integer in_dividend,
+ acpi_integer in_divisor,
acpi_integer *out_quotient,
acpi_integer *out_remainder)
{
/* Always check for a zero divisor */
- if (*in_divisor == 0) {
+ if (in_divisor == 0) {
ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
- divisor.full = *in_divisor;
- dividend.full = *in_dividend;
+ divisor.full = in_divisor;
+ dividend.full = in_dividend;
if (divisor.part.hi == 0) {
/*
* 1) Simplest case is where the divisor is 32 bits, we can
acpi_status
acpi_ut_short_divide (
- acpi_integer *in_dividend,
+ acpi_integer in_dividend,
u32 divisor,
acpi_integer *out_quotient,
u32 *out_remainder)
/* Return only what was requested */
if (out_quotient) {
- *out_quotient = *in_dividend / divisor;
+ *out_quotient = in_dividend / divisor;
}
if (out_remainder) {
- *out_remainder = (u32) *in_dividend % divisor;
+ *out_remainder = (u32) in_dividend % divisor;
}
return_ACPI_STATUS (AE_OK);
acpi_status
acpi_ut_divide (
- acpi_integer *in_dividend,
- acpi_integer *in_divisor,
+ acpi_integer in_dividend,
+ acpi_integer in_divisor,
acpi_integer *out_quotient,
acpi_integer *out_remainder)
{
/* Always check for a zero divisor */
- if (*in_divisor == 0) {
+ if (in_divisor == 0) {
ACPI_REPORT_ERROR (("acpi_ut_divide: Divide by zero\n"));
return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
}
/* Return only what was requested */
if (out_quotient) {
- *out_quotient = *in_dividend / *in_divisor;
+ *out_quotient = in_dividend / in_divisor;
}
if (out_remainder) {
- *out_remainder = *in_dividend % *in_divisor;
+ *out_remainder = in_dividend % in_divisor;
}
return_ACPI_STATUS (AE_OK);