/*-1* Copyright (c) 2013 Hans Petter Selasky. All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions5* are met:6* 1. Redistributions of source code must retain the above copyright7* notice, this list of conditions and the following disclaimer.8* 2. Redistributions in binary form must reproduce the above copyright9* notice, this list of conditions and the following disclaimer in the10* documentation and/or other materials provided with the distribution.11*12* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND13* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE14* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE15* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE16* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL17* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS18* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)19* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT20* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY21* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF22* SUCH DAMAGE.23*/2425#ifndef _SYSINIT_H_26#define _SYSINIT_H_2728struct sysinit_data {29uint8_t b_keyword_name[64];30uint8_t b_debug_info[128];31uint8_t b_global_type[128];32uint8_t b_global_name[128];33uint8_t b_file_name[256];34uint32_t dw_endian32;35uint32_t dw_msb_value; /* must be non-zero, else entry is skipped */36uint32_t dw_lsb_value;37uint32_t dw_file_line;38} __attribute__((__packed__));3940#define SYSINIT_ENTRY(uniq, keyword, msb, lsb, g_type, g_name, debug) \41static const struct sysinit_data sysinit_##uniq \42__attribute__((__section__(".debug.sysinit"), \43__used__, __aligned__(1))) = { \44.b_keyword_name = { keyword }, \45.b_debug_info = { debug }, \46.b_global_type = { g_type }, \47.b_global_name = { g_name }, \48.b_file_name = { __FILE__ }, \49.dw_endian32 = 0x76543210U, \50.dw_msb_value = (msb), \51.dw_lsb_value = (lsb), \52.dw_file_line = __LINE__ \53}5455#endif /* _SYSINIT_H_ */565758