diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-01-21 14:15:06 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-01-21 14:15:06 +0000 |
commit | 017518c1f6ed9939c7f390cb91078f0919b5494c (patch) | |
tree | f716d617ec351497ebbd53971614033b104aa914 /target-arm/cpu.h | |
parent | 9e273ef2174d7cd5b14a16d8638812541d3eb6bb (diff) | |
download | qemu-017518c1f6ed9939c7f390cb91078f0919b5494c.zip qemu-017518c1f6ed9939c7f390cb91078f0919b5494c.tar.gz qemu-017518c1f6ed9939c7f390cb91078f0919b5494c.tar.bz2 |
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 9108b5b..ee873b7 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 |