mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
exec: add wrapper for host pointer access
host pointer accesses force pointer math, let's add a wrapper to make them safer. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
parent
68a5e38a7e
commit
1240be2435
2 changed files with 10 additions and 5 deletions
|
|
@ -313,6 +313,11 @@ typedef struct RAMBlock {
|
|||
int fd;
|
||||
} RAMBlock;
|
||||
|
||||
static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset)
|
||||
{
|
||||
return (char *)block->host + offset;
|
||||
}
|
||||
|
||||
typedef struct RAMList {
|
||||
QemuMutex mutex;
|
||||
/* Protected by the iothread lock. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue