diff options
Diffstat (limited to 'arch')
32 files changed, 65 insertions, 65 deletions
diff --git a/arch/x86_64/arch/boot/boot.hpp b/arch/x86_64/arch/boot/boot.hpp index 7df61c4b..c790152c 100644 --- a/arch/x86_64/arch/boot/boot.hpp +++ b/arch/x86_64/arch/boot/boot.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_BOOT_BOOT_HPP -#define TEACHOS_X86_64_BOOT_BOOT_HPP +#ifndef TEACHOS_ARCH_X86_64_BOOT_BOOT_HPP +#define TEACHOS_ARCH_X86_64_BOOT_BOOT_HPP #ifdef __ASSEMBLER__ // clang-format off diff --git a/arch/x86_64/arch/boot/ld.hpp b/arch/x86_64/arch/boot/ld.hpp index a8b83d66..f46caac6 100644 --- a/arch/x86_64/arch/boot/ld.hpp +++ b/arch/x86_64/arch/boot/ld.hpp @@ -12,8 +12,8 @@ //! //! @see arch/x86_64/scripts/kernel.ld -#ifndef TEACHOS_X86_64_BOOT_LD_HPP -#define TEACHOS_X86_64_BOOT_LD_HPP +#ifndef TEACHOS_ARCH_X86_64_BOOT_LD_HPP +#define TEACHOS_ARCH_X86_64_BOOT_LD_HPP #include <cstddef> diff --git a/arch/x86_64/arch/bus/cpu.hpp b/arch/x86_64/arch/bus/cpu.hpp index b027b5f5..b7b4b9b3 100644 --- a/arch/x86_64/arch/bus/cpu.hpp +++ b/arch/x86_64/arch/bus/cpu.hpp @@ -73,4 +73,4 @@ namespace arch::bus } // namespace arch::bus -#endif // TEACHOS_X86_64_BUS_CPU_HPP +#endif diff --git a/arch/x86_64/arch/bus/isa.hpp b/arch/x86_64/arch/bus/isa.hpp index 44a68059..cefc48f0 100644 --- a/arch/x86_64/arch/bus/isa.hpp +++ b/arch/x86_64/arch/bus/isa.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_BUS_ISA_HPP -#define TEACHOS_X86_64_BUS_ISA_HPP +#ifndef TEACHOS_ARCH_X86_64_BUS_ISA_HPP +#define TEACHOS_ARCH_X86_64_BUS_ISA_HPP #include <kapi/capabilities/facet_id.hpp> #include <kapi/devices.hpp> @@ -47,4 +47,4 @@ namespace arch::bus } // namespace arch::bus -#endif // TEACHOS_X86_64_BUS_ISA_HPP +#endif diff --git a/arch/x86_64/arch/cpu/control_register.hpp b/arch/x86_64/arch/cpu/control_register.hpp index 127d1e24..c11ea367 100644 --- a/arch/x86_64/arch/cpu/control_register.hpp +++ b/arch/x86_64/arch/cpu/control_register.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_CPU_CONTROL_REGISTERS_HPP -#define TEACHOS_X86_64_CPU_CONTROL_REGISTERS_HPP +#ifndef TEACHOS_ARCH_X86_64_CPU_CONTROL_REGISTERS_HPP +#define TEACHOS_ARCH_X86_64_CPU_CONTROL_REGISTERS_HPP // IWYU pragma: private, include <arch/cpu/registers.hpp> diff --git a/arch/x86_64/arch/cpu/global_descriptor_table.hpp b/arch/x86_64/arch/cpu/global_descriptor_table.hpp index b17c5093..e485d65c 100644 --- a/arch/x86_64/arch/cpu/global_descriptor_table.hpp +++ b/arch/x86_64/arch/cpu/global_descriptor_table.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_GLOBAL_DESCRIPTOR_TABLE_HPP -#define TEACHOS_X86_64_GLOBAL_DESCRIPTOR_TABLE_HPP +#ifndef TEACHOS_ARCH_X86_64_GLOBAL_DESCRIPTOR_TABLE_HPP +#define TEACHOS_ARCH_X86_64_GLOBAL_DESCRIPTOR_TABLE_HPP #include <arch/cpu/segment_descriptor.hpp> diff --git a/arch/x86_64/arch/cpu/interrupts.cpp b/arch/x86_64/arch/cpu/interrupts.cpp index c825e8ab..2fdc4671 100644 --- a/arch/x86_64/arch/cpu/interrupts.cpp +++ b/arch/x86_64/arch/cpu/interrupts.cpp @@ -50,7 +50,7 @@ namespace arch::cpu constexpr auto pic_master_irq_end = pic_master_irq_start + 8; constexpr auto pic_slave_irq_start = pic_master_irq_end; - constexpr auto to_exception_type(exception e) + constexpr auto to_exception_type(exception e) -> enum kapi::cpu::exception::type { switch (e) { @@ -75,7 +75,7 @@ namespace arch::cpu } } - constexpr auto has_error_code(exception e) + constexpr auto has_error_code(exception e) -> bool { switch (e) { @@ -155,8 +155,7 @@ namespace arch::cpu if (kapi::interrupts::dispatch(irq_number) == kapi::interrupts::status::unhandled) { - kstd::println(kstd::print_sink::stderr, "[ARCH:CPU] Unhandled interrupt {:#04x} (IRQ{})", number, - irq_number); + kstd::println(kstd::print_sink::stderr, "[ARCH:CPU] Unhandled interrupt {:#04x} (IRQ{})", number, irq_number); } acknowledge_pic_interrupt(frame); diff --git a/arch/x86_64/arch/cpu/interrupts.hpp b/arch/x86_64/arch/cpu/interrupts.hpp index 6162f56a..be755cc3 100644 --- a/arch/x86_64/arch/cpu/interrupts.hpp +++ b/arch/x86_64/arch/cpu/interrupts.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_CPU_INTERRUPTS_HPP -#define TEACHOS_X86_64_CPU_INTERRUPTS_HPP +#ifndef TEACHOS_ARCH_X86_64_CPU_INTERRUPTS_HPP +#define TEACHOS_ARCH_X86_64_CPU_INTERRUPTS_HPP #include <arch/cpu/segment_selector.hpp> diff --git a/arch/x86_64/arch/cpu/legacy_pic.hpp b/arch/x86_64/arch/cpu/legacy_pic.hpp index 5fcaecac..f85efd19 100644 --- a/arch/x86_64/arch/cpu/legacy_pic.hpp +++ b/arch/x86_64/arch/cpu/legacy_pic.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_CPU_LEGACY_PIC_HPP -#define TEACHOS_X86_64_CPU_LEGACY_PIC_HPP +#ifndef TEACHOS_ARCH_X86_64_CPU_LEGACY_PIC_HPP +#define TEACHOS_ARCH_X86_64_CPU_LEGACY_PIC_HPP #include <arch/io/port_io.hpp> diff --git a/arch/x86_64/arch/cpu/model_specific_register.hpp b/arch/x86_64/arch/cpu/model_specific_register.hpp index 1410c343..7f854124 100644 --- a/arch/x86_64/arch/cpu/model_specific_register.hpp +++ b/arch/x86_64/arch/cpu/model_specific_register.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_CPU_MODEL_SPECIFIC_REGISTER_HPP -#define TEACHOS_X86_64_CPU_MODEL_SPECIFIC_REGISTER_HPP +#ifndef TEACHOS_ARCH_X86_64_CPU_MODEL_SPECIFIC_REGISTER_HPP +#define TEACHOS_ARCH_X86_64_CPU_MODEL_SPECIFIC_REGISTER_HPP // IWYU pragma: private, include <x86_64/cpu/registers.hpp> diff --git a/arch/x86_64/arch/cpu/registers.hpp b/arch/x86_64/arch/cpu/registers.hpp index 58633f6e..afe7d1e1 100644 --- a/arch/x86_64/arch/cpu/registers.hpp +++ b/arch/x86_64/arch/cpu/registers.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_CPU_REGISTERS_HPP -#define TEACHOS_X86_64_CPU_REGISTERS_HPP +#ifndef TEACHOS_ARCH_X86_64_CPU_REGISTERS_HPP +#define TEACHOS_ARCH_X86_64_CPU_REGISTERS_HPP #include <arch/cpu/control_register.hpp> // IWYU pragma: export #include <arch/cpu/model_specific_register.hpp> // IWYU pragma: export diff --git a/arch/x86_64/arch/cpu/segment_descriptor.hpp b/arch/x86_64/arch/cpu/segment_descriptor.hpp index 9570670f..0c1ada01 100644 --- a/arch/x86_64/arch/cpu/segment_descriptor.hpp +++ b/arch/x86_64/arch/cpu/segment_descriptor.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_SEGMENT_DESCRIPTOR_HPP -#define TEACHOS_X86_64_SEGMENT_DESCRIPTOR_HPP +#ifndef TEACHOS_ARCH_X86_64_SEGMENT_DESCRIPTOR_HPP +#define TEACHOS_ARCH_X86_64_SEGMENT_DESCRIPTOR_HPP #include <cstdint> diff --git a/arch/x86_64/arch/cpu/segment_selector.hpp b/arch/x86_64/arch/cpu/segment_selector.hpp index 1a78c473..87806751 100644 --- a/arch/x86_64/arch/cpu/segment_selector.hpp +++ b/arch/x86_64/arch/cpu/segment_selector.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_SEGMENT_SELECTOR_HPP -#define TEACHOS_X86_64_SEGMENT_SELECTOR_HPP +#ifndef TEACHOS_ARCH_X86_64_SEGMENT_SELECTOR_HPP +#define TEACHOS_ARCH_X86_64_SEGMENT_SELECTOR_HPP #include <cstdint> diff --git a/arch/x86_64/arch/cpu/task_state_segment.hpp b/arch/x86_64/arch/cpu/task_state_segment.hpp index 373fb8af..ab141f4c 100644 --- a/arch/x86_64/arch/cpu/task_state_segment.hpp +++ b/arch/x86_64/arch/cpu/task_state_segment.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_TASK_STATE_SEGMENT_HPP -#define TEACHOS_X86_64_TASK_STATE_SEGMENT_HPP +#ifndef TEACHOS_ARCH_X86_64_TASK_STATE_SEGMENT_HPP +#define TEACHOS_ARCH_X86_64_TASK_STATE_SEGMENT_HPP #include <cstdint> diff --git a/arch/x86_64/arch/debug/qemu_output.hpp b/arch/x86_64/arch/debug/qemu_output.hpp index 27898395..18ae84bb 100644 --- a/arch/x86_64/arch/debug/qemu_output.hpp +++ b/arch/x86_64/arch/debug/qemu_output.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_DEBUG_QEMU_OUTPUT_HPP -#define TEACHOS_X86_64_DEBUG_QEMU_OUTPUT_HPP +#ifndef TEACHOS_ARCH_X86_64_DEBUG_QEMU_OUTPUT_HPP +#define TEACHOS_ARCH_X86_64_DEBUG_QEMU_OUTPUT_HPP #include <arch/io/port_io.hpp> diff --git a/arch/x86_64/arch/io/port_io.hpp b/arch/x86_64/arch/io/port_io.hpp index 475e223b..d21ef976 100644 --- a/arch/x86_64/arch/io/port_io.hpp +++ b/arch/x86_64/arch/io/port_io.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_IO_PORT_IO_HPP -#define TEACHOS_X86_64_IO_PORT_IO_HPP +#ifndef TEACHOS_ARCH_X86_64_IO_PORT_IO_HPP +#define TEACHOS_ARCH_X86_64_IO_PORT_IO_HPP #include <array> #include <concepts> diff --git a/arch/x86_64/arch/memory/higher_half_mapper.hpp b/arch/x86_64/arch/memory/higher_half_mapper.hpp index 9b02ee63..4f6574ff 100644 --- a/arch/x86_64/arch/memory/higher_half_mapper.hpp +++ b/arch/x86_64/arch/memory/higher_half_mapper.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_HIGHER_HALF_MAPPER_HPP -#define TEACHOS_X86_64_HIGHER_HALF_MAPPER_HPP +#ifndef TEACHOS_ARCH_X86_64_HIGHER_HALF_MAPPER_HPP +#define TEACHOS_ARCH_X86_64_HIGHER_HALF_MAPPER_HPP #include <arch/memory/page_table.hpp> diff --git a/arch/x86_64/arch/memory/kernel_mapper.hpp b/arch/x86_64/arch/memory/kernel_mapper.hpp index adbf688f..aeb936dc 100644 --- a/arch/x86_64/arch/memory/kernel_mapper.hpp +++ b/arch/x86_64/arch/memory/kernel_mapper.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_KERNEL_MAPPER_HPP -#define TEACHOS_X86_64_KERNEL_MAPPER_HPP +#ifndef TEACHOS_ARCH_X86_64_KERNEL_MAPPER_HPP +#define TEACHOS_ARCH_X86_64_KERNEL_MAPPER_HPP #include <kapi/memory.hpp> diff --git a/arch/x86_64/arch/memory/mmu.hpp b/arch/x86_64/arch/memory/mmu.hpp index 7046f7fc..9bd95b43 100644 --- a/arch/x86_64/arch/memory/mmu.hpp +++ b/arch/x86_64/arch/memory/mmu.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_MEMORY_MMU_HPP -#define TEACHOS_X86_64_MEMORY_MMU_HPP +#ifndef TEACHOS_ARCH_X86_64_MEMORY_MMU_HPP +#define TEACHOS_ARCH_X86_64_MEMORY_MMU_HPP #include <kapi/memory/address.hpp> diff --git a/arch/x86_64/arch/memory/page_table.hpp b/arch/x86_64/arch/memory/page_table.hpp index 12abacb5..0c0f1a77 100644 --- a/arch/x86_64/arch/memory/page_table.hpp +++ b/arch/x86_64/arch/memory/page_table.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_PAGE_TABLE_HPP -#define TEACHOS_X86_64_PAGE_TABLE_HPP +#ifndef TEACHOS_ARCH_X86_64_PAGE_TABLE_HPP +#define TEACHOS_ARCH_X86_64_PAGE_TABLE_HPP #include <kapi/memory.hpp> diff --git a/arch/x86_64/arch/memory/page_utilities.hpp b/arch/x86_64/arch/memory/page_utilities.hpp index 068e8249..478f776d 100644 --- a/arch/x86_64/arch/memory/page_utilities.hpp +++ b/arch/x86_64/arch/memory/page_utilities.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_PAGE_UTILITIES_HPP -#define TEACHOS_X86_64_PAGE_UTILITIES_HPP +#ifndef TEACHOS_ARCH_X86_64_PAGE_UTILITIES_HPP +#define TEACHOS_ARCH_X86_64_PAGE_UTILITIES_HPP #include <kapi/memory.hpp> diff --git a/arch/x86_64/arch/memory/region_allocator.cpp b/arch/x86_64/arch/memory/region_allocator.cpp index ece492f3..b78924d8 100644 --- a/arch/x86_64/arch/memory/region_allocator.cpp +++ b/arch/x86_64/arch/memory/region_allocator.cpp @@ -15,12 +15,13 @@ namespace arch::memory { namespace { - constexpr auto last_frame(multiboot2::memory_map::region const & region) + constexpr auto last_frame(multiboot2::memory_map::region const & region) -> kapi::memory::frame { return kapi::memory::frame::containing(kapi::memory::physical_address{region.base + region.size_in_B - 1}); } constexpr auto falls_within(kapi::memory::frame candidate, kapi::memory::frame start, kapi::memory::frame end) + -> bool { return candidate >= start && candidate <= end; } diff --git a/arch/x86_64/arch/memory/region_allocator.hpp b/arch/x86_64/arch/memory/region_allocator.hpp index 5d9da2e0..61cc1d4d 100644 --- a/arch/x86_64/arch/memory/region_allocator.hpp +++ b/arch/x86_64/arch/memory/region_allocator.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_MEMORY_REGION_ALLOCATOR_HPP -#define TEACHOS_X86_64_MEMORY_REGION_ALLOCATOR_HPP +#ifndef TEACHOS_ARCH_X86_64_MEMORY_REGION_ALLOCATOR_HPP +#define TEACHOS_ARCH_X86_64_MEMORY_REGION_ALLOCATOR_HPP #include <kapi/memory/address.hpp> #include <kapi/memory/frame.hpp> diff --git a/arch/x86_64/arch/vga/crtc.hpp b/arch/x86_64/arch/vga/crtc.hpp index e57e675f..75469e4b 100644 --- a/arch/x86_64/arch/vga/crtc.hpp +++ b/arch/x86_64/arch/vga/crtc.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_IO_HPP -#define TEACHOS_X86_64_VGA_IO_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_CRTC_HPP +#define TEACHOS_ARCH_X86_64_VGA_CRTC_HPP #include <arch/io/port_io.hpp> diff --git a/arch/x86_64/arch/vga/text.hpp b/arch/x86_64/arch/vga/text.hpp index 2e73dd2d..35e57292 100644 --- a/arch/x86_64/arch/vga/text.hpp +++ b/arch/x86_64/arch/vga/text.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_HPP -#define TEACHOS_X86_64_VGA_TEXT_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_HPP #include <arch/vga/text/attribute.hpp> // IWYU pragma: export #include <arch/vga/text/color.hpp> // IWYU pragma: export @@ -7,4 +7,4 @@ #include <arch/vga/text/device.hpp> // IWYU pragma: export #include <arch/vga/text/flags.hpp> // IWYU pragma: export -#endif // TEACHOS_ARCH_X86_64_VIDEO_VGA_TEXT_HPP
\ No newline at end of file +#endif
\ No newline at end of file diff --git a/arch/x86_64/arch/vga/text/attribute.hpp b/arch/x86_64/arch/vga/text/attribute.hpp index 29ff22b7..9e3d79af 100644 --- a/arch/x86_64/arch/vga/text/attribute.hpp +++ b/arch/x86_64/arch/vga/text/attribute.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_ATTRIBUTE_HPP -#define TEACHOS_X86_64_VGA_TEXT_ATTRIBUTE_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_ATTRIBUTE_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_ATTRIBUTE_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/arch/vga/text/buffer.hpp b/arch/x86_64/arch/vga/text/buffer.hpp index 8eb66457..7827b1af 100644 --- a/arch/x86_64/arch/vga/text/buffer.hpp +++ b/arch/x86_64/arch/vga/text/buffer.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_BUFFER_HPP -#define TEACHOS_X86_64_VGA_TEXT_BUFFER_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_BUFFER_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_BUFFER_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/arch/vga/text/color.hpp b/arch/x86_64/arch/vga/text/color.hpp index e0ad6dfa..75e0a5fd 100644 --- a/arch/x86_64/arch/vga/text/color.hpp +++ b/arch/x86_64/arch/vga/text/color.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_COLOR_HPP -#define TEACHOS_X86_64_VGA_TEXT_COLOR_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_COLOR_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_COLOR_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/arch/vga/text/common_attributes.hpp b/arch/x86_64/arch/vga/text/common_attributes.hpp index 3d8929f4..20faa841 100644 --- a/arch/x86_64/arch/vga/text/common_attributes.hpp +++ b/arch/x86_64/arch/vga/text/common_attributes.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_COMMON_ATTRIBUTES_HPP -#define TEACHOS_X86_64_VGA_TEXT_COMMON_ATTRIBUTES_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_COMMON_ATTRIBUTES_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_COMMON_ATTRIBUTES_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/arch/vga/text/device.hpp b/arch/x86_64/arch/vga/text/device.hpp index 0a0e0178..be07876b 100644 --- a/arch/x86_64/arch/vga/text/device.hpp +++ b/arch/x86_64/arch/vga/text/device.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_DEVICE_HPP -#define TEACHOS_X86_64_VGA_TEXT_DEVICE_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_DEVICE_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_DEVICE_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/arch/vga/text/flags.hpp b/arch/x86_64/arch/vga/text/flags.hpp index 7a29e334..45f94e6b 100644 --- a/arch/x86_64/arch/vga/text/flags.hpp +++ b/arch/x86_64/arch/vga/text/flags.hpp @@ -1,5 +1,5 @@ -#ifndef TEACHOS_X86_64_VGA_TEXT_FLAGS_HPP -#define TEACHOS_X86_64_VGA_TEXT_FLAGS_HPP +#ifndef TEACHOS_ARCH_X86_64_VGA_TEXT_FLAGS_HPP +#define TEACHOS_ARCH_X86_64_VGA_TEXT_FLAGS_HPP // IWYU pragma: private, include <arch/vga/text.hpp> diff --git a/arch/x86_64/kapi/memory.cpp b/arch/x86_64/kapi/memory.cpp index 9cf955e5..03c5107c 100644 --- a/arch/x86_64/kapi/memory.cpp +++ b/arch/x86_64/kapi/memory.cpp @@ -40,7 +40,7 @@ namespace kapi::memory auto constinit higher_half_mapper = std::optional<arch::memory::higher_half_mapper>{}; //! Instantiate a basic, memory region based, early frame allocator for remapping. - auto collect_memory_information() + auto collect_memory_information() -> arch::memory::region_allocator::memory_information { auto memory_map = boot::bootstrap_information.mbi->maybe_memory_map(); if (!memory_map) |
