/*
 * include/linker_lists.h
 *
 * Implementation of linker-generated arrays
 *
 * Copyright (C) 2012 Marek Vasut <marex@denx.de>
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef __LINKER_LISTS_H__
#define __LINKER_LISTS_H__

/*
 * There is no use in including this from ASM files, but that happens
 * anyway, e.g. PPC kgdb.S includes command.h which incluse us.
 * So just don't define anything when included from ASM.
 */

#if !defined(__ASSEMBLY__)

/**
 * A linker list is constructed by grouping together linker input
 * sections, each containning one entry of the list. Each input section
 * contains a constant initialized variable which holds the entry's
 * content. Linker list input sections are constructed from the list
 * and entry names, plus a prefix which allows grouping all lists
 * together. Assuming _list and _entry are the list and entry names,
 * then the corresponding input section name is
 *
 *   .u_boot_list_ + 2_ + @_list + _2_ + @_entry
 *
 * and the C variable name is
 *
 *   _u_boot_list + _2_ + @_list + _2_ + @_entry
 *
 * This ensures uniqueness for both input section and C variable name.
 *
 * Note that the names differ only in the first character, "." for the
 * setion and "_" for the variable, so that the linker cannot confuse
 * section and symbol names. From now on, both names will be referred
 * to as
 *
 *   %u_boot_list_ + 2_ + @_list + _2_ + @_entry
 *
 * Entry variables need never be referred to directly.
 *
 * The naming scheme for input sections allows grouping all linker lists
 * into a single linker output section and grouping all entries for a
 * single list.
 *
 * Note the two '_2_' constant components in the names: their presence
 * allows putting a start and end symbols around a list, by mapping
 * these symbols to sections names with components "1" (before) and
 * "3" (after) instead of "2" (within).
 * Start and end symbols for a list can generally be defined as
 *
 *   %u_boot_list_2_ + @_list + _1_...
 *   %u_boot_list_2_ + @_list + _3_...
 *
 * Start and end symbols for the whole of the linker lists area can be
 * defined as
 *
 *   %u_boot_list_1_...
 *   %u_boot_list_3_...
 *
 * Here is an example of the sorted sections which result from a list
 * "array" made up of three entries : "first", "second" and "third",
 * iterated at least once.
 *
 *   .u_boot_list_2_array_1
 *   .u_boot_list_2_array_2_first
 *   .u_boot_list_2_array_2_second
 *   .u_boot_list_2_array_2_third
 *   .u_boot_list_2_array_3
 *
 * If lists must be divided into sublists (e.g. for iterating only on
 * part of a list), one can simply give the list a name of the form
 * 'outer_2_inner', where 'outer' is the global list name and 'inner'
 * is the sub-list name. Iterators for the whole list should use the
 * global list name ("outer"); iterators for only a sub-list should use
 * the full sub-list name ("outer_2_inner").
 *
 *  Here is an example of the sections generated from a global list
 * named "drivers", two sub-lists named "i2c" and "pci", and iterators
 * defined for the whole list and each sub-list:
 *
 *   %u_boot_list_2_drivers_1
 *   %u_boot_list_2_drivers_2_i2c_1
 *   %u_boot_list_2_drivers_2_i2c_2_first
 *   %u_boot_list_2_drivers_2_i2c_2_first
 *   %u_boot_list_2_drivers_2_i2c_2_second
 *   %u_boot_list_2_drivers_2_i2c_2_third
 *   %u_boot_list_2_drivers_2_i2c_3
 *   %u_boot_list_2_drivers_2_pci_1
 *   %u_boot_list_2_drivers_2_pci_2_first
 *   %u_boot_list_2_drivers_2_pci_2_second
 *   %u_boot_list_2_drivers_2_pci_2_third
 *   %u_boot_list_2_drivers_2_pci_3
 *   %u_boot_list_2_drivers_3
 */

/**
 * ll_entry_declare() - Declare linker-generated array entry
 * @_type:	Data type of the entry
 * @_name:	Name of the entry
 * @_list:	name of the list. Should contain only characters allowed
 *		in a C variable name!
 *
 * This macro declares a variable that is placed into a linker-generated
 * array. This is a basic building block for more advanced use of linker-
 * generated arrays. The user is expected to build their own macro wrapper
 * around this one.
 *
 * A variable declared using this macro must be compile-time initialized.
 *
 * Special precaution must be made when using this macro:
 *
 * 1) The _type must not contain the "static" keyword, otherwise the
 *    entry is generated and can be iterated but is listed in the map
 *    file and cannot be retrieved by name.
 *
 * 2) In case a section is declared that contains some array elements AND
 *    a subsection of this section is declared and contains some elements,
 *    it is imperative that the elements are of the same type.
 *
 * 4) In case an outer section is declared that contains some array elements
 *    AND an inner subsection of this section is declared and contains some
 *    elements, then when traversing the outer section, even the elements of
 *    the inner sections are present in the array.
 *
 * Example:
 * ll_entry_declare(struct my_sub_cmd, my_sub_cmd, cmd_sub, cmd.sub) = {
 *         .x = 3,
 *         .y = 4,
 * };
 */
