blob: be647fc1eb84134fa46cb720e0cf5b9734ab1e0c [file] [log] [blame]
Yong WU355383f2014-07-24 21:32:15 +08001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_RUNTIME_NATIVE_BRIDGE_H_
18#define ART_RUNTIME_NATIVE_BRIDGE_H_
19
Andreas Gampe855564b2014-07-25 02:32:19 -070020#include <string>
21
Yong WU355383f2014-07-24 21:32:15 +080022namespace art {
23
Ian Rogers68d8b422014-07-17 11:09:10 -070024// Initialize the native bridge, if any. Should be called by Runtime::Init(). An empty string
25// signals that we do not want to load a native bridge.
26void SetNativeBridgeLibraryString(const std::string& native_bridge_library_string);
Yong WU355383f2014-07-24 21:32:15 +080027
Ian Rogers68d8b422014-07-17 11:09:10 -070028// Load a shared library that is supported by the native-bridge.
29void* NativeBridgeLoadLibrary(const char* libpath, int flag);
Andreas Gampe855564b2014-07-25 02:32:19 -070030
Ian Rogers68d8b422014-07-17 11:09:10 -070031// Get a native-bridge trampoline for specified native method.
32void* NativeBridgeGetTrampoline(void* handle, const char* name, const char* shorty, uint32_t len);
Yong WU355383f2014-07-24 21:32:15 +080033
Ian Rogers68d8b422014-07-17 11:09:10 -070034// True if native library is valid and is for an ABI that is supported by native-bridge.
35bool NativeBridgeIsSupported(const char* libpath);
Yong WU355383f2014-07-24 21:32:15 +080036
37}; // namespace art
38
39#endif // ART_RUNTIME_NATIVE_BRIDGE_H_