[submodule "pixman"]
path = pixman
url = git://anongit.freedesktop.org/pixman
+[submodule "dtc"]
+ path = dtc
+ url = git://git.qemu.org/dtc.git
$(SRC_PATH)/pixman/configure:
(cd $(SRC_PATH)/pixman; autoreconf -v --install)
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+DTC_CFLAGS=$(CFLAGS) $(extra_cflags) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+
+subdir-dtc:dtc/libfdt dtc/tests
+ $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
+
+dtc/%:
+ mkdir -p $@
+
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
rm -rf $$d || exit 1 ; \
done
if test -f pixman/config.log; then make -C pixman distclean; fi
+ if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
ar de en-us fi fr-be hr it lv nl pl ru th \
endif
STPFILES=
-ifndef CONFIG_HAIKU
-LIBS+=-lm
-endif
-
config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak
obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
-LIBS+=-lz
+LIBS+=$(libs_softmmu)
# xen support
obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
all-obj-y = $(obj-y)
all-obj-y += $(addprefix ../, $(common-obj-y))
+ifndef CONFIG_HAIKU
+LIBS+=-lm
+endif
+
ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
# enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
- if test "$cpu" = "i386"; then
- # We need something better than i386 for __sync_val_compare_and_swap
- # and can expect that QEMU will only run on i686 or later.
- QEMU_CFLAGS="-march=i686 $QEMU_CFLAGS"
- fi
LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
cat > $TMPC << EOF
int main(void) { return 0; }
case "$cpu" in
sparc)
LDFLAGS="-m32 $LDFLAGS"
- QEMU_CFLAGS="-m32 -mcpu=ultrasparc $QEMU_CFLAGS"
+ CPU_CFLAGS="-m32 -mcpu=ultrasparc"
;;
sparc64)
LDFLAGS="-m64 $LDFLAGS"
- QEMU_CFLAGS="-m64 -mcpu=ultrasparc $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64 -mcpu=ultrasparc"
;;
s390)
- QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m31 -march=z990"
LDFLAGS="-m31 $LDFLAGS"
;;
s390x)
- QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64 -march=z990"
LDFLAGS="-m64 $LDFLAGS"
;;
i386)
- QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
cc_i386='$(CC) -m32'
;;
x86_64)
- QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64"
LDFLAGS="-m64 $LDFLAGS"
cc_i386='$(CC) -m32'
;;
# No special flags required for other host CPUs
esac
+QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"
+EXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS"
+
default_target_list=""
# these targets are portable
fi
fi
-#
+##########################################
+# __sync_fetch_and_and requires at least -march=i486. Many toolchains
+# use i686 as default anyway, but for those that don't, an explicit
+# specification is necessary
+
+if test "$cpu" = "i386"; then
+ cat > $TMPC << EOF
+static int sfaa(int *ptr)
+{
+ return __sync_fetch_and_and(ptr, 0);
+}
+
+int main(void)
+{
+ int val = 42;
+ sfaa(&val);
+ return val;
+}
+EOF
+ if ! compile_prog "" "" ; then
+ QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS"
+ fi
+fi
+
+#########################################
# Solaris specific configure tool chain decisions
-#
+
if test "$solaris" = "yes" ; then
if has $install; then
:
"Make sure to have the zlib libs and headers installed."
fi
fi
+libs_softmmu="$libs_softmmu -lz"
##########################################
# libseccomp check
int main(void) { return 0; }
EOF
if compile_prog "" "$fdt_libs" ; then
+ # system DTC is good - use it
fdt=yes
- libs_softmmu="$libs_softmmu $fdt_libs"
- else
- if test "$fdt" = "yes" ; then
- feature_not_found "fdt"
+ elif test -d ${source_path}/dtc/libfdt ; then
+ # have submodule DTC - use it
+ fdt=yes
+ dtc_internal="yes"
+ mkdir -p dtc
+ if [ "$source_path" != `pwd` ] ; then
+ symlink "$source_path/dtc/Makefile" "dtc/Makefile"
+ symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
+ fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+ fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+ elif test "$fdt" = "yes" ; then
+ # have neither and want - prompt for system/submodule install
+ error_exit "ERROR: DTC not present. Your options:" \
+ " (1) Preferred: Install the DTC devel package" \
+ " (2) Fetch the DTC submodule, using:" \
+ " git submodule update --init dtc"
+ else
+ # don't have and don't want
fdt_libs=
fdt=no
fi
fi
+libs_softmmu="$libs_softmmu $fdt_libs"
+
##########################################
# GLX probe, used by milkymist-tmu2
if test "$glx" != "no" ; then
fi
fi
-##########################################
-# __sync_fetch_and_and requires at least -march=i486. Many toolchains
-# use i686 as default anyway, but for those that don't, an explicit
-# specification is necessary
-if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then
- cat > $TMPC << EOF
-static int sfaa(int *ptr)
-{
- return __sync_fetch_and_and(ptr, 0);
-}
-
-int main(void)
-{
- int val = 42;
- sfaa(&val);
- return val;
-}
-EOF
- if ! compile_prog "" "" ; then
- QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS"
- fi
-fi
-
##########################################
# check and set a backend for coroutine
fi
# add pixman flags after all config tests are done
-QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags"
+QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags"
libs_softmmu="$libs_softmmu $pixman_libs"
echo "Install prefix $prefix"
echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak
echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
+echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
echo "ARCH=$ARCH" >> $config_host_mak
+
+case "$cpu" in
+ i386|x86_64|ppc)
+ # The TCG interpreter currently does not support ld/st optimization.
+ if test "$tcg_interpreter" = "no" ; then
+ echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_host_mak
+ fi
+ ;;
+esac
if test "$debug_tcg" = "yes" ; then
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
fi
if test "$glx" = "yes" ; then
echo "CONFIG_GLX=y" >> $config_host_mak
+ echo "GLX_LIBS=$glx_libs" >> $config_host_mak
fi
if test "$libiscsi" = "yes" ; then
echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
fi
+if test "$tcg_interpreter" = "yes"; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
+elif test "$ARCH" = "sparc64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES"
+elif test "$ARCH" = "s390x" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES"
+elif test "$ARCH" = "x86_64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES"
+else
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
+fi
+QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES"
+
echo "TOOLS=$tools" >> $config_host_mak
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
target_nptl="no"
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
gdb_xml_files=""
-target_short_alignment=2
-target_int_alignment=4
-target_long_alignment=4
-target_llong_alignment=8
-target_libs_softmmu=
TARGET_ARCH="$target_arch2"
TARGET_BASE_ARCH=""
;;
x86_64)
TARGET_BASE_ARCH=i386
- target_long_alignment=8
;;
alpha)
- target_long_alignment=8
target_nptl="yes"
;;
arm|armeb)
bflt="yes"
target_nptl="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
- target_llong_alignment=4
;;
cris)
target_nptl="yes"
;;
lm32)
- target_libs_softmmu="$glx_libs"
;;
m68k)
bflt="yes"
gdb_xml_files="cf-core.xml cf-fp.xml"
- target_int_alignment=2
- target_long_alignment=2
- target_llong_alignment=2
;;
microblaze|microblazeel)
TARGET_ARCH=microblaze
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
- target_long_alignment=8
;;
moxie)
;;
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- target_long_alignment=8
;;
ppc64abi32)
TARGET_ARCH=ppc64
;;
sparc64)
TARGET_BASE_ARCH=sparc
- target_long_alignment=8
;;
sparc32plus)
TARGET_ARCH=sparc64
;;
s390x)
target_nptl="yes"
- target_long_alignment=8
;;
unicore32)
;;
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
}
-case "$cpu" in
- i386|x86_64|ppc)
- # The TCG interpreter currently does not support ld/st optimization.
- if test "$tcg_interpreter" = "no" ; then
- echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak
- fi
- ;;
-esac
-
-echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
-echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
-echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
-echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
target_arch_name="`upper $TARGET_ARCH`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
if test "$xen_pci_passthrough" = yes; then
echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak"
fi
- else
- echo "CONFIG_NO_XEN=y" >> $config_target_mak
fi
;;
*)
- echo "CONFIG_NO_XEN=y" >> $config_target_mak
esac
case "$target_arch2" in
arm|i386|x86_64|ppcemb|ppc|ppc64|s390x)
fi
if test "$target_softmmu" = "yes" ; then
echo "CONFIG_SOFTMMU=y" >> $config_target_mak
- echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
case "$target_arch2" in
i386|x86_64)
echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
-includes=""
ldflags=""
-if test "$tcg_interpreter" = "yes"; then
- includes="-I\$(SRC_PATH)/tcg/tci $includes"
-elif test "$ARCH" = "sparc64" ; then
- includes="-I\$(SRC_PATH)/tcg/sparc $includes"
-elif test "$ARCH" = "s390x" ; then
- includes="-I\$(SRC_PATH)/tcg/s390 $includes"
-elif test "$ARCH" = "x86_64" ; then
- includes="-I\$(SRC_PATH)/tcg/i386 $includes"
-else
- includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
-fi
-includes="-I\$(SRC_PATH)/tcg $includes"
-
for i in $ARCH $TARGET_BASE_ARCH ; do
case "$i" in
alpha)
echo "LDFLAGS+=$ldflags" >> $config_target_mak
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
-echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
done # for target in $targets
echo "config-host.h: subdir-pixman" >> $config_host_mak
fi
+if [ "$dtc_internal" = "yes" ]; then
+ echo "config-host.h: subdir-dtc" >> $config_host_mak
+fi
+
# build tree in object directory in case the source is not in the current directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"
CONFIG_LM32=y
CONFIG_MILKYMIST=y
+CONFIG_MILKYMIST_TMU2=$(CONFIG_GLX)
CONFIG_FRAMEBUFFER=y
CONFIG_PTIMER=y
CONFIG_PFLASH_CFI01=y
--- /dev/null
+Subproject commit bc895d6d09695d05ceb8b52486ffe861d6cfbdde
common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o
common-obj-$(CONFIG_ZAURUS) += tc6393xb.o
-ifeq ($(CONFIG_GLX),y)
-common-obj-$(CONFIG_MILKYMIST) += milkymist-tmu2.o
+ifeq ($(CONFIG_MILKYMIST_TMU2),y)
+common-obj-y += milkymist-tmu2.o
+libs_softmmu += $(GLX_LIBS)
endif
obj-$(CONFIG_OMAP) += omap_dss.o
#define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8)
-typedef int16_t target_short __attribute__ ((aligned(TARGET_SHORT_ALIGNMENT)));
-typedef uint16_t target_ushort __attribute__((aligned(TARGET_SHORT_ALIGNMENT)));
-typedef int32_t target_int __attribute__((aligned(TARGET_INT_ALIGNMENT)));
-typedef uint32_t target_uint __attribute__((aligned(TARGET_INT_ALIGNMENT)));
-typedef int64_t target_llong __attribute__((aligned(TARGET_LLONG_ALIGNMENT)));
-typedef uint64_t target_ullong __attribute__((aligned(TARGET_LLONG_ALIGNMENT)));
/* target_ulong is the type of a virtual address */
#if TARGET_LONG_SIZE == 4
-typedef int32_t target_long __attribute__((aligned(TARGET_LONG_ALIGNMENT)));
-typedef uint32_t target_ulong __attribute__((aligned(TARGET_LONG_ALIGNMENT)));
+typedef int32_t target_long;
+typedef uint32_t target_ulong;
#define TARGET_FMT_lx "%08x"
#define TARGET_FMT_ld "%d"
#define TARGET_FMT_lu "%u"
#elif TARGET_LONG_SIZE == 8
-typedef int64_t target_long __attribute__((aligned(TARGET_LONG_ALIGNMENT)));
-typedef uint64_t target_ulong __attribute__((aligned(TARGET_LONG_ALIGNMENT)));
+typedef int64_t target_long;
+typedef uint64_t target_ulong;
#define TARGET_FMT_lx "%016" PRIx64
#define TARGET_FMT_ld "%" PRId64
#define TARGET_FMT_lu "%" PRIu64
#include "cpu.h"
#ifdef TARGET_ABI32
-typedef uint32_t abi_ulong;
-typedef int32_t abi_long;
+#define TARGET_ABI_BITS 32
+#else
+#define TARGET_ABI_BITS TARGET_LONG_BITS
+#endif
+
+#ifdef TARGET_M68K
+#define ABI_INT_ALIGNMENT 2
+#define ABI_LONG_ALIGNMENT 2
+#define ABI_LLONG_ALIGNMENT 2
+#endif
+
+#ifdef TARGET_ARM
+#define ABI_LLONG_ALIGNMENT 4
+#endif
+
+#ifndef ABI_SHORT_ALIGNMENT
+#define ABI_SHORT_ALIGNMENT 2
+#endif
+#ifndef ABI_INT_ALIGNMENT
+#define ABI_INT_ALIGNMENT 4
+#endif
+#ifndef ABI_LONG_ALIGNMENT
+#define ABI_LONG_ALIGNMENT (TARGET_ABI_BITS / 8)
+#endif
+#ifndef ABI_LLONG_ALIGNMENT
+#define ABI_LLONG_ALIGNMENT 8
+#endif
+
+typedef int16_t abi_short __attribute__ ((aligned(ABI_SHORT_ALIGNMENT)));
+typedef uint16_t abi_ushort __attribute__((aligned(ABI_SHORT_ALIGNMENT)));
+typedef int32_t abi_int __attribute__((aligned(ABI_INT_ALIGNMENT)));
+typedef uint32_t abi_uint __attribute__((aligned(ABI_INT_ALIGNMENT)));
+typedef int64_t abi_llong __attribute__((aligned(ABI_LLONG_ALIGNMENT)));
+typedef uint64_t abi_ullong __attribute__((aligned(ABI_LLONG_ALIGNMENT)));
+
+#ifdef TARGET_ABI32
+typedef uint32_t abi_ulong __attribute__((aligned(ABI_LONG_ALIGNMENT)));
+typedef int32_t abi_long __attribute__((aligned(ABI_LONG_ALIGNMENT)));
#define TARGET_ABI_FMT_lx "%08x"
#define TARGET_ABI_FMT_ld "%d"
#define TARGET_ABI_FMT_lu "%u"
-#define TARGET_ABI_BITS 32
static inline abi_ulong tswapal(abi_ulong v)
{
}
#else
-typedef target_ulong abi_ulong;
-typedef target_long abi_long;
+typedef target_ulong abi_ulong __attribute__((aligned(ABI_LONG_ALIGNMENT)));
+typedef target_long abi_long __attribute__((aligned(ABI_LONG_ALIGNMENT)));
#define TARGET_ABI_FMT_lx TARGET_FMT_lx
#define TARGET_ABI_FMT_ld TARGET_FMT_ld
#define TARGET_ABI_FMT_lu TARGET_FMT_lu
-#define TARGET_ABI_BITS TARGET_LONG_BITS
/* for consistency, define ABI32 too */
#if TARGET_ABI_BITS == 32
#define TARGET_ABI32 1
static inline bool xen_enabled(void)
{
-#if defined(CONFIG_XEN_BACKEND) && !defined(CONFIG_NO_XEN)
+#if defined(CONFIG_XEN_BACKEND) && defined(CONFIG_XEN)
return xen_allowed;
#else
return 0;
#define ELF_DATA ELFDATA2LSB
#endif
-typedef target_ulong target_elf_greg_t;
+#ifdef TARGET_ABI_MIPSN32
+typedef abi_ullong target_elf_greg_t;
+#define tswapreg(ptr) tswap64(ptr)
+#else
+typedef abi_ulong target_elf_greg_t;
+#define tswapreg(ptr) tswapal(ptr)
+#endif
+
#ifdef USE_UID16
-typedef target_ushort target_uid_t;
-typedef target_ushort target_gid_t;
+typedef abi_ushort target_uid_t;
+typedef abi_ushort target_gid_t;
#else
-typedef target_uint target_uid_t;
-typedef target_uint target_gid_t;
+typedef abi_uint target_uid_t;
+typedef abi_uint target_gid_t;
#endif
-typedef target_int target_pid_t;
+typedef abi_int target_pid_t;
#ifdef TARGET_I386
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUARMState *env)
{
- (*regs)[0] = tswapl(env->regs[0]);
- (*regs)[1] = tswapl(env->regs[1]);
- (*regs)[2] = tswapl(env->regs[2]);
- (*regs)[3] = tswapl(env->regs[3]);
- (*regs)[4] = tswapl(env->regs[4]);
- (*regs)[5] = tswapl(env->regs[5]);
- (*regs)[6] = tswapl(env->regs[6]);
- (*regs)[7] = tswapl(env->regs[7]);
- (*regs)[8] = tswapl(env->regs[8]);
- (*regs)[9] = tswapl(env->regs[9]);
- (*regs)[10] = tswapl(env->regs[10]);
- (*regs)[11] = tswapl(env->regs[11]);
- (*regs)[12] = tswapl(env->regs[12]);
- (*regs)[13] = tswapl(env->regs[13]);
- (*regs)[14] = tswapl(env->regs[14]);
- (*regs)[15] = tswapl(env->regs[15]);
-
- (*regs)[16] = tswapl(cpsr_read((CPUARMState *)env));
- (*regs)[17] = tswapl(env->regs[0]); /* XXX */
+ (*regs)[0] = tswapreg(env->regs[0]);
+ (*regs)[1] = tswapreg(env->regs[1]);
+ (*regs)[2] = tswapreg(env->regs[2]);
+ (*regs)[3] = tswapreg(env->regs[3]);
+ (*regs)[4] = tswapreg(env->regs[4]);
+ (*regs)[5] = tswapreg(env->regs[5]);
+ (*regs)[6] = tswapreg(env->regs[6]);
+ (*regs)[7] = tswapreg(env->regs[7]);
+ (*regs)[8] = tswapreg(env->regs[8]);
+ (*regs)[9] = tswapreg(env->regs[9]);
+ (*regs)[10] = tswapreg(env->regs[10]);
+ (*regs)[11] = tswapreg(env->regs[11]);
+ (*regs)[12] = tswapreg(env->regs[12]);
+ (*regs)[13] = tswapreg(env->regs[13]);
+ (*regs)[14] = tswapreg(env->regs[14]);
+ (*regs)[15] = tswapreg(env->regs[15]);
+
+ (*regs)[16] = tswapreg(cpsr_read((CPUARMState *)env));
+ (*regs)[17] = tswapreg(env->regs[0]); /* XXX */
}
#define USE_ELF_CORE_DUMP
target_ulong ccr = 0;
for (i = 0; i < ARRAY_SIZE(env->gpr); i++) {
- (*regs)[i] = tswapl(env->gpr[i]);
+ (*regs)[i] = tswapreg(env->gpr[i]);
}
- (*regs)[32] = tswapl(env->nip);
- (*regs)[33] = tswapl(env->msr);
- (*regs)[35] = tswapl(env->ctr);
- (*regs)[36] = tswapl(env->lr);
- (*regs)[37] = tswapl(env->xer);
+ (*regs)[32] = tswapreg(env->nip);
+ (*regs)[33] = tswapreg(env->msr);
+ (*regs)[35] = tswapreg(env->ctr);
+ (*regs)[36] = tswapreg(env->lr);
+ (*regs)[37] = tswapreg(env->xer);
for (i = 0; i < ARRAY_SIZE(env->crf); i++) {
ccr |= env->crf[i] << (32 - ((i + 1) * 4));
}
- (*regs)[38] = tswapl(ccr);
+ (*regs)[38] = tswapreg(ccr);
}
#define USE_ELF_CORE_DUMP
(*regs)[TARGET_EF_R0] = 0;
for (i = 1; i < ARRAY_SIZE(env->active_tc.gpr); i++) {
- (*regs)[TARGET_EF_R0 + i] = tswapl(env->active_tc.gpr[i]);
+ (*regs)[TARGET_EF_R0 + i] = tswapreg(env->active_tc.gpr[i]);
}
(*regs)[TARGET_EF_R26] = 0;
(*regs)[TARGET_EF_R27] = 0;
- (*regs)[TARGET_EF_LO] = tswapl(env->active_tc.LO[0]);
- (*regs)[TARGET_EF_HI] = tswapl(env->active_tc.HI[0]);
- (*regs)[TARGET_EF_CP0_EPC] = tswapl(env->active_tc.PC);
- (*regs)[TARGET_EF_CP0_BADVADDR] = tswapl(env->CP0_BadVAddr);
- (*regs)[TARGET_EF_CP0_STATUS] = tswapl(env->CP0_Status);
- (*regs)[TARGET_EF_CP0_CAUSE] = tswapl(env->CP0_Cause);
+ (*regs)[TARGET_EF_LO] = tswapreg(env->active_tc.LO[0]);
+ (*regs)[TARGET_EF_HI] = tswapreg(env->active_tc.HI[0]);
+ (*regs)[TARGET_EF_CP0_EPC] = tswapreg(env->active_tc.PC);
+ (*regs)[TARGET_EF_CP0_BADVADDR] = tswapreg(env->CP0_BadVAddr);
+ (*regs)[TARGET_EF_CP0_STATUS] = tswapreg(env->CP0_Status);
+ (*regs)[TARGET_EF_CP0_CAUSE] = tswapreg(env->CP0_Cause);
}
#define USE_ELF_CORE_DUMP
int i, pos = 0;
for (i = 0; i < 32; i++) {
- (*regs)[pos++] = tswapl(env->regs[i]);
+ (*regs)[pos++] = tswapreg(env->regs[i]);
}
for (i = 0; i < 6; i++) {
- (*regs)[pos++] = tswapl(env->sregs[i]);
+ (*regs)[pos++] = tswapreg(env->sregs[i]);
}
}
int i;
for (i = 0; i < 32; i++) {
- (*regs)[i] = tswapl(env->gpr[i]);
+ (*regs)[i] = tswapreg(env->gpr[i]);
}
- (*regs)[32] = tswapl(env->pc);
- (*regs)[33] = tswapl(env->sr);
+ (*regs)[32] = tswapreg(env->pc);
+ (*regs)[33] = tswapreg(env->sr);
}
#define ELF_HWCAP 0
#define ELF_PLATFORM NULL
int i;
for (i = 0; i < 16; i++) {
- (*regs[i]) = tswapl(env->gregs[i]);
+ (*regs[i]) = tswapreg(env->gregs[i]);
}
- (*regs)[TARGET_REG_PC] = tswapl(env->pc);
- (*regs)[TARGET_REG_PR] = tswapl(env->pr);
- (*regs)[TARGET_REG_SR] = tswapl(env->sr);
- (*regs)[TARGET_REG_GBR] = tswapl(env->gbr);
- (*regs)[TARGET_REG_MACH] = tswapl(env->mach);
- (*regs)[TARGET_REG_MACL] = tswapl(env->macl);
+ (*regs)[TARGET_REG_PC] = tswapreg(env->pc);
+ (*regs)[TARGET_REG_PR] = tswapreg(env->pr);
+ (*regs)[TARGET_REG_SR] = tswapreg(env->sr);
+ (*regs)[TARGET_REG_GBR] = tswapreg(env->gbr);
+ (*regs)[TARGET_REG_MACH] = tswapreg(env->mach);
+ (*regs)[TARGET_REG_MACL] = tswapreg(env->macl);
(*regs)[TARGET_REG_SYSCALL] = 0; /* FIXME */
}
static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *env)
{
- (*regs)[0] = tswapl(env->dregs[1]);
- (*regs)[1] = tswapl(env->dregs[2]);
- (*regs)[2] = tswapl(env->dregs[3]);
- (*regs)[3] = tswapl(env->dregs[4]);
- (*regs)[4] = tswapl(env->dregs[5]);
- (*regs)[5] = tswapl(env->dregs[6]);
- (*regs)[6] = tswapl(env->dregs[7]);
- (*regs)[7] = tswapl(env->aregs[0]);
- (*regs)[8] = tswapl(env->aregs[1]);
- (*regs)[9] = tswapl(env->aregs[2]);
- (*regs)[10] = tswapl(env->aregs[3]);
- (*regs)[11] = tswapl(env->aregs[4]);
- (*regs)[12] = tswapl(env->aregs[5]);
- (*regs)[13] = tswapl(env->aregs[6]);
- (*regs)[14] = tswapl(env->dregs[0]);
- (*regs)[15] = tswapl(env->aregs[7]);
- (*regs)[16] = tswapl(env->dregs[0]); /* FIXME: orig_d0 */
- (*regs)[17] = tswapl(env->sr);
- (*regs)[18] = tswapl(env->pc);
+ (*regs)[0] = tswapreg(env->dregs[1]);
+ (*regs)[1] = tswapreg(env->dregs[2]);
+ (*regs)[2] = tswapreg(env->dregs[3]);
+ (*regs)[3] = tswapreg(env->dregs[4]);
+ (*regs)[4] = tswapreg(env->dregs[5]);
+ (*regs)[5] = tswapreg(env->dregs[6]);
+ (*regs)[6] = tswapreg(env->dregs[7]);
+ (*regs)[7] = tswapreg(env->aregs[0]);
+ (*regs)[8] = tswapreg(env->aregs[1]);
+ (*regs)[9] = tswapreg(env->aregs[2]);
+ (*regs)[10] = tswapreg(env->aregs[3]);
+ (*regs)[11] = tswapreg(env->aregs[4]);
+ (*regs)[12] = tswapreg(env->aregs[5]);
+ (*regs)[13] = tswapreg(env->aregs[6]);
+ (*regs)[14] = tswapreg(env->dregs[0]);
+ (*regs)[15] = tswapreg(env->aregs[7]);
+ (*regs)[16] = tswapreg(env->dregs[0]); /* FIXME: orig_d0 */
+ (*regs)[17] = tswapreg(env->sr);
+ (*regs)[18] = tswapreg(env->pc);
(*regs)[19] = 0; /* FIXME: regs->format | regs->vector */
}
};
struct target_elf_siginfo {
- target_int si_signo; /* signal number */
- target_int si_code; /* extra code */
- target_int si_errno; /* errno */
+ abi_int si_signo; /* signal number */
+ abi_int si_code; /* extra code */
+ abi_int si_errno; /* errno */
};
struct target_elf_prstatus {
struct target_elf_siginfo pr_info; /* Info associated with signal */
- target_short pr_cursig; /* Current signal */
- target_ulong pr_sigpend; /* XXX */
- target_ulong pr_sighold; /* XXX */
+ abi_short pr_cursig; /* Current signal */
+ abi_ulong pr_sigpend; /* XXX */
+ abi_ulong pr_sighold; /* XXX */
target_pid_t pr_pid;
target_pid_t pr_ppid;
target_pid_t pr_pgrp;
struct target_timeval pr_cutime; /* XXX Cumulative user time */
struct target_timeval pr_cstime; /* XXX Cumulative system time */
target_elf_gregset_t pr_reg; /* GP registers */
- target_int pr_fpvalid; /* XXX */
+ abi_int pr_fpvalid; /* XXX */
};
#define ELF_PRARGSZ (80) /* Number of chars for args */
char pr_sname; /* char for pr_state */
char pr_zomb; /* zombie */
char pr_nice; /* nice val */
- target_ulong pr_flag; /* flags */
+ abi_ulong pr_flag; /* flags */
target_uid_t pr_uid;
target_gid_t pr_gid;
target_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
#ifdef BSWAP_NEEDED
static void bswap_prstatus(struct target_elf_prstatus *prstatus)
{
- prstatus->pr_info.si_signo = tswapl(prstatus->pr_info.si_signo);
- prstatus->pr_info.si_code = tswapl(prstatus->pr_info.si_code);
- prstatus->pr_info.si_errno = tswapl(prstatus->pr_info.si_errno);
+ prstatus->pr_info.si_signo = tswap32(prstatus->pr_info.si_signo);
+ prstatus->pr_info.si_code = tswap32(prstatus->pr_info.si_code);
+ prstatus->pr_info.si_errno = tswap32(prstatus->pr_info.si_errno);
prstatus->pr_cursig = tswap16(prstatus->pr_cursig);
- prstatus->pr_sigpend = tswapl(prstatus->pr_sigpend);
- prstatus->pr_sighold = tswapl(prstatus->pr_sighold);
+ prstatus->pr_sigpend = tswapal(prstatus->pr_sigpend);
+ prstatus->pr_sighold = tswapal(prstatus->pr_sighold);
prstatus->pr_pid = tswap32(prstatus->pr_pid);
prstatus->pr_ppid = tswap32(prstatus->pr_ppid);
prstatus->pr_pgrp = tswap32(prstatus->pr_pgrp);
static void bswap_psinfo(struct target_elf_prpsinfo *psinfo)
{
- psinfo->pr_flag = tswapl(psinfo->pr_flag);
+ psinfo->pr_flag = tswapal(psinfo->pr_flag);
psinfo->pr_uid = tswap16(psinfo->pr_uid);
psinfo->pr_gid = tswap16(psinfo->pr_gid);
psinfo->pr_pid = tswap32(psinfo->pr_pid);