![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
Go to the source code of this file.
Macros | |
#define | ITS_FILE_ID_SIZE 12 |
#define | ITS_DEFAULT_EMPTY_BUFF_VAL 0 |
#define | ITS_UTILS_BOUND_CHECK(err_msg, data_size, data_buf_size) typedef char err_msg[(data_size <= data_buf_size)*2 - 1] |
Macro to check, at compilation time, if data fits in data buffer. More... | |
#define | ITS_UTILS_MIN(x, y) (((x) < (y)) ? (x) : (y)) |
Evaluates to the minimum of the two parameters. More... | |
#define | ITS_UTILS_MAX(x, y) (((x) > (y)) ? (x) : (y)) |
Evaluates to the maximum of the two parameters. More... | |
#define | ITS_UTILS_ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) |
Aligns a value up to the provided alignment. More... | |
#define | ITS_UTILS_IS_ALIGNED(x, a) (((x) & ((a) - 1)) == 0) |
Checks that a value is aligned to the provided alignment. More... | |
Functions | |
psa_status_t | its_utils_check_contained_in (size_t superset_size, size_t subset_offset, size_t subset_size) |
Checks if a subset region is fully contained within a superset region. More... | |
psa_status_t | its_utils_validate_fid (const uint8_t *fid) |
Validates file ID. More... | |
#define ITS_DEFAULT_EMPTY_BUFF_VAL 0 |
Definition at line 21 of file its_utils.h.
#define ITS_FILE_ID_SIZE 12 |
Definition at line 20 of file its_utils.h.
#define ITS_UTILS_ALIGN | ( | x, | |
a | |||
) | (((x) + ((a) - 1)) & ~((a) - 1)) |
Aligns a value up to the provided alignment.
[in] | x | Value to be aligned |
[in] | a | Alignment (must be a power of two) |
x
that is aligned to a
. Definition at line 56 of file its_utils.h.
#define ITS_UTILS_BOUND_CHECK | ( | err_msg, | |
data_size, | |||
data_buf_size | |||
) | typedef char err_msg[(data_size <= data_buf_size)*2 - 1] |
Macro to check, at compilation time, if data fits in data buffer.
[in] | err_msg | Error message which will be displayed in first instance if the error is triggered |
[in] | data_size | Data size to check if it fits |
[in] | data_buf_size | Size of the data buffer |
Definition at line 35 of file its_utils.h.
#define ITS_UTILS_IS_ALIGNED | ( | x, | |
a | |||
) | (((x) & ((a) - 1)) == 0) |
Checks that a value is aligned to the provided alignment.
[in] | x | Value to check for alignment |
[in] | a | Alignment (must be a power of two) |
x
is aligned to a
, 0 otherwise. Definition at line 66 of file its_utils.h.
#define ITS_UTILS_MAX | ( | x, | |
y | |||
) | (((x) > (y)) ? (x) : (y)) |
Evaluates to the maximum of the two parameters.
Definition at line 46 of file its_utils.h.
#define ITS_UTILS_MIN | ( | x, | |
y | |||
) | (((x) < (y)) ? (x) : (y)) |
Evaluates to the minimum of the two parameters.
Definition at line 41 of file its_utils.h.
psa_status_t its_utils_check_contained_in | ( | size_t | superset_size, |
size_t | subset_offset, | ||
size_t | subset_size | ||
) |
Checks if a subset region is fully contained within a superset region.
[in] | superset_size | Size of superset region |
[in] | subset_offset | Offset of start of subset region from start of superset region |
[in] | subset_size | Size of subset region |
PSA_SUCCESS | The subset is contained within the superset |
PSA_ERROR_INVALID_ARGUMENT | Otherwise |
Definition at line 10 of file its_utils.c.
psa_status_t its_utils_validate_fid | ( | const uint8_t * | fid | ) |
Validates file ID.
[in] | fid | File ID |
Definition at line 30 of file its_utils.c.