aboutsummaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/cpu-common.h1
-rw-r--r--include/exec/gdbstub.h14
-rw-r--r--include/exec/memattrs.h3
-rw-r--r--include/exec/memop.h4
-rw-r--r--include/exec/tswap.h83
5 files changed, 21 insertions, 84 deletions
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index a684855..9b658a3 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -85,6 +85,7 @@ void qemu_ram_unset_idstr(RAMBlock *block);
const char *qemu_ram_get_idstr(RAMBlock *rb);
void *qemu_ram_get_host_addr(RAMBlock *rb);
ram_addr_t qemu_ram_get_offset(RAMBlock *rb);
+ram_addr_t qemu_ram_get_fd_offset(RAMBlock *rb);
ram_addr_t qemu_ram_get_used_length(RAMBlock *rb);
ram_addr_t qemu_ram_get_max_length(RAMBlock *rb);
bool qemu_ram_is_shared(RAMBlock *rb);
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 0675b0b..a16c005 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -125,6 +125,20 @@ const GDBFeature *gdb_find_static_feature(const char *xmlname);
int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
/**
+ * gdb_write_register() - Write a register associated with a CPU.
+ * @cpu: The CPU associated with the register.
+ * @buf: The buffer that the register contents will be set to.
+ * @reg: The register's number returned by gdb_find_feature_register().
+ *
+ * The size of @buf must be at least the size of the register being
+ * written.
+ *
+ * Return: The number of written bytes, or 0 if an error occurred (for
+ * example, an unknown register was provided).
+ */
+int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg);
+
+/**
* typedef GDBRegDesc - a register description from gdbstub
*/
typedef struct {
diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index 8db1d30..52ee955 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -54,6 +54,9 @@ typedef struct MemTxAttrs {
*/
unsigned int pid:8;
+ /* PCI - IOMMU operations, see PCIAddressType */
+ unsigned int address_type:1;
+
/*
* Bus masters which don't specify any attributes will get this
* (via the MEMTXATTRS_UNSPECIFIED constant), so that we can
diff --git a/include/exec/memop.h b/include/exec/memop.h
index 407a47d..cf7da33 100644
--- a/include/exec/memop.h
+++ b/include/exec/memop.h
@@ -162,8 +162,8 @@ static inline unsigned memop_size(MemOp op)
static inline MemOp size_memop(unsigned size)
{
#ifdef CONFIG_DEBUG_TCG
- /* Power of 2 up to 8. */
- assert((size & (size - 1)) == 0 && size >= 1 && size <= 8);
+ /* Power of 2 up to 1024 */
+ assert(is_power_of_2(size) && size >= 1 && size <= (1 << MO_SIZE));
#endif
return (MemOp)ctz32(size);
}
diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index 49511f2..72219e2 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -9,18 +9,7 @@
#define TSWAP_H
#include "qemu/bswap.h"
-
-/**
- * target_big_endian:
- * Returns true if the (default) endianness of the target is big endian,
- * false otherwise. Common code should normally never need to know about the
- * endianness of the target, so please do *not* use this function unless you
- * know very well what you are doing!
- */
-bool target_big_endian(void);
-#ifdef COMPILING_PER_TARGET
-#define target_big_endian() TARGET_BIG_ENDIAN
-#endif
+#include "qemu/target-info.h"
/*
* If we're in target-specific code, we can hard-code the swapping
@@ -80,74 +69,4 @@ static inline void tswap64s(uint64_t *s)
}
}
-/* Return ld{word}_{le,be}_p following target endianness. */
-#define LOAD_IMPL(word, args...) \
-do { \
- if (target_big_endian()) { \
- return glue(glue(ld, word), _be_p)(args); \
- } else { \
- return glue(glue(ld, word), _le_p)(args); \
- } \
-} while (0)
-
-static inline int lduw_p(const void *ptr)
-{
- LOAD_IMPL(uw, ptr);
-}
-
-static inline int ldsw_p(const void *ptr)
-{
- LOAD_IMPL(sw, ptr);
-}
-
-static inline int ldl_p(const void *ptr)
-{
- LOAD_IMPL(l, ptr);
-}
-
-static inline uint64_t ldq_p(const void *ptr)
-{
- LOAD_IMPL(q, ptr);
-}
-
-static inline uint64_t ldn_p(const void *ptr, int sz)
-{
- LOAD_IMPL(n, ptr, sz);
-}
-
-#undef LOAD_IMPL
-
-/* Call st{word}_{le,be}_p following target endianness. */
-#define STORE_IMPL(word, args...) \
-do { \
- if (target_big_endian()) { \
- glue(glue(st, word), _be_p)(args); \
- } else { \
- glue(glue(st, word), _le_p)(args); \
- } \
-} while (0)
-
-
-static inline void stw_p(void *ptr, uint16_t v)
-{
- STORE_IMPL(w, ptr, v);
-}
-
-static inline void stl_p(void *ptr, uint32_t v)
-{
- STORE_IMPL(l, ptr, v);
-}
-
-static inline void stq_p(void *ptr, uint64_t v)
-{
- STORE_IMPL(q, ptr, v);
-}
-
-static inline void stn_p(void *ptr, int sz, uint64_t v)
-{
- STORE_IMPL(n, ptr, sz, v);
-}
-
-#undef STORE_IMPL
-
#endif /* TSWAP_H */