blob: edcc1f8f7ac513be61b2d8f8342ad5236daa6a00 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("$zx/kernel/params.gni")
assert(current_cpu == "x64")
group("acpi") {
deps = [
":bus-acpi",
]
}
config("config") {
visibility = [ ":*" ]
include_dirs = [ "include" ]
if (enable_user_pci) {
defines = [ "ENABLE_USER_PCI" ]
}
if (!is_gcc) {
cflags = [ "-Wno-null-pointer-arithmetic" ]
}
cflags_c = [ "-fno-strict-aliasing" ]
}
driver("bus-acpi") {
sources = [
"bus-acpi.c",
"cpu-trace.c",
"debug.c",
"dev/dev-battery.c",
"dev/dev-cros-ec/dev.cpp",
"dev/dev-cros-ec/motion.cpp",
"dev/dev-ec.c",
"dev/dev-pwrbtn.cpp",
"dev/dev-pwrsrc.c",
"dev/dev-tbmc.cpp",
"dev/dev-thermal.c",
"init.c",
"iommu.c",
"methods.cpp",
"nhlt.c",
"pciroot.cpp",
"power.c",
"resources.c",
"util.c",
]
# Userspace PCI feature flag. The scaffolding for the userspace pci bus
# driver is in pci.cpp. If not enabled then the kernel pci bus driver
# initialization code in ACPI (kpci.c) will be built instead.
if (enable_user_pci) {
sources += [ "pci.cpp" ]
} else {
sources += [ "kpci.c" ]
}
configs += [ ":config" ]
deps = [
"$zx/system/banjo/ddk-protocol-acpi",
"$zx/system/banjo/ddk-protocol-hidbus",
"$zx/system/banjo/ddk-protocol-intelhda-dsp",
"$zx/system/banjo/ddk-protocol-pciroot",
"$zx/system/banjo/ddk-protocol-platform-device",
"$zx/system/banjo/ddk-protocol-scpi",
"$zx/system/fidl/fuchsia-hardware-power:c",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/fbl",
"$zx/system/ulib/hid",
"$zx/system/ulib/pci",
"$zx/system/ulib/region-alloc",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zxcpp",
"$zx/third_party/lib/acpica",
"$zx/third_party/ulib/chromiumos-platform-ec",
]
}