blob: 64138962b8fd30fb2c9007e9a4f6c4596c419473 [file] [log] [blame] [edit]
# 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/zircon/migrated_targets.gni")
import("$zx/system/ulib/hwreg/hwreg_asm_header.gni")
if (zx != "/" || current_toolchain != default_toolchain) {
zx_library("arch") {
kernel = true
static = true
# Not much is actually usable on host, but hwreg definitions and such are.
host = true
sdk = "source"
sdk_headers = [ "lib/arch/asm.h" ]
sdk_migrated = true
sources = [
"cpuid.cc",
"lbr.cc",
]
deps = [ "$zx/system/ulib/fbl" ]
public_deps = [
# <lib/arch/x86/cpuid.h> has #include <hwreg/bitfields.h>.
"$zx/system/ulib/hwreg:headers",
]
if (is_host) {
deps += [ "host" ]
public_deps += [ "host:headers" ]
} else {
# The per-CPU subdirectory is a separate library() target but it shares
# (and overrides) the <lib/arch/...> header name space and users of this
# library need never realize it's distinct.
deps += [ zircon_cpu ]
public_deps += [
":gen-x86-msr-asm",
"$zircon_cpu:headers",
]
}
}
}
hwreg_asm_header("gen-x86-msr-asm") {
visibility = [ ":*" ]
output_name = "lib/arch/x86/msr-asm.h"
sources = [ "gen-x86-msr-asm.cc" ]
deps = [ ":arch" ]
}