Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Shared Memory

Shared memory transport definitions for SCMI. More...

Files

file  shmem.h
 Header file for the SCMI Shared Memory.

Functions

int scmi_shmem_write_message (const struct device *shmem, struct scmi_message *msg, bool use_polling)
 Write a message in the SHMEM area.
int scmi_shmem_read_hdr (const struct device *shmem, uint32_t *hdr)
 Read a message header from a SHMEM area.
int scmi_shmem_read_message (const struct device *shmem, struct scmi_message *msg)
 Read a message from a SHMEM area.
void scmi_shmem_update_flags (const struct device *shmem, uint32_t mask, uint32_t val)
 Update the channel flags.
uint32_t scmi_shmem_channel_status (const struct device *shmem)
 Read a channel's status.
int scmi_shmem_vendor_write_message (struct scmi_shmem_layout *layout)
 Process vendor specific features when writing message.
int scmi_shmem_vendor_read_message (const struct scmi_shmem_layout *layout)
 Process vendor specific features when reading message.
void scmi_shmem_mark_channel_free (const struct device *dev)
 Mark a SHMEM channel as free (acknowledge message consumption).

Detailed Description

Shared memory transport definitions for SCMI.

Function Documentation

◆ scmi_shmem_channel_status()

uint32_t scmi_shmem_channel_status ( const struct device * shmem)

#include <shmem.h>

Read a channel's status.

Parameters
shmemPointer to shmem device

◆ scmi_shmem_mark_channel_free()

void scmi_shmem_mark_channel_free ( const struct device * dev)

#include <shmem.h>

Mark a SHMEM channel as free (acknowledge message consumption).

Per SCMI spec: Bit[0]=1 means FREE, Bit[0]=0 means BUSY. This helper sets the BUSY bit to indicate the channel is free.

Parameters
devpointer to shmem device

◆ scmi_shmem_read_hdr()

int scmi_shmem_read_hdr ( const struct device * shmem,
uint32_t * hdr )

#include <shmem.h>

Read a message header from a SHMEM area.

Parameters
shmempointer to shmem device
hdrmessage to write the data into
Return values
0if successful
negativeerrno if failure

◆ scmi_shmem_read_message()

int scmi_shmem_read_message ( const struct device * shmem,
struct scmi_message * msg )

#include <shmem.h>

Read a message from a SHMEM area.

Parameters
shmemPointer to shmem device
msgMessage to write the data into
Returns
0 on success, negative errno value on failure.

◆ scmi_shmem_update_flags()

void scmi_shmem_update_flags ( const struct device * shmem,
uint32_t mask,
uint32_t val )

#include <shmem.h>

Update the channel flags.

Parameters
shmemPointer to shmem device
maskValue to negate and bitwise-and the old channel flags value
valValue to bitwise and with the mask and bitwise-or with the masked old value

◆ scmi_shmem_vendor_read_message()

int scmi_shmem_vendor_read_message ( const struct scmi_shmem_layout * layout)

#include <shmem.h>

Process vendor specific features when reading message.

Parameters
layoutLayout of the message
Returns
0 on success, negative errno value on failure.

◆ scmi_shmem_vendor_write_message()

int scmi_shmem_vendor_write_message ( struct scmi_shmem_layout * layout)

#include <shmem.h>

Process vendor specific features when writing message.

Parameters
layoutLayout of the message
Returns
0 on success, negative errno value on failure.

◆ scmi_shmem_write_message()

int scmi_shmem_write_message ( const struct device * shmem,
struct scmi_message * msg,
bool use_polling )

#include <shmem.h>

Write a message in the SHMEM area.

Parameters
shmemPointer to shmem device
msgMessage to write
use_pollingtrue if polling should be used, false otherwise
Returns
0 on success, negative errno value on failure.