mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-15 22:43:55 +00:00
The motivation is eventual ABI considerations for ARCv3 but even without
it this change us worthwhile as diffstat reduces 100 net lines
r25 is a callee saved register, normally not saved by entry code in
pt_regs. However because of its usage in CONFIG_ARC_CURR_IN_REG it needs
to be. This in turn requires a whole bunch of special casing when we
need to access r25. Then there is distinction between user mode r25 vs.
kernel mode r25 - hence distinct SAVE_CALLEE_SAVED_{USER,KERNEL}
Instead use gp which is a scratch register and thus saved already in entry
code. This cleans things up significantly and much nocer on eyes:
- SAVE_CALLEE_SAVED_{USER,KERNEL} are now exactly same
- no special user_r25 slot in pt_reggs
Note that typical global asm registers are callee-saved (r25), but gp is
not callee-saved thus needs additional -ffixed-<reg> toggle
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
26 lines
548 B
C
26 lines
548 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
|
|
*
|
|
* Vineetg: May 16th, 2008
|
|
* - Current macro is now implemented as "global register" r25
|
|
*/
|
|
|
|
#ifndef _ASM_ARC_CURRENT_H
|
|
#define _ASM_ARC_CURRENT_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#ifdef CONFIG_ARC_CURR_IN_REG
|
|
|
|
register struct task_struct *curr_arc asm("gp");
|
|
#define current (curr_arc)
|
|
|
|
#else
|
|
#include <asm-generic/current.h>
|
|
#endif /* ! CONFIG_ARC_CURR_IN_REG */
|
|
|
|
#endif /* ! __ASSEMBLY__ */
|
|
|
|
#endif /* _ASM_ARC_CURRENT_H */
|