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