git: 1169099f8fd9 - stable/13 - Make the arm64 get_pcpu a function again

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 14 Mar 2022 15:07:31 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=1169099f8fd981f2e085f451f0b4a62e18bfe507

commit 1169099f8fd981f2e085f451f0b4a62e18bfe507
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-03-08 11:38:51 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-03-14 15:00:27 +0000

    Make the arm64 get_pcpu a function again
    
    We assume the pointer returned from get_pcpu will be consistent even
    if the thread is moved to a new CPU. Fix this by partially reverting
    63c858a04d565 to make get_pcpu a function again.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit ed306634266002a05c88c3a4cd036c99d4cd139a)
---
 sys/arm64/include/pcpu.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h
index ce4dc46e1609..d83c9a656634 100644
--- a/sys/arm64/include/pcpu.h
+++ b/sys/arm64/include/pcpu.h
@@ -58,7 +58,14 @@ struct pcpu;
 
 register struct pcpu *pcpup __asm ("x18");
 
-#define	get_pcpu()	pcpup
+static inline struct pcpu *
+get_pcpu(void)
+{
+	struct pcpu *pcpu;
+
+	__asm __volatile("mov   %0, x18" : "=&r"(pcpu));
+	return (pcpu);
+}
 
 static inline struct thread *
 get_curthread(void)