git: ed3066342660 - main - Make the arm64 get_pcpu a function again
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 08 Mar 2022 11:59:43 UTC
The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ed306634266002a05c88c3a4cd036c99d4cd139a commit ed306634266002a05c88c3a4cd036c99d4cd139a Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2022-03-08 11:38:51 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2022-03-08 11:54: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. Sponsored by: The FreeBSD Foundation --- 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 09f6361c651c..b93f3b2e4816 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)