aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-03-03 17:59:06 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-03-03 17:59:06 +0000
commit5a30d3f19d9c6d135bf7a395a24dc455698d5cf9 (patch)
tree3ada83652cc2f37b7a6344585c8bd72e5e99588d
parent41e37c33fc5897ff8015af8e0e3f5eb13c394b51 (diff)
parentc0fd260e9da7e6e60ea6bf1b0198a804f147073f (diff)
downloadqemu-5a30d3f19d9c6d135bf7a395a24dc455698d5cf9.zip
qemu-5a30d3f19d9c6d135bf7a395a24dc455698d5cf9.tar.gz
qemu-5a30d3f19d9c6d135bf7a395a24dc455698d5cf9.tar.bz2
Merge branch 'upstream' of git://qemu.weilnetz.de/qemu
* 'upstream' of git://qemu.weilnetz.de/qemu: Move definition of HOST_LONG_BITS to qemu-common.h target-xtensa: Clean includes target-unicore32: Clean includes target-sh4: Clean includes target-s390x: Clean includes target-ppc: Clean includes target-mips: Clean includes target-microblaze: Clean includes target-m68k: Clean includes target-lm32: Clean includes target-i386: Clean includes target-cris: Clean includes target-arm: Clean includes target-alpha: Clean includes Remove macro HOST_LONG_SIZE
-rwxr-xr-xconfigure12
-rw-r--r--cpu-defs.h2
-rw-r--r--qemu-common.h9
-rw-r--r--target-alpha/cpu.h1
-rw-r--r--target-alpha/translate.c5
-rw-r--r--target-arm/helper.c5
-rw-r--r--target-cris/cpu.h3
-rw-r--r--target-cris/helper.c4
-rw-r--r--target-cris/mmu.c5
-rw-r--r--target-cris/translate.c7
-rw-r--r--target-i386/helper.c6
-rw-r--r--target-i386/op_helper.c1
-rw-r--r--target-lm32/cpu.h1
-rw-r--r--target-lm32/helper.c5
-rw-r--r--target-lm32/translate.c8
-rw-r--r--target-m68k/cpu.h1
-rw-r--r--target-m68k/helper.c5
-rw-r--r--target-m68k/translate.c6
-rw-r--r--target-microblaze/cpu.h3
-rw-r--r--target-microblaze/helper.c5
-rw-r--r--target-microblaze/mmu.c4
-rw-r--r--target-microblaze/translate.c8
-rw-r--r--target-mips/translate.c7
-rw-r--r--target-ppc/helper.c6
-rw-r--r--target-ppc/translate.c6
-rw-r--r--target-s390x/cpu.h3
-rw-r--r--target-s390x/helper.c5
-rw-r--r--target-s390x/translate.c5
-rw-r--r--target-sh4/translate.c6
-rw-r--r--target-unicore32/cpu.h2
-rw-r--r--target-unicore32/helper.c4
-rw-r--r--target-xtensa/core-dc232b.c1
-rw-r--r--target-xtensa/core-fsf.c1
-rw-r--r--target-xtensa/helper.c1
-rw-r--r--thunk.h4
35 files changed, 25 insertions, 132 deletions
diff --git a/configure b/configure
index 7e69ea8..a5eb832 100755
--- a/configure
+++ b/configure
@@ -1291,17 +1291,6 @@ esac
fi
-# host long bits test, actually a pointer size test
-cat > $TMPC << EOF
-int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1];
-EOF
-if compile_object; then
-hostlongbits=64
-else
-hostlongbits=32
-fi
-
-
##########################################
# NPTL probe
@@ -2988,7 +2977,6 @@ fi
if test "$bigendian" = "yes" ; then
echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
fi
-echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
rc_version=`cat $source_path/VERSION`
diff --git a/cpu-defs.h b/cpu-defs.h
index 57a709b..4527cbf 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -60,8 +60,6 @@ typedef uint64_t target_ulong __attribute__((aligned(TARGET_LONG_ALIGNMENT)));
#error TARGET_LONG_SIZE undefined
#endif
-#define HOST_LONG_SIZE (HOST_LONG_BITS / 8)
-
#define EXCP_INTERRUPT 0x10000 /* async interruption */
#define EXCP_HLT 0x10001 /* hlt instruction reached */
#define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */
diff --git a/qemu-common.h b/qemu-common.h
index c5e9cad..dbfce6f 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -65,6 +65,15 @@ typedef struct Monitor Monitor;
#define TIME_MAX LONG_MAX
#endif
+/* HOST_LONG_BITS is the size of a native pointer in bits. */
+#if UINTPTR_MAX == UINT32_MAX
+# define HOST_LONG_BITS 32
+#elif UINTPTR_MAX == UINT64_MAX
+# define HOST_LONG_BITS 64
+#else
+# error Unknown pointer size
+#endif
+
#ifndef CONFIG_IOVEC
#define CONFIG_IOVEC
struct iovec {
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 9d61d45..5cd6fd8 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -21,6 +21,7 @@
#define __CPU_ALPHA_H__
#include "config.h"
+#include "qemu-common.h"
#define TARGET_LONG_BITS 64
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index a961159..1d2142b 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -17,15 +17,10 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
-
#include "cpu.h"
#include "disas.h"
#include "host-utils.h"
#include "tcg-op.h"
-#include "qemu-common.h"
#include "helper.h"
#define GEN_HELPER 1
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 4929372..abe1c30 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1,11 +1,6 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cpu.h"
#include "gdbstub.h"
#include "helper.h"
-#include "qemu-common.h"
#include "host-utils.h"
#if !defined(CONFIG_USER_ONLY)
#include "hw/loader.h"
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 453afbb..222a062 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -20,6 +20,9 @@
#ifndef CPU_CRIS_H
#define CPU_CRIS_H
+#include "config.h"
+#include "qemu-common.h"
+
#define TARGET_LONG_BITS 32
#define CPUState struct CPUCRISState
diff --git a/target-cris/helper.c b/target-cris/helper.c
index 5bc6d81..dd7f18e 100644
--- a/target-cris/helper.c
+++ b/target-cris/helper.c
@@ -18,10 +18,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
#include "cpu.h"
#include "mmu.h"
#include "host-utils.h"
diff --git a/target-cris/mmu.c b/target-cris/mmu.c
index d481e39..5cd8f27 100644
--- a/target-cris/mmu.c
+++ b/target-cris/mmu.c
@@ -20,11 +20,6 @@
#ifndef CONFIG_USER_ONLY
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "config.h"
#include "cpu.h"
#include "mmu.h"
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 70abf8a..cbdc72c 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -23,19 +23,12 @@
* The condition code translation is in need of attention.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
#include "helper.h"
#include "mmu.h"
#include "crisv32-decode.h"
-#include "qemu-common.h"
#define GEN_HELPER 1
#include "helper.h"
diff --git a/target-i386/helper.c b/target-i386/helper.c
index d12c962..af6bba2 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -16,14 +16,8 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
#include "cpu.h"
-#include "qemu-common.h"
#include "kvm.h"
#ifndef CONFIG_USER_ONLY
#include "sysemu.h"
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 2aea71b..63a08d6 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -22,7 +22,6 @@
#include "dyngen-exec.h"
#include "host-utils.h"
#include "ioport.h"
-#include "qemu-common.h"
#include "qemu-log.h"
#include "cpu-defs.h"
#include "helper.h"
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h
index 037ef52..b6b6b4c 100644
--- a/target-lm32/cpu.h
+++ b/target-lm32/cpu.h
@@ -24,6 +24,7 @@
#define CPUState struct CPULM32State
+#include "config.h"
#include "qemu-common.h"
#include "cpu-defs.h"
struct CPULM32State;
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index fc0b444..2637c03 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -17,11 +17,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "config.h"
#include "cpu.h"
#include "host-utils.h"
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 0be105d..c80e48b 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -17,18 +17,10 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-
#include "cpu.h"
#include "disas.h"
#include "helper.h"
#include "tcg-op.h"
-#include "qemu-common.h"
#include "hw/lm32_pic.h"
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 0667f82..4cc3a35 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -24,6 +24,7 @@
#define CPUState struct CPUM68KState
+#include "config.h"
#include "qemu-common.h"
#include "cpu-defs.h"
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 674c8e6..fa675bf 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -18,12 +18,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
#include "cpu.h"
-#include "qemu-common.h"
#include "gdbstub.h"
#include "helpers.h"
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 0e7f1fe..2bdd9dd 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -17,13 +17,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include "config.h"
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 3ecaeee..4092506 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -19,6 +19,9 @@
#ifndef CPU_MICROBLAZE_H
#define CPU_MICROBLAZE_H
+#include "config.h"
+#include "qemu-common.h"
+
#define TARGET_LONG_BITS 32
#define CPUState struct CPUMBState
diff --git a/target-microblaze/helper.c b/target-microblaze/helper.c
index 2cf2802..e1355ff 100644
--- a/target-microblaze/helper.c
+++ b/target-microblaze/helper.c
@@ -17,11 +17,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "config.h"
#include "cpu.h"
#include "host-utils.h"
diff --git a/target-microblaze/mmu.c b/target-microblaze/mmu.c
index 281fc8d..7c34ac0 100644
--- a/target-microblaze/mmu.c
+++ b/target-microblaze/mmu.c
@@ -16,11 +16,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include "config.h"
#include "cpu.h"
#define D(x)
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 96ce2ec..725c2dd 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -17,19 +17,11 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <assert.h>
-
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
#include "helper.h"
#include "microblaze-decode.h"
-#include "qemu-common.h"
#define GEN_HELPER 1
#include "helper.h"
diff --git a/target-mips/translate.c b/target-mips/translate.c
index d5b1c76..8361d88 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -20,16 +20,9 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
-#include "qemu-common.h"
#include "helper.h"
#define GEN_HELPER 1
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 928fbcf..bb76a8b 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -16,15 +16,9 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
#include "cpu.h"
#include "helper_regs.h"
-#include "qemu-common.h"
#include "kvm.h"
#include "kvm_ppc.h"
#include "cpus.h"
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index b2780db..8573e1f 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -17,16 +17,10 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
-#include "qemu-common.h"
#include "host-utils.h"
#include "helper.h"
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index b8893b3..e892bec 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -19,6 +19,9 @@
#ifndef CPU_S390X_H
#define CPU_S390X_H
+#include "config.h"
+#include "qemu-common.h"
+
#define TARGET_LONG_BITS 64
#define ELF_MACHINE EM_S390
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 10cc9dd..c0ec890 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -18,13 +18,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cpu.h"
#include "gdbstub.h"
-#include "qemu-common.h"
#include "qemu-timer.h"
#ifndef CONFIG_USER_ONLY
#include "sysemu.h"
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index ee15672..71f9dcd 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -17,11 +17,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
/* #define DEBUG_ILLEGAL_INSTRUCTIONS */
/* #define DEBUG_INLINE_BRANCHES */
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index aacf96d..dd0ee4b 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -16,11 +16,6 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
#define DEBUG_DISAS
#define SH4_DEBUG_DISAS
@@ -29,7 +24,6 @@
#include "cpu.h"
#include "disas.h"
#include "tcg-op.h"
-#include "qemu-common.h"
#include "helper.h"
#define GEN_HELPER 1
diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index b4e72cf..f725634 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -20,6 +20,8 @@
#define CPUState struct CPUState_UniCore32
+#include "config.h"
+#include "qemu-common.h"
#include "cpu-defs.h"
#include "softfloat.h"
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index b5b1cb7..ee7f82b 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -5,14 +5,10 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "cpu.h"
#include "gdbstub.h"
#include "helper.h"
-#include "qemu-common.h"
#include "host-utils.h"
static inline void set_feature(CPUState *env, int feature)
diff --git a/target-xtensa/core-dc232b.c b/target-xtensa/core-dc232b.c
index b723c4c..7c03835 100644
--- a/target-xtensa/core-dc232b.c
+++ b/target-xtensa/core-dc232b.c
@@ -1,7 +1,6 @@
#include "cpu.h"
#include "exec-all.h"
#include "gdbstub.h"
-#include "qemu-common.h"
#include "host-utils.h"
#include "core-dc232b/core-isa.h"
diff --git a/target-xtensa/core-fsf.c b/target-xtensa/core-fsf.c
index 88de4dd..c11d970 100644
--- a/target-xtensa/core-fsf.c
+++ b/target-xtensa/core-fsf.c
@@ -1,7 +1,6 @@
#include "cpu.h"
#include "exec-all.h"
#include "gdbstub.h"
-#include "qemu-common.h"
#include "host-utils.h"
#include "core-fsf/core-isa.h"
diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c
index 2ef50d6..42a559f 100644
--- a/target-xtensa/helper.c
+++ b/target-xtensa/helper.c
@@ -28,7 +28,6 @@
#include "cpu.h"
#include "exec-all.h"
#include "gdbstub.h"
-#include "qemu-common.h"
#include "host-utils.h"
#if !defined(CONFIG_USER_ONLY)
#include "hw/loader.h"
diff --git a/thunk.h b/thunk.h
index 109c541..9810743 100644
--- a/thunk.h
+++ b/thunk.h
@@ -99,7 +99,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
case TYPE_PTRVOID:
case TYPE_PTR:
if (is_host) {
- return HOST_LONG_SIZE;
+ return sizeof(void *);
} else {
return TARGET_ABI_BITS / 8;
}
@@ -136,7 +136,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
case TYPE_PTRVOID:
case TYPE_PTR:
if (is_host) {
- return HOST_LONG_SIZE;
+ return sizeof(void *);
} else {
return TARGET_ABI_BITS / 8;
}