This change adds `k_cycle_get_64()` on platforms that support a 64-bit cycle counter. The interface functions `arch_k_cycle_get_64()` and `sys_clock_cycle_get_64()` are also introduced. Fixes #39934 Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
52 lines
929 B
C
52 lines
929 B
C
/*
|
|
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief ARM AArch32 public kernel miscellaneous
|
|
*
|
|
* ARM AArch32-specific kernel miscellaneous interface. Included by arm/arch.h.
|
|
*/
|
|
|
|
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_MISC_H_
|
|
#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_MISC_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
extern uint32_t sys_clock_cycle_get_32(void);
|
|
|
|
static inline uint32_t arch_k_cycle_get_32(void)
|
|
{
|
|
return sys_clock_cycle_get_32();
|
|
}
|
|
|
|
extern uint64_t sys_clock_cycle_get_64(void);
|
|
|
|
static inline uint64_t arch_k_cycle_get_64(void)
|
|
{
|
|
return sys_clock_cycle_get_64();
|
|
}
|
|
|
|
static ALWAYS_INLINE void arch_nop(void)
|
|
{
|
|
__asm__ volatile("nop");
|
|
}
|
|
|
|
#if defined(CONFIG_USERSPACE)
|
|
extern bool z_arm_thread_is_in_user_mode(void);
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_MISC_H_ */
|