Skip to contentSkip to conversation

target/arm/common-semi-target.h: Remove unnecessary boot.h include

PATCH In review Peter Maydell 2 participants 2 messages Sep 25, 2023 – Sep 28, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm/common-semi-target.h: Remove unnecessary boot.h include

The hw/arm/boot.h include in common-semi-target.h is not actually needed, and it's a bit odd because it pulls a hw/arm header into a target/arm file.

This include was originally needed because the semihosting code used the arm_boot_info struct to get the base address of the RAM in system emulation, to use in a (bad) heuristic for the return values for the SYS_HEAPINFO semihosting call. We've since overhauled how we calculate the HEAPINFO values in system emulation, and the code no longer uses the arm_boot_info struct.

Remove the now-redundant include line, and instead directly include the cpu-qom.h header that we were previously getting via boot.h.

---
 target/arm/common-semi-target.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
target/arm/common-semi-target.h +1 -3
index 629d75ca5a7..fa00c7fabb6 100644
@@ -10,9 +10,7 @@
 #ifndef TARGET_ARM_COMMON_SEMI_TARGET_H
 #define TARGET_ARM_COMMON_SEMI_TARGET_H
 
-#ifndef CONFIG_USER_ONLY
-#include "hw/arm/boot.h"
-#endif
+#include "target/arm/cpu-qom.h"
 
 static inline target_ulong common_semi_arg(CPUState *cs, int argno)
 {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Peter Maydell

The hw/arm/boot.h include in common-semi-target.h is not actually needed, and it's a bit odd because it pulls a hw/arm header into a target/arm file.

This include was originally needed because the semihosting code used the arm_boot_info struct to get the base address of the RAM in system emulation, to use in a (bad) heuristic for the return values for the SYS_HEAPINFO semihosting call. We've since overhauled how we calculate the HEAPINFO values in system emulation, and the code no longer uses the arm_boot_info struct.

Quoted 7 lines

Remove the now-redundant include line, and instead directly include the cpu-qom.h header that we were previously getting via boot.h.

---
  target/arm/common-semi-target.h | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

r~