Software APIs
hart_polyfills.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 
5 #define _DEFAULT_SOURCE // Make sure we get usleep() from unistd.h.
6 
7 #include <stddef.h>
8 #include <unistd.h>
9 
11 
12 void busy_spin_micros(uint32_t usec) { usleep(usec); }
13 
14 // Because this function is defined by libc as well, we do not bother
15 // defining abort() on-target.
16 //
17 // noreturn void abort(void);
18 
19 // `extern` declarations to give the inline functions in the
20 // corresponding header a link location.
21 
22 extern void wait_for_interrupt(void);
23 extern void icache_invalidate(void);