From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 06/27] include/exec/softmmu-semi.h: Add support for 64-bit values
Date: Fri, 4 Sep 2015 16:05:35 +0100 [thread overview]
Message-ID: <1441379156-23939-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1441379156-23939-1-git-send-email-peter.maydell@linaro.org>
Add support for getting and setting 64-bit values in the
softmmu semihosting support functions. This will be needed
for 64-bit ARM semihosting.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Christopher Covington <cov@codeaurora.org>
Message-id: 1439483745-28752-6-git-send-email-peter.maydell@linaro.org
---
include/exec/softmmu-semi.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/exec/softmmu-semi.h b/include/exec/softmmu-semi.h
index 1819cc2..3a58c3f 100644
--- a/include/exec/softmmu-semi.h
+++ b/include/exec/softmmu-semi.h
@@ -9,6 +9,14 @@
#ifndef SOFTMMU_SEMI_H
#define SOFTMMU_SEMI_H 1
+static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
+{
+ uint64_t val;
+
+ cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 8, 0);
+ return tswap64(val);
+}
+
static inline uint32_t softmmu_tget32(CPUArchState *env, target_ulong addr)
{
uint32_t val;
@@ -16,6 +24,7 @@ static inline uint32_t softmmu_tget32(CPUArchState *env, target_ulong addr)
cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 4, 0);
return tswap32(val);
}
+
static inline uint32_t softmmu_tget8(CPUArchState *env, target_ulong addr)
{
uint8_t val;
@@ -24,16 +33,25 @@ static inline uint32_t softmmu_tget8(CPUArchState *env, target_ulong addr)
return val;
}
+#define get_user_u64(arg, p) ({ arg = softmmu_tget64(env, p); 0; })
#define get_user_u32(arg, p) ({ arg = softmmu_tget32(env, p) ; 0; })
#define get_user_u8(arg, p) ({ arg = softmmu_tget8(env, p) ; 0; })
#define get_user_ual(arg, p) get_user_u32(arg, p)
+static inline void softmmu_tput64(CPUArchState *env,
+ target_ulong addr, uint64_t val)
+{
+ val = tswap64(val);
+ cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 8, 1);
+}
+
static inline void softmmu_tput32(CPUArchState *env,
target_ulong addr, uint32_t val)
{
val = tswap32(val);
cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 4, 1);
}
+#define put_user_u64(arg, p) ({ softmmu_tput64(env, p, arg) ; 0; })
#define put_user_u32(arg, p) ({ softmmu_tput32(env, p, arg) ; 0; })
#define put_user_ual(arg, p) put_user_u32(arg, p)
--
1.9.1
next prev parent reply other threads:[~2015-09-04 15:06 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 15:05 [Qemu-devel] [PULL 00/27] target-arm queue Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 01/27] arm: Use g_new() & friends where that makes obvious sense Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 02/27] target-arm/arm-semi.c: Fix broken SYS_WRITE0 via gdb Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 03/27] target-arm: Improve semihosting debug prints Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 04/27] gdbstub: Implement gdb_do_syscallv() Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 05/27] target-arm/arm-semi.c: Factor out repeated 'return env->regs[0]' Peter Maydell
2015-09-04 15:05 ` Peter Maydell [this message]
2015-09-04 15:05 ` [Qemu-devel] [PULL 07/27] target-arm/arm-semi.c: Support widening APIs to 64 bits Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 08/27] target-arm/arm-semi.c: Implement A64 specific SyncCacheRange call Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 09/27] target-arm/arm-semi.c: SYS_EXIT on A64 takes a parameter block Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 10/27] target-arm: Wire up HLT 0xf000 as the A64 semihosting instruction Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 11/27] smbios: add smbios 3.0 support Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 12/27] smbios: implement smbios support for mach-virt Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 13/27] arm: cpu: assert() on no-EL2 virt IRQ error condition Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 14/27] arm: Remove hw_error() usages Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 15/27] target-arm: Fix AArch32:AArch64 general-purpose register mapping Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 16/27] hw/arm/virt: Add high MMIO PCI region, 512G in size Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 17/27] target-arm: Fix arm_excp_unmasked() function Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 18/27] i.MX: Add SOC support for i.MX31 Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 19/27] i.MX: KZM: use standalone i.MX31 SOC support Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 20/27] i.MX: Add I2C controller emulator Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 21/27] i.MX: Add FEC Ethernet Emulator Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 22/27] i.MX: Add SOC support for i.MX25 Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 23/27] i.MX: Add the i.MX25 PDK platform Peter Maydell
2015-09-27 19:48 ` Peter Crosthwaite
2015-09-27 19:52 ` Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 24/27] i.MX: Add qtest support for I2C device emulator Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 25/27] i.MX: Add i2C devices to i.MX31 SOC Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 26/27] target-arm: Refactor CPU affinity handling Peter Maydell
2015-09-04 15:05 ` [Qemu-devel] [PULL 27/27] arm/virt: Add full-sized " Peter Maydell
2015-09-07 9:40 ` [Qemu-devel] [PULL 00/27] target-arm queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441379156-23939-7-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).