index.rst 3.2 KB

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