Skip to contentSkip to conversation

target/riscv: Include missing headers in '*internals.h'

PATCH Applied Philippe Mathieu-Daudé 3 participants 8 messages Dec 3, 2024 – Dec 4, 2024 RISC-V

lore
Share & tools
lore
#0 lore raw

cover target/riscv: Include missing headers in '*internals.h'

2 trivial RISC-V oriented patches extracted from a bigger series which refactor include/exec/ headers.

Philippe Mathieu-Daudé (2):
target/riscv: Include missing headers in 'vector_internals.h' target/riscv: Include missing headers in 'internals.h'

 target/riscv/internals.h        | 3 +++
 target/riscv/vector_internals.h | 1 +
 2 files changed, 4 insertions(+)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 target/riscv: Include missing headers in 'vector_internals.h'

Rather than relying on implicit includes, explicit them, in order to avoid when refactoring unrelated headers:

target/riscv/vector_internals.h:36:12: error: call to undeclared function 'FIELD_EX32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

     36 |     return FIELD_EX32(simd_data(desc), VDATA, NF);
        |            ^
---
 target/riscv/vector_internals.h | 1 +
 1 file changed, 1 insertion(+)
target/riscv/vector_internals.h +1 -0
index 9e1e15b5750..a11cc8366dc 100644
@@ -20,6 +20,7 @@
 #define TARGET_RISCV_VECTOR_INTERNALS_H
 
 #include "qemu/bitops.h"
+#include "hw/registerfields.h"
 #include "cpu.h"
 #include "tcg/tcg-gvec-desc.h"
 #include "internals.h"
Signature · 1 line
2.45.2
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] target/riscv: Include missing headers in 'vector_internals.h'

Quoted 9 lines · Philippe Mathieu-Daudé

Rather than relying on implicit includes, explicit them, in order to avoid when refactoring unrelated headers:

target/riscv/vector_internals.h:36:12: error: call to undeclared function 'FIELD_EX32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

      36 |     return FIELD_EX32(simd_data(desc), VDATA, NF);
         |            ^

---

Quoted 15 lines
  target/riscv/vector_internals.h | 1 +
  1 file changed, 1 insertion(+)
target/riscv/vector_internals.h +1 -0
index 9e1e15b5750..a11cc8366dc 100644
@@ -20,6 +20,7 @@
  #define TARGET_RISCV_VECTOR_INTERNALS_H
 
  #include "qemu/bitops.h"
+#include "hw/registerfields.h"
  #include "cpu.h"
  #include "tcg/tcg-gvec-desc.h"
  #include "internals.h"
Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] target/riscv: Include missing headers in 'vector_internals.h'

In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

Rather than relying on implicit includes, explicit them, in order to avoid when refactoring unrelated headers:

target/riscv/vector_internals.h:36:12: error: call to undeclared function 'FIELD_EX32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

     36 |     return FIELD_EX32(simd_data(desc), VDATA, NF);
        |            ^

Alistair

Quoted 20 lines
---
 target/riscv/vector_internals.h | 1 +
 1 file changed, 1 insertion(+)
target/riscv/vector_internals.h +1 -1
index 9e1e15b5750..a11cc8366dc 100644
@@ -20,6 +20,7 @@
 #define TARGET_RISCV_VECTOR_INTERNALS_H
 
 #include "qemu/bitops.h"
+#include "hw/registerfields.h"
 #include "cpu.h"
 #include "tcg/tcg-gvec-desc.h"
 #include "internals.h"
--

2.45.2

#4 lore raw

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

In reply to Philippe Mathieu-Daudé

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
---
 target/riscv/internals.h | 3 +++
 1 file changed, 3 insertions(+)
target/riscv/internals.h +3 -0
index ddbdee885bc..76934eaa7b5 100644
@@ -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:
Signature · 1 line
2.45.2
Reviewed-by on v1 2/2
#5 lore raw

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

Quoted 14 lines · Philippe Mathieu-Daudé

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
Quoted 2 lines

---

Quoted 18 lines
  target/riscv/internals.h | 3 +++
  1 file changed, 3 insertions(+)
target/riscv/internals.h +3 -0
index ddbdee885bc..76934eaa7b5 100644
@@ -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:
Reviewed-by on v1 2/2
#6 lore raw

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

In reply to Philippe Mathieu-Daudé
Quoted 15 lines · Philippe Mathieu-Daudé

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
Quoted 1 line

Alistair

Quoted 23 lines
---
 target/riscv/internals.h | 3 +++
 1 file changed, 3 insertions(+)
target/riscv/internals.h +3 -1
index ddbdee885bc..76934eaa7b5 100644
@@ -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

#7 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 7 lines · Philippe Mathieu-Daudé

2 trivial RISC-V oriented patches extracted from a bigger series which refactor include/exec/ headers.

Philippe Mathieu-Daudé (2):
target/riscv: Include missing headers in 'vector_internals.h' target/riscv: Include missing headers in 'internals.h'

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 9 lines
 target/riscv/internals.h        | 3 +++
 target/riscv/vector_internals.h | 1 +
 2 files changed, 4 insertions(+)

--
2.45.2