diff options
| author | Michael S. Tsirkin | 2014-11-12 10:44:41 +0100 |
|---|---|---|
| committer | Amit Shah | 2014-12-16 13:17:35 +0100 |
| commit | 1240be24357ee292f8d05aa2abfdba75dd0ca25d (patch) | |
| tree | 377ce51d512e0916fc18b25b2fce85ce352e9ab4 /include | |
| parent | MAINTAINERS: add include files to virtio-serial entry (diff) | |
| download | qemu-1240be24357ee292f8d05aa2abfdba75dd0ca25d.tar.gz qemu-1240be24357ee292f8d05aa2abfdba75dd0ca25d.tar.xz qemu-1240be24357ee292f8d05aa2abfdba75dd0ca25d.zip | |
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/exec/cpu-all.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c085804aed..9d8d408ea6 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -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. */ |
