From c41638cb759ce569630ffae4c5c4cdee1b0f3b82 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 7 Apr 2014 13:56:15 +0100 Subject: Make zygotes aware of their supported ABIs. Query system properties for the list of ABIs and pass it as a command line argument to ZygoteInit. Also add a new Zygote command that returns this list of ABIs to peers. Change-Id: I68034c6f63fa626911122579a011a0a25a8cda94 --- cmds/app_process/app_main.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'cmds/app_process') diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index e0290c3..3e8d6a0 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -10,8 +10,9 @@ #include #include #include -#include #include +#include +#include #include #include @@ -135,6 +136,12 @@ static size_t computeArgBlockSize(int argc, char* const argv[]) { return (end - start); } +#if defined(__LP64__) +static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist64"; +#else +static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist32"; +#endif + int main(int argc, char* const argv[]) { AppRuntime runtime(argv[0], computeArgBlockSize(argc, argv)); @@ -205,6 +212,17 @@ int main(int argc, char* const argv[]) args.add(String8("start-system-server")); } + char prop[PROP_VALUE_MAX]; + if (property_get(ABI_LIST_PROPERTY, prop, NULL) == 0) { + LOG_ALWAYS_FATAL("app_process: Unable to deterimine ABI list from property %s.", + ABI_LIST_PROPERTY); + return 11; + } + + String8 abiFlag("--abi-list="); + abiFlag.append(prop); + args.add(abiFlag); + // In zygote mode, pass all remaining arguments to the zygote // main() method. for (; i < argc; ++i) { -- cgit v1.1