blob: 8dbf74c1c9273e79f1295a7cc4d6b7ab675851f2 [file] [log] [blame]
# Copyright 2020 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/toolchain/toolchain_environment.gni")
import("//zircon/system/ulib/hwreg/hwreg_asm_header.gni")
library_headers("headers") {
visibility = [ "../*" ]
headers = []
public_deps = [
# <lib/arch/internal/zbi-constants.h> has #include <fidl/zbi/data/asm/zbi.h>
"//sdk/fidl/zbi:zbi_zither.asm",
# <lib/arch/zbi-boot.h> has #include <lib/zbi-format/zbi.h>.
# <lib/arch/internal/zbi-constants.h> has #include <lib/zbi-format/zbi.h>.
"//sdk/lib/zbi-format",
# <lib/arch/x86/boot-cpuid.h> has #include <lib/special-sections/special-sections.h>.
"//zircon/kernel/lib/special-sections",
# <lib/arch/x86/cpuid.h> has #include <hwreg/bitfields.h>.
"//zircon/system/ulib/hwreg:headers",
]
public_deps += [ ":gen-cpuid-asm" ]
}
static_library("x86") {
visibility = [ "../*" ]
public_deps = [ ":headers" ]
sources = []
deps = [ "//zircon/system/ulib/hwreg" ]
include_dirs = [
"include",
"../include",
]
if (is_kernel) {
sources += [
"boot-cpuid.S",
"boot-cpuid.cc",
"random.cc",
"standard-segments.cc",
]
deps += [
":gen-cpuid-asm",
"//zircon/kernel/lib/ktl",
"//zircon/kernel/lib/libc",
"//zircon/kernel/lib/special-sections",
]
if (toolchain_environment == "kernel.phys32") {
sources += [ "zbi-boot.cc" ]
} else {
sources += [ "descriptor-regs.S" ]
}
}
}
hwreg_asm_header("gen-cpuid-asm") {
output_name = "lib/arch/x86/cpuid-asm.h"
defines = [ "LIB_ARCH_PRINTERS" ]
sources = [ "gen-cpuid-asm.cc" ]
deps = [ ".." ]
}