mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 17:56:40 +07:00
powerpc: Don't use local named register variable in current_thread_info
LLVM doesn't support local named register variables and is unlikely to. current_thread_info is using one, fix it by moving it out and calling it __current_r1(). I gave it a bit of an obscure name because we don't want anyone else using it - they should use current_stack_pointer(). This specific case is performance critical and we can't afford to call a function to get it. Furthermore it isn't important to know exactly where in the stack we are since we mask the lower bits. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
e88f157de5
commit
a3e5b356b3
@ -71,13 +71,12 @@ struct thread_info {
|
||||
#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
|
||||
|
||||
/* how to get the thread information struct from C */
|
||||
register unsigned long __current_r1 asm("r1");
|
||||
static inline struct thread_info *current_thread_info(void)
|
||||
{
|
||||
register unsigned long sp asm("r1");
|
||||
|
||||
/* gcc4, at least, is smart enough to turn this into a single
|
||||
* rlwinm for ppc32 and clrrdi for ppc64 */
|
||||
return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
|
||||
return (struct thread_info *)(__current_r1 & ~(THREAD_SIZE-1));
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
Loading…
Reference in New Issue
Block a user