1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2014, Linaro Limited 4 */ 5 6 #ifndef INITCALL_H 7 #define INITCALL_H 8 9 #include <tee_api_types.h> 10 11 typedef TEE_Result (*initcall_t)(void); 12 13 #define __define_initcall(level, fn) \ 14 static initcall_t __initcall_##fn __attribute__((used)) \ 15 __attribute__((__section__(".initcall" level))) = fn 16 17 #define service_init(fn) __define_initcall("1", fn) 18 #define service_init_late(fn) __define_initcall("2", fn) 19 #define driver_init(fn) __define_initcall("3", fn) 20 #define driver_init_late(fn) __define_initcall("4", fn) 21 22 #endif 23