]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x64Remainder.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / DivU64x64Remainder.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 DivU64x64Remainder.c
15
16 Abstract:
17
18 Math worker functions.
19
20 --*/
21
22 #include "BaseLibInternal.h"
23
24 /**
25 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
26 a 64-bit unsigned result and an optional 64-bit unsigned remainder.
27
28 This function divides the 64-bit unsigned value Dividend by the 64-bit
29 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
30 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
31 This function returns the 64-bit unsigned quotient.
32
33 If Divisor is 0, then ASSERT().
34
35 @param Dividend A 64-bit unsigned value.
36 @param Divisor A 64-bit unsigned value.
37 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
38 optional and may be NULL.
39
40 @return Dividend / Divisor
41
42 **/
43 UINT64
44 EFIAPI
45 DivU64x64Remainder (
46 IN UINT64 Dividend,
47 IN UINT64 Divisor,
48 OUT UINT64 *Remainder OPTIONAL
49 )
50 {
51 ASSERT (Divisor != 0);
52 return InternalMathDivRemU64x64 (Dividend, Divisor, Remainder);
53 }