Software APIs
hart.c
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
6
7#include <stdbool.h>
8
12
13void busy_spin_micros(uint32_t usec) {
14 uint64_t start = ibex_mcycle_read();
15 uint64_t cycles = to_cpu_cycles(usec);
16 while ((ibex_mcycle_read() - start) < cycles) {
17 }
18}
19
20noreturn void abort(void) {
21 while (true) {
22 wait_for_interrupt();
23 }
24}
25
26// `extern` declarations to give the inline functions in the
27// corresponding header a link location.
28
29extern void wait_for_interrupt(void);
30extern void icache_invalidate(void);