diff mbox

[1/5] target-arm/translate.c: Use arm_dc_feature() in ENABLE_ARCH_ macros

Message ID 1414524244-20316-2-git-send-email-peter.maydell@linaro.org
State Accepted
Headers show

Commit Message

Peter Maydell Oct. 28, 2014, 7:24 p.m. UTC
All the places where we use the ENABLE_ARCH_* and ARCH() macros have a
DisasContext* s, so switch them over to use arm_dc_feature() rather than
arm_feature() so we don't need to pass the CPUARMState* env around too.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Alex Bennée Oct. 31, 2014, 1:09 p.m. UTC | #1
Peter Maydell <peter.maydell@linaro.org> writes:

> All the places where we use the ENABLE_ARCH_* and ARCH() macros have a
> DisasContext* s, so switch them over to use arm_dc_feature() rather than
> arm_feature() so we don't need to pass the CPUARMState* env around too.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---
>  target-arm/translate.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 1d52e47..f69e5ef 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -38,16 +38,16 @@
>  #include "trace-tcg.h"
>  
>  
> -#define ENABLE_ARCH_4T    arm_feature(env, ARM_FEATURE_V4T)
> -#define ENABLE_ARCH_5     arm_feature(env, ARM_FEATURE_V5)
> +#define ENABLE_ARCH_4T    arm_dc_feature(s, ARM_FEATURE_V4T)
> +#define ENABLE_ARCH_5     arm_dc_feature(s, ARM_FEATURE_V5)
>  /* currently all emulated v5 cores are also v5TE, so don't bother */
> -#define ENABLE_ARCH_5TE   arm_feature(env, ARM_FEATURE_V5)
> +#define ENABLE_ARCH_5TE   arm_dc_feature(s, ARM_FEATURE_V5)
>  #define ENABLE_ARCH_5J    0
> -#define ENABLE_ARCH_6     arm_feature(env, ARM_FEATURE_V6)
> -#define ENABLE_ARCH_6K   arm_feature(env, ARM_FEATURE_V6K)
> -#define ENABLE_ARCH_6T2   arm_feature(env, ARM_FEATURE_THUMB2)
> -#define ENABLE_ARCH_7     arm_feature(env, ARM_FEATURE_V7)
> -#define ENABLE_ARCH_8     arm_feature(env, ARM_FEATURE_V8)
> +#define ENABLE_ARCH_6     arm_dc_feature(s, ARM_FEATURE_V6)
> +#define ENABLE_ARCH_6K   arm_dc_feature(s, ARM_FEATURE_V6K)
> +#define ENABLE_ARCH_6T2   arm_dc_feature(s, ARM_FEATURE_THUMB2)
> +#define ENABLE_ARCH_7     arm_dc_feature(s, ARM_FEATURE_V7)
> +#define ENABLE_ARCH_8     arm_dc_feature(s, ARM_FEATURE_V8)
>  
>  #define ARCH(x) do { if (!ENABLE_ARCH_##x) goto illegal_op; } while(0)
Claudio Fontana Nov. 4, 2014, 9:04 a.m. UTC | #2
On 28.10.2014 20:24, Peter Maydell wrote:
> All the places where we use the ENABLE_ARCH_* and ARCH() macros have a
> DisasContext* s, so switch them over to use arm_dc_feature() rather than
> arm_feature() so we don't need to pass the CPUARMState* env around too.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target-arm/translate.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 1d52e47..f69e5ef 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -38,16 +38,16 @@
>  #include "trace-tcg.h"
>  
>  
> -#define ENABLE_ARCH_4T    arm_feature(env, ARM_FEATURE_V4T)
> -#define ENABLE_ARCH_5     arm_feature(env, ARM_FEATURE_V5)
> +#define ENABLE_ARCH_4T    arm_dc_feature(s, ARM_FEATURE_V4T)
> +#define ENABLE_ARCH_5     arm_dc_feature(s, ARM_FEATURE_V5)
>  /* currently all emulated v5 cores are also v5TE, so don't bother */
> -#define ENABLE_ARCH_5TE   arm_feature(env, ARM_FEATURE_V5)
> +#define ENABLE_ARCH_5TE   arm_dc_feature(s, ARM_FEATURE_V5)
>  #define ENABLE_ARCH_5J    0
> -#define ENABLE_ARCH_6     arm_feature(env, ARM_FEATURE_V6)
> -#define ENABLE_ARCH_6K   arm_feature(env, ARM_FEATURE_V6K)
> -#define ENABLE_ARCH_6T2   arm_feature(env, ARM_FEATURE_THUMB2)
> -#define ENABLE_ARCH_7     arm_feature(env, ARM_FEATURE_V7)
> -#define ENABLE_ARCH_8     arm_feature(env, ARM_FEATURE_V8)
> +#define ENABLE_ARCH_6     arm_dc_feature(s, ARM_FEATURE_V6)
> +#define ENABLE_ARCH_6K   arm_dc_feature(s, ARM_FEATURE_V6K)
> +#define ENABLE_ARCH_6T2   arm_dc_feature(s, ARM_FEATURE_THUMB2)
> +#define ENABLE_ARCH_7     arm_dc_feature(s, ARM_FEATURE_V7)
> +#define ENABLE_ARCH_8     arm_dc_feature(s, ARM_FEATURE_V8)
>  
>  #define ARCH(x) do { if (!ENABLE_ARCH_##x) goto illegal_op; } while(0)
>  
> 

