Software APIs
dif_cheriot_autogen.h File Reference

CHERIOT Device Interface Functions More...

#include <stdbool.h>
#include <stdint.h>
#include "sw/device/lib/base/macros.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/device/lib/dif/dif_base.h"
#include "hw/top/dt/cheriot.h"

Go to the source code of this file.

Data Structures

struct  dif_cheriot
 A handle to cheriot. More...
 

Typedefs

typedef struct dif_cheriot dif_cheriot_t
 A handle to cheriot.
 
typedef enum dif_cheriot_alert dif_cheriot_alert_t
 A cheriot alert type.
 

Enumerations

enum  dif_cheriot_alert { kDifCheriotAlertFatalFault = 0 }
 A cheriot alert type. More...
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_init (mmio_region_t base_addr, dif_cheriot_t *cheriot)
 Creates a new handle for a(n) cheriot peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_init_from_dt (dt_cheriot_t dt, dif_cheriot_t *cheriot)
 Creates a new handle for a(n) cheriot peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_get_dt (const dif_cheriot_t *cheriot, dt_cheriot_t *dt)
 Get the DT handle from this DIF.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_alert_force (const dif_cheriot_t *cheriot, dif_cheriot_alert_t alert)
 Forces a particular alert, causing it to be escalated as if the hardware had raised it.
 

Detailed Description

CHERIOT Device Interface Functions

Definition in file dif_cheriot_autogen.h.


Data Structure Documentation

◆ dif_cheriot

struct dif_cheriot

A handle to cheriot.

This type should be treated as opaque by users.

Definition at line 37 of file dif_cheriot_autogen.h.

Data Fields
mmio_region_t base_addr The base address for the cheriot hardware registers.
dt_cheriot_t dt The instance, set to kDtCheriotCount if not initialized through dif_cheriot_init_from_dt.

Typedef Documentation

◆ dif_cheriot_t

typedef struct dif_cheriot dif_cheriot_t

A handle to cheriot.

This type should be treated as opaque by users.

Enumeration Type Documentation

◆ dif_cheriot_alert

A cheriot alert type.

Enumerator
kDifCheriotAlertFatalFault 

This fatal alert is triggered when an integrity fault is detected, when the meta SRAM path returns a device error, or when the tag filter's transaction FIFO reports a pointer error.

Definition at line 98 of file dif_cheriot_autogen.h.

Function Documentation

◆ dif_cheriot_alert_force()

OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_alert_force ( const dif_cheriot_t * cheriot,
dif_cheriot_alert_t alert )

Forces a particular alert, causing it to be escalated as if the hardware had raised it.

Parameters
cheriotA cheriot handle.
alertThe alert to force.
Returns
The result of the operation.

Definition at line 62 of file dif_cheriot_autogen.c.

◆ dif_cheriot_get_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_get_dt ( const dif_cheriot_t * cheriot,
dt_cheriot_t * dt )

Get the DT handle from this DIF.

If this DIF was initialized by dif_cheriot_init_from_dt(dt, ..) then this function will return dt. Otherwise it will return an error.

Parameters
cheriotA cheriot handle.
[out]dtDT handle.
Returns
kDifBadArg if the DIF has no DT information, kDifOk otherwise.

Definition at line 52 of file dif_cheriot_autogen.c.

◆ dif_cheriot_init()

OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_init ( mmio_region_t base_addr,
dif_cheriot_t * cheriot )

Creates a new handle for a(n) cheriot peripheral.

This function does not actuate the hardware.

Parameters
base_addrThe MMIO base address of the cheriot peripheral.
[out]cheriotOut param for the initialized handle.
Returns
The result of the operation.

DEPRECATED This function exists solely for the transition to dt-based DIFs and will be removed in the future.

Definition at line 25 of file dif_cheriot_autogen.c.

◆ dif_cheriot_init_from_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_cheriot_init_from_dt ( dt_cheriot_t dt,
dif_cheriot_t * cheriot )

Creates a new handle for a(n) cheriot peripheral.

This function does not actuate the hardware.

Parameters
dtThe devicetable description of the device.
[out]cheriotOut param for the initialized handle.
Returns
The result of the operation.

Definition at line 39 of file dif_cheriot_autogen.c.