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
20
typedef
int (*
initcall_fn
)(void);
21
25
struct
initcall
{
26
initcall_fn
function
;
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
56
void
initcalls_run
(uint32_t level);
57
58
#endif
/* CARDSIGHT_INIT_H */
initcalls_run
void initcalls_run(uint32_t level)
Run every init call of one level.
initcall_fn
int(* initcall_fn)(void)
Signature of an init call.
Definition
init.h:20
initcall
One entry of the .initcall linker section.
Definition
init.h:25
initcall::function
initcall_fn function
Definition
init.h:26
initcall::priority
unsigned char priority
Definition
init.h:28
initcall::level
unsigned char level
Definition
init.h:27
software
include
init.h
Generated by
1.15.0