aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-03-25 10:34:47 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-05-02 18:05:18 +0200
commit2d238fd9871687b1557f15b8878a6cf3e9634b57 (patch)
tree1ecdd74927037aea7bc899c78a9cdddefb38ff22 /vl-android.c
parentec1d38fbb171c45fc8b79734efb80e2c21db6ef8 (diff)
downloadexternal_qemu-2d238fd9871687b1557f15b8878a6cf3e9634b57.zip
external_qemu-2d238fd9871687b1557f15b8878a6cf3e9634b57.tar.gz
external_qemu-2d238fd9871687b1557f15b8878a6cf3e9634b57.tar.bz2
Add 'emulator' launcher program.
This patch renames the current ARM-specific emulator binary to 'emulator-arm' and introduces a new tiny (less than 20KB) 'emulator' launcher program. The role of 'emulator' is to launch either 'emulator-arm' or 'emulator-x86' based on the target AVD or platform build being used. This program will be replaced in the future by what is currently known as 'emulator-ui', but is a good placeholder until this work is completed. + Move some utility functions from android/avd/info.[hc] to android/avd/util.[hc] so that 'emulator' can use them directly. IMPORTANT: For platform builds, the target architecture is detected automatically by parsing the build.prop file. For SDK AVDs however, there is no easy way to determine the target architecture, so the patch adds a new hw.cpu.arch property which can have value 'arm' or 'x86' Change-Id: I0084c196695a75c8b9230ba716b3cd2e12610ded
Diffstat (limited to 'vl-android.c')
-rw-r--r--vl-android.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/vl-android.c b/vl-android.c
index 6653286..abfa423 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -5629,6 +5629,29 @@ int main(int argc, char **argv, char **envp)
}
#endif
+ /* Check the CPU Architecture value */
+#if defined(TARGET_ARM)
+ if (strcmp(android_hw->hw_cpu_arch,"arm") != 0) {
+ fprintf(stderr, "-- Invalid CPU architecture: %s, expected 'arm'\n",
+ android_hw->hw_cpu_arch);
+ exit(1);
+ }
+#elif defined(TARGET_X86)
+ if (strcmp(android_hw->hw_cpu_arch,"x86") != 0) {
+ fprintf(stderr, "-- Invalid CPU architecture: %s, expected 'x86'\n",
+ android_hw->hw_cpu_arch);
+ exit(1);
+ }
+#endif
+
+ /* Grab CPU model if provided in hardware.ini */
+ if ( !cpu_model
+ && android_hw->hw_cpu_model
+ && android_hw->hw_cpu_model[0] != '\0')
+ {
+ cpu_model = android_hw->hw_cpu_model;
+ }
+
/* Combine kernel command line passed from the UI with parameters
* collected during initialization.
*