Tamas Ban | a9de4a6 | 2018-09-18 08:09:45 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __BOOT_RECORD_H__ |
| 9 | #define __BOOT_RECORD_H__ |
| 10 | |
| 11 | #include <stdint.h> |
| 12 | #include <stddef.h> |
| 13 | #include <limits.h> |
| 14 | |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
| 19 | /*! |
| 20 | * \enum shared_data_err_t |
| 21 | * |
| 22 | * \brief Return values for adding data entry to shared memory area |
| 23 | */ |
| 24 | enum shared_memory_err_t { |
| 25 | SHARED_MEMORY_OK = 0, |
| 26 | SHARED_MEMORY_OVERFLOW = 1, |
| 27 | SHARED_MEMORY_OVERWRITE = 2, |
| 28 | |
| 29 | /* This is used to force the maximum size */ |
| 30 | TLV_TYPE_MAX = INT_MAX |
| 31 | }; |
| 32 | |
| 33 | /*! |
| 34 | * \brief Add a data item to the shared data area between bootloader and |
| 35 | * runtime SW |
| 36 | * |
| 37 | * \param[in] major_type TLV major type, identify consumer |
| 38 | * \param[in] minor_type TLV minor type, identify TLV type |
| 39 | * \param[in] size length of added data |
| 40 | * \param[in] data pointer to data |
| 41 | * |
| 42 | * \return Returns error code as specified in \ref shared_memory_err_t |
| 43 | */ |
| 44 | enum shared_memory_err_t |
| 45 | boot_add_data_to_shared_area(uint8_t major_type, |
| 46 | uint8_t minor_type, |
| 47 | size_t size, |
| 48 | const uint8_t *data); |
| 49 | |
| 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif /* __BOOT_RECORD_H__ */ |