defs.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_BINARY_INFO_DEFS_H
8#define _PICO_BINARY_INFO_DEFS_H
9
10// this file is for pre-processor definitions only
11
12// should be found within the first 256 bytes of the real binary (i.e. after the flash second stage if a flash binary)
13//
14// Note the layout is:
15//
16// addr : BINARY_INFO_MARKER_START
17// addr+0x04 : __binary_info_start
18// addr+0x08 : __binary_info_end
19// addr+0x0c : __address_mapping_table
20// addr+0x10 | BINARY_INFO_MARKER_END
21//
22// __binary_info_start to __binary_info_end are the start, end (non inclusive) of an array
23// of pointers to binary_info_t structures
24//
25// __address_mapping_table is an array of the following items:
26//
27// uint32_t source_addr_start
28// uint32_t dest_addr_start
29// uint32_t dest_addr_end
30//
31// representing a mapping from the stored address in the binary/flash to addresses at runtime.
32// The linker will store pointers within the binary using their runtime values, however because of
33// "AT" mapping in the link script these addresses actually correspond to a different address in the binary
34// image. This mapping (which in the case of crt0.S is simply the data copy table used at initialization
35// to copy data into its runtime location) can be used by picotool or others to reverse the mapping to find data
36// within the binary.
37//
38// Note the above array is terminated with a NULL source_addr_start
39
40#define BINARY_INFO_MARKER_START 0x7188ebf2
41#define BINARY_INFO_MARKER_END 0xe71aa390
42
43#endif