blob: 4c2fae6e94d764ac8b17885eafc29fb4d3f8b324 [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
#include <ktl/type_traits.h>
// A small collection of functions used to deal with architecture specific
// quirks in sections of code which are generally architecture independent.
// If we have any A73 cores in the system, we need to work around
// Cortex-A73 erratum 858921, described in:
// Right now, this means that we need a special version of current_ticks() in
// the kernel, and to inject a special version of zx_ticks_get in the VDSO if
// our clients are not going to make a syscall in order to read the tick
// counter.
// Do not call this function until all of the cores have been started and had a
// chance to identify themselves. Use mp_wait_for_all_cpus_started
// (kernel/mp.h) to establish this if needed.
#if __aarch64__
bool arch_quirks_needs_arm_erratum_858921_mitigation();
template <typename T = void>
static inline bool arch_quirks_needs_arm_erratum_858921_mitigation() {
static_assert(!ktl::is_same_v<T, T>,
"Do not call arch_quirks_needs_arm_erratum_858921_mitigation when building "
"for non-ARM architectures");
return false;