aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utmath.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/utmath.c')
-rw-r--r--drivers/acpi/acpica/utmath.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c
index 35059a14eb72..49cf7b7fd816 100644
--- a/drivers/acpi/acpica/utmath.c
+++ b/drivers/acpi/acpica/utmath.c
@@ -48,11 +48,27 @@
48ACPI_MODULE_NAME("utmath") 48ACPI_MODULE_NAME("utmath")
49 49
50/* 50/*
51 * Support for double-precision integer divide. This code is included here 51 * Optional support for 64-bit double-precision integer divide. This code
52 * in order to support kernel environments where the double-precision math 52 * is configurable and is implemented in order to support 32-bit kernel
53 * library is not available. 53 * environments where a 64-bit double-precision math library is not available.
54 *
55 * Support for a more normal 64-bit divide/modulo (with check for a divide-
56 * by-zero) appears after this optional section of code.
54 */ 57 */
55#ifndef ACPI_USE_NATIVE_DIVIDE 58#ifndef ACPI_USE_NATIVE_DIVIDE
59/* Structures used only for 64-bit divide */
60typedef struct uint64_struct {
61 u32 lo;
62 u32 hi;
63
64} uint64_struct;
65
66typedef union uint64_overlay {
67 u64 full;
68 struct uint64_struct part;
69
70} uint64_overlay;
71
56/******************************************************************************* 72/*******************************************************************************
57 * 73 *
58 * FUNCTION: acpi_ut_short_divide 74 * FUNCTION: acpi_ut_short_divide
@@ -69,6 +85,7 @@ ACPI_MODULE_NAME("utmath")
69 * 32-bit remainder. 85 * 32-bit remainder.
70 * 86 *
71 ******************************************************************************/ 87 ******************************************************************************/
88
72acpi_status 89acpi_status
73acpi_ut_short_divide(u64 dividend, 90acpi_ut_short_divide(u64 dividend,
74 u32 divisor, u64 *out_quotient, u32 *out_remainder) 91 u32 divisor, u64 *out_quotient, u32 *out_remainder)