diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-08-20 15:08:38 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-08-20 15:08:38 +0200 |
| commit | 51bd0daba2fa3cd42242b2c07cf4851bc7845fb1 (patch) | |
| tree | 66217854d939dee1e20d6972ae996bca12aed458 | |
| parent | 9638a27c37f1f85625d9b3681792fce37fb935af (diff) | |
| download | kernel-51bd0daba2fa3cd42242b2c07cf4851bc7845fb1.tar.xz kernel-51bd0daba2fa3cd42242b2c07cf4851bc7845fb1.zip | |
chore: clean up some more doc comments
| -rw-r--r-- | arch/x86_64/arch/vga/text/attribute.hpp | 12 | ||||
| -rw-r--r-- | libs/elf/elf/section_header.hpp | 114 |
2 files changed, 84 insertions, 42 deletions
diff --git a/arch/x86_64/arch/vga/text/attribute.hpp b/arch/x86_64/arch/vga/text/attribute.hpp index 6395aed0..29ff22b7 100644 --- a/arch/x86_64/arch/vga/text/attribute.hpp +++ b/arch/x86_64/arch/vga/text/attribute.hpp @@ -17,10 +17,14 @@ namespace arch::vga::text //! @see text::background_flag struct attribute { - color foreground_color : 3; ///< The foreground color of the cell, e.g. the color of the code point. - enum foreground_flag foreground_flag : 1; ///< The foreground color modification flag of the cell. - color background_color : 3; ///< The background color of the cell. - enum background_flag background_flag : 1; ///< The background color modification flag of the cell. + //! The foreground color of the cell, e.g. the color of the code point. + color foreground_color : 3; + //! The foreground color modification flag of the cell. + enum foreground_flag foreground_flag : 1; + //! The background color of the cell. + color background_color : 3; + //! The background color modification flag of the cell. + enum background_flag background_flag : 1; }; static_assert(sizeof(attribute) == 1, "The VGA text mode attribute must fit inside a single byte."); diff --git a/libs/elf/elf/section_header.hpp b/libs/elf/elf/section_header.hpp index b1305ec2..cf738d00 100644 --- a/libs/elf/elf/section_header.hpp +++ b/libs/elf/elf/section_header.hpp @@ -47,39 +47,67 @@ namespace elf //! The type of the section described by this header. enum struct header_type : std::uint32_t { - null = 0, ///< Is inactive - program_data = 1, ///< Contains program data - symbol_table = 2, ///< Contains a symbol table - string_table = 3, ///< Contains a string table - relocation_entries_with_addends = 4, ///< Contains relocation information with addends - hash_table = 5, ///< Contains a symbol hash table - dynamic_linking_entries = 6, ///< Contains dynamic linking information - notes = 7, ///< Contains additional notes about the object file - no_content = 8, ///< Contains no data - relocation_entries_without_addends = 9, ///< Contains relocation information without addends - reserved = 10, ///< Reserved for future use - dynamic_linker_symbol_table = 11, ///< Contains the dynamic linker symbol table - init_array = 14, ///< Contains an array of constructor pointers - fini_array = 15, ///< Contains an array of destructor pointers - preinit_array = 16, ///< Contains an array of pre-constructor pointers - group_table = 17, ///< Defines a section group - extended_section_header_indices = 18, ///< Contains extended section header indices + //! Is inactive + null = 0, + //! Contains program data + program_data = 1, + //! Contains a symbol table + symbol_table = 2, + //! Contains a string table + string_table = 3, + //! Contains relocation information with addends + relocation_entries_with_addends = 4, + //! Contains a symbol hash table + hash_table = 5, + //! Contains dynamic linking information + dynamic_linking_entries = 6, + //! Contains additional notes about the object file + notes = 7, + //! Contains no data + no_content = 8, + //! Contains relocation information without addends + relocation_entries_without_addends = 9, + //! Reserved for future use + reserved = 10, + //! Contains the dynamic linker symbol table + dynamic_linker_symbol_table = 11, + //! Contains an array of constructor pointers + init_array = 14, + //! Contains an array of destructor pointers + fini_array = 15, + //! Contains an array of destructor pointers + preinit_array = 16, + //! Defines a section group + group_table = 17, + //! Contains extended section header indices + extended_section_header_indices = 18, }; //! The properties of the section describe by this header. enum struct header_flags : format_uint { - writable = 0x1, ///< Contains writable data - allocated = 0x2, ///< Occupies memory during execution - executable = 0x4, ///< Contains executable instructions - mergeable = 0x10, ///< Contained data may be merged for deduplication - strings = 0x20, ///< Contains null-terminated strings - info_link = 0x40, ///< Contains the section header index of linked section - link_order = 0x80, ///< Must respect linking location relative to linked section - os_specific = 0x100, ///< Must be handled in an OS specific way - group_member = 0x200, ///< Is a member of a section group - thread_local_storage = 0x400, ///< Contains thread local storage data - compressed = 0x800, ///< Is compressed + //! Contains writable data + writable = 0x1, + //! Occupies memory during execution + allocated = 0x2, + //! Contains executable instructions + executable = 0x4, + //! Contained data may be merged for deduplication + mergeable = 0x10, + //! Contains null-terminated strings + strings = 0x20, + //! Contains the section header index of linked section + info_link = 0x40, + //! Must respect linking location relative to linked section + link_order = 0x80, + //! Must be handled in an OS specific way + os_specific = 0x100, + //! Is a member of a section group + group_member = 0x200, + //! Contains thread local storage data + thread_local_storage = 0x400, + //! Is compressed + compressed = 0x800, }; //! Check if the section is allocated @@ -100,16 +128,26 @@ namespace elf return std::to_underlying(flags) & std::to_underlying(header_flags::writable); } - std::uint32_t name_offset; ///< Offset into the section header string table, defining the section name - header_type type; ///< Type of this section - header_flags flags; ///< Flags of this section - format_uint virtual_load_address; ///< Virtual address where this section is loaded - format_uint file_offset; ///< Offset of the start of this section's data in the file - format_uint size; ///< Size of this section in memory - std::uint32_t linked_section; ///< Index of a section this section is linked to - std::uint32_t extra_info; ///< Additional information for this section (type and flag dependent) - format_uint alignment; ///< Alignment requirement of this section in memory - format_uint entry_size; ///< Size of the entries inside this section (if any) + //! Offset into the section header string table, defining the section name + std::uint32_t name_offset; + //! Type of this section + header_type type; + //! Flags of this section + header_flags flags; + //! Virtual address where this section is loaded + format_uint virtual_load_address; + //! Offset of the start of this section's data in the file + format_uint file_offset; + //! Size of this section in memory + format_uint size; + //! Index of a section this section is linked to + std::uint32_t linked_section; + //! Additional information for this section (type and flag dependent) + std::uint32_t extra_info; + //! Alignment requirement of this section in memory + format_uint alignment; + //! Size of the entries inside this section (if any) + format_uint entry_size; }; static_assert(sizeof(section_header<format::elf32>) == section_header_size<format::elf32>); |
