Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
arch.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Cadence Design Systems, Inc.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
13#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_ARCH_H_
14#define ZEPHYR_INCLUDE_ARCH_XTENSA_ARCH_H_
15
16#include <irq.h>
17
18#include <devicetree.h>
19#if !defined(_ASMLANGUAGE) && !defined(__ASSEMBLER__)
20#include <zephyr/types.h>
21#include <toolchain.h>
23#include <arch/common/sys_io.h>
24#include <arch/common/ffs.h>
25#include <sw_isr_table.h>
26#include <arch/xtensa/thread.h>
27#include <arch/xtensa/irq.h>
28#include <xtensa/config/core.h>
30#include <arch/xtensa/gdbstub.h>
31
32#ifdef CONFIG_KERNEL_COHERENCE
33#define ARCH_STACK_PTR_ALIGN XCHAL_DCACHE_LINESIZE
34#else
35#define ARCH_STACK_PTR_ALIGN 16
36#endif
37
38/* Xtensa GPRs are often designated by two different names */
39#define sys_define_gpr_with_alias(name1, name2) union { uint32_t name1, name2; }
40
41#include <arch/xtensa/exc.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/* internal routine documented in C file, needed by IRQ_CONNECT() macro */
48extern void z_irq_priority_set(uint32_t irq, uint32_t prio, uint32_t flags);
49
50#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
51{ \
52 Z_ISR_DECLARE(irq_p, flags_p, isr_p, isr_param_p); \
53}
54
55/* Spurious interrupt handler. Throws an error if called */
56extern void z_irq_spurious(const void *unused);
57
58#define XTENSA_ERR_NORET
59
61
62static inline uint32_t arch_k_cycle_get_32(void)
63{
65}
66
68
69static inline uint64_t arch_k_cycle_get_64(void)
70{
72}
73
74static ALWAYS_INLINE void arch_nop(void)
75{
76 __asm__ volatile("nop");
77}
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* !defined(_ASMLANGUAGE) && !defined(__ASSEMBLER__) */
84
85#endif /* ZEPHYR_INCLUDE_ARCH_XTENSA_ARCH_H_ */
#define ALWAYS_INLINE
Definition: common.h:124
Devicetree main header.
flags
Definition: http_parser.h:131
Public interface for configuring interrupts.
uint64_t sys_clock_cycle_get_64(void)
uint32_t sys_clock_cycle_get_32(void)
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
Software-managed ISR table.
Macros to abstract toolchain specific capabilities.
static ALWAYS_INLINE void arch_nop(void)
Definition: arch.h:74
static uint32_t arch_k_cycle_get_32(void)
Definition: arch.h:62
static uint64_t arch_k_cycle_get_64(void)
Definition: arch.h:69
Xtensa public exception handling.