#define ll_entry_declare(_type, _name, _list)				\
	_type _u_boot_list_2_##_list##_2_##_name __aligned(4)		\
			__attribute__((unused,				\
			section(".u_boot_list_2_"#_list"_2_"#_name)))

/**
 * We need a 0-byte-size type for iterator symbols, and the compiler
 * does not allow defining objects of C type 'void'. Using an empty
 * struct is allowed by the compiler, but causes gcc versions 4.4 and
 * below to complain about aliasing. Therefore we use the next best
 * thing: zero-sized arrays, which are both 0-byte-size and exempt from
 * aliasing warnings.
 */

/**
 * ll_entry_start() - Point to first entry of linker-generated array
 * @_type:	Data type of the entry
 * @_list:	Name of the list in which this entry is placed
 *
 * This function returns (_type *) pointer to the very first entry of a
 * linker-generated array placed into subsection of .u_boot_list section
 * specified by _list argument.
 *
 * Since this macro defines an array start symbol, its leftmost index
 * must be 2 and its rightmost index must be 1.
 *
 * Example:
 * struct my_sub_cmd *msc = ll_entry_start(struct my_sub_cmd, cmd_sub);
 */
#define ll_entry_start(_type, _list)					\
({									\
	static char start[0] __aligned(4) __attribute__((unused,	\
		section(".u_boot_list_2_"#_list"_1")));			\
	(_type *)&start;						\
})

/**
 * ll_entry_end() - Point after last entry of linker-generated array
 * @_type:	Data type of the entry
 * @_list:	Name of the list in which this entry is placed
 *		(with underscores instead of dots)
 *
 * This function returns (_type *) pointer after the very last entry of
 * a linker-generated array placed into subsection of .u_boot_list
 * section specified by _list argument.
 *
 * Since this macro defines an array end symbol, its leftmost index
 * must be 2 and its rightmost index must be 3.
 *
 * Example:
 * struct my_sub_cmd *msc = ll_entry_end(struct my_sub_cmd, cmd_sub);
 */
#define ll_entry_end(_type, _list)					\
({									\
	static char end[0] __aligned(4) __attribute__((unused,	\
		section(".u_boot_list_2_"#_list"_3")));			\
	(_type *)&end;							\
})
/**
 * ll_entry_count() - Return the number of elements in linker-generated array
 * @_type:	Data type of the entry
 * @_list:	Name of the list of which the number of elements is computed
 *
 * This function returns the number of elements of a linker-generated array
 * placed into subsection of .u_boot_list section specified by _list
 * argument. The result is of an unsigned int type.
 *
 * Example:
 * int i;
 * const unsigned int count = ll_entry_count(struct my_sub_cmd, cmd_sub);
 * struct my_sub_cmd *msc = ll_entry_start(struct my_sub_cmd, cmd_sub);
 * for (i = 0; i < count; i++, msc++)
 *         printf("Entry %i, x=%i y=%i\n", i, msc->x, msc->y);
 */
#define ll_entry_count(_type, _list)					\
	({								\
		_type *start = ll_entry_start(_type, _list);		\
		_type *end = ll_entry_end(_type, _list);		\
		unsigned int _ll_result = end - start;			\
		_ll_result;						\
	})

/**
 * ll_entry_get() - Retrieve entry from linker-generated array by name
 * @_type:	Data type of the entry
 * @_name:	Name of the entry
 * @_list:	Name of the list in which this entry is placed
 *
 * This function returns a pointer to a particular entry in LG-array
 * identified by the subsection of u_boot_list where the entry resides
 * and it's name.
 *
 * Example:
 * ll_entry_declare(struct my_sub_cmd, my_sub_cmd, cmd_sub) = {
 *         .x = 3,
 *         .y = 4,
 * };
 * ...
 * struct my_sub_cmd *c = ll_entry_get(struct my_sub_cmd, my_sub_cmd, cmd_sub);
 */
#define ll_entry_get(_type, _name, _list)				\
	({								\
		extern _type _u_boot_list_2_##_list##_2_##_name;	\
		_type *_ll_result =					\
			&_u_boot_list_2_##_list##_2_##_name;	\
		_ll_result;						\
	})

/**
 * ll_start() - Point to first entry of first linker-generated array
 * @_type:	Data type of the entry
 *
 * This function returns (_type *) pointer to the very first entry of
 * the very first linker-generated array.
 *
 * Since this macro defines the start of the linker-generated arrays,
 * its leftmost index must be 1.
 *
 * Example:
 * struct my_sub_cmd *msc = ll_start(struct my_sub_cmd);
 */
#define ll_start(_type)							\
({									\
	static char start[0] __aligned(4) __attribute__((unused,	\
		section(".u_boot_list_1")));				\
	(_type *)&start;						\
})

/**
 * ll_entry_end() - Point after last entry of last linker-generated array
 * @_type:	Data type of the entry
 *
 * This function returns (_type *) pointer after the very last entry of
 * the very last linker-generated array.
 *
 * Since this macro defines the end of the linker-generated arrays,
 * its leftmost index must be 3.
 *
 * Example:
 * struct my_sub_cmd *msc = ll_end(struct my_sub_cmd);
 */
#define ll_end(_type)							\
({									\
	static char end[0] __aligned(4) __attribute__((unused,	\
		section(".u_boot_list_3")));				\
	(_type *)&end;							\
})

#endif /* __ASSEMBLY__ */

#endif	/* __LINKER_LISTS_H__ */
