ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_hw_intrinsics.h
Go to the documentation of this file.
1
37
38#pragma once
39
40#include <stdint.h>
41
42#ifndef RA8_OFF_TARGET
43
60static inline void ra8_hw_wfi(void)
61{
62 __asm__ volatile("wfi" ::: "memory");
63}
64
81static inline void ra8_hw_dsb(void)
82{
83 __asm__ volatile("dsb 0xF" ::: "memory");
84}
85
102static inline void ra8_hw_isb(void)
103{
104 __asm__ volatile("isb 0xF" ::: "memory");
105}
106
123static inline void ra8_hw_nop(void)
124{
125 __asm__ volatile("nop");
126}
127
143static inline void ra8_hw_irq_enable(void)
144{
145 __asm__ volatile("cpsie i" ::: "memory");
146}
147
162static inline void ra8_hw_irq_disable(void)
163{
164 __asm__ volatile("cpsid i" ::: "memory");
165}
166
184static inline void ra8_hw_wait_for_reset(void)
185{
186 __asm__ volatile("dsb 0xF" ::: "memory");
187 for (;;) { /* GCOVR_EXCL_LINE -- never reached on target; host uses the stub. */
188 }
189}
190
191#else /* RA8_OFF_TARGET -- host bodies live in the stub TU */
192
193/* Host build: ra8_hw_wfi is defined in tests/mocks/src/ra8_host_asm_stub.c;
194 see implementation for details. */
195void ra8_hw_wfi(void);
196/* Host build: ra8_hw_dsb is defined in tests/mocks/src/ra8_host_asm_stub.c;
197 see implementation for details. */
198void ra8_hw_dsb(void);
199/* Host build: ra8_hw_isb is defined in tests/mocks/src/ra8_host_asm_stub.c;
200 see implementation for details. */
201void ra8_hw_isb(void);
202/* Host build: ra8_hw_nop is defined in tests/mocks/src/ra8_host_asm_stub.c;
203 see implementation for details. */
204void ra8_hw_nop(void);
205/* Host build: ra8_hw_irq_enable is defined in tests/mocks/src/ra8_host_asm_stub.c;
206 see implementation for details. */
207void ra8_hw_irq_enable(void);
208/* Host build: ra8_hw_irq_disable is defined in tests/mocks/src/ra8_host_asm_stub.c;
209 see implementation for details. */
210void ra8_hw_irq_disable(void);
211/* Host build: ra8_hw_wait_for_reset is defined in tests/mocks/src/ra8_host_asm_stub.c;
212 see implementation for details. */
213void ra8_hw_wait_for_reset(void);
214
215#endif /* RA8_OFF_TARGET */
static void ra8_hw_irq_enable(void)
Enable maskable interrupts (clear PRIMASK).
static void ra8_hw_dsb(void)
Data Synchronisation Barrier (full system).
static void ra8_hw_irq_disable(void)
Disable maskable interrupts (set PRIMASK).
static void ra8_hw_nop(void)
No-operation used to pad a calibrated busy-wait.
static void ra8_hw_wait_for_reset(void)
Barrier-then-spin used after requesting a system reset.
static void ra8_hw_isb(void)
Instruction Synchronisation Barrier (full system).
static void ra8_hw_wfi(void)
Wait For Interrupt: place the core in low-power wait.