cpu: Fix build for MacOS.

* The value of build environment variable KVM_ISA is serialized into
  the generated file `kvm_isa.hh'. This value should be a string, but on
  hosts where the KVM headers are not available, the default `None` is
  inserted. Changed the default value to the string `""` in this case.

* Added missing include for `std::array`.

Change-Id: I651122cc46fc9c0757f592b05f4b4cab285cb91f
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57889
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Richard Cooper
2022-03-03 18:08:39 +00:00
parent 2ced661aed
commit 48ed8407c9
2 changed files with 4 additions and 1 deletions

View File

@@ -40,7 +40,9 @@ with gem5_scons.Configure(main) as conf:
# we rely on exists since version 2.6.36 of the kernel, but somehow
# the KVM_API_VERSION does not reflect the change. We test for one of
# the types as a fall back.
conf.env['KVM_ISA'] = None
# The default value of KVM_ISA should serialize to a string in the
# C++ header and test False in Scons/Python.
conf.env['KVM_ISA'] = ''
if not conf.CheckHeader('linux/kvm.h', '<>'):
print("Info: Compatible header file <linux/kvm.h> not found, "
"disabling KVM support.")

View File

@@ -42,6 +42,7 @@
#ifndef __CPU_STATIC_INST_HH__
#define __CPU_STATIC_INST_HH__
#include <array>
#include <bitset>
#include <cstdint>
#include <memory>