Loading...
Searching...
No Matches
hdr.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Kaspar Schleiser <kaspar@schleiser.de>
3 * SPDX-FileCopyrightText: 2018 Inria
4 * SPDX-FileCopyrightText: 2018 Freie Universität Berlin
5 * SPDX-License-Identifier: LGPL-2.1-only
6 */
7
8#pragma once
9
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <stdint.h>
36
41#define RIOTBOOT_MAGIC 0x544f4952 /* "RIOT" */
42
47typedef struct {
48 uint32_t magic_number;
49 uint32_t version;
50 uint32_t start_addr;
51 uint32_t chksum;
53
54
61void riotboot_hdr_print(const riotboot_hdr_t *riotboot_hdr);
62
71int riotboot_hdr_validate(const riotboot_hdr_t *riotboot_hdr);
72
80uint32_t riotboot_hdr_checksum(const riotboot_hdr_t *riotboot_hdr);
81
82#ifdef __cplusplus
83}
84#endif
int riotboot_hdr_validate(const riotboot_hdr_t *riotboot_hdr)
Validate image header.
void riotboot_hdr_print(const riotboot_hdr_t *riotboot_hdr)
Print formatted riotboot_hdr_t to STDIO.
uint32_t riotboot_hdr_checksum(const riotboot_hdr_t *riotboot_hdr)
Calculate header checksum.
Structure to store image header - All members are little endian.
Definition hdr.h:47
uint32_t start_addr
Address after the allocated space for the header.
Definition hdr.h:50
uint32_t magic_number
Header magic number (always "RIOT")
Definition hdr.h:48
uint32_t chksum
Checksum of riotboot_hdr.
Definition hdr.h:51
uint32_t version
Integer representing the partition version.
Definition hdr.h:49