]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory: Define API for MemoryRegionOps to take attrs and return status
authorPeter Maydell <peter.maydell@linaro.org>
Sun, 26 Apr 2015 15:49:23 +0000 (16:49 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Sun, 26 Apr 2015 15:49:23 +0000 (16:49 +0100)
commitcc05c43ad942165ecc6ffd39e41991bee43af044
tree9177b464e37e5fac8cbc9db9534515fac82c996e
parente1a5476354d396773e4c555f126d752d4ae58fa9
memory: Define API for MemoryRegionOps to take attrs and return status

Define an API so that devices can register MemoryRegionOps whose read
and write callback functions are passed an arbitrary pointer to some
transaction attributes and can return a success-or-failure status code.
This will allow us to model devices which:
 * behave differently for ARM Secure/NonSecure memory accesses
 * behave differently for privileged/unprivileged accesses
 * may return a transaction failure (causing a guest exception)
   for erroneous accesses

This patch defines the new API and plumbs the attributes parameter through
to the memory.c public level functions io_mem_read() and io_mem_write(),
where it is currently dummied out.

The success/failure response indication is also propagated out to
io_mem_read() and io_mem_write(), which retain the old-style
boolean true-for-error return.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
include/exec/memattrs.h [new file with mode: 0644]
include/exec/memory.h
memory.c