MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderplatform_getappinfo.c
Go to the documentation of this file.
1
/*
2
3
Module: mccibootloaderplatform_getappinfo.c
4
5
Function:
6
McciBootloaderPlatform_getAppInfo()
7
8
Copyright and License:
9
This file copyright (C) 2021 by
10
11
MCCI Corporation
12
3520 Krums Corners Road
13
Ithaca, NY 14850
14
15
See accompanying LICENSE file for copyright and license information.
16
17
Author:
18
Terry Moore, MCCI Corporation March 2021
19
20
*/
21
22
#include "
mcci_bootloader_platform.h
"
23
#include "
mcci_bootloader_appinfo.h
"
24
#include "
mcci_bootloader_cm0plus_appimage.h
"
25
␌
26
/****************************************************************************\
27
|
28
| Manifest constants & typedefs.
29
|
30
\****************************************************************************/
31
32
33
34
/****************************************************************************\
35
|
36
| Read-only data.
37
|
38
\****************************************************************************/
39
40
41
42
/****************************************************************************\
43
|
44
| Variables.
45
|
46
\****************************************************************************/
47
48
␌
49
/*
50
51
Name: McciBootloaderPlatform_getAppInfo()
52
53
Function:
54
Find the app info structure in a header
55
56
Definition:
57
const McciBootloader_AppInfo_t *
58
McciBootloaderPlatform_getAppInfo(
59
const void *pHeader,
60
size_t nHeader
61
);
62
63
Description:
64
Given a pointer to the header of an image (not necessarily at
65
its final location), and a count of the buffer bytes, this function
66
returns a pointer to the McciBootloader_AppInfo_t header structure.
67
68
Returns:
69
Non-null if the app info structure was found and passes the checks,
70
NULL otherwise.
71
72
Notes:
73
74
75
*/
76
77
const
McciBootloader_AppInfo_t *
78
McciBootloaderPlatform_getAppInfo
(
79
const
void
*pHeader,
80
size_t
nHeader
81
)
82
{
83
const
McciBootloader_CortexPageZero_t
*
const
pPageZero = pHeader;
84
85
if
(nHeader <
sizeof
(*pPageZero))
86
return
NULL;
87
88
const
McciBootloader_AppInfo_t *
const
pAppInfo =
89
&pPageZero->
PageZero
.
AppInfo
;
90
91
if
(pAppInfo->magic !=
MCCI_BOOTLOADER_APP_INFO_MAGIC
)
92
return
NULL;
93
94
if
(pAppInfo->size !=
sizeof
(*pAppInfo))
95
return
NULL;
96
97
return
pAppInfo;
98
}
99
100
/**** end of mccibootloaderplatform_getappinfo.c ****/
mcci_bootloader_appinfo.h
MCCI_BOOTLOADER_APP_INFO_MAGIC
#define MCCI_BOOTLOADER_APP_INFO_MAGIC
Definition
mcci_bootloader_appinfo.h:67
mcci_bootloader_cm0plus_appimage.h
mcci_bootloader_platform.h
McciBootloaderPlatform_getAppInfo
const McciBootloader_AppInfo_t * McciBootloaderPlatform_getAppInfo(const void *pHeader, size_t nHeader)
Definition
mccibootloaderplatform_getappinfo.c:78
McciBootloader_CortexPageZeroContents_t::AppInfo
McciBootloader_AppInfo_t AppInfo
Definition
mcci_bootloader_cm0plus_appimage.h:47
McciBootloader_CortexPageZero_t
Definition
mcci_bootloader_cm0plus_appimage.h:51
McciBootloader_CortexPageZero_t::PageZero
McciBootloader_CortexPageZeroContents_t PageZero
Definition
mcci_bootloader_cm0plus_appimage.h:56
platform
arch
cm0plus
src
mccibootloaderplatform_getappinfo.c
Generated on Thu Feb 19 2026 18:47:32 for MCCI Trusted Bootloader by
1.9.8