14#ifndef ZEPHYR_INCLUDE_ARCH_NIOS2_ARCH_H_
15#define ZEPHYR_INCLUDE_ARCH_NIOS2_ARCH_H_
28#define ARCH_STACK_PTR_ALIGN 4
42#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
44 Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
47extern void z_irq_spurious(
const void *unused);
51 unsigned int key, tmp;
54 "rdctl %[key], status\n\t"
56 "and %[tmp], %[key], %[tmp]\n\t"
57 "wrctl status, %[tmp]\n\t"
58 : [
key]
"=r" (
key), [tmp]
"=r" (tmp)
75#if (ALT_CPU_NUM_OF_SHADOW_REG_SETS > 0) || \
76 (defined ALT_CPU_EIC_PRESENT) || \
77 (defined ALT_CPU_MMU_PRESENT) || \
78 (defined ALT_CPU_MPU_PRESENT)
80 "andi %[key], %[key], 1\n\t"
81 "beq %[key], zero, 1f\n\t"
82 "rdctl %[key], status\n\t"
83 "ori %[key], %[key], 1\n\t"
84 "wrctl status, %[key]\n\t"
90 "wrctl status, %[key]"
125typedef struct __esf z_arch_esf_t;
127FUNC_NORETURN
void z_SysFatalErrorHandler(
unsigned int reason,
128 const z_arch_esf_t *esf);
130FUNC_NORETURN
void z_NanoFatalErrorHandler(
unsigned int reason,
131 const z_arch_esf_t *esf);
164#define NIOS2_BADADDR_CAUSE_MASK \
165 (BIT(NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR) | \
166 BIT(NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR) | \
167 BIT(NIOS2_EXCEPTION_MISALIGNED_TARGET_PC) | \
168 BIT(NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION) | \
169 BIT(NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION) | \
170 BIT(NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION) | \
171 BIT(NIOS2_EXCEPTION_ECC_DATA_ERR))
183 __asm__
volatile(
"nop");
Per-arch thread definition.
#define ALWAYS_INLINE
Definition: common.h:116
static ALWAYS_INLINE void arch_nop(void)
Definition: arch.h:181
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Definition: arch.h:49
static ALWAYS_INLINE void arch_irq_unlock(unsigned int key)
Definition: arch.h:64
void arch_irq_disable(unsigned int irq)
uint32_t sys_clock_cycle_get_32(void)
nios2_exception_cause
Definition: arch.h:133
@ NIOS2_EXCEPTION_ECC_DATA_CACHE_WRITEBACK_ERR
Definition: arch.h:157
@ NIOS2_EXCEPTION_UNKNOWN
Definition: arch.h:134
@ NIOS2_EXCEPTION_TLB_WRITE_PERM_VIOLATION
Definition: arch.h:150
@ NIOS2_EXCEPTION_ECC_TLB_ERR
Definition: arch.h:153
@ NIOS2_EXCEPTION_MPU_INST_REGION_VIOLATION
Definition: arch.h:151
@ NIOS2_EXCEPTION_SUPERVISOR_ONLY_DATA_ADDR
Definition: arch.h:146
@ NIOS2_EXCEPTION_CPU_ONLY_RESET_REQUEST
Definition: arch.h:136
@ NIOS2_EXCEPTION_TLB_MISS
Definition: arch.h:147
@ NIOS2_EXCEPTION_ILLEGAL_INST
Definition: arch.h:140
@ NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST_ADDR
Definition: arch.h:144
@ NIOS2_EXCEPTION_UNIMPLEMENTED_INST
Definition: arch.h:139
@ NIOS2_EXCEPTION_MPU_DATA_REGION_VIOLATION
Definition: arch.h:152
@ NIOS2_EXCEPTION_ECC_FETCH_ERR
Definition: arch.h:154
@ NIOS2_EXCEPTION_MISALIGNED_TARGET_PC
Definition: arch.h:142
@ NIOS2_EXCEPTION_TLB_READ_PERM_VIOLATION
Definition: arch.h:149
@ NIOS2_EXCEPTION_DIVISION_ERROR
Definition: arch.h:143
@ NIOS2_EXCEPTION_MISALIGNED_DATA_ADDR
Definition: arch.h:141
@ NIOS2_EXCEPTION_SUPERVISOR_ONLY_INST
Definition: arch.h:145
@ NIOS2_EXCEPTION_TLB_EXECUTE_PERM_VIOLATION
Definition: arch.h:148
@ NIOS2_EXCEPTION_TRAP_INST
Definition: arch.h:138
@ NIOS2_EXCEPTION_ECC_REGISTER_FILE_ERR
Definition: arch.h:155
@ NIOS2_EXCEPTION_INTERRUPT
Definition: arch.h:137
@ NIOS2_EXCEPTION_ECC_DATA_ERR
Definition: arch.h:156
@ NIOS2_EXCEPTION_RESET
Definition: arch.h:135
static uint32_t arch_k_cycle_get_32(void)
Definition: arch.h:176
void arch_irq_enable(unsigned int irq)
static ALWAYS_INLINE bool arch_irq_unlocked(unsigned int key)
Definition: arch.h:96
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Software-managed ISR table.