mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-15 14:13:31 -06:00
xen: Add xen_mr_is_memory()
Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240529140739.1387692-4-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
638181a180
commit
1be974bc26
2 changed files with 9 additions and 2 deletions
|
@ -12,6 +12,12 @@
|
||||||
|
|
||||||
MemoryRegion xen_memory;
|
MemoryRegion xen_memory;
|
||||||
|
|
||||||
|
/* Check for xen memory. */
|
||||||
|
bool xen_mr_is_memory(MemoryRegion *mr)
|
||||||
|
{
|
||||||
|
return mr == &xen_memory;
|
||||||
|
}
|
||||||
|
|
||||||
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
|
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +34,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mr == &xen_memory) {
|
if (xen_mr_is_memory(mr)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +61,7 @@ static void xen_set_memory(struct MemoryListener *listener,
|
||||||
{
|
{
|
||||||
XenIOState *state = container_of(listener, XenIOState, memory_listener);
|
XenIOState *state = container_of(listener, XenIOState, memory_listener);
|
||||||
|
|
||||||
if (section->mr == &xen_memory) {
|
if (xen_mr_is_memory(section->mr)) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (add) {
|
if (add) {
|
||||||
|
|
|
@ -49,4 +49,5 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
|
||||||
|
|
||||||
#endif /* CONFIG_XEN_IS_POSSIBLE */
|
#endif /* CONFIG_XEN_IS_POSSIBLE */
|
||||||
|
|
||||||
|
bool xen_mr_is_memory(MemoryRegion *mr);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue