#include "acpi.h"
#include "accommon.h"
Go to the source code of this file.
|
ACPI_STATUS | AcpiUtShortMultiply (UINT64 Multiplicand, UINT32 Multiplier, UINT64 *OutProduct) |
|
ACPI_STATUS | AcpiUtShortShiftLeft (UINT64 Operand, UINT32 Count, UINT64 *OutResult) |
|
ACPI_STATUS | AcpiUtShortShiftRight (UINT64 Operand, UINT32 Count, UINT64 *OutResult) |
|
ACPI_STATUS | AcpiUtShortDivide (UINT64 Dividend, UINT32 Divisor, UINT64 *OutQuotient, UINT32 *OutRemainder) |
|
ACPI_STATUS | AcpiUtDivide (UINT64 InDividend, UINT64 InDivisor, UINT64 *OutQuotient, UINT64 *OutRemainder) |
|
◆ _COMPONENT
◆ UINT64_OVERLAY
◆ UINT64_STRUCT
◆ AcpiUtDivide()
Definition at line 402 of file utmath.c.
407{
417
418
420
421
422
423
424 if (InDivisor == 0)
425 {
428 }
429
431 Dividend.
Full = InDividend;
433 {
434
435
436
437
439
440
441
442
443
445 Quotient.
Part.
Hi, Partial1);
446
447 ACPI_DIV_64_BY_32 (Partial1, Dividend.
Part.
Lo,
Divisor.Part.Lo,
449 }
450
451 else
452 {
453
454
455
456
458 NormalizedDividend = Dividend;
460
461
462
463 do
464 {
468 NormalizedDividend.
Part.
Hi, NormalizedDividend.
Part.
Lo);
469
470 }
while (NormalizedDivisor.
Part.
Hi != 0);
471
472
473
474 ACPI_DIV_64_BY_32 (
477
478
479
480
481
485
488
489 if (Partial3.
Part.
Hi == 0)
490 {
492 {
494 {
496 {
499 }
500 }
501 else
502 {
505 }
506 }
507
511
513 {
515 }
516 }
517 }
518
519
520
521 if (OutQuotient)
522 {
523 *OutQuotient = Quotient.
Full;
524 }
525 if (OutRemainder)
526 {
528 }
529
531}
unsigned long long UINT64
#define AE_AML_DIVIDE_BY_ZERO
#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo)
#define return_ACPI_STATUS(s)
#define ACPI_FUNCTION_TRACE(a)
#define ACPI_ERROR(plist)
_In_ LARGE_INTEGER Divisor
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Referenced by AcpiExOpcode_2A_1T_1R(), AcpiExOpcode_2A_2T_1R(), and AcpiUtPutNumber().
◆ AcpiUtShortDivide()
Definition at line 337 of file utmath.c.
342{
346
347
349
350
351
352
354 {
357 }
358
359 DividendOvl.
Full = Dividend;
360
361
362
363
364
366 Quotient.
Part.
Hi, Remainder32);
367
368 ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.
Part.
Lo,
Divisor,
369 Quotient.
Part.
Lo, Remainder32);
370
371
372
373 if (OutQuotient)
374 {
375 *OutQuotient = Quotient.
Full;
376 }
377 if (OutRemainder)
378 {
379 *OutRemainder = Remainder32;
380 }
381
383}
Referenced by AcpiExConvertToAscii(), AcpiExDigitsNeeded(), AcpiExIntegerToString(), AcpiExOpcode_1A_1T_1R(), AcpiExSystemMemorySpaceHandler(), AcpiGetTimerDuration(), and AcpiUtStrtoulMultiply64().
◆ AcpiUtShortMultiply()
Definition at line 88 of file utmath.c.
92{
96
97
99
100
101 MultiplicandOvl.
Full = Multiplicand;
102
103
104
105
106
107 ACPI_MUL_64_BY_32 (0, MultiplicandOvl.
Part.
Hi, Multiplier,
108 Product.
Part.
Hi, Carry32);
109
110 ACPI_MUL_64_BY_32 (0, MultiplicandOvl.
Part.
Lo, Multiplier,
111 Product.
Part.
Lo, Carry32);
112
113 Product.
Part.
Hi += Carry32;
114
115
116
117 if (OutProduct)
118 {
119 *OutProduct = Product.
Full;
120 }
121
123}
Referenced by AcpiUtScanNumber().
◆ AcpiUtShortShiftLeft()
Definition at line 139 of file utmath.c.
143{
145
146
148
149
150 OperandOvl.
Full = Operand;
151
152 if ((
Count & 63) >= 32)
153 {
157 }
158 ACPI_SHIFT_LEFT_64_BY_32 (OperandOvl.
Part.
Hi,
160
161
162
163 if (OutResult)
164 {
165 *OutResult = OperandOvl.
Full;
166 }
167
169}
◆ AcpiUtShortShiftRight()
Definition at line 184 of file utmath.c.
188{
190
191
193
194
195 OperandOvl.
Full = Operand;
196
197 if ((
Count & 63) >= 32)
198 {
202 }
203 ACPI_SHIFT_RIGHT_64_BY_32 (OperandOvl.
Part.
Hi,
205
206
207
208 if (OutResult)
209 {
210 *OutResult = OperandOvl.
Full;
211 }
212
214}
Referenced by AcpiUtHexToAsciiChar().