aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-02-23 13:32:37 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-02-23 17:05:34 +0100
commit462564f31bbdc9939bf1d2376e2782defa7ef655 (patch)
tree261958f81739fbfcf4228c05fdbcc6f854008286
parentfa59e01ddace99351b212b8d82700156776e27e6 (diff)
downloadexternal_qemu-462564f31bbdc9939bf1d2376e2782defa7ef655.zip
external_qemu-462564f31bbdc9939bf1d2376e2782defa7ef655.tar.gz
external_qemu-462564f31bbdc9939bf1d2376e2782defa7ef655.tar.bz2
Minor cleanups for core/ui Makefile separation.
This patch contains minor cleanups that will be needed by a few future patches that will improve the way core and ui sources are separated and built. - remove a few compiler warnings - formatting - remove the memcheck CONFIG_MEMCHECK checks (they later get in the way) - refine hw/hw.h inclusion's of cpu.h (this comes from upstream) - add missing definitions for PRUd64 and PRUx64 (used later) - remove CONFIG_SHAPER test, replace with CONFIG_ANDROID instead. - add missing strdup() calls. Change-Id: Ic7d6681a51af718c298f0ee4bd884b1d8750f28e
-rw-r--r--android/main-ui.c4
-rw-r--r--android/main.c4
-rw-r--r--android/utils/system.h6
-rw-r--r--hw/hw.h3
-rw-r--r--memcheck/memcheck.c6
-rw-r--r--memcheck/memcheck.h6
-rw-r--r--memcheck/memcheck_common.h6
-rw-r--r--memcheck/memcheck_logging.h6
-rw-r--r--memcheck/memcheck_malloc_map.c6
-rw-r--r--memcheck/memcheck_malloc_map.h6
-rw-r--r--memcheck/memcheck_mmrange_map.c6
-rw-r--r--memcheck/memcheck_mmrange_map.h6
-rw-r--r--memcheck/memcheck_proc_management.c6
-rw-r--r--memcheck/memcheck_proc_management.h6
-rw-r--r--memcheck/memcheck_util.c6
-rw-r--r--memcheck/memcheck_util.h6
-rw-r--r--net-android.c12
-rw-r--r--target-arm/helper.c4
-rw-r--r--target-i386/cpu.h4
19 files changed, 23 insertions, 86 deletions
diff --git a/android/main-ui.c b/android/main-ui.c
index 9bf121b..e9973b0 100644
--- a/android/main-ui.c
+++ b/android/main-ui.c
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
opts->no_skin = opts->noskin;
/* Parses options and builds an appropriate AVD. */
- avd = android_avdInfo = createAVD(opts, &inAndroidBuild) ;
+ avd = android_avdInfo = createAVD(opts, &inAndroidBuild);
/* get the skin from the virtual device configuration */
opts->skin = (char*) avdInfo_getSkinName( avd );
@@ -1015,7 +1015,7 @@ int main(int argc, char **argv)
#endif
args[n++] = "-android-avdname";
- args[n++] = avdInfo_getName(avd);
+ args[n++] = (char*) avdInfo_getName(avd);
/* Set up the interfaces for inter-emulator networking */
if (opts->shared_net_id) {
diff --git a/android/main.c b/android/main.c
index b2c2c80..40f4b9b 100644
--- a/android/main.c
+++ b/android/main.c
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
opts->no_skin = opts->noskin;
/* Parses options and builds an appropriate AVD. */
- avd = android_avdInfo = createAVD(opts, &inAndroidBuild) ;
+ avd = android_avdInfo = createAVD(opts, &inAndroidBuild);
/* get the skin from the virtual device configuration */
opts->skin = (char*) avdInfo_getSkinName( avd );
@@ -810,7 +810,7 @@ int main(int argc, char **argv)
#endif
args[n++] = "-android-avdname";
- args[n++] = avdInfo_getName(avd);
+ args[n++] = (char*) avdInfo_getName(avd);
/* Set up the interfaces for inter-emulator networking */
if (opts->shared_net_id) {
diff --git a/android/utils/system.h b/android/utils/system.h
index c8163c6..464957d 100644
--- a/android/utils/system.h
+++ b/android/utils/system.h
@@ -173,6 +173,12 @@ extern void sleep_ms( int timeout );
#ifndef PRIx64
# define PRIx64 "llx"
#endif
+#ifndef PRUd64
+# define PRUd64 "llu"
+#endif
+#ifndef PRUx64
+# define PRUx64 "llx"
+#endif
/* */
diff --git a/hw/hw.h b/hw/hw.h
index 4f9b650..efcbe1e 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -4,7 +4,10 @@
#include "qemu-common.h"
#include "irq.h"
+
+#if defined(TARGET_PHYS_ADDRESS_SPACE_BITS) && !defined(NEED_CPU_H)
#include "cpu.h"
+#endif
/* VM Load/Save */
diff --git a/memcheck/memcheck.c b/memcheck/memcheck.c
index 3c8194a..3ccb196 100644
--- a/memcheck/memcheck.c
+++ b/memcheck/memcheck.c
@@ -14,12 +14,6 @@
* Contains implementation of memory checking framework in the emulator.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-queue.h"
#include "qemu_file.h"
#include "elff_api.h"
diff --git a/memcheck/memcheck.h b/memcheck/memcheck.h
index a9a6422..a7761a9 100644
--- a/memcheck/memcheck.h
+++ b/memcheck/memcheck.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_H
#define QEMU_MEMCHECK_MEMCHECK_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_common.h"
#ifdef __cplusplus
diff --git a/memcheck/memcheck_common.h b/memcheck/memcheck_common.h
index e6d12db..e753094 100644
--- a/memcheck/memcheck_common.h
+++ b/memcheck/memcheck_common.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_COMMON_H
#define QEMU_MEMCHECK_MEMCHECK_COMMON_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-common.h"
#include "cpu.h"
diff --git a/memcheck/memcheck_logging.h b/memcheck/memcheck_logging.h
index c2ae6e9..94a3c09 100644
--- a/memcheck/memcheck_logging.h
+++ b/memcheck/memcheck_logging.h
@@ -17,12 +17,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_LOGGING_H
#define QEMU_MEMCHECK_MEMCHECK_LOGGING_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-common.h"
#include "android/utils/debug.h"
diff --git a/memcheck/memcheck_malloc_map.c b/memcheck/memcheck_malloc_map.c
index 07ae889..d7e8032 100644
--- a/memcheck/memcheck_malloc_map.c
+++ b/memcheck/memcheck_malloc_map.c
@@ -15,12 +15,6 @@
* memory blocks allocated by the guest system.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_malloc_map.h"
#include "memcheck_util.h"
#include "memcheck_logging.h"
diff --git a/memcheck/memcheck_malloc_map.h b/memcheck/memcheck_malloc_map.h
index b356180..1c25738 100644
--- a/memcheck/memcheck_malloc_map.h
+++ b/memcheck/memcheck_malloc_map.h
@@ -24,12 +24,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_MALLOC_MAP_H
#define QEMU_MEMCHECK_MEMCHECK_MALLOC_MAP_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "sys-tree.h"
#include "memcheck_common.h"
diff --git a/memcheck/memcheck_mmrange_map.c b/memcheck/memcheck_mmrange_map.c
index f2609df..d9a1211 100644
--- a/memcheck/memcheck_mmrange_map.c
+++ b/memcheck/memcheck_mmrange_map.c
@@ -15,12 +15,6 @@
* memory mappings in the guest system.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_mmrange_map.h"
#include "memcheck_logging.h"
diff --git a/memcheck/memcheck_mmrange_map.h b/memcheck/memcheck_mmrange_map.h
index f2c9701..f291c95 100644
--- a/memcheck/memcheck_mmrange_map.h
+++ b/memcheck/memcheck_mmrange_map.h
@@ -22,12 +22,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_MMRANGE_MAP_H
#define QEMU_MEMCHECK_MEMCHECK_MMRANGE_MAP_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "sys-tree.h"
#include "memcheck_common.h"
diff --git a/memcheck/memcheck_proc_management.c b/memcheck/memcheck_proc_management.c
index 593ba32..45cf141 100644
--- a/memcheck/memcheck_proc_management.c
+++ b/memcheck/memcheck_proc_management.c
@@ -15,12 +15,6 @@
* memchecker framework.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "elff/elff_api.h"
#include "memcheck.h"
#include "memcheck_proc_management.h"
diff --git a/memcheck/memcheck_proc_management.h b/memcheck/memcheck_proc_management.h
index 68b6181..7f489cf 100644
--- a/memcheck/memcheck_proc_management.h
+++ b/memcheck/memcheck_proc_management.h
@@ -18,12 +18,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_PROC_MANAGEMENT_H
#define QEMU_MEMCHECK_MEMCHECK_PROC_MANAGEMENT_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "qemu-queue.h"
#include "memcheck_common.h"
#include "memcheck_malloc_map.h"
diff --git a/memcheck/memcheck_util.c b/memcheck/memcheck_util.c
index 5449488..8a59914 100644
--- a/memcheck/memcheck_util.c
+++ b/memcheck/memcheck_util.c
@@ -14,12 +14,6 @@
* Contains implementation of utility routines for memchecker framework.
*/
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "stdio.h"
#include "qemu-common.h"
#include "android/utils/path.h"
diff --git a/memcheck/memcheck_util.h b/memcheck/memcheck_util.h
index b75ee53..2a9907e 100644
--- a/memcheck/memcheck_util.h
+++ b/memcheck/memcheck_util.h
@@ -17,12 +17,6 @@
#ifndef QEMU_MEMCHECK_MEMCHECK_UTIL_H
#define QEMU_MEMCHECK_MEMCHECK_UTIL_H
-/* This file should compile iff qemu is built with memory checking
- * configuration turned on. */
-#ifndef CONFIG_MEMCHECK
-#error CONFIG_MEMCHECK is not defined.
-#endif // CONFIG_MEMCHECK
-
#include "memcheck_common.h"
#include "elff/elff_api.h"
diff --git a/net-android.c b/net-android.c
index 234235b..6459eff 100644
--- a/net-android.c
+++ b/net-android.c
@@ -126,7 +126,7 @@
#include "libslirp.h"
#endif
-#if defined(CONFIG_SHAPER)
+#if defined(CONFIG_ANDROID)
#include "shaper.h"
#endif
@@ -730,7 +730,7 @@ ip_packet_is_internal( const uint8_t* data, size_t size )
return ( data[12] == 10 && data[16] == 10);
}
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
NetShaper slirp_shaper_in;
NetShaper slirp_shaper_out;
@@ -773,12 +773,12 @@ slirp_init_shapers( void )
netshaper_set_rate( slirp_shaper_in, qemu_net_upload_speed );
}
-#endif /* CONFIG_SHAPER */
+#endif /* CONFIG_ANDROID */
int slirp_can_output(void)
{
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
return !slirp_vc ||
( netshaper_can_send(slirp_shaper_out) &&
qemu_can_send_packet(slirp_vc) );
@@ -799,7 +799,7 @@ void slirp_output(const uint8_t *pkt, int pkt_len)
if (!slirp_vc)
return;
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
netshaper_send(slirp_shaper_out, (void*)pkt, pkt_len);
#else
qemu_send_packet(slirp_vc, pkt, pkt_len);
@@ -820,7 +820,7 @@ static ssize_t slirp_receive(VLANClientState *vc, const uint8_t *buf, size_t siz
if (qemu_tcpdump_active)
qemu_tcpdump_packet(buf, size);
-#ifdef CONFIG_SHAPER
+#ifdef CONFIG_ANDROID
netshaper_send(slirp_shaper_in, (char*)buf, size);
#else
slirp_input(buf, size);
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 258e2cb..f595b2c 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1214,7 +1214,7 @@ static inline int get_phys_addr(CPUState *env, uint32_t address,
int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address,
int access_type, int mmu_idx, int is_softmmu)
{
- uint32_t phys_addr;
+ uint32_t phys_addr = 0;
int prot;
int ret, is_user;
@@ -1244,7 +1244,7 @@ int cpu_arm_handle_mmu_fault (CPUState *env, target_ulong address,
target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
{
- uint32_t phys_addr;
+ uint32_t phys_addr = 0;
int prot;
int ret;
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 4e7eb58..88547cb 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -181,7 +181,7 @@
#define HF2_VINTR_SHIFT 3 /* value of V_INTR_MASKING bit */
#define HF2_GIF_MASK (1 << HF2_GIF_SHIFT)
-#define HF2_HIF_MASK (1 << HF2_HIF_SHIFT)
+#define HF2_HIF_MASK (1 << HF2_HIF_SHIFT)
#define HF2_NMI_MASK (1 << HF2_NMI_SHIFT)
#define HF2_VINTR_MASK (1 << HF2_VINTR_SHIFT)
@@ -409,7 +409,7 @@
#define CPUID_VENDOR_INTEL_3 0x6c65746e /* "ntel" */
#define CPUID_VENDOR_AMD_1 0x68747541 /* "Auth" */
-#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */
+#define CPUID_VENDOR_AMD_2 0x69746e65 /* "enti" */
#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */
#define CPUID_MWAIT_IBE (1 << 1) /* Interrupts can exit capability */