]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/DivU64x64Remainder.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / DivU64x64Remainder.c
1 /** @file
2 Math worker functions.
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "BaseLibInternals.h"
10
11 /**
12 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
13 a 64-bit unsigned result and an optional 64-bit unsigned remainder.
14
15 This function divides the 64-bit unsigned value Dividend by the 64-bit
16 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
17 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
18 This function returns the 64-bit unsigned quotient.
19
20 If Divisor is 0, then ASSERT().
21
22 @param Dividend A 64-bit unsigned value.
23 @param Divisor A 64-bit unsigned value.
24 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
25 optional and may be NULL.
26
27 @return Dividend / Divisor
28
29 **/
30 UINT64
31 EFIAPI
32 DivU64x64Remainder (
33 IN UINT64 Dividend,
34 IN UINT64 Divisor,
35 OUT UINT64 *Remainder OPTIONAL
36 )
37 {
38 ASSERT (Divisor != 0);
39 return InternalMathDivRemU64x64 (Dividend, Divisor, Remainder);
40 }