1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2011 The Chromium OS Authors.
12 _Static_assert(EVT_COUNT
< 256, "Can only support 256 event types with 8 bits");
15 * init_fnc_t - Init function
17 * Return: 0 if OK -ve on error
19 typedef int (*init_fnc_t
)(void);
21 /* Top bit indicates that the initcall is an event */
22 #define INITCALL_IS_EVENT GENMASK(BITS_PER_LONG - 1, 8)
23 #define INITCALL_EVENT_TYPE GENMASK(7, 0)
25 #define INITCALL_EVENT(_type) (void *)((_type) | INITCALL_IS_EVENT)
28 * initcall_run_list() - Run through a list of function calls
30 * This calls functions one after the other, stopping at the first error, or
31 * when NULL is obtained.
33 * @init_sequence: NULL-terminated init sequence to run
34 * Return: 0 if OK, or -ve error code from the first failure
36 int initcall_run_list(const init_fnc_t init_sequence
[]);