hdr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de>
3  * 2018 Inria
4  * 2018 Freie Universität Berlin
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
11 #pragma once
12 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #include <stdint.h>
39 
44 #define RIOTBOOT_MAGIC 0x544f4952 /* "RIOT" */
45 
50 typedef struct {
51  uint32_t magic_number;
52  uint32_t version;
53  uint32_t start_addr;
54  uint32_t chksum;
64 void riotboot_hdr_print(const riotboot_hdr_t *riotboot_hdr);
65 
74 int riotboot_hdr_validate(const riotboot_hdr_t *riotboot_hdr);
75 
83 uint32_t riotboot_hdr_checksum(const riotboot_hdr_t *riotboot_hdr);
84 
85 #ifdef __cplusplus
86 }
87 #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:50
uint32_t start_addr
Address after the allocated space for the header.
Definition: hdr.h:53
uint32_t magic_number
Header magic number (always "RIOT")
Definition: hdr.h:51
uint32_t chksum
Checksum of riotboot_hdr
Definition: hdr.h:54
uint32_t version
Integer representing the partition version
Definition: hdr.h:52