diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-09-26 16:14:03 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-09-26 16:14:03 +0100 |
commit | 1329132d28bf14b9508f7a1f04a2c63422bc3f99 (patch) | |
tree | ff1527f32f493e9889ba4dfae5d06fe62380b136 /include | |
parent | eb13d1cf4a0478fc29f80abfbac8209479325f35 (diff) | |
parent | 3fc4a64cbaed2ddee4c60ddc06740b320e18ab82 (diff) |
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
vhost: fixes
Misc fixes related to memory region handling.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Wed 25 Sep 2019 15:28:23 BST
# gpg: using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67
# Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469
* remotes/mst/tags/for_upstream:
vhost: Fix memory region section comparison
memory: Provide an equality function for MemoryRegionSections
memory: Align MemoryRegionSections fields
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/memory.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index a30245c25a..6e67043ee0 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -495,15 +495,27 @@ static inline FlatView *address_space_to_flatview(AddressSpace *as) * @nonvolatile: this section is non-volatile */ struct MemoryRegionSection { + Int128 size; MemoryRegion *mr; FlatView *fv; hwaddr offset_within_region; - Int128 size; hwaddr offset_within_address_space; bool readonly; bool nonvolatile; }; +static inline bool MemoryRegionSection_eq(MemoryRegionSection *a, + MemoryRegionSection *b) +{ + return a->mr == b->mr && + a->fv == b->fv && + a->offset_within_region == b->offset_within_region && + a->offset_within_address_space == b->offset_within_address_space && + int128_eq(a->size, b->size) && + a->readonly == b->readonly && + a->nonvolatile == b->nonvolatile; +} + /** * memory_region_init: Initialize a memory region * |