git: f5f567c2264b - releng/13.1 - Make the arm64 get_pcpu a function again
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 23 Mar 2022 19:48:24 UTC
The branch releng/13.1 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f5f567c2264bf4960042a0a3751f6905d34bc3df commit f5f567c2264bf4960042a0a3751f6905d34bc3df Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2022-03-08 11:38:51 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2022-03-23 19:46:58 +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. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation (cherry picked from commit ed306634266002a05c88c3a4cd036c99d4cd139a) (cherry picked from commit 1169099f8fd981f2e085f451f0b4a62e18bfe507) --- 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)