runtime.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_RUNTIME_H
8#define _PICO_RUNTIME_H
9
10#include "pico.h"
11
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#ifndef __ASSEMBLER__
48void runtime_init(void);
49
50void runtime_run_initializers(void);
51void runtime_run_per_core_initializers(void);
52
53#ifndef PICO_RUNTIME_INIT_FUNC
54#define PICO_RUNTIME_INIT_FUNC(func, priority_string) uintptr_t __used __attribute__((section(".preinit_array." priority_string))) __pre_init_ ## func = (uintptr_t)(void (*)(void)) (func)
55#endif
56#else
57#ifndef PICO_RUNTIME_INIT_FUNC
58#define PICO_RUNTIME_INIT_FUNC(func, priority_string) __pre_init func, priority_string
59#endif
60#endif
61#define PICO_RUNTIME_INIT_FUNC_HW(func, priority_string) PICO_RUNTIME_INIT_FUNC(func, priority_string)
62#define PICO_RUNTIME_INIT_FUNC_RUNTIME(func, priority_string) PICO_RUNTIME_INIT_FUNC(func, priority_string)
63// priority strings are of the form 00000->99999; we want the per core stuff all at the end, so prefix with ZZZZZ which is clearly after 99999
64#define PICO_RUNTIME_INIT_FUNC_PER_CORE(func, priority_string) PICO_RUNTIME_INIT_FUNC(func, "ZZZZZ." priority_string)
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif
void runtime_init(void)
Run all the initializations that are usually called by crt0.S before entering main.
Definition: llvm_libc_interface.c:82