+++ /dev/null
-/** @file\r
- 64-bit Math Worker Function.\r
- The 32-bit versions of C compiler generate calls to library routines\r
- to handle 64-bit math. These functions use non-standard calling conventions.\r
-\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials are licensed and made available\r
- under the terms and conditions of the BSD License which accompanies this\r
- distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include <Library/BaseLib.h>\r
-\r
-\r
-/*\r
- * Divides a 64-bit unsigned value with a 64-bit unsigned value and returns\r
- * a 64-bit unsigned result.\r
- */\r
-__declspec(naked) void __cdecl _aulldiv (void)\r
-{\r
- //\r
- // Wrapper Implementation over EDKII DivU64x64Reminder() routine\r
- // UINT64\r
- // EFIAPI\r
- // DivU64x64Remainder (\r
- // IN UINT64 Dividend,\r
- // IN UINT64 Divisor,\r
- // OUT UINT64 *Remainder OPTIONAL\r
- // )\r
- //\r
- _asm {\r
-\r
- ; Original local stack when calling _aulldiv\r
- ; -----------------\r
- ; | |\r
- ; |---------------|\r
- ; | |\r
- ; |-- Divisor --|\r
- ; | |\r
- ; |---------------|\r
- ; | |\r
- ; |-- Dividend --|\r
- ; | |\r
- ; |---------------|\r
- ; | ReturnAddr** |\r
- ; ESP---->|---------------|\r
- ;\r
-\r
- ;\r
- ; Set up the local stack for NULL Reminder pointer\r
- ;\r
- xor eax, eax\r
- push eax\r
-\r
- ;\r
- ; Set up the local stack for Divisor parameter\r
- ;\r
- mov eax, [esp + 20]\r
- push eax\r
- mov eax, [esp + 20]\r
- push eax\r
-\r
- ;\r
- ; Set up the local stack for Dividend parameter\r
- ;\r
- mov eax, [esp + 20]\r
- push eax\r
- mov eax, [esp + 20]\r
- push eax\r
-\r
- ;\r
- ; Call native DivU64x64Remainder of BaseLib\r
- ;\r
- call DivU64x64Remainder\r
-\r
- ;\r
- ; Adjust stack\r
- ;\r
- add esp, 20\r
-\r
- ret 16\r
- }\r
-}\r