diff mbox series

[2/2] target/riscv: Include missing headers in 'internals.h'

Message ID 20241203200828.47311-3-philmd@linaro.org
State Accepted
Commit fcea54c21261af715a79aece39add80e725cdcc6
Headers show
Series target/riscv: Include missing headers in '*internals.h' | expand

Commit Message

Philippe Mathieu-Daudé Dec. 3, 2024, 8:08 p.m. UTC
Rather than relying on implicit includes, explicit them,
in order to avoid when refactoring unrelated headers:

  target/riscv/internals.h:49:15: error: use of undeclared identifier 'PRV_S'
     49 |         ret = PRV_S;
        |               ^
  target/riscv/internals.h:93:9: error: call to undeclared function 'env_archcpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     93 |     if (env_archcpu(env)->cfg.ext_zfinx) {
        |         ^
  target/riscv/internals.h:101:15: error: unknown type name 'float32'; did you mean 'float'?
    101 | static inline float32 check_nanbox_s(CPURISCVState *env, uint64_t f)
        |               ^~~~~~~
        |               float

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/riscv/internals.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Daniel Henrique Barboza Dec. 3, 2024, 9:07 p.m. UTC | #1
On 12/3/24 5:08 PM, Philippe Mathieu-Daudé wrote:
> Rather than relying on implicit includes, explicit them,
> in order to avoid when refactoring unrelated headers:
> 
>    target/riscv/internals.h:49:15: error: use of undeclared identifier 'PRV_S'
>       49 |         ret = PRV_S;
>          |               ^
>    target/riscv/internals.h:93:9: error: call to undeclared function 'env_archcpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>       93 |     if (env_archcpu(env)->cfg.ext_zfinx) {
>          |         ^
>    target/riscv/internals.h:101:15: error: unknown type name 'float32'; did you mean 'float'?
>      101 | static inline float32 check_nanbox_s(CPURISCVState *env, uint64_t f)
>          |               ^~~~~~~
>          |               float
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   target/riscv/internals.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/target/riscv/internals.h b/target/riscv/internals.h
> index ddbdee885bc..76934eaa7b5 100644
> --- a/target/riscv/internals.h
> +++ b/target/riscv/internals.h
> @@ -19,7 +19,10 @@
>   #ifndef RISCV_CPU_INTERNALS_H
>   #define RISCV_CPU_INTERNALS_H
>   
> +#include "exec/cpu-common.h"
>   #include "hw/registerfields.h"
> +#include "fpu/softfloat-types.h"
> +#include "target/riscv/cpu_bits.h"
>   
>   /*
>    * The current MMU Modes are:
Alistair Francis Dec. 4, 2024, 2:29 a.m. UTC | #2
On Wed, Dec 4, 2024 at 5:09 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Rather than relying on implicit includes, explicit them,
> in order to avoid when refactoring unrelated headers:
>
>   target/riscv/internals.h:49:15: error: use of undeclared identifier 'PRV_S'
>      49 |         ret = PRV_S;
>         |               ^
>   target/riscv/internals.h:93:9: error: call to undeclared function 'env_archcpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      93 |     if (env_archcpu(env)->cfg.ext_zfinx) {
>         |         ^
>   target/riscv/internals.h:101:15: error: unknown type name 'float32'; did you mean 'float'?
>     101 | static inline float32 check_nanbox_s(CPURISCVState *env, uint64_t f)
>         |               ^~~~~~~
>         |               float
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/internals.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/target/riscv/internals.h b/target/riscv/internals.h
> index ddbdee885bc..76934eaa7b5 100644
> --- a/target/riscv/internals.h
> +++ b/target/riscv/internals.h
> @@ -19,7 +19,10 @@
>  #ifndef RISCV_CPU_INTERNALS_H
>  #define RISCV_CPU_INTERNALS_H
>
> +#include "exec/cpu-common.h"
>  #include "hw/registerfields.h"
> +#include "fpu/softfloat-types.h"
> +#include "target/riscv/cpu_bits.h"
>
>  /*
>   * The current MMU Modes are:
> --
> 2.45.2
>
>
diff mbox series

Patch

diff --git a/target/riscv/internals.h b/target/riscv/internals.h
index ddbdee885bc..76934eaa7b5 100644
--- a/target/riscv/internals.h
+++ b/target/riscv/internals.h
@@ -19,7 +19,10 @@ 
 #ifndef RISCV_CPU_INTERNALS_H
 #define RISCV_CPU_INTERNALS_H
 
+#include "exec/cpu-common.h"
 #include "hw/registerfields.h"
+#include "fpu/softfloat-types.h"
+#include "target/riscv/cpu_bits.h"
 
 /*
  * The current MMU Modes are: