qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] also build big-endian version of qemu-arm


From: Lennert Buytenhek
Subject: [Qemu-devel] [PATCH] also build big-endian version of qemu-arm
Date: Sun, 19 Dec 2004 17:40:28 +0100
User-agent: Mutt/1.4.1i

Hi,

This patches causes a big-endian version of qemu-arm (called qemu-armeb) to
be built alongside the regular little-endian one.  Lightly tested with some
simple static big-endian binaries.  Also adds a binfmt_misc signature, and
adds support for building on armv4b (untested.)


cheers,
Lennert


diff -urN qemu-20041218.orig/configure qemu-20041218.mild/configure
--- qemu-20041218.orig/configure        2004-11-14 22:20:23.000000000 +0100
+++ qemu-20041218.mild/configure        2004-12-19 17:00:55.688538798 +0100
@@ -27,11 +27,14 @@
 make="make"
 strip="strip"
 cpu=`uname -m`
-target_list="i386-user i386 i386-softmmu arm-user sparc-user ppc-user 
ppc-softmmu sparc-softmmu"
+target_list="i386-user i386 i386-softmmu arm-user armeb-user sparc-user 
ppc-user ppc-softmmu sparc-softmmu"
 case "$cpu" in
   i386|i486|i586|i686|i86pc|BePC)
     cpu="i386"
   ;;
+  armv4b)
+    cpu="armv4b"
+  ;;
   armv4l)
     cpu="armv4l"
   ;;
@@ -205,7 +208,7 @@
 else
 
 # if cross compiling, cannot launch a program, so make a static guess
-if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = 
"sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k"; then
+if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = 
"sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
     bigendian="yes"
 fi
 
@@ -383,6 +386,9 @@
 elif test "$cpu" = "amd64" ; then
   echo "ARCH=amd64" >> $config_mak
   echo "#define HOST_AMD64 1" >> $config_h
+elif test "$cpu" = "armv4b" ; then
+  echo "ARCH=arm" >> $config_mak
+  echo "#define HOST_ARM 1" >> $config_h
 elif test "$cpu" = "armv4l" ; then
   echo "ARCH=arm" >> $config_mak
   echo "#define HOST_ARM 1" >> $config_h
@@ -482,6 +488,7 @@
 config_h=$target_dir/config.h
 target_cpu=`echo $target | cut -d '-' -f 1`
 target_bigendian="no"
+[ "$target_cpu" = "armeb" ] && target_bigendian=yes
 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
 target_softmmu="no"
@@ -499,6 +506,9 @@
 if test "$target" = "arm-user" ; then
   mkdir -p $target_dir/nwfpe
 fi
+if test "$target" = "armeb-user" ; then
+  mkdir -p $target_dir/nwfpe
+fi
 if test "$target_user_only" = "no" ; then
   mkdir -p $target_dir/slirp
 fi
@@ -523,6 +533,10 @@
   echo "TARGET_ARCH=arm" >> $config_mak
   echo "#define TARGET_ARCH \"arm\"" >> $config_h
   echo "#define TARGET_ARM 1" >> $config_h
+elif test "$target_cpu" = "armeb" ; then
+  echo "TARGET_ARCH=arm" >> $config_mak
+  echo "#define TARGET_ARCH \"arm\"" >> $config_h
+  echo "#define TARGET_ARM 1" >> $config_h
 elif test "$target_cpu" = "sparc" ; then
   echo "TARGET_ARCH=sparc" >> $config_mak
   echo "#define TARGET_ARCH \"sparc\"" >> $config_h
diff -urN qemu-20041218.orig/.cvsignore qemu-20041218.mild/.cvsignore
--- qemu-20041218.orig/.cvsignore       2004-11-16 01:00:04.000000000 +0100
+++ qemu-20041218.mild/.cvsignore       2004-12-19 17:22:14.687021448 +0100
@@ -1,4 +1,5 @@
 arm-user
+armeb-user
 config-host.*
 dyngen
 i386
diff -urN qemu-20041218.orig/Makefile.target qemu-20041218.mild/Makefile.target
--- qemu-20041218.orig/Makefile.target  2004-12-18 01:00:14.000000000 +0100
+++ qemu-20041218.mild/Makefile.target  2004-12-19 17:21:46.510777933 +0100
@@ -13,7 +13,15 @@
 HELPER_CFLAGS=$(CFLAGS)
 DYNGEN=../dyngen$(EXESUF)
 # user emulator name
-QEMU_USER=qemu-$(TARGET_ARCH)
+ifeq ($(TARGET_ARCH),arm)
+  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
+    QEMU_USER=qemu-armeb
+  else
+    QEMU_USER=qemu-arm
+  endif
+else
+  QEMU_USER=qemu-$(TARGET_ARCH)
+endif
 # system emulator name
 ifdef CONFIG_SOFTMMU
 ifeq ($(TARGET_ARCH), i386)
diff -urN qemu-20041218.orig/qemu-binfmt-conf.sh 
qemu-20041218.mild/qemu-binfmt-conf.sh
--- qemu-20041218.orig/qemu-binfmt-conf.sh      2004-03-28 00:58:14.000000000 
+0100
+++ qemu-20041218.mild/qemu-binfmt-conf.sh      2004-12-19 17:22:35.053306195 
+0100
@@ -25,6 +25,7 @@
 fi
 if [ $cpu != "arm" ] ; then
     echo   
':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-arm:'
 > /proc/sys/fs/binfmt_misc/register
+    echo   
':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-armeb:'
 > /proc/sys/fs/binfmt_misc/register
 fi
 if [ $cpu != "sparc" ] ; then
     echo   
':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/usr/local/bin/qemu-sparc:'
 > /proc/sys/fs/binfmt_misc/register




reply via email to

[Prev in Thread] Current Thread [Next in Thread]