exec: Header cleanups around memory.h/address-spaces.h
cover exec: Header cleanups around memory.h/address-spaces.h
Trivial header cleanups extracted from bigger series. Sending separately since somehow unrelated to its goal.
Philippe Mathieu-Daudé (4):
hw/net/i82596: Include missing 'exec/address-spaces.h' header hw/dma/etraxfs: Include missing 'exec/memory.h' header exec/address-spaces.h: Remove unuseful 'exec/memory.h' include sysemu/kvm: Re-include "exec/memattrs.h" header
include/exec/address-spaces.h | 2 -- include/sysemu/kvm.h | 1 + hw/dma/etraxfs_dma.c | 1 + hw/net/i82596.c | 1 + 4 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/4 hw/net/i82596: Include missing 'exec/address-spaces.h' header
hw/net/i82596.c access the global 'address_space_memory' calling the ld/st_phys() API. address_space_memory is declared in "exec/address-spaces.h". Currently this header is indirectly pulled in via another header. Explicitly include it to avoid when refactoring unrelated headers:
hw/net/i82596.c:91:23: error: use of undeclared identifier 'address_space_memory'; did you mean 'address_space_destroy'?
return ldub_phys(&address_space_memory, addr);
^~~~~~~~~~~~~~~~~~~~
address_space_destroy--- hw/net/i82596.c | 1 + 1 file changed, 1 insertion(+)
hw/net/i82596.c +1 -0
@@ -15,6 +15,7 @@#include "hw/irq.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "exec/address-spaces.h" #include "qemu/module.h" #include "trace.h" #include "i82596.h"
Signature · 1 line
2.38.1
Re: [PATCH 1/4] hw/net/i82596: Include missing 'exec/address-spaces.h' header
Quoted 11 lines · Philippe Mathieu-Daudé
hw/net/i82596.caccess the global 'address_space_memory' calling the ld/st_phys() API.address_space_memoryis declared in "exec/address-spaces.h". Currently this header is indirectly pulled in via another header. Explicitly include it to avoid when refactoring unrelated headers:hw/net/i82596.c:91:23: error: use of undeclared identifier 'address_space_memory'; did you mean 'address_space_destroy'? return ldub_phys(&address_space_memory, addr); ^~~~~~~~~~~~~~~~~~~~ address_space_destroy
Quoted 4 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- hw/net/i82596.c | 1 + 1 file changed, 1 insertion(+)
r~
PATCH 2/4 hw/dma/etraxfs: Include missing 'exec/memory.h' header
In reply to Philippe Mathieu-DaudéThe 'fs_dma_ctrl' structure has a MemoryRegion 'mmio' field which is initialized in etraxfs_dmac_init() calling memory_region_init_io() and memory_region_add_subregion().
These functions are declared in "exec/memory.h", along with the MemoryRegion structure. Include the missing header.
--- hw/dma/etraxfs_dma.c | 1 + 1 file changed, 1 insertion(+)
hw/dma/etraxfs_dma.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/main-loop.h" #include "sysemu/runstate.h" #include "exec/address-spaces.h" +#include "exec/memory.h" #include "hw/cris/etraxfs_dma.h"
Signature · 1 line
2.38.1
Re: [PATCH 2/4] hw/dma/etraxfs: Include missing 'exec/memory.h' header
Quoted 11 lines · Philippe Mathieu-Daudé
The '
fs_dma_ctrl' structure has a MemoryRegion 'mmio' field which is initialized inetraxfs_dmac_init()callingmemory_region_init_io()andmemory_region_add_subregion().These functions are declared in "
exec/memory.h", along with the MemoryRegion structure. Include the missing header.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- hw/dma/etraxfs_dma.c | 1 + 1 file changed, 1 insertion(+)
r~
PATCH 3/4 exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
In reply to Philippe Mathieu-Daudé"exec/address-spaces.h" declares get_system_io() and get_system_memory(), both returning a MemoryRegion pointer. MemoryRegion is forward declared in "qemu/typedefs.h", so we don't need any declaration from "exec/memory.h" here. Remove it.
--- include/exec/address-spaces.h | 2 -- 1 file changed, 2 deletions(-)
include/exec/address-spaces.h +0 -2
@@ -19,8 +19,6 @@* you're one of them. */ -#include "exec/memory.h" -#ifndef CONFIG_USER_ONLY /* Get the root memory region. This interface should only be used temporarily
Signature · 1 line
2.38.1
Re: [PATCH 3/4] exec/address-spaces.h: Remove unuseful 'exec/memory.h' include
Quoted 10 lines · Philippe Mathieu-Daudé
"
exec/address-spaces.h" declaresget_system_io()andget_system_memory(), both returning a MemoryRegion pointer. MemoryRegion is forward declared in "qemu/typedefs.h", so we don't need any declaration from "exec/memory.h" here. Remove it.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- include/exec/address-spaces.h | 2 -- 1 file changed, 2 deletions(-)
r~
PATCH 4/4 sysemu/kvm: Re-include "exec/memattrs.h" header
In reply to Philippe Mathieu-DaudéCommit 1e05888ab5 ("sysemu/kvm: Remove unused headers") was a bit overzealous while cleaning "sysemu/kvm.h" headers:kvm_arch_post_run() returns a MemTxAttrs type, so depends on "exec/memattrs.h" for its definition.
--- include/sysemu/kvm.h | 1 + 1 file changed, 1 insertion(+)
include/sysemu/kvm.h +1 -0
@@ -14,6 +14,7 @@#ifndef QEMU_KVM_H #define QEMU_KVM_H +#include "exec/memattrs.h" #include "qemu/accel.h" #include "qom/object.h"
Signature · 1 line
2.38.1
Re: [PATCH 4/4] sysemu/kvm: Re-include "exec/memattrs.h" header
Quoted 10 lines · Philippe Mathieu-Daudé
Commit
1e05888ab5("sysemu/kvm: Remove unused headers") was a bit overzealous while cleaning "sysemu/kvm.h" headers:kvm_arch_post_run()returns a MemTxAttrs type, so depends on "exec/memattrs.h" for its definition.Fixes 1e05888ab5 ("sysemu/kvm: Remove unused headers")Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- include/sysemu/kvm.h | 1 + 1 file changed, 1 insertion(+)
r~