[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/18] cpu_ldst.h, cpu-all.h, bswap.h: Update documen
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 17/18] cpu_ldst.h, cpu-all.h, bswap.h: Update documentation on ld/st accessors |
Date: |
Tue, 20 Jan 2015 15:45:46 +0000 |
Add documentation of what the cpu_*_* accessors look like.
Correct some minor errors in the existing documentation of the
direct _p accessor family. Remove the near-duplicate comment
on the _p accessors from cpu-all.h and replace it with a reference
to the comment in bswap.h.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-id: address@hidden
---
include/exec/cpu-all.h | 38 ++------------------------------------
include/exec/cpu_ldst.h | 21 ++++++++++++++++++++-
include/qemu/bswap.h | 11 ++++++++++-
3 files changed, 32 insertions(+), 38 deletions(-)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 5fdd2fe..2c48286 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -115,43 +115,9 @@ static inline void tswap64s(uint64_t *s)
#define bswaptls(s) bswap64s(s)
#endif
-/* CPU memory access without any memory or io remapping */
-
-/*
- * the generic syntax for the memory accesses is:
- *
- * load: ld{type}{sign}{size}{endian}_{access_type}(ptr)
- *
- * store: st{type}{size}{endian}_{access_type}(ptr, val)
- *
- * type is:
- * (empty): integer access
- * f : float access
- *
- * sign is:
- * (empty): for floats or 32 bit size
- * u : unsigned
- * s : signed
- *
- * size is:
- * b: 8 bits
- * w: 16 bits
- * l: 32 bits
- * q: 64 bits
- *
- * endian is:
- * (empty): target cpu endianness or 8 bit access
- * r : reversed target cpu endianness (not implemented yet)
- * be : big endian (not implemented yet)
- * le : little endian (not implemented yet)
- *
- * access_type is:
- * raw : host memory access
- * user : user mode access using soft MMU
- * kernel : kernel mode access using soft MMU
+/* Target-endianness CPU memory access functions. These fit into the
+ * {ld,st}{type}{sign}{size}{endian}_p naming scheme described in bswap.h.
*/
-
-/* target-endianness CPU memory access functions */
#if defined(TARGET_WORDS_BIGENDIAN)
#define lduw_p(p) lduw_be_p(p)
#define ldsw_p(p) ldsw_be_p(p)
diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
index 16f4e30..d98ff17 100644
--- a/include/exec/cpu_ldst.h
+++ b/include/exec/cpu_ldst.h
@@ -23,7 +23,26 @@
*
* Used by target op helpers.
*
- * MMU mode suffixes are defined in target cpu.h.
+ * The syntax for the accessors is:
+ *
+ * load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr)
+ *
+ * store: cpu_st{sign}{size}_{mmusuffix}(env, ptr, val)
+ *
+ * sign is:
+ * (empty): for 32 and 64 bit sizes
+ * u : unsigned
+ * s : signed
+ *
+ * size is:
+ * b: 8 bits
+ * w: 16 bits
+ * l: 32 bits
+ * q: 64 bits
+ *
+ * mmusuffix is one of the generic suffixes "data" or "code", or
+ * (for softmmu configs) a target-specific MMU mode suffix as defined
+ * in target cpu.h.
*/
#ifndef CPU_LDST_H
#define CPU_LDST_H
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 78c1ced..07d88de 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -204,7 +204,7 @@ typedef union {
* f : float access
*
* sign is:
- * (empty): for floats or 32 bit size
+ * (empty): for 32 or 64 bit sizes (including floats and doubles)
* u : unsigned
* s : signed
*
@@ -218,7 +218,16 @@ typedef union {
* he : host endian
* be : big endian
* le : little endian
+ * te : target endian
* (except for byte accesses, which have no endian infix).
+ *
+ * The target endian accessors are obviously only available to source
+ * files which are built per-target; they are defined in cpu-all.h.
+ *
+ * In all cases these functions take a host pointer.
+ * For accessors that take a guest address rather than a
+ * host address, see the cpu_{ld,st}_* accessors defined in
+ * cpu_ldst.h.
*/
static inline int ldub_p(const void *ptr)
--
1.9.1
- [Qemu-devel] [PULL 01/18] scripts/qapi-types.py: Add dummy member to empty structs, (continued)
- [Qemu-devel] [PULL 01/18] scripts/qapi-types.py: Add dummy member to empty structs, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 18/18] cpu_ldst.h: Don't define helpers if MMU_MODE*_SUFFIX not defined, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 16/18] cpu_ldst_template.h: Drop unused cpu_ldfq/stfq/ldfl/stfl accessors, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 15/18] cpu_ldst.h: Drop unused _raw macros, saddr() and laddr(), Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 14/18] cpu_ldst_template.h: Use ld*_p directly rather than via ld*_raw macros, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 10/18] target-mips: Don't use _raw load/store accessors, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 09/18] linux-user/main.c (m68k): Use get_user_u16 rather than lduw in cpu_loop, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 13/18] cpu_ldst.h: Use inline functions for usermode cpu_ld/st accessors, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 06/18] linux-user/elfload.c: Don't use _raw accessor functions, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 08/18] linux-user/vm86.c: Use cpu_ldl_data &c rather than plain ldl &c, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 17/18] cpu_ldst.h, cpu-all.h, bswap.h: Update documentation on ld/st accessors,
Peter Maydell <=
- [Qemu-devel] [PULL 05/18] target-sparc: Don't use {ld, st}*_raw functions, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 04/18] monitor.c: Use ld*_p() instead of ld*_raw(), Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 03/18] cpu_ldst.h: Remove unused ldul_ macros, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 12/18] cpu_ldst.h: Remove unused very short ld*/st* defines, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 07/18] bsd-user/elfload.c: Don't use ldl() or ldq_raw(), Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 02/18] exec.c: Drop TARGET_HAS_ICE define and checks, Peter Maydell, 2015/01/20
- [Qemu-devel] [PULL 11/18] cpu_ldst.h: Drop unused ld/st*_kernel defines, Peter Maydell, 2015/01/20
- Re: [Qemu-devel] [PULL 00/18] misc cross-tree patches queue, Peter Maydell, 2015/01/20