-//------------------------------------------------------------------------------ \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
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
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
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
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