nit: the line for ENABLE_ARCH_6K seems to be differently aligned than the rest.

Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
Peter Maydell Nov. 4, 2014, 12:04 p.m. UTC | #3
On 4 November 2014 09:04, Claudio Fontana <claudio.fontana@huawei.com> wrote:
> On 28.10.2014 20:24, Peter Maydell wrote:
> nit: the line for ENABLE_ARCH_6K seems to be differently aligned than the rest.
>
> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>

Thanks; I fixed the missing space.

-- PMM
diff mbox

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 1d52e47..f69e5ef 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -38,16 +38,16 @@ 
 #include "trace-tcg.h"
 
 
-#define ENABLE_ARCH_4T    arm_feature(env, ARM_FEATURE_V4T)
-#define ENABLE_ARCH_5     arm_feature(env, ARM_FEATURE_V5)
+#define ENABLE_ARCH_4T    arm_dc_feature(s, ARM_FEATURE_V4T)
+#define ENABLE_ARCH_5     arm_dc_feature(s, ARM_FEATURE_V5)
 /* currently all emulated v5 cores are also v5TE, so don't bother */
-#define ENABLE_ARCH_5TE   arm_feature(env, ARM_FEATURE_V5)
+#define ENABLE_ARCH_5TE   arm_dc_feature(s, ARM_FEATURE_V5)
 #define ENABLE_ARCH_5J    0
-#define ENABLE_ARCH_6     arm_feature(env, ARM_FEATURE_V6)
-#define ENABLE_ARCH_6K   arm_feature(env, ARM_FEATURE_V6K)
-#define ENABLE_ARCH_6T2   arm_feature(env, ARM_FEATURE_THUMB2)
-#define ENABLE_ARCH_7     arm_feature(env, ARM_FEATURE_V7)
-#define ENABLE_ARCH_8     arm_feature(env, ARM_FEATURE_V8)
+#define ENABLE_ARCH_6     arm_dc_feature(s, ARM_FEATURE_V6)
+#define ENABLE_ARCH_6K   arm_dc_feature(s, ARM_FEATURE_V6K)
+#define ENABLE_ARCH_6T2   arm_dc_feature(s, ARM_FEATURE_THUMB2)
+#define ENABLE_ARCH_7     arm_dc_feature(s, ARM_FEATURE_V7)
+#define ENABLE_ARCH_8     arm_dc_feature(s, ARM_FEATURE_V8)
 
 #define ARCH(x) do { if (!ENABLE_ARCH_##x) goto illegal_op; } while(0)