aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu-all.h10
-rw-r--r--cpu-common.h4
-rw-r--r--exec-all.h8
-rw-r--r--exec.c6
-rw-r--r--kvm.h2
5 files changed, 21 insertions, 9 deletions
diff --git a/cpu-all.h b/cpu-all.h
index a51b301ca4..e32ea47cfa 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -849,6 +849,8 @@ void cpu_set_log(int log_flags);
void cpu_set_log_filename(const char *filename);
int cpu_str_to_log_mask(const char *str);
+#if !defined(CONFIG_USER_ONLY)
+
/* memory API */
extern int phys_ram_fd;
@@ -877,9 +879,6 @@ extern int mem_prealloc;
/* Set if TLB entry is an IO callback. */
#define TLB_MMIO (1 << 5)
-int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
- uint8_t *buf, int len, int is_write);
-
#define VGA_DIRTY_FLAG 0x01
#define CODE_DIRTY_FLAG 0x02
#define MIGRATION_DIRTY_FLAG 0x08
@@ -926,6 +925,11 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size);
void qemu_flush_coalesced_mmio_buffer(void);
+#endif /* !CONFIG_USER_ONLY */
+
+int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
+ uint8_t *buf, int len, int is_write);
+
/*******************************************/
/* host CPU ticks (if available) */
diff --git a/cpu-common.h b/cpu-common.h
index 0ec9b72a91..f53690ac8c 100644
--- a/cpu-common.h
+++ b/cpu-common.h
@@ -10,6 +10,8 @@
#include "bswap.h"
#include "qemu-queue.h"
+#if !defined(CONFIG_USER_ONLY)
+
/* address in the RAM (different from a physical address) */
typedef unsigned long ram_addr_t;
@@ -106,4 +108,6 @@ void cpu_physical_memory_write_rom(target_phys_addr_t addr,
#define IO_MEM_SUBPAGE (2)
#define IO_MEM_SUBWIDTH (4)
+#endif
+
#endif /* !CPU_COMMON_H */
diff --git a/exec-all.h b/exec-all.h
index 04d2146e75..6c44d32f85 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -274,10 +274,6 @@ static inline void tb_add_jump(TranslationBlock *tb, int n,
TranslationBlock *tb_find_pc(unsigned long pc_ptr);
-extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
-extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
-extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
-
#include "qemu-lock.h"
extern spinlock_t tb_lock;
@@ -286,6 +282,10 @@ extern int tb_invalidated_flag;
#if !defined(CONFIG_USER_ONLY)
+extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
+extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
+extern void *io_mem_opaque[IO_MEM_NB_ENTRIES];
+
void tlb_fill(target_ulong addr, int is_write, int mmu_idx,
void *retaddr);
diff --git a/exec.c b/exec.c
index c7697acace..e9cec6aaaf 100644
--- a/exec.c
+++ b/exec.c
@@ -217,7 +217,9 @@ int loglevel;
static int log_append = 0;
/* statistics */
+#if !defined(CONFIG_USER_ONLY)
static int tlb_flush_count;
+#endif
static int tb_flush_count;
static int tb_phys_invalidate_count;
@@ -3924,6 +3926,8 @@ void cpu_io_recompile(CPUState *env, void *retaddr)
cpu_resume_from_signal(env, NULL);
}
+#if !defined(CONFIG_USER_ONLY)
+
void dump_exec_info(FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
{
@@ -3977,8 +3981,6 @@ void dump_exec_info(FILE *f,
tcg_dump_info(f, cpu_fprintf);
}
-#if !defined(CONFIG_USER_ONLY)
-
#define MMUSUFFIX _cmmu
#define GETPC() NULL
#define env cpu_single_env
diff --git a/kvm.h b/kvm.h
index b2937b9956..fd8d0c16c8 100644
--- a/kvm.h
+++ b/kvm.h
@@ -35,6 +35,7 @@ int kvm_init_vcpu(CPUState *env);
int kvm_cpu_exec(CPUState *env);
+#if !defined(CONFIG_USER_ONLY)
int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size);
int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size);
@@ -47,6 +48,7 @@ void kvm_setup_guest_memory(void *start, size_t size);
int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
void kvm_flush_coalesced_mmio_buffer(void);
+#endif
int kvm_insert_breakpoint(CPUState *current_env, target_ulong addr,
target_ulong len, int type);