• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos/kernel/kernel.gni")
15
16declare_args() {
17  if (current_cpu == "arm") {
18    bpf_arch = "arm"
19  } else if (current_cpu == "arm64") {
20    bpf_arch = "aarch64"
21  } else if (current_cpu == "x86_64" || current_cpu == "x64") {
22    bpf_arch = "x86_64"
23  } else if (current_cpu == "mipsel") {
24    bpf_arch = "mipsel"
25  } else if (current_cpu == "riscv64") {
26    bpf_arch = "riscv64"
27  } else if (current_cpu == "riscv32") {
28    bpf_arch = "riscv32"
29  } else if (current_cpu == "loongarch64") {
30    bpf_arch = "loongarch64"
31  }
32}
33
34declare_args() {
35  if ((defined(target_os) && target_os == "ohos") ||
36      (defined(ohos_kernel_type) && ohos_kernel_type == "linux")) {
37    bpf_target_os = "linux"
38    bpf_target_triple = "${bpf_arch}-linux-ohos"
39  } else if (defined(ohos_kernel_type) && ohos_kernel_type == "liteos_a") {
40    bpf_target_os = "liteos_a"
41    bpf_target_triple = "arm-liteos-ohos"
42  }
43}
44
45declare_args() {
46  bpf_inc_out_dir = bpf_target_triple
47  bpf_linux_kernel_dir = "//kernel/linux/${linux_kernel_version}"
48}
49
50declare_args() {
51  kernel_tools_dir = "${bpf_linux_kernel_dir}/tools/lib/bpf"
52}
53