3 * \brief Auxiliary information for binaries
6 * (c) 2009 Alexander Warg <warg@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU General Public License 2.
11 * Please see the COPYING-GPL-2 file for details.
13 * As a special exception, you may use this file as part of a free software
14 * library without restriction. Specifically, if other files instantiate
15 * templates or use macros or inline functions from this file, or you compile
16 * this file and link it with other files to produce an executable, this
17 * file does not by itself cause the resulting executable to be covered by
18 * the GNU General Public License. This exception does not however
19 * invalidate any other reasons why the executable file might be covered by
20 * the GNU General Public License.
24 #include <l4/sys/types.h>
28 * \defgroup api_l4re_elf_aux L4Re ELF Auxiliary Information
30 * \brief API for embedding auxiliary information into
33 * This API allows information for the binary loader to be embedded into a
34 * binary application. This information can be reserved areas in the virtual
35 * memory of an application and things such as the stack size to be allocated
36 * for the first application thread.
41 * \brief Define an auxiliary vector element.
43 * This is the generic method for defining auxiliary vector elements.
44 * A more convenient way is to use L4RE_ELF_AUX_ELEM_T.
48 * L4RE_ELF_AUX_ELEM l4re_elf_aux_vma_t decl_name =
49 * { L4RE_ELF_AUX_T_VMA, sizeof(l4re_elf_aux_vma_t), 0x2000, 0x4000 };
52 #define L4RE_ELF_AUX_ELEM const __attribute__((used, section(".rol4re_elf_aux")))
55 * \brief Define an auxiliary vector element.
56 * \param type is the data type for the element (e.g., l4re_elf_aux_vma_t)
57 * \param id is the identifier (variable name) for the declaration (the
58 * variable is defined with \c static storage class)
59 * \param tag is the tag value for the element e.g., #L4RE_ELF_AUX_T_VMA
60 * \param val are the values to be set in the descriptor
64 * L4RE_ELF_AUX_ELEM_T(l4re_elf_aux_vma_t, decl_name, L4RE_ELF_AUX_T_VMA, 0x2000, 0x4000 };
67 #define L4RE_ELF_AUX_ELEM_T(type, id, tag, val...) \
68 static const __attribute__((used, section(".rol4re_elf_aux"))) \
69 type id = {tag, sizeof(type), val}
74 * \brief Tag for an invalid element in the auxiliary vector
76 L4RE_ELF_AUX_T_NONE = 0,
79 * \brief Tag for descriptor for a reserved virtual memory area.
84 * \brief Tag for descriptor that defines the stack size for
85 * the first application thread.
87 L4RE_ELF_AUX_T_STACK_SIZE,
90 * \brief Tag for descriptor that defines the stack address
91 * for the first application thread.
93 L4RE_ELF_AUX_T_STACK_ADDR,
97 * \brief Generic header for each auxiliary vector element.
99 typedef struct l4re_elf_aux_t
106 * \brief Auxiliary vector element for a reserved virtual memory area.
108 typedef struct l4re_elf_aux_vma_t
114 } l4re_elf_aux_vma_t;
117 * \brief Auxiliary vector element for a single unsigned data word.
119 typedef struct l4re_elf_aux_mword_t
124 } l4re_elf_aux_mword_t;