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 
13 void 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 
20 noreturn void abort(void) {
21  while (true) {
23  }
24 }
25 
26 // `extern` declarations to give the inline functions in the
27 // corresponding header a link location.
28 
29 extern void wait_for_interrupt(void);
30 extern void icache_invalidate(void);