/* Copyright (C) 2012, Aaron Lindsay This file is part of Aedrix. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef INIT_H #define INIT_H struct initcall_func { void (*fptr)(); }; #define _initcall(level_name, level, func) struct initcall_func func##_##level##_initcall \ __attribute__ ((section ("." level_name "initcalls"))) = { func } /* The actual calls to be used externally */ #define early_initcall(func) _initcall("early", 0, func) #define driversubsys_initcall(func) _initcall("driversubsys", 1, func) #define device_initcall(func) _initcall("device", 2, func) #endif /* INIT_H */