Zephyr API Documentation 4.4.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
test_asm_inline_gcc.h
Go to the documentation of this file.
1/* GCC specific test inline assembler functions and macros */
2
3/*
4 * Copyright (c) 2015, Wind River Systems, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef _TEST_ASM_INLINE_GCC_H
10#define _TEST_ASM_INLINE_GCC_H
11
12#include <zephyr/sys/barrier.h>
13
14#if !defined(__GNUC__)
15#error test_asm_inline_gcc.h goes only with GCC
16#endif
17
18#if defined(CONFIG_X86)
19static inline void timestamp_serialize(void)
20{
21 __asm__ __volatile__ (/* serialize */
22 "xorl %%eax,%%eax;\n\t"
23 "cpuid;\n\t"
24 :
25 :
26 : "%eax", "%ebx", "%ecx", "%edx");
27}
28#elif defined(CONFIG_CPU_ARM9) || \
29 defined(CONFIG_CPU_CORTEX_M) || \
30 defined(CONFIG_CPU_AARCH32_CORTEX_R) || \
31 defined(CONFIG_CPU_AARCH32_CORTEX_A) || \
32 defined(CONFIG_CPU_CORTEX_A) || \
33 defined(CONFIG_CPU_AARCH64_CORTEX_R)
34static inline void timestamp_serialize(void)
35{
37}
38#elif defined(CONFIG_ARC)
39#define timestamp_serialize()
40#elif defined(CONFIG_ARCH_POSIX)
41#define timestamp_serialize()
42#elif defined(CONFIG_XTENSA)
43#define timestamp_serialize()
44#elif defined(CONFIG_RISCV)
45#define timestamp_serialize()
46#elif defined(CONFIG_SPARC)
47#define timestamp_serialize()
48#elif defined(CONFIG_MIPS)
49#define timestamp_serialize()
50#elif defined(CONFIG_RX)
51#define timestamp_serialize()
52#elif defined(CONFIG_OPENRISC)
53#define timestamp_serialize()
54#else
55#error implementation of timestamp_serialize() not provided for your CPU target
56#endif
57
58#endif /* _TEST_ASM_INLINE_GCC_H */
static ALWAYS_INLINE void barrier_isync_fence_full(void)
Full/sequentially-consistent instruction synchronization barrier.
Definition barrier.h:92
static void timestamp_serialize(void)
Definition test_asm_inline_other.h:15