From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH v11 09/14] Implement __aeabi_uldivmod
Date: Tue, 15 Apr 2025 10:35:43 +0000 [thread overview]
Message-ID: <20250415103710.116109-10-phcoder@gmail.com> (raw)
In-Reply-To: <20250415103710.116109-1-phcoder@gmail.com>
Some arm compilers insert 64-bit division into the
code compiled from libgcrypt source and possibly others.
Rether than fighting it, simply provide the function in
question.
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
grub-core/kern/arm/compiler-rt.S | 11 +++++++++++
include/grub/compiler-rt.h | 3 +++
2 files changed, 14 insertions(+)
diff --git a/grub-core/kern/arm/compiler-rt.S b/grub-core/kern/arm/compiler-rt.S
index 645b42f50..26fe1c98d 100644
--- a/grub-core/kern/arm/compiler-rt.S
+++ b/grub-core/kern/arm/compiler-rt.S
@@ -75,6 +75,17 @@ FUNCTION(__aeabi_uidivmod)
FUNCTION(__aeabi_idivmod)
division32 grub_divmod32s
+ /* Copied from LLVM under MIT license. */
+FUNCTION(__aeabi_uldivmod)
+ push {r11, lr}
+ sub sp, sp, #16
+ add r12, sp, #8
+ str r12, [sp]
+ bl grub_divmod64
+ ldr r2, [sp, #8]
+ ldr r3, [sp, #12]
+ add sp, sp, #16
+ pop {r11, pc}
/*
* Null divide-by-zero handler
*/
diff --git a/include/grub/compiler-rt.h b/include/grub/compiler-rt.h
index 17828b322..43fd8f4d7 100644
--- a/include/grub/compiler-rt.h
+++ b/include/grub/compiler-rt.h
@@ -73,6 +73,9 @@ EXPORT_FUNC (__aeabi_uidiv) (grub_uint32_t a, grub_uint32_t b);
grub_uint32_t
EXPORT_FUNC (__aeabi_uidivmod) (grub_uint32_t a, grub_uint32_t b);
+grub_uint64_t
+EXPORT_FUNC (__aeabi_uldivmod) (grub_uint64_t a, grub_uint64_t b);
+
grub_int32_t
EXPORT_FUNC (__aeabi_idiv) (grub_int32_t a, grub_int32_t b);
grub_int32_t
--
2.49.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2025-04-15 10:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 10:35 [PATCH v11 00/14] Upgrade libgcrypt to 1.11 Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 01/14] Import libgcrypt 1.11 Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 02/14] Import b64dec from gpg-error Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 03/14] b64dec: Adjust for compilation in GRUB environment Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 04/14] Adjust import script, definitions and API users for libgcrypt 1.11 Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 05/14] Add DSA and RSA SEXP tests Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 06/14] keccak: Disable acceleration with SSE asm Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 07/14] libgcrypt: Fix coverity warnings Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 08/14] Remove now unneeded gcrypt compilation flag Vladimir Serbinenko
2025-04-15 10:35 ` Vladimir Serbinenko [this message]
2025-04-15 10:35 ` [PATCH v11 10/14] Enable (u)divdi3 and (u)moddi3 for mips Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 11/14] gcry: Ignore sign-compare warnings Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 12/14] libgcrypt: Import blake family of hashes Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 13/14] import_gcry: Make compatible with python 3.4 Vladimir Serbinenko
2025-04-15 10:35 ` [PATCH v11 14/14] import_gcry: Fix pylint warnings Vladimir Serbinenko
-- strict thread matches above, loose matches on Subject: below --
2025-04-10 22:00 [PATCH v11 00/14] Update libgcrypt to 1.11 Vladimir Serbinenko
2025-04-10 22:00 ` [PATCH v11 09/14] Implement __aeabi_uldivmod Vladimir Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250415103710.116109-10-phcoder@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.