blob: 5868ff1514ef8ecbbd111995801943399086edec [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/unification/global_variables.gni")
# TODO(mcgrathr): declare_args() { qemu_boot_format = "multiboot"/"zeropage" }
if (current_cpu == "x64") {
# Environment for building raw QEMU kernels.
# x86-64 QEMU loads 32-bit (i686) binaries (Multiboot or Linux zero page).
qemu_environment = "//zircon/kernel/arch/x86/phys:kernel.phys32"
} else {
# Environment for building raw QEMU kernels (64-bit physical memory).
qemu_environment = "//zircon/kernel/phys:kernel.phys_$current_cpu"
}
if (toolchain.environment == "kernel.phys") {
# What to link into a raw QEMU kernel executable (direct physical memory).
qemu_deps = [ "//zircon/kernel/phys:qemu-header" ]
} else {
assert(current_cpu == "x64")
assert(toolchain.environment == get_label_info(qemu_environment, "name"),
"Bad toolchain environment ${toolchain.environment}, expected " +
get_label_info(qemu_environment, "name"))
# What to link into a raw QEMU kernel executable (x86-32 Multiboot).
qemu_deps = [ "//zircon/kernel/arch/x86/phys:multiboot" ]
}
# zbi_test() $timeout value for short-running tests launched via QEMU.
qemu_short_timeout = 30