//------------------------------------------------------------------------------\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
//------------------------------------------------------------------------------\r
\r
\r
- EXTERN __aeabi_uldivmod\r
+ IMPORT __aeabi_uldivmod\r
+ EXPORT __aeabi_ldivmod\r
+ EXPORT __rt_sdiv64\r
\r
- INCLUDE AsmMacroExport.inc\r
+ AREA s___aeabi_ldivmod, CODE, READONLY, ARM\r
+\r
+ ARM\r
\r
;\r
-;UINT32\r
+;INT64\r
;EFIAPI\r
-;__aeabi_uidivmode (\r
-; IN UINT32 Dividen\r
-; IN UINT32 Divisor\r
+;__rt_sdiv64 (\r
+; IN INT64 Divisor\r
+; IN INT64 Dividend\r
; );\r
;\r
+__rt_sdiv64\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_ldivmod\r
\r
- RVCT_ASM_EXPORT __aeabi_ldivmod\r
+;\r
+;INT64\r
+;EFIAPI\r
+;__aeabi_ldivmod (\r
+; IN INT64 Dividend\r
+; IN INT64 Divisor\r
+; );\r
+;\r
+__aeabi_ldivmod\r
PUSH {r4,lr}\r
ASRS r4,r1,#1\r
EOR r4,r4,r3,LSR #1\r
RSBS r2,r2,#0\r
RSC r3,r3,#0\r
L_Test2\r
- BL __aeabi_uldivmod ;\r
+ BL __aeabi_uldivmod\r
TST r4,#0x40000000\r
BEQ L_Test3\r
RSBS r0,r0,#0\r
POP {r4,pc}\r
\r
END\r
-\r
-\r