Software APIs
hart.h File Reference

This header provides functions for controlling the excution of a hart, such as halt-like functionality. More...

#include <stddef.h>
#include <stdint.h>
#include <stdnoreturn.h>
#include "sw/device/lib/base/macros.h"
#include "sw/device/lib/base/stdasm.h"

Go to the source code of this file.

Functions

void wait_for_interrupt (void)
 Hints to the processor that we don't have anything better to be doing, and to go into low-power mode until an interrupt is serviced.
 
void icache_invalidate (void)
 Invalidates the instruction cache.
 
void busy_spin_micros (uint32_t usec)
 Spin for at least the given number of microseconds.
 
noreturn void abort (void)
 Immediately halt program execution.
 

Detailed Description

This header provides functions for controlling the excution of a hart, such as halt-like functionality.

Definition in file hart.h.

Function Documentation

◆ abort()

noreturn void abort ( void )

Immediately halt program execution.

This function conforms to the semantics defined in ISO C11 S7.22.4.1.

Definition at line 20 of file hart.c.

◆ busy_spin_micros()

void busy_spin_micros ( uint32_t usec)

Spin for at least the given number of microseconds.

Parameters
usecDuration in microseconds.

Definition at line 12 of file hart_polyfills.c.

◆ icache_invalidate()

void icache_invalidate ( void )
inline

Invalidates the instruction cache.

Definition at line 36 of file hart.h.

◆ wait_for_interrupt()

void wait_for_interrupt ( void )
inline

Hints to the processor that we don't have anything better to be doing, and to go into low-power mode until an interrupt is serviced.

This function may behave as if it is a no-op.

Definition at line 27 of file hart.h.