blob: 872e60d3c73cfc1cd38082b8bfe5938c8ea25988 [file] [log] [blame]
David 'Digit' Turner045bdbe2014-04-28 22:26:52 +02001// Copyright (C) 2014 The Android Open Source Project
2//
3// This software is licensed under the terms of the GNU General Public
4// License version 2, as published by the Free Software Foundation, and
5// may be copied, distributed, and modified under those terms.
6//
7// This program is distributed in the hope that it will be useful,
8// but WITHOUT ANY WARRANTY; without even the implied warranty of
9// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10// GNU General Public License for more details.
11
12#include "android/cpu_accelerator.h"
13
14// This source acts as a small C++ -> C bridge between android/emulation/
15// and android/main.c
16
17#include "android/base/String.h"
18#include "android/emulation/CpuAccelerator.h"
19
20#include "android/utils/system.h"
21
22extern "C" bool android_hasCpuAcceleration(char** status_p) {
23 android::CpuAccelerator accel = android::GetCurrentCpuAccelerator();
24
25 if (status_p) {
26 android::base::String status =
27 android::GetCurrentCpuAcceleratorStatus();
28 *status_p = ASTRDUP(status.c_str());
29 }
30
31 return accel != android::CPU_ACCELERATOR_NONE;
32}