CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
init.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
9
10#ifndef CARDSIGHT_INIT_H
11#define CARDSIGHT_INIT_H
12
13#include <stdint.h>
14
20typedef int (*initcall_fn)(void);
21
25struct initcall {
27 unsigned char level;
28 unsigned char priority;
29};
30
41#define INITCALL(_level, _priority, _fn) \
42 static const struct initcall __initcall_##_fn __attribute__((used, section(".initcall"))) = { \
43 .function = (_fn), \
44 .level = (_level), \
45 .priority = (_priority), \
46 }
47
56void initcalls_run(uint32_t level);
57
58#endif /* CARDSIGHT_INIT_H */
void initcalls_run(uint32_t level)
Run every init call of one level.
int(* initcall_fn)(void)
Signature of an init call.
Definition init.h:20
One entry of the .initcall linker section.
Definition init.h:25
initcall_fn function
Definition init.h:26
unsigned char priority
Definition init.h:28
unsigned char level
Definition init.h:27