mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
memattrs: Check the size of MemTxAttrs
Make sure MemTxAttrs is packed into 8 bytes and does not exceed 8 bytes. Suggested-by: Philippe Mathieu-Daudà <philmd@linaro.org> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250121151322.171832-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5014e33b1e
commit
57f9d9c84a
1 changed files with 2 additions and 0 deletions
|
@ -64,6 +64,8 @@ typedef struct MemTxAttrs {
|
|||
uint16_t _reserved2;
|
||||
} MemTxAttrs;
|
||||
|
||||
QEMU_BUILD_BUG_ON(sizeof(MemTxAttrs) > 8);
|
||||
|
||||
/* Bus masters which don't specify any attributes will get this,
|
||||
* which has all attribute bits clear except the topmost one
|
||||
* (so that we can distinguish "all attributes deliberately clear"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue