From 2d238fd9871687b1557f15b8878a6cf3e9634b57 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Fri, 25 Mar 2011 10:34:47 +0100 Subject: 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 --- vl-android.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'vl-android.c') 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. * -- cgit v1.1