diff options
author | Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | 2017-11-28 16:48:40 +0300 |
---|---|---|
committer | Alexey Brodkin <abrodkin@synopsys.com> | 2017-12-11 11:36:22 +0300 |
commit | e59c3797204b4cd565c0792620341e3d39f9240b (patch) | |
tree | 638668beac9953ea443ae983b90ec5146f0c5193 | |
parent | 4e782b594089cc3946314325faebad8c318565f4 (diff) |
ARC: add macro to get CPU id
ARCNUM [15:8] field in ARC_AUX_IDENTITY register allows us to
uniquely identify each core in a multi-core system.
I.e. with help of this macro each core may get its index in SMP system.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
-rw-r--r-- | arch/arc/include/asm/arcregs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h index 54a9b00d4c..2a1bfc74ec 100644 --- a/arch/arc/include/asm/arcregs.h +++ b/arch/arc/include/asm/arcregs.h @@ -72,6 +72,9 @@ /* gcc builtin sr needs reg param to be long immediate */ #define write_aux_reg(reg_immed, val) \ __builtin_arc_sr((unsigned int)val, reg_immed) + +/* ARCNUM [15:8] - field to identify each core in a multi-core system */ +#define CPU_ID_GET() ((read_aux_reg(ARC_AUX_IDENTITY) & 0xFF00) >> 8) #endif /* __ASSEMBLY__ */ #endif /* _ASM_ARC_ARCREGS_H */ |