Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
misc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013-2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
14#ifndef ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_
15#define ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#ifndef _ASMLANGUAGE
23
24static inline uint32_t arch_k_cycle_get_32(void)
25{
27}
28
30
31static inline uint64_t arch_k_cycle_get_64(void)
32{
34}
35
36static ALWAYS_INLINE void arch_nop(void)
37{
38 __asm__ volatile("nop");
39}
40
41#if defined(CONFIG_USERSPACE)
42extern bool z_arm_thread_is_in_user_mode(void);
43#endif
44
45#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_HOOK)
46/* Prototype of a hook that can be enabled to be called every time the CPU is
47 * made idle (the calls will be done from k_cpu_idle() and k_cpu_atomic_idle()).
48 * If this hook returns false, the CPU is prevented from entering the actual
49 * sleep (the WFE/WFI instruction is skipped).
50 */
51bool z_arm_on_enter_cpu_idle(void);
52#endif
53
54#if defined(CONFIG_ARM_ON_ENTER_CPU_IDLE_PREPARE_HOOK)
55/* Prototype of a hook that can be enabled to be called every time the CPU is
56 * made idle (the calls will be done from k_cpu_idle() and k_cpu_atomic_idle()).
57 * The function is called before interrupts are disabled and can prepare to
58 * upcoming call to z_arm_on_enter_cpu_idle.
59 */
60void z_arm_on_enter_cpu_idle_prepare(void);
61#endif
62
63#endif
64
65#ifdef __cplusplus
66}
67#endif
68
69#endif /* ZEPHYR_INCLUDE_ARCH_ARM_MISC_H_ */
uint64_t sys_clock_cycle_get_64(void)
uint32_t sys_clock_cycle_get_32(void)
static uint32_t arch_k_cycle_get_32(void)
Definition misc.h:26
static uint64_t arch_k_cycle_get_64(void)
Definition misc.h:33
static ALWAYS_INLINE void arch_nop(void)
Definition misc.h:36
#define ALWAYS_INLINE
Definition common.h:129
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91