blob: f7a63087f14fa46e5598ef6a686db55f37ba47a2 [file] [log] [blame]
Tamas Bana9de4a62018-09-18 08:09:45 +01001/*
Tamas Ban5b647472019-01-05 08:59:30 +00002 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Tamas Bana9de4a62018-09-18 08:09:45 +01003 *
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
16extern "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 */
24enum 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 */
44enum shared_memory_err_t
45boot_add_data_to_shared_area(uint8_t major_type,
Tamas Ban5b647472019-01-05 08:59:30 +000046 uint16_t minor_type,
Tamas Bana9de4a62018-09-18 08:09:45 +010047 size_t size,
48 const uint8_t *data);
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif /* __BOOT_RECORD_H__ */