diff options
author | Sijie Chen <sijiec@google.com> | 2023-12-12 00:15:46 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-12-12 00:15:46 +0000 |
commit | cc6de89215dbe6fe7124f4e223d1c80b224a1cb5 (patch) | |
tree | cd9fc862562cfb7b8ffecdc921a11bbc6d6f6cfe | |
parent | 9907773b960358e237097c820d4c36d131e51f6a (diff) | |
parent | e5719835881e9aa148e41e75c9a1c5eadd94db58 (diff) | |
download | binary_translation-cc6de89215dbe6fe7124f4e223d1c80b224a1cb5.tar.gz |
[Berberis] Add libjnigraphics library am: 59c704084f am: e571983588
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/binary_translation/+/2869754
Change-Id: I3844d9dec7092b8399d4c44d7659c038995904e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
5 files changed, 42 insertions, 6 deletions
diff --git a/android_api/libjnigraphics/Android.bp b/android_api/libjnigraphics/Android.bp new file mode 100644 index 00000000..23ac99d8 --- /dev/null +++ b/android_api/libjnigraphics/Android.bp @@ -0,0 +1,30 @@ +// +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_shared { + name: "libberberis_proxy_libjnigraphics", + defaults: ["berberis_proxy_library_defaults"], + header_libs: ["jni_headers"], + srcs: ["//frameworks/libs/native_bridge_support/libjnigraphics:native_bridge_proxy_libjnigraphics_files"], + shared_libs: [ + "libandroid", + "libjnigraphics", + ], +} diff --git a/berberis_config.mk b/berberis_config.mk index ffb0e1f3..58f2558c 100644 --- a/berberis_config.mk +++ b/berberis_config.mk @@ -39,6 +39,7 @@ BERBERIS_PRODUCT_PACKAGES_RISCV64_TO_X86_64 := \ libberberis_proxy_libcamera2ndk \ libberberis_proxy_libmediandk \ libberberis_proxy_libnativehelper \ + libberberis_proxy_libjnigraphics \ libberberis_proxy_libnativewindow \ libberberis_proxy_libneuralnetworks \ libberberis_proxy_libwebviewchromium_plat_support \ diff --git a/calling_conventions/include/berberis/calling_conventions/calling_conventions_riscv64.h b/calling_conventions/include/berberis/calling_conventions/calling_conventions_riscv64.h index ec6f5d94..4297589d 100644 --- a/calling_conventions/include/berberis/calling_conventions/calling_conventions_riscv64.h +++ b/calling_conventions/include/berberis/calling_conventions/calling_conventions_riscv64.h @@ -81,8 +81,8 @@ class CallingConventions { } constexpr ArgLocation GetIntResLoc(unsigned size) { - // Fundamental integer type - 1/1, 2/2, 4/4, 8/8. - CHECK_LE(size, 8u); + // Fundamental integer type - 1/1, 2/2, 4/4, 8/8, 16/16. + CHECK_LE(size, 16u); // Use x10/a0. return {kArgLocationInt, 0u}; diff --git a/guest_abi/riscv64/include/berberis/guest_abi/guest_abi_arch.h b/guest_abi/riscv64/include/berberis/guest_abi/guest_abi_arch.h index 8f46ada3..01c4d921 100644 --- a/guest_abi/riscv64/include/berberis/guest_abi/guest_abi_arch.h +++ b/guest_abi/riscv64/include/berberis/guest_abi/guest_abi_arch.h @@ -228,9 +228,9 @@ class GuestAbi { struct GuestArgumentInfo<IntegerType, kCallingConventionsVariant, std::enable_if_t<std::is_integral_v<IntegerType>>> { - // Integers wider than 8 bytes are not supported. They do not appear in the public Android API. - // TODO: Remove this if 16-byte parameters are encountered. - static_assert(sizeof(IntegerType) <= 8); + // Integers wider than 16 bytes are not supported. They do not appear in the public Android + // API. + static_assert(sizeof(IntegerType) <= 16); constexpr static ArgumentClass kArgumentClass = ArgumentClass::kInteger; constexpr static unsigned kSize = sizeof(IntegerType); // Use sizeof, not alignof for kAlignment because all integer types are naturally aligned on diff --git a/guest_abi/riscv64/include/berberis/guest_abi/guest_params_arch.h b/guest_abi/riscv64/include/berberis/guest_abi/guest_params_arch.h index 31dd1bba..17c92416 100644 --- a/guest_abi/riscv64/include/berberis/guest_abi/guest_params_arch.h +++ b/guest_abi/riscv64/include/berberis/guest_abi/guest_params_arch.h @@ -133,6 +133,11 @@ class GuestParamsAndReturn<ReturnType(ParamType...) noexcept(kNoexcept), kCallin return {conv, return_loc, param_locs}; } + constexpr static riscv64::ArgLocation ReturnInfoHelper() { + riscv64::CallingConventions conv; + return ReturnInfoHelper(conv); + } + constexpr static riscv64::ArgLocation ReturnInfoHelper(riscv64::CallingConventions& conv) { using ReturnInfo = GuestArgumentInfo<ReturnType, kCallingConventionsVariant>; if constexpr (std::is_same_v<ReturnType, void>) { @@ -153,7 +158,7 @@ class GuestParamsAndReturn<ReturnType(ParamType...) noexcept(kNoexcept), kCallin constexpr static riscv64::CallingConventions kVaStartBase = std::get<0>(ParamsInfoHelper()); - constexpr static riscv64::ArgLocation kReturnLocation = std::get<1>(ParamsInfoHelper()); + constexpr static riscv64::ArgLocation kReturnLocation = ReturnInfoHelper(); constexpr static std::array<riscv64::ArgLocation, sizeof...(ParamType)> kParamsLocations = std::get<2>(ParamsInfoHelper()); |