blob: e8d652e1fe73dc908a74747ad8ac548c8fe1a95f [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("x86") {
deps = [
":platform-bus-x86",
]
}
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("platform-bus-x86") {
sources = [
"acpi-dev/dev-battery.c",
"acpi-dev/dev-cros-ec/dev.cpp",
"acpi-dev/dev-cros-ec/motion.cpp",
"acpi-dev/dev-ec.c",
"acpi-dev/dev-pwrbtn.cpp",
"acpi-dev/dev-pwrsrc.c",
"acpi-dev/dev-tbmc.cpp",
"acpi-dev/dev-thermal.c",
"acpi-nswalk.c",
"debug.c",
"init.c",
"iommu.c",
"methods.cpp",
"nhlt.c",
"pciroot.cpp",
"power.c",
"resources.c",
"sysmem.c",
"util.c",
"x86.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.pciroot",
"$zx/system/banjo/ddk.protocol.platform.bus",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.scpi",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/fidl/fuchsia-hardware-power:c",
"$zx/system/fidl/fuchsia-hardware-thermal:c",
"$zx/system/fidl/fuchsia-sysmem: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/third_party/lib/acpica",
"$zx/third_party/ulib/chromiumos-platform-ec",
]
}
test("x86-battery-test") {
output_name = "x86-battery-test"
test_group = "ddk"
sources = [
"acpi-dev/dev-battery-test.c",
]
configs += [ ":config" ]
deps = [
"$zx/system/banjo/ddk.protocol.acpi",
"$zx/system/banjo/ddk.protocol.hidbus",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/banjo/ddk.protocol.platform.bus",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.scpi",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/fidl/fuchsia-hardware-power:c",
"$zx/system/fidl/fuchsia-hardware-thermal: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/zxtest",
"$zx/third_party/lib/acpica",
"$zx/third_party/ulib/chromiumos-platform-ec",
]
}