From: Clement Leger <cleger@xxxxxxxxx> Add this macro for upcoming socinfo driver. This extract a sfr field using only its name. Signed-off-by: Clement Leger <cleger@xxxxxxxxx> Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx> --- arch/kvx/include/asm/sfr.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/kvx/include/asm/sfr.h b/arch/kvx/include/asm/sfr.h index 5b93cee345..89ff64bbdc 100644 --- a/arch/kvx/include/asm/sfr.h +++ b/arch/kvx/include/asm/sfr.h @@ -44,4 +44,8 @@ kvx_sfr_set_mask(unsigned char sfr, uint64_t mask, uint64_t value) #define kvx_sfr_set(_sfr, _val) __builtin_kvx_set(KVX_SFR_ ## _sfr, _val) #define kvx_sfr_get(_sfr) __builtin_kvx_get(KVX_SFR_ ## _sfr) +#define kvx_sfr_field_val(_val, _sfr, _field) \ + (((_val) & KVX_SFR_ ## _sfr ## _ ## _field ## _MASK) \ + >> KVX_SFR_ ## _sfr ## _ ## _field ## _SHIFT) + #endif /* _ASM_KVX_SFR_DEFS_H */ -- 2.17.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox