diff options
32 files changed, 57 insertions, 12 deletions
diff --git a/arch/x86_64/include/arch/boot/pointers.hpp b/arch/x86_64/include/arch/boot/pointers.hpp index 29cc3cf..fe9c657 100644 --- a/arch/x86_64/include/arch/boot/pointers.hpp +++ b/arch/x86_64/include/arch/boot/pointers.hpp @@ -9,6 +9,7 @@ namespace teachos::arch::boot * @brief Address pointing to the start of the multiboot information structure. */ extern "C" size_t const multiboot_information_pointer; + } // namespace teachos::arch::boot #endif // TEACHOS_ARCH_X86_64_BOOT_POINTERS_HPP diff --git a/arch/x86_64/include/arch/exception_handling/assert.hpp b/arch/x86_64/include/arch/exception_handling/assert.hpp index 58c1f33..7dc4381 100644 --- a/arch/x86_64/include/arch/exception_handling/assert.hpp +++ b/arch/x86_64/include/arch/exception_handling/assert.hpp @@ -11,6 +11,7 @@ namespace teachos::arch::exception_handling * @param message Message that should be printed before halting the execution if the condition is not met. */ auto assert(bool condition, char const * message) -> void; + } // namespace teachos::arch::exception_handling -#endif +#endif // TEACHOS_ARCH_X86_64_EXCEPTION_HANDLING_ASSERT_HPP diff --git a/arch/x86_64/include/arch/exception_handling/panic.hpp b/arch/x86_64/include/arch/exception_handling/panic.hpp index 9566159..6a2404c 100644 --- a/arch/x86_64/include/arch/exception_handling/panic.hpp +++ b/arch/x86_64/include/arch/exception_handling/panic.hpp @@ -4,10 +4,20 @@ namespace teachos::arch::exception_handling { /** - * @brief Print a kernel panic message and then halt the system. + * @brief Print the given kernel panic message and then halt the system. + * + * @param reason Reason to print before halting the system. */ [[noreturn]] auto panic(char const * reason) -> void; + + /** + * @brief Print the given kernel panic message started by a given prefix and then halt the system. + * + * @param prefix Prefix to print before printing the reason. + * @param reason Reason to print before halting the system. + */ [[noreturn]] auto panic(char const * prefix, char const * reason) -> void; + } // namespace teachos::arch::exception_handling -#endif
\ No newline at end of file +#endif // TEACHOS_ARCH_X86_64_EXCEPTION_HANDLING_PANIC_HPP diff --git a/arch/x86_64/include/arch/io/port_io.hpp b/arch/x86_64/include/arch/io/port_io.hpp index 1945261..ba41660 100644 --- a/arch/x86_64/include/arch/io/port_io.hpp +++ b/arch/x86_64/include/arch/io/port_io.hpp @@ -130,4 +130,4 @@ namespace teachos::arch::io } // namespace teachos::arch::io -#endif +#endif // TEACHOS_ARCH_X86_64_IO_PORT_IO_HPP diff --git a/arch/x86_64/include/arch/kernel/halt.hpp b/arch/x86_64/include/arch/kernel/halt.hpp index 6c58938..377acc0 100644 --- a/arch/x86_64/include/arch/kernel/halt.hpp +++ b/arch/x86_64/include/arch/kernel/halt.hpp @@ -3,7 +3,11 @@ namespace teachos::arch::kernel { + /** + * @brief Halts the kernel execution, meaning any code after a call to this will not run anymore. + */ extern "C" [[noreturn]] auto halt() -> void; -} -#endif
\ No newline at end of file +} // namespace teachos::arch::kernel + +#endif // TEACHOS_ARCH_X86_64_KERNEL_HALT_HPP diff --git a/arch/x86_64/include/arch/kernel/main.hpp b/arch/x86_64/include/arch/kernel/main.hpp index 8813b46..a13e5f4 100644 --- a/arch/x86_64/include/arch/kernel/main.hpp +++ b/arch/x86_64/include/arch/kernel/main.hpp @@ -3,7 +3,11 @@ namespace teachos::arch::kernel { + /** + * @brief Initalizes the kernel system. + */ auto main() -> void; -} -#endif +} // namespace teachos::arch::kernel + +#endif // TEACHOS_ARCH_X86_64_KERNEL_MAIN_HPP diff --git a/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp b/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp index adba4f1..685babd 100644 --- a/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp +++ b/arch/x86_64/include/arch/memory/allocator/area_frame_allocator.hpp @@ -60,6 +60,7 @@ namespace teachos::arch::memory::allocator physical_frame const multiboot_start; ///< The start address of the multiboot code in memory. physical_frame const multiboot_end; ///< The end address of the multiboot code in memory. }; + } // namespace teachos::arch::memory::allocator #endif // TEACHOS_ARCH_X86_64_MEMORY_ALLOCATOR_AREA_FRAME_ALLOCATOR_HPP diff --git a/arch/x86_64/include/arch/memory/allocator/concept.hpp b/arch/x86_64/include/arch/memory/allocator/concept.hpp index 9d58fad..18bb6bd 100644 --- a/arch/x86_64/include/arch/memory/allocator/concept.hpp +++ b/arch/x86_64/include/arch/memory/allocator/concept.hpp @@ -17,6 +17,7 @@ namespace teachos::arch::memory::allocator { t.allocate_frame() } -> std::same_as<std::optional<physical_frame>>; { t.deallocate_frame(a) } -> std::same_as<void>; }; + } // namespace teachos::arch::memory::allocator #endif // TEACHOS_ARCH_X86_64_MEMORY_ALLOCATOR_CONCEPT_HPP diff --git a/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp b/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp index d5e2f4c..c323c10 100644 --- a/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp +++ b/arch/x86_64/include/arch/memory/allocator/physical_frame.hpp @@ -80,6 +80,7 @@ namespace teachos::arch::memory::allocator }; typedef shared::container<shared::forward_value_iterator<physical_frame>> frame_container; + } // namespace teachos::arch::memory::allocator #endif // TEACHOS_ARCH_X86_64_MEMORY_ALLOCATOR_PHYSICAL_FRAME_HPP diff --git a/arch/x86_64/include/arch/memory/allocator/tiny_frame_allocator.hpp b/arch/x86_64/include/arch/memory/allocator/tiny_frame_allocator.hpp index 8124442..5a9b772 100644 --- a/arch/x86_64/include/arch/memory/allocator/tiny_frame_allocator.hpp +++ b/arch/x86_64/include/arch/memory/allocator/tiny_frame_allocator.hpp @@ -66,6 +66,7 @@ namespace teachos::arch::memory::allocator std::array<std::optional<physical_frame>, TINY_ALLOCATOR_FRAMES_COUNT> frames = {}; ///< Container that holds the frames allocated by another allocator. }; + } // namespace teachos::arch::memory::allocator #endif // TEACHOS_ARCH_X86_64_MEMORY_ALLOCATOR_TINY_FRAME_ALLOCATOR_HPP diff --git a/arch/x86_64/include/arch/memory/cpu/control_register.hpp b/arch/x86_64/include/arch/memory/cpu/control_register.hpp index 4988036..9b0a4d5 100644 --- a/arch/x86_64/include/arch/memory/cpu/control_register.hpp +++ b/arch/x86_64/include/arch/memory/cpu/control_register.hpp @@ -65,6 +65,7 @@ namespace teachos::arch::memory::cpu * @param flag he flag to set in the CR2. */ auto set_cr2_bit(cr2_flags flag) -> void; + } // namespace teachos::arch::memory::cpu #endif // TEACHOS_ARCH_X86_64_MEMORY_CPU_CR3_HPP diff --git a/arch/x86_64/include/arch/memory/cpu/msr.hpp b/arch/x86_64/include/arch/memory/cpu/msr.hpp index 49e9bcf..5cce816 100644 --- a/arch/x86_64/include/arch/memory/cpu/msr.hpp +++ b/arch/x86_64/include/arch/memory/cpu/msr.hpp @@ -58,6 +58,7 @@ namespace teachos::arch::memory::cpu * @param flag The flag to set in the EFER register. */ auto set_efer_bit(efer_flags flag) -> void; + } // namespace teachos::arch::memory::cpu #endif // TEACHOS_ARCH_X86_64_MEMORY_CPU_NXE_HPP
\ No newline at end of file diff --git a/arch/x86_64/include/arch/memory/heap/concept.hpp b/arch/x86_64/include/arch/memory/heap/concept.hpp index 52dba51..1cd24f4 100644 --- a/arch/x86_64/include/arch/memory/heap/concept.hpp +++ b/arch/x86_64/include/arch/memory/heap/concept.hpp @@ -13,6 +13,7 @@ namespace teachos::arch::memory::heap { t.allocate(size) } -> std::same_as<uint8_t *>; { t.deallocate(pointer, size) } -> std::same_as<void>; }; + } // namespace teachos::arch::memory::heap #endif // TEACHOS_ARCH_X86_64_MEMORY_HEAP_CONCEPT_HPP diff --git a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp index 03b8828..06b21bb 100644 --- a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp +++ b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp @@ -126,6 +126,7 @@ namespace teachos::arch::memory::heap memory_block * first; ///< First free entry in our memory. shared::mutex mutex; ///< Mutex to ensure only one thread calls allocate or deallocate at once. }; + } // namespace teachos::arch::memory::heap #endif // TEACHOS_ARCH_X86_64_MEMORY_HEAP_LINKED_LIST_ALLOCATOR_HPP diff --git a/arch/x86_64/include/arch/memory/heap/memory_block.hpp b/arch/x86_64/include/arch/memory/heap/memory_block.hpp index c62dd57..502d64e 100644 --- a/arch/x86_64/include/arch/memory/heap/memory_block.hpp +++ b/arch/x86_64/include/arch/memory/heap/memory_block.hpp @@ -32,6 +32,7 @@ namespace teachos::arch::memory::heap ///< size variable and the pointer to the next hole. memory_block * next; ///< Optional pointer to the next free memory, holds nullptr if there is none. }; + } // namespace teachos::arch::memory::heap #endif // TEACHOS_ARCH_X86_64_MEMORY_HEAP_MEMORY_BLOCK_HPP diff --git a/arch/x86_64/include/arch/memory/main.hpp b/arch/x86_64/include/arch/memory/main.hpp index bbf160b..164abbc 100644 --- a/arch/x86_64/include/arch/memory/main.hpp +++ b/arch/x86_64/include/arch/memory/main.hpp @@ -4,12 +4,13 @@ namespace teachos::arch::memory { /** - * @brief Initializes memory management + * @brief Initializes memory management. * * @note Enables the necessary register flags and remaps the kernel, * elf_sections, vga_text and the heap. */ auto initialize_memory_management() -> void; + } // namespace teachos::arch::memory -#endif +#endif // TEACHOS_ARCH_X86_64_MEMORY_MAIN_HPP diff --git a/arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp b/arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp index 549839a..e8f6b0a 100644 --- a/arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp +++ b/arch/x86_64/include/arch/memory/multiboot/elf_symbols_section.hpp @@ -163,6 +163,7 @@ namespace teachos::arch::memory::multiboot }; typedef shared::container<shared::contiguous_pointer_iterator<elf_section_header>> elf_section_header_container; + } // namespace teachos::arch::memory::multiboot #endif // TEACHOS_ARCH_X86_64_MEMORY_MULTIBOOT_ELF_SYBOLS_SECTION_HPP diff --git a/arch/x86_64/include/arch/memory/multiboot/info.hpp b/arch/x86_64/include/arch/memory/multiboot/info.hpp index 7924993..a9abf12 100644 --- a/arch/x86_64/include/arch/memory/multiboot/info.hpp +++ b/arch/x86_64/include/arch/memory/multiboot/info.hpp @@ -58,6 +58,7 @@ namespace teachos::arch::memory::multiboot uint32_t total_size; ///< Total size of all multiboot::tags and their data. alignas(8) struct tag tags; ///< Specific tags. }; + } // namespace teachos::arch::memory::multiboot #endif // TEACHOS_ARCH_X86_64_MEMORY_MULTIBOOT_INFO_HPP diff --git a/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp b/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp index 413f5a1..c28c986 100644 --- a/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp +++ b/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp @@ -47,6 +47,7 @@ namespace teachos::arch::memory::multiboot }; typedef shared::container<shared::contiguous_pointer_iterator<memory_area>> memory_area_container; + } // namespace teachos::arch::memory::multiboot #endif // TEACHOS_ARCH_X86_64_MEMORY_MULTIBOOT_MEMORY_MAP_HPP diff --git a/arch/x86_64/include/arch/memory/multiboot/reader.hpp b/arch/x86_64/include/arch/memory/multiboot/reader.hpp index 9707757..bda0c43 100644 --- a/arch/x86_64/include/arch/memory/multiboot/reader.hpp +++ b/arch/x86_64/include/arch/memory/multiboot/reader.hpp @@ -47,6 +47,7 @@ namespace teachos::arch::memory::multiboot * @return Relevant data read from multiboot2. */ auto read_multiboot2() -> memory_information; + } // namespace teachos::arch::memory::multiboot #endif // TEACHOS_ARCH_X86_64_MEMORY_MULTIBOOT_READER_HPP diff --git a/arch/x86_64/include/arch/memory/paging/inactive_page_table.hpp b/arch/x86_64/include/arch/memory/paging/inactive_page_table.hpp index a9ab258..8d96740 100644 --- a/arch/x86_64/include/arch/memory/paging/inactive_page_table.hpp +++ b/arch/x86_64/include/arch/memory/paging/inactive_page_table.hpp @@ -33,6 +33,7 @@ namespace teachos::arch::memory::paging allocator::physical_frame page_table_level_4_frame; ///< Temporary level 4 page table }; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_INACTIVE_PAGE_TABLE_HPP diff --git a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp index 897ae06..74f1c14 100644 --- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp +++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp @@ -153,6 +153,7 @@ namespace teachos::arch::memory::paging multiboot::memory_information const & mem_info; ///< Information about elf kernel sections required for remapping process. }; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_KERNEL_MAPPER_HPP diff --git a/arch/x86_64/include/arch/memory/paging/page_entry.hpp b/arch/x86_64/include/arch/memory/paging/page_entry.hpp index a7ba262..876ea3c 100644 --- a/arch/x86_64/include/arch/memory/paging/page_entry.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_entry.hpp @@ -110,6 +110,7 @@ namespace teachos::arch::memory::paging std::bitset<64U> flags; ///< Underlying bitset used to read the flags from. Bits 9 - 11 and 52 - 62 can be ///< freely used for additional flags by the operating system. }; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_PAGE_ENTRY_HPP diff --git a/arch/x86_64/include/arch/memory/paging/page_table.hpp b/arch/x86_64/include/arch/memory/paging/page_table.hpp index 7a15875..51ddcd4 100644 --- a/arch/x86_64/include/arch/memory/paging/page_table.hpp +++ b/arch/x86_64/include/arch/memory/paging/page_table.hpp @@ -142,6 +142,7 @@ namespace teachos::arch::memory::paging level table_level; ///< Level page table is currently on, depends on how often next_level was ///< called successfully. }; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_PAGE_TABLE_HPP diff --git a/arch/x86_64/include/arch/memory/paging/temporary_page.hpp b/arch/x86_64/include/arch/memory/paging/temporary_page.hpp index 02cb545..d0d7781 100644 --- a/arch/x86_64/include/arch/memory/paging/temporary_page.hpp +++ b/arch/x86_64/include/arch/memory/paging/temporary_page.hpp @@ -58,6 +58,7 @@ namespace teachos::arch::memory::paging virtual_page page; ///< Underlying virtual page we want to temporarily map. allocator::tiny_frame_allocator allocator; ///< Allocator that should be used to map the temporary page. }; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_TEMPORARY_PAGE_HPP
\ No newline at end of file diff --git a/arch/x86_64/include/arch/memory/paging/virtual_page.hpp b/arch/x86_64/include/arch/memory/paging/virtual_page.hpp index 0ee9cbd..d820e82 100644 --- a/arch/x86_64/include/arch/memory/paging/virtual_page.hpp +++ b/arch/x86_64/include/arch/memory/paging/virtual_page.hpp @@ -85,6 +85,7 @@ namespace teachos::arch::memory::paging }; typedef shared::container<shared::forward_value_iterator<virtual_page>> page_container; + } // namespace teachos::arch::memory::paging #endif // TEACHOS_ARCH_X86_64_MEMORY_PAGING_VIRTUAL_PAGE_HPP diff --git a/arch/x86_64/include/arch/shared/container.hpp b/arch/x86_64/include/arch/shared/container.hpp index b335e72..f2fd1dc 100644 --- a/arch/x86_64/include/arch/shared/container.hpp +++ b/arch/x86_64/include/arch/shared/container.hpp @@ -77,6 +77,7 @@ namespace teachos::arch::shared iterator begin_itr = {}; ///< Pointer to the first element of the given template type. iterator end_itr = {}; ///< Pointer to one pas the last element of the given template type. }; + } // namespace teachos::arch::shared #endif // TEACHOS_ARCH_X86_64_SHARED_CONTAINER_HPP diff --git a/arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp b/arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp index 7d5019a..e2520dc 100644 --- a/arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp +++ b/arch/x86_64/include/arch/shared/contiguous_pointer_iterator.hpp @@ -184,6 +184,7 @@ namespace teachos::arch::shared pointer_type ptr = {}; ///< Underlying value the iterator is currently pointing too and should increment or decrement. }; + } // namespace teachos::arch::shared #endif // TEACHOS_ARCH_X86_64_SHARED_CONTIGUOUS_POINTER_ITERATOR_HPP diff --git a/arch/x86_64/include/arch/shared/forward_value_iterator.hpp b/arch/x86_64/include/arch/shared/forward_value_iterator.hpp index a84d291..c5dfc06 100644 --- a/arch/x86_64/include/arch/shared/forward_value_iterator.hpp +++ b/arch/x86_64/include/arch/shared/forward_value_iterator.hpp @@ -104,6 +104,7 @@ namespace teachos::arch::shared value_type value = {}; ///< Underlying value the iterator is currently pointing too and should increment or decrement. }; + } // namespace teachos::arch::shared #endif // TEACHOS_ARCH_X86_64_SHARED_FORWARD_VALUE_ITERATOR_HPP diff --git a/arch/x86_64/include/arch/shared/mutex.hpp b/arch/x86_64/include/arch/shared/mutex.hpp index 33e9e17..b18a8b3 100644 --- a/arch/x86_64/include/arch/shared/mutex.hpp +++ b/arch/x86_64/include/arch/shared/mutex.hpp @@ -51,6 +51,7 @@ namespace teachos::arch::shared private: std::atomic<bool> locked = {false}; // Atomic boolean to track if mutex is locked or not. }; + } // namespace teachos::arch::shared #endif // TEACHOS_ARCH_X86_64_SHARED_MUTEX_HPP diff --git a/arch/x86_64/include/arch/video/vga/io.hpp b/arch/x86_64/include/arch/video/vga/io.hpp index 3d2e90c..c399fad 100644 --- a/arch/x86_64/include/arch/video/vga/io.hpp +++ b/arch/x86_64/include/arch/video/vga/io.hpp @@ -36,4 +36,4 @@ namespace teachos::arch::video::vga } // namespace teachos::arch::video::vga -#endif +#endif // TEACHOS_ARCH_X86_64_VIDEO_VGA_IO_HPP diff --git a/arch/x86_64/include/arch/video/vga/text.hpp b/arch/x86_64/include/arch/video/vga/text.hpp index 665dc1c..cfbf98f 100644 --- a/arch/x86_64/include/arch/video/vga/text.hpp +++ b/arch/x86_64/include/arch/video/vga/text.hpp @@ -163,6 +163,7 @@ namespace teachos::arch::video::vga::text divisor /= 10; } } + } // namespace teachos::arch::video::vga::text -#endif
\ No newline at end of file +#endif // TEACHOS_ARCH_X86_64_VIDEO_VGA_TEXT_HPP
\ No newline at end of file |
