blob: a7b0ee4e87d35be53c5e4edcd30b61c2b0457a02 [file] [log] [blame]
Mario Six78a88f72018-07-10 08:40:17 +02001====================
2U-Boot Hacker Manual
3====================
4
5Linker-Generated Arrays
6=======================
7
8A linker list is constructed by grouping together linker input
9sections, each containing one entry of the list. Each input section
10contains a constant initialized variable which holds the entry's
11content. Linker list input sections are constructed from the list
12and entry names, plus a prefix which allows grouping all lists
13together. Assuming _list and _entry are the list and entry names,
14then the corresponding input section name is
15
16::
17
18 .u_boot_list_ + 2_ + @_list + _2_ + @_entry
19
20and the C variable name is
21
22::
23
24 _u_boot_list + _2_ + @_list + _2_ + @_entry
25
26This ensures uniqueness for both input section and C variable name.
27
28Note that the names differ only in the first character, "." for the
29section and "_" for the variable, so that the linker cannot confuse
30section and symbol names. From now on, both names will be referred
31to as
32
33::
34
35 %u_boot_list_ + 2_ + @_list + _2_ + @_entry
36
37Entry variables need never be referred to directly.
38
39The naming scheme for input sections allows grouping all linker lists
40into a single linker output section and grouping all entries for a
41single list.
42
43Note the two '_2_' constant components in the names: their presence
44allows putting a start and end symbols around a list, by mapping
45these symbols to sections names with components "1" (before) and
46"3" (after) instead of "2" (within).
47Start and end symbols for a list can generally be defined as
48
49::
50
51 %u_boot_list_2_ + @_list + _1_...
52 %u_boot_list_2_ + @_list + _3_...
53
54Start and end symbols for the whole of the linker lists area can be
55defined as
56
57::
58
59 %u_boot_list_1_...
60 %u_boot_list_3_...
61
62Here is an example of the sorted sections which result from a list
63"array" made up of three entries : "first", "second" and "third",
64iterated at least once.
65
66::
67
68 .u_boot_list_2_array_1
69 .u_boot_list_2_array_2_first
70 .u_boot_list_2_array_2_second
71 .u_boot_list_2_array_2_third
72 .u_boot_list_2_array_3
73
74If lists must be divided into sublists (e.g. for iterating only on
75part of a list), one can simply give the list a name of the form
76'outer_2_inner', where 'outer' is the global list name and 'inner'
77is the sub-list name. Iterators for the whole list should use the
78global list name ("outer"); iterators for only a sub-list should use
79the full sub-list name ("outer_2_inner").
80
81Here is an example of the sections generated from a global list
82named "drivers", two sub-lists named "i2c" and "pci", and iterators
83defined for the whole list and each sub-list:
84
85::
86
87 %u_boot_list_2_drivers_1
88 %u_boot_list_2_drivers_2_i2c_1
89 %u_boot_list_2_drivers_2_i2c_2_first
90 %u_boot_list_2_drivers_2_i2c_2_first
91 %u_boot_list_2_drivers_2_i2c_2_second
92 %u_boot_list_2_drivers_2_i2c_2_third
93 %u_boot_list_2_drivers_2_i2c_3
94 %u_boot_list_2_drivers_2_pci_1
95 %u_boot_list_2_drivers_2_pci_2_first
96 %u_boot_list_2_drivers_2_pci_2_second
97 %u_boot_list_2_drivers_2_pci_2_third
98 %u_boot_list_2_drivers_2_pci_3
99 %u_boot_list_2_drivers_3
100
101.. kernel-doc:: include/linker_lists.h
102 :internal:
103
104Serial system
105=============
106
107.. kernel-doc:: drivers/serial/serial.c
108 :internal:
109
110The U-Boot EFI subsystem
111========================
112
113Boot services
114-------------
115
116.. kernel-doc:: lib/efi_loader/efi_boottime.c
117 :internal: