Skip to content

Commit fd4dcd5

Browse files
Asher8118ash-arm
andauthored
Add aarch64_sme_accessible to newlib patch (#547)
To check for SME support, compiler-rt makes a call to __aarch64_sme_accessible(). It expects this symbol to be defined in newlib, which is currently incorrect. This patch extends newlib.patch to add the definition of __aarch64_sme_accessible. Co-authored-by: Rin Dobrescu <[email protected]>
1 parent cd41a86 commit fd4dcd5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

patches/newlib.patch

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c
2+
index 7343cc61f..2c4b63c17 100644
3+
--- a/libgloss/aarch64/syscalls.c
4+
+++ b/libgloss/aarch64/syscalls.c
5+
@@ -172,6 +172,12 @@ newslot (void)
6+
return i;
7+
}
8+
9+
+int __aarch64_sme_accessible() {
10+
+ int result = 0;
11+
+ asm volatile ( "mrs %x[result], id_aa64pfr1_el1" : [result]"=r"(result) : : );
12+
+ return (result & 0x3000000) != 0;
13+
+}
14+
+
15+
void
16+
initialise_monitor_handles (void)
17+
{
118
diff --git a/libgloss/arm/cpu-init/rdimon-aem.S b/libgloss/arm/cpu-init/rdimon-aem.S
219
index 95b86e4d4..b91034ae6 100644
320
--- a/libgloss/arm/cpu-init/rdimon-aem.S

0 commit comments

Comments
 (0)