MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mcci_bootloader_types.h
Go to the documentation of this file.
1/* mcci_bootloader_types.h Mon Jun 29 2020 10:14:36 tmm */
2
3/*
4
5Module: mcci_bootloader_types.h
6
7Function:
8 Format of on-media data for the MCCI bootloader.
9
10Version:
11 V0.1.0 Mon Jun 29 2020 10:14:36 tmm Edit level 1
12
13Copyright notice:
14 This file copyright (C) 2020 by
15
16 MCCI Corporation
17 3520 Krums Corners Road
18 Ithaca, NY 14850
19
20 An unpublished work. All rights reserved.
21
22 This file is proprietary information, and may not be disclosed or
23 copied without the prior permission of MCCI Corporation.
24
25Author:
26 Terry Moore, MCCI Corporation June 2020
27
28Revision history:
29 0.1.0 Mon Jun 29 2020 10:14:36 tmm
30 Module created.
31
32*/
33
34#ifndef _MCCI_BOOTLOADER_TYPES_H_ /* prevent multiple includes */
35#define _MCCI_BOOTLOADER_TYPES_H_
36
37#include "mcciadk_env.h"
38
39#include <stdbool.h>
40#include <stddef.h>
41#include <stdint.h>
42#include <stdarg.h>
43
44/****************************************************************************\
45|
46| Environmental basics
47|
48\****************************************************************************/
49
50#ifdef __cplusplus
51# define MCCI_BOOTLOADER_BEGIN_DECLS extern "C" {
52# define MCCI_BOOTLOADER_END_DECLS }
53#else
54# define MCCI_BOOTLOADER_BEGIN_DECLS /* nothing */
55# define MCCI_BOOTLOADER_END_DECLS /* nothing */
56#endif
57
58#ifdef _MSC_VER
59# define MCCI_BOOTLOADER_NORETURN_PFX __declspec(noreturn)
60# define MCCI_BOOTLOADER_NORETURN_SFX /* nothing */
61#else
62# define MCCI_BOOTLOADER_NORETURN_PFX /* nothing */
63# define MCCI_BOOTLOADER_NORETURN_SFX __attribute__((__noreturn__))
64#endif
65
66#define MCCI_BOOTLOADER_NOT_REACHED() __builtin_unreachable()
67
68/****************************************************************************\
69|
70| Scalar types and type handles.
71|
72\****************************************************************************/
73
75
76///
77/// \brief error codes for the bootloader
78///
79/// \see McciBootloaderError_e
80///
81typedef uint32_t McciBootloaderError_t;
82
83///
84/// \brief Abstract type for storage byte addresses
85///
86/// The bootloader assumes that boot images are wholly contained in the
87/// first 4 GiB of the storage device.
88///
90
91///
92/// \brief Current boot system state
93///
94/// \note enum types don't have predictable width. So we declare this as
95/// a `uint32_t`, and have a separate declariton for the enum.
96///
97/// \see McciBootloaderState_e
98///
99typedef uint32_t McciBootloaderState_t;
100
101///
102/// \brief The (ostensibly) architecture-neutral application header
103///
104typedef struct McciBootloader_AppInfo_s McciBootloader_AppInfo_t;
105
106///
107/// \brief The (ostensibly) architecture-neutral application header
108///
109typedef struct McciBootloader_SignatureBlock_s McciBootloader_SignatureBlock_t;
110
112#endif /* _MCCI_BOOTLOADER_TYPES_H_ */
#define MCCI_BOOTLOADER_BEGIN_DECLS
#define MCCI_BOOTLOADER_END_DECLS
uint32_t McciBootloaderState_t
Current boot system state.
uint32_t McciBootloaderError_t
error codes for the bootloader
uint32_t McciBootloaderStorageAddress_t
Abstract type for storage byte addresses.
Application information block.