blob: fe0179f8996394a06f08d48e2497e3b8c7248326 [file] [edit]
# Copyright 2019 The Fuchsia Authors
#
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT
import("//build/cpp/library_headers.gni")
import("//build/rust/rustc_library.gni")
import("//build/zircon/zircon_cpu.gni")
source_set("platform") {
public_deps = [ ":headers" ]
sources = [
"debug.cc",
"efi.cc",
"efi_bootbyte.cc",
"efi_crashlog.cc",
"halt_helper.cc",
"mapped_crashlog.cc",
"mexec.cc",
"power.cc",
]
deps = [
"//sdk/lib/zbi-format",
"//src/lib/zbitl",
"//zircon/kernel/dev/interrupt",
"//zircon/kernel/dev/pdev/hw_watchdog",
"//zircon/kernel/lib/boot-options",
"//zircon/kernel/lib/cbuf",
"//zircon/kernel/lib/code-patching:headers",
"//zircon/kernel/lib/console",
"//zircon/kernel/lib/counters",
"//zircon/kernel/lib/crashlog",
"//zircon/kernel/lib/debuglog",
"//zircon/kernel/lib/init",
"//zircon/kernel/lib/instrumentation:headers",
"//zircon/kernel/lib/jtrace:headers",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/page",
"//zircon/kernel/lib/persistent-debuglog",
"//zircon/kernel/lib/root_resource_filter",
"//zircon/kernel/phys:boot-constants",
"//zircon/kernel/phys:handoff",
"//zircon/kernel/phys/lib/memalloc",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/ram-crashlog",
"//zircon/system/ulib/zx",
]
}
library_headers("headers") {
headers = [
"platform/uart.h",
"platform/mexec.h",
]
}
source_set("tests") {
testonly = true
sources = [
"efi_test.cc",
"suspend_cpu_tests.cc",
]
deps = [
":platform",
"//zircon/kernel/lib/efi",
"//zircon/kernel/lib/unittest",
]
}
group("kernel-tests") {
testonly = true
deps = [ ":tests" ]
if (current_cpu == "arm64") {
deps += [ "generic-arm:kernel-tests" ]
} else if (current_cpu == "riscv64") {
deps += [ "generic-riscv64:kernel-tests" ]
} else if (current_cpu == "x64") {
deps += [ "pc:kernel-tests" ]
}
}
source_set("ffi") {
sources = [
"power_ffi.cc",
"timer_ffi.cc",
]
deps = [ "//zircon/kernel/lib/ktl" ]
}
rustc_library("platform-rs") {
edition = "2024"
name = "platform_rs"
source_root = "timer.rs"
sources = [
"power.rs",
"timer.rs",
]
non_rust_deps = [ ":ffi" ]
}