15f9996aaSopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd. 25f9996aaSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 35f9996aaSopenharmony_ci# you may not use this file except in compliance with the License. 45f9996aaSopenharmony_ci# You may obtain a copy of the License at 55f9996aaSopenharmony_ci# 65f9996aaSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 75f9996aaSopenharmony_ci# 85f9996aaSopenharmony_ci# Unless required by applicable law or agreed to in writing, software 95f9996aaSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 105f9996aaSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 115f9996aaSopenharmony_ci# See the License for the specific language governing permissions and 125f9996aaSopenharmony_ci# limitations under the License. 135f9996aaSopenharmony_ci 145f9996aaSopenharmony_ciimport("//build/ohos/kernel/kernel.gni") 155f9996aaSopenharmony_ci 165f9996aaSopenharmony_cideclare_args() { 175f9996aaSopenharmony_ci if (current_cpu == "arm") { 185f9996aaSopenharmony_ci bpf_arch = "arm" 195f9996aaSopenharmony_ci } else if (current_cpu == "arm64") { 205f9996aaSopenharmony_ci bpf_arch = "aarch64" 215f9996aaSopenharmony_ci } else if (current_cpu == "x86_64" || current_cpu == "x64") { 225f9996aaSopenharmony_ci bpf_arch = "x86_64" 235f9996aaSopenharmony_ci } else if (current_cpu == "mipsel") { 245f9996aaSopenharmony_ci bpf_arch = "mipsel" 255f9996aaSopenharmony_ci } else if (current_cpu == "riscv64") { 265f9996aaSopenharmony_ci bpf_arch = "riscv64" 275f9996aaSopenharmony_ci } else if (current_cpu == "loongarch64") { 285f9996aaSopenharmony_ci bpf_arch = "loongarch64" 295f9996aaSopenharmony_ci } 305f9996aaSopenharmony_ci} 315f9996aaSopenharmony_ci 325f9996aaSopenharmony_cideclare_args() { 335f9996aaSopenharmony_ci if ((defined(target_os) && target_os == "ohos") || 345f9996aaSopenharmony_ci (defined(ohos_kernel_type) && ohos_kernel_type == "linux")) { 355f9996aaSopenharmony_ci bpf_target_os = "linux" 365f9996aaSopenharmony_ci bpf_target_triple = "${bpf_arch}-linux-ohos" 375f9996aaSopenharmony_ci } else if (defined(ohos_kernel_type) && ohos_kernel_type == "liteos_a") { 385f9996aaSopenharmony_ci bpf_target_os = "liteos_a" 395f9996aaSopenharmony_ci bpf_target_triple = "arm-liteos-ohos" 405f9996aaSopenharmony_ci } 415f9996aaSopenharmony_ci} 425f9996aaSopenharmony_ci 435f9996aaSopenharmony_cideclare_args() { 445f9996aaSopenharmony_ci bpf_inc_out_dir = bpf_target_triple 455f9996aaSopenharmony_ci bpf_linux_kernel_dir = "//kernel/linux/${linux_kernel_version}" 465f9996aaSopenharmony_ci} 475f9996aaSopenharmony_ci 485f9996aaSopenharmony_cideclare_args() { 495f9996aaSopenharmony_ci kernel_tools_dir = "${bpf_linux_kernel_dir}/tools/lib/bpf" 505f9996aaSopenharmony_ci} 51