summaryrefslogtreecommitdiffstats
path: root/target-arm/cpu.h
diff options
context:
space:
mode:
authorPeter Maydell2016-01-21 15:15:06 +0100
committerPeter Maydell2016-01-21 15:15:06 +0100
commit017518c1f6ed9939c7f390cb91078f0919b5494c (patch)
treef716d617ec351497ebbd53971614033b104aa914 /target-arm/cpu.h
parenttarget-arm: Add QOM property for Secure memory region (diff)
downloadqemu-017518c1f6ed9939c7f390cb91078f0919b5494c.tar.gz
qemu-017518c1f6ed9939c7f390cb91078f0919b5494c.tar.xz
qemu-017518c1f6ed9939c7f390cb91078f0919b5494c.zip
target-arm: Implement asidx_from_attrs
Implement the asidx_from_attrs CPU method to return the Secure or NonSecure address space as appropriate. (The function is inline so we can use it directly in target-arm code to be added in later patches.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'target-arm/cpu.h')
-rw-r--r--target-arm/cpu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 9108b5bd6d..ee873b7079 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -1997,4 +1997,12 @@ enum {
QEMU_PSCI_CONDUIT_HVC = 2,
};
+#ifndef CONFIG_USER_ONLY
+/* Return the address space index to use for a memory access */
+static inline int arm_asidx_from_attrs(CPUState *cs, MemTxAttrs attrs)
+{
+ return attrs.secure ? ARMASIdx_S : ARMASIdx_NS;
+}
+#endif
+
#endif