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 l4re_elf_aux_api L4Re ELF Auxiliary Information
29 * \brief API for embedding auxiliary information into
32 * This API allows information for the binary loader to be embedded into a
33 * binary application. This information can be reserved areas in the virtual
34 * memory of an application and things such as the stack size to be allocated
35 * for the first application thread.
40 * \brief Define an auxiliary vector element.
42 * This is the generic method for defining auxiliary vector elements.
43 * A more convenient way is to use L4RE_ELF_AUX_ELEM_T.
47 * L4RE_ELF_AUX_ELEM l4re_elf_aux_vma_t decl_name =
48 * { L4RE_ELF_AUX_T_VMA, sizeof(l4re_elf_aux_vma_t), 0x2000, 0x4000 };
51 #define L4RE_ELF_AUX_ELEM const __attribute__((used, section(".rol4re_elf_aux")))
54 * \brief Define an auxiliary vector element.
55 * \param type is the data type for the element (e.g., l4re_elf_aux_vma_t)
56 * \param id is the identifier (variable name) for the declaration (the
57 * variable is defined with \c static storage class)
58 * \param tag is the tag value for the element e.g., #L4RE_ELF_AUX_T_VMA
59 * \param val are the values to be set in the descriptor
63 * L4RE_ELF_AUX_ELEM_T(l4re_elf_aux_vma_t, decl_name, L4RE_ELF_AUX_T_VMA, 0x2000, 0x4000 };
66 #define L4RE_ELF_AUX_ELEM_T(type, id, tag, val...) \
67 static const __attribute__((used, section(".rol4re_elf_aux"))) \
68 type id = {tag, sizeof(type), val}
73 * \brief Tag for an invalid element in the auxiliary vector
75 L4RE_ELF_AUX_T_NONE = 0,
78 * \brief Tag for descriptor for a reserved virtual memory area.
83 * \brief Tag for descriptor that defines the stack size for
84 * the first application thread.
86 L4RE_ELF_AUX_T_STACK_SIZE,
89 * \brief Tag for descriptor that defines the stack address
90 * for the first application thread.
92 L4RE_ELF_AUX_T_STACK_ADDR,
96 * \brief Generic header for each auxiliary vector element.
98 typedef struct l4re_elf_aux_t
105 * \brief Auxiliary vector element for a reserved virtual memory area.
107 typedef struct l4re_elf_aux_vma_t
113 } l4re_elf_aux_vma_t;
116 * \brief Auxiliary vector element for a single unsigned data word.
118 typedef struct l4re_elf_aux_mword_t
123 } l4re_elf_aux_mword_t;