|
CardSight 0.1.0
C API reference for the CardSight firmware and application
|
Init calls: functions that run in order after the kernel is up. More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | initcall |
| One entry of the .initcall linker section. More... | |
Macros | |
| #define | INITCALL(_level, _priority, _fn) |
| Register a function as an init call. | |
Typedefs | |
| typedef int(* | initcall_fn) (void) |
| Signature of an init call. | |
Functions | |
| void | initcalls_run (uint32_t level) |
| Run every init call of one level. | |
Init calls: functions that run in order after the kernel is up.
Levels 0 and 1 run on the boot stack before the scheduler starts; levels 2 and 3 run from the boot task. Within a level a lower priority number runs first.
| #define INITCALL | ( | _level, | |
| _priority, | |||
| _fn ) |
Register a function as an init call.
Places a static struct initcall in the .initcall section, which initcalls_run() walks. The symbol is named after _fn and kept even when nothing references it.
| _level | Init level (0 to 3). |
| _priority | Order within the level; lower runs first. |
| _fn | Function with the initcall_fn signature. |
| typedef int(* initcall_fn) (void) |
Signature of an init call.
| void initcalls_run | ( | uint32_t | level | ) |
Run every init call of one level.
Walks priorities from 0 to 255 and, for each, the whole .initcall section, calling the entries whose level and priority match. Return values are ignored.
| [in] | level | Init level to run. |