]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / uldiv.asm
index 393794c13af76001fcb167864d13ede42095f816..e143052a712f2a678654ce66088b506c67d8fd8b 100644 (file)
@@ -1,28 +1,43 @@
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
 //\r
 // Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+// Copyright (c) 2018, Pete Batard. All rights reserved.<BR>\r
 //\r
-// This program and the accompanying materials\r
-// are licensed and made available under the terms and conditions of the BSD License\r
-// which accompanies this 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
+// SPDX-License-Identifier: BSD-2-Clause-Patent\r
 //\r
 //------------------------------------------------------------------------------\r
 \r
 \r
-\r
     EXPORT  __aeabi_uldivmod\r
+    EXPORT  __rt_udiv64\r
+\r
+    AREA  s___aeabi_uldivmod, CODE, READONLY, ARM\r
+\r
+    ARM\r
 \r
-    AREA  Uldivmod, CODE, READONLY\r
+;\r
+;UINT64\r
+;EFIAPI\r
+;__rt_udiv64 (\r
+;  IN  UINT64   Divisor\r
+;  IN  UINT64   Dividend\r
+;  )\r
+;\r
+__rt_udiv64\r
+  ; Swap r0-r1 and r2-r3\r
+  mov     r12, r0\r
+  mov     r0, r2\r
+  mov     r2, r12\r
+  mov     r12, r1\r
+  mov     r1, r3\r
+  mov     r3, r12\r
+  b       __aeabi_uldivmod\r
 \r
-;        \r
+;\r
 ;UINT64\r
 ;EFIAPI\r
 ;__aeabi_uldivmod (\r
-;  IN  UINT64   Dividend  \r
+;  IN  UINT64   Dividend\r
 ;  IN  UINT64   Divisor\r
 ;  )\r
 ;\r
@@ -77,7 +92,7 @@ __aeabi_uldivmod_label2
   mov     ip, r3\r
   mov     lr, r2\r
   b       _ll_udiv_ginormous\r
-  \r
+\r
 _ll_udiv_small\r
   cmp     r4, ip, lsl #1\r
   mov     r3, #0  ; 0x0\r
@@ -157,7 +172,7 @@ _ll_udiv_small_label5
   add     r1, r1, r3, lsl r6\r
   mov     r3, #0  ; 0x0\r
   ldmia   sp!, {r4, r5, r6, pc}\r
-  \r
+\r
 _ll_udiv_big\r
   subs    r0, r5, lr\r
   mov     r3, #0  ; 0x0\r
@@ -245,7 +260,7 @@ _ll_udiv_big_label4
   orr     r2, r2, r4, ror r6\r
   adc     r1, r1, #0      ; 0x0\r
   ldmia   sp!, {r4, r5, r6, pc}\r
-  \r
+\r
 _ll_udiv_ginormous\r
   subs    r2, r5, lr\r
   mov     r1, #0  ; 0x0\r
@@ -254,15 +269,14 @@ _ll_udiv_ginormous
   movcc   r2, r5\r
   movcc   r3, r4\r
   ldmia   sp!, {r4, r5, r6, pc}\r
-  \r
+\r
 _ll_div0\r
   ldmia   sp!, {r4, r5, r6, lr}\r
   mov     r0, #0  ; 0x0\r
   mov     r1, #0  ; 0x0\r
   b       __aeabi_ldiv0\r
-  \r
+\r
 __aeabi_ldiv0\r
-  BX        r14\r
+  bx        r14\r
 \r
   END\r
-\r