[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCHv6 11/37] plat/common: Introduce SYSREG_READ32/64 SYSTEM_WRITE32/64 for different size
On 09/17/2018 08:18 AM, Wei Chen (Arm Technology China) wrote: Hi Julien, Hi, My point here is you add & which does not make sense in the current context. Can you explain why you always put it in such case?-----Original Message----- From: Julien Grall <julien.grall@xxxxxxx> Sent: 2018年9月17日 8:44 To: Wei Chen (Arm Technology China) <Wei.Chen@xxxxxxx>; minios- devel@xxxxxxxxxxxxxxxxxxxx; simon.kuenzer@xxxxxxxxx Cc: Kaly Xin (Arm Technology China) <Kaly.Xin@xxxxxxx>; nd <nd@xxxxxxx> Subject: Re: [Minios-devel] [UNIKRAFT PATCHv6 11/37] plat/common: Introduce SYSREG_READ32/64 SYSTEM_WRITE32/64 for different size Hi, On 09/14/2018 08:56 AM, Wei Chen wrote:On Arm, the system registers may have different size. Introduce these four helpers will give us a direct visual about the register's size we are accessing. Signed-off-by: Wei Chen <wei.chen@xxxxxxx> --- plat/common/include/arm/arm64/cpu.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plat/common/include/arm/arm64/cpu.hb/plat/common/include/arm/arm64/cpu.hindex 702761c..db8be9c 100644 --- a/plat/common/include/arm/arm64/cpu.h +++ b/plat/common/include/arm/arm64/cpu.h @@ -90,3 +90,17 @@ static inline void ioreg_write64(volatile uint64_t *addr,uint64_t value)#define SYSREG_WRITE(reg, val) \ __asm__ __volatile__("msr " __STRINGIFY(reg) ", %0" \ : : "r" ((uint64_t)(val))) + +#define SYSREG_READ32(reg) \ +({ uint32_t val; \ + __asm__ __volatile__("mrs %0, " __STRINGIFY(reg) \ + : "=&r" (val)); \I am not entirely sure why you need the earlycloberr (&) here. The operand will not be written before the instruction has finished.Is there any harm that I am using the "&", because I always use it in such case? Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |