1// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_library_headers {
21    name: "libberberis_kernel_api_headers",
22    defaults: ["berberis_guest_agnostic_defaults"],
23    host_supported: true,
24    export_include_dirs: ["include"],
25}
26
27cc_library_static {
28    name: "libberberis_kernel_api_common",
29    defaults: [
30        "berberis_guest_agnostic_defaults",
31    ],
32    host_supported: true,
33    srcs: [
34        "exec_emulation.cc",
35        "fcntl_emulation.cc",
36        "main_executable_real_path_emulation.cc",
37        "open_emulation.cc",
38        "runtime_bridge.cc",
39        "sigevent_emulation.cc",
40        "sys_mman_emulation.cc",
41        "sys_prctl_emulation.cc",
42        "sys_ptrace_emulation.cc",
43        "unistd_emulation.cc",
44    ],
45    header_libs: [
46        "libberberis_base_headers",
47        "libberberis_guest_os_primitives_headers",
48        "libberberis_kernel_api_headers",
49    ],
50    export_header_lib_headers: ["libberberis_kernel_api_headers"],
51}
52
53cc_library_static {
54    name: "libberberis_kernel_api_riscv64",
55    defaults: [
56        "berberis_defaults_64",
57    ],
58    host_supported: true,
59    whole_static_libs: [
60        "libberberis_kernel_api_common",
61    ],
62    srcs: [
63        "riscv64/epoll_emulation.cc",
64        "riscv64/open_emulation.cc",
65        "riscv64/syscall_emulation_arch.cc",
66        "riscv64/syscall_emulation.cc",
67        "riscv64/tracing.cc",
68    ],
69    local_include_dirs: ["riscv64"],
70    header_libs: [
71        "libberberis_base_headers",
72        "libberberis_guest_os_primitives_headers",
73        "libberberis_guest_state_riscv64_headers",
74        "libberberis_instrument_headers",
75        "libberberis_kernel_api_headers",
76    ],
77    export_header_lib_headers: ["libberberis_kernel_api_headers"],
78}
79