aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-09-20 16:06:15 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-09-20 16:06:15 -0700
commit72e536bed18c886abd2b86223acbc159b5403e8c (patch)
tree76d62b89def805b259f4d0eb504b70ae10ec495d /android
parent6f0e6da580dcc786104edefef3a879f018834a3a (diff)
parent238b4b0ef1a01afa66ef267dae4a96401ad386db (diff)
downloadexternal_qemu-72e536bed18c886abd2b86223acbc159b5403e8c.zip
external_qemu-72e536bed18c886abd2b86223acbc159b5403e8c.tar.gz
external_qemu-72e536bed18c886abd2b86223acbc159b5403e8c.tar.bz2
am 238b4b0e: Fix ARMv7 emulation by disabling CPU alignment exceptions
Merge commit '238b4b0ef1a01afa66ef267dae4a96401ad386db' into eclair-plus-aosp * commit '238b4b0ef1a01afa66ef267dae4a96401ad386db': Fix ARMv7 emulation by disabling CPU alignment exceptions
Diffstat (limited to 'android')
-rw-r--r--android/main.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/android/main.c b/android/main.c
index 35f236f..1024ec2 100644
--- a/android/main.c
+++ b/android/main.c
@@ -2321,8 +2321,31 @@ int main(int argc, char **argv)
n = 1;
/* generate arguments for the underlying qemu main() */
- args[n++] = "-kernel";
- args[n++] = (char*) avdInfo_getImageFile(avd, AVD_IMAGE_KERNEL);
+ {
+ const char* kernelFile = avdInfo_getImageFile(avd, AVD_IMAGE_KERNEL);
+ int kernelFileLen = strlen(kernelFile);
+
+ args[n++] = "-kernel";
+ args[n++] = (char*)kernelFile;
+
+ /* If the kernel image name ends in "-armv7", then change the cpu
+ * type automatically. This is a poor man's approach to configuration
+ * management, but should allow us to get past building ARMv7
+ * system images with dex preopt pass without introducing too many
+ * changes to the emulator sources.
+ *
+ * XXX:
+ * A 'proper' change would require adding some sort of hardware-property
+ * to each AVD config file, then automatically determine its value for
+ * full Android builds (depending on some environment variable), plus
+ * some build system changes. I prefer not to do that for now for reasons
+ * of simplicity.
+ */
+ if (kernelFileLen > 6 && !memcmp(kernelFile + kernelFileLen - 6, "-armv7", 6)) {
+ args[n++] = "-cpu";
+ args[n++] = "cortex-a8";
+ }
+ }
args[n++] = "-initrd";
args[n++] = (char*) avdInfo_getImageFile(avd, AVD_IMAGE_RAMDISK);