Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
|
4.1.99 |
Reading Binary Descriptors of other images. More...
Typedefs | |
typedef int(* | bindesc_callback_t) (const struct bindesc_entry *entry, void *user_data) |
Callback type to be called on descriptors found during a walk. | |
Functions | |
int | bindesc_open_memory_mapped_flash (struct bindesc_handle *handle, size_t offset) |
Open an image's binary descriptors for reading, from a memory mapped flash. | |
int | bindesc_open_ram (struct bindesc_handle *handle, const uint8_t *address, size_t max_size) |
Open an image's binary descriptors for reading, from RAM. | |
int | bindesc_open_flash (struct bindesc_handle *handle, size_t offset, const struct device *flash_device) |
Open an image's binary descriptors for reading, from flash. | |
int | bindesc_foreach (struct bindesc_handle *handle, bindesc_callback_t callback, void *user_data) |
Walk the binary descriptors and run a user defined callback on each of them. | |
int | bindesc_find_str (struct bindesc_handle *handle, uint16_t id, const char **result) |
Find a specific descriptor of type string. | |
int | bindesc_find_uint (struct bindesc_handle *handle, uint16_t id, const uint32_t **result) |
Find a specific descriptor of type uint. | |
int | bindesc_find_bytes (struct bindesc_handle *handle, uint16_t id, const uint8_t **result, size_t *result_size) |
Find a specific descriptor of type bytes. | |
int | bindesc_get_size (struct bindesc_handle *handle, size_t *result) |
Get the size of an image's binary descriptors. | |
Reading Binary Descriptors of other images.
typedef int(* bindesc_callback_t) (const struct bindesc_entry *entry, void *user_data) |
#include <zephyr/bindesc.h>
Callback type to be called on descriptors found during a walk.
entry | Current descriptor |
user_data | The user_data given to bindesc_foreach |
int bindesc_find_bytes | ( | struct bindesc_handle * | handle, |
uint16_t | id, | ||
const uint8_t ** | result, | ||
size_t * | result_size ) |
#include <zephyr/bindesc.h>
Find a specific descriptor of type bytes.
handle | An initialized bindesc handle |
id | ID to search for |
result | Pointer to the found bytes |
result_size | Size of the found bytes |
0 | If the descriptor was found |
-ENOENT | If the descriptor was not found |
int bindesc_find_str | ( | struct bindesc_handle * | handle, |
uint16_t | id, | ||
const char ** | result ) |
#include <zephyr/bindesc.h>
Find a specific descriptor of type string.
handle | An initialized bindesc handle |
id | ID to search for |
result | Pointer to the found string |
0 | If the descriptor was found |
-ENOENT | If the descriptor was not found |
int bindesc_find_uint | ( | struct bindesc_handle * | handle, |
uint16_t | id, | ||
const uint32_t ** | result ) |
#include <zephyr/bindesc.h>
Find a specific descriptor of type uint.
handle | An initialized bindesc handle |
id | ID to search for |
result | Pointer to the found uint |
0 | If the descriptor was found |
-ENOENT | If the descriptor was not found |
int bindesc_foreach | ( | struct bindesc_handle * | handle, |
bindesc_callback_t | callback, | ||
void * | user_data ) |
#include <zephyr/bindesc.h>
Walk the binary descriptors and run a user defined callback on each of them.
handle | An initialized bindesc handle |
callback | A user defined callback to be called on each descriptor |
user_data | User defined data to be given to the callback |
int bindesc_get_size | ( | struct bindesc_handle * | handle, |
size_t * | result ) |
#include <zephyr/bindesc.h>
Get the size of an image's binary descriptors.
Walks the binary descriptor structure to caluculate the total size of the structure in bytes. This is useful, for instance, if the whole structure is to be copied to RAM.
handle | An initialized bindesc handle |
result | Pointer to write result to |
int bindesc_open_flash | ( | struct bindesc_handle * | handle, |
size_t | offset, | ||
const struct device * | flash_device ) |
#include <zephyr/bindesc.h>
Open an image's binary descriptors for reading, from flash.
Initializes a bindesc handle for subsequent calls to bindesc API. As opposed to reading bindesc from RAM or memory mapped flash, this backend requires reading the data from flash to an internal buffer using the flash API
handle | Bindesc handle to be given to subsequent calls |
offset | The offset from the beginning of the flash that the bindesc magic can be found at |
flash_device | Flash device to read descriptors from |
0 | On success |
-ENOENT | If no bindesc magic was found at the given offset |
int bindesc_open_memory_mapped_flash | ( | struct bindesc_handle * | handle, |
size_t | offset ) |
#include <zephyr/bindesc.h>
Open an image's binary descriptors for reading, from a memory mapped flash.
Initializes a bindesc handle for subsequent calls to bindesc API. Memory mapped flash is any flash that can be directly accessed by the CPU, without needing to use the flash API for copying the data to RAM.
handle | Bindesc handle to be given to subsequent calls |
offset | The offset from the beginning of the flash that the bindesc magic can be found at |
0 | On success |
-ENOENT | If no bindesc magic was found at the given offset |
int bindesc_open_ram | ( | struct bindesc_handle * | handle, |
const uint8_t * | address, | ||
size_t | max_size ) |
#include <zephyr/bindesc.h>
Open an image's binary descriptors for reading, from RAM.
Initializes a bindesc handle for subsequent calls to bindesc API. It's assumed that the whole bindesc context was copied to RAM prior to calling this function, either by the user or by a bootloader.
handle | Bindesc handle to be given to subsequent calls |
address | The address that the bindesc magic can be found at |
max_size | Maximum size of the given buffer |
0 | On success |
-ENOENT | If no bindesc magic was found at the given address |
-EINVAL | If the given address is not aligned |