FreeBSD/sys/contrib/dev/acpica/components/utilities/utmath.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiUtShortDivide, AcpiUtDivide
 *
 * PARAMETERS:  See function headers above
 *
 * DESCRIPTION: Native versions of the UtDivide functions. Use these if either
 *              1) The target is a 64-bit platform and therefore 64-bit
 *                 integer math is supported directly by the machine.
 *              2) The target is a 32-bit or 16-bit platform, and the
 *                 double-precision integer math library is available to
 *                 perform the divide.
 *
 ******************************************************************************/
AcpiUtShortDivide, AcpiUtDivide
PARAMETERS:  See function headers above

Native versions of the UtDivide functions. Use these if either
1) The target is a 64-bit platform and therefore 64-bit
integer math is supported directly by the machine.
2) The target is a 32-bit or 16-bit platform, and the
double-precision integer math library is available to
perform the divide.
AcpiUtShortDivide AcpiUtDivide PARAMETERS : See function headers above Native versions of the UtDivide functions . Use these if either 1 ) The target is a 64 - bit platform and therefore 64 - bit integer math is supported directly by the machine . 2 ) The target is a 32 - bit or 16 - bit platform and the double - precision integer math library is available to perform the divide .
ACPI_STATUS
AcpiUtShortDivide (
    UINT64                  InDividend,
    UINT32                  Divisor,
    UINT64                  *OutQuotient,
    UINT32                  *OutRemainder)
{
    ACPI_FUNCTION_TRACE (UtShortDivide);
    if (Divisor == 0)
    {
        ACPI_ERROR ((AE_INFO, "Divide by zero"));
        return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO);
    }
    if (OutQuotient)
    {
        *OutQuotient = InDividend / Divisor;
    }
    if (OutRemainder)
    {
        *OutRemainder = (UINT32) (InDividend % Divisor);
    }
    return_ACPI_STATUS (AE_OK);
}
ACPI_STATUS AcpiUtShortDivide ( UINT64 InDividend , UINT32 Divisor , UINT64 * OutQuotient , UINT32 * OutRemainder ) { ACPI_FUNCTION_TRACE ( UtShortDivide ) ; if ( Divisor == 0 ) { ACPI_ERROR ( ( AE_INFO , " " ) ) ; return_ACPI_STATUS ( AE_AML_DIVIDE_BY_ZERO ) ; } if ( OutQuotient ) { * OutQuotient = InDividend / Divisor ; } if ( OutRemainder ) { * OutRemainder = ( UINT32 ) ( InDividend % Divisor ) ; } return_ACPI_STATUS ( AE_OK ) ; }
FUNCTION:    AcpiUtShortDivide, AcpiUtDivide
 PARAMETERS:  See function headers above
FUNCTION : AcpiUtShortDivide AcpiUtDivide PARAMETERS : See function headers above
/* Always check for a zero divisor */ /* Return only what was requested */