blob: d273dd0dd7d54a99c2aa65c2812d67f5d96d2bf1 [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/zircon/migrated_targets.gni")
import("//zircon/system/ulib/hwreg/hwreg_asm_header.gni")
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 = []
public_deps = [
# <lib/arch/x86/cpuid.h> has #include <hwreg/bitfields.h>.
"//zircon/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-arm64-feature-asm",
":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" ]
}
hwreg_asm_header("gen-arm64-feature-asm") {
visibility = [ ":*" ]
output_name = "lib/arch/arm64/feature-asm.h"
sources = [ "gen-arm64-feature-asm.cc" ]
deps = [ ":arch" ]
}