diff mbox series

[Xen-devel,01/15] xen/arm: cpregs: Allow HSR_CPREG* to receive more than 1 parameter

Message ID 20180716172712.20294-2-julien.grall@arm.com
State New
Headers show
Series xen/arm: Bunch of clean-up/improvement | expand

Commit Message

Julien Grall July 16, 2018, 5:26 p.m. UTC
At the moment, HSR_CPREG is expected to receive only the co-processor
register name in parameter. Because the name is actually a define, this
may have been expanded by a previous macro.

Rather than imposing the use of _HSR_CPREG* in such cases, allow
HSR_CPREG to receive more than 1 parameter.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/include/asm-arm/cpregs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Stabellini Aug. 14, 2018, 9:47 p.m. UTC | #1
On Mon, 16 Jul 2018, Julien Grall wrote:
> At the moment, HSR_CPREG is expected to receive only the co-processor
> register name in parameter. Because the name is actually a define, this
> may have been expanded by a previous macro.
> 
> Rather than imposing the use of _HSR_CPREG* in such cases, allow
> HSR_CPREG to receive more than 1 parameter.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  xen/include/asm-arm/cpregs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
> index 8db65d5e2a..4c74e8161b 100644
> --- a/xen/include/asm-arm/cpregs.h
> +++ b/xen/include/asm-arm/cpregs.h
> @@ -47,8 +47,8 @@
>      ((__HSR_CPREG_##op1) << HSR_CP64_OP1_SHIFT)
>  
>  /* Encode a register as per HSR ISS pattern */
> -#define HSR_CPREG32(X) _HSR_CPREG32(X)
> -#define HSR_CPREG64(X) _HSR_CPREG64(X)
> +#define HSR_CPREG32(X...) _HSR_CPREG32(X)
> +#define HSR_CPREG64(X...) _HSR_CPREG64(X)
>  
>  /*
>   * Order registers by Coprocessor-> CRn-> Opcode 1-> CRm-> Opcode 2
> -- 
> 2.11.0
>
diff mbox series

Patch

diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index 8db65d5e2a..4c74e8161b 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -47,8 +47,8 @@ 
     ((__HSR_CPREG_##op1) << HSR_CP64_OP1_SHIFT)
 
 /* Encode a register as per HSR ISS pattern */
-#define HSR_CPREG32(X) _HSR_CPREG32(X)
-#define HSR_CPREG64(X) _HSR_CPREG64(X)
+#define HSR_CPREG32(X...) _HSR_CPREG32(X)
+#define HSR_CPREG64(X...) _HSR_CPREG64(X)
 
 /*
  * Order registers by Coprocessor-> CRn-> Opcode 1-> CRm-> Opcode 2