aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/pre/src/context_switching/syscall
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/pre/src/context_switching/syscall')
-rw-r--r--arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp10
-rw-r--r--arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp11
2 files changed, 12 insertions, 9 deletions
diff --git a/arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp b/arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp
index 3c43336..dbb3ed9 100644
--- a/arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp
+++ b/arch/x86_64/pre/src/context_switching/syscall/syscall_enable.cpp
@@ -8,12 +8,12 @@ namespace teachos::arch::context_switching::syscall
{
namespace
{
- interrupt_descriptor_table::segment_selector constexpr KERNEL_CODE_SEGMENT_SELECTOR{
- 1U, interrupt_descriptor_table::segment_selector::REQUEST_LEVEL_KERNEL};
+ constexpr interrupt_descriptor_table::segment_selector KERNEL_CODE_SEGMENT_SELECTOR{
+ 1U, interrupt_descriptor_table::segment_selector::REQUEST_LEVEL_KERNEL};
- auto constexpr IA32_STAR_ADDRESS = 0xC0000081;
- auto constexpr IA32_LSTAR_ADDRESS = 0xC0000082;
- auto constexpr IA32_FMASK_ADDRESS = 0xC0000084;
+ constexpr auto IA32_STAR_ADDRESS = 0xC000'0081;
+ constexpr auto IA32_LSTAR_ADDRESS = 0xC000'0082;
+ constexpr auto IA32_FMASK_ADDRESS = 0xC000'0084;
} // namespace
diff --git a/arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp b/arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp
index 84dbe5f..c120f77 100644
--- a/arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp
+++ b/arch/x86_64/pre/src/context_switching/syscall/syscall_handler.cpp
@@ -14,7 +14,7 @@ namespace teachos::arch::context_switching::syscall
{
auto write_to_vga_buffer(uint64_t buffer) -> response
{
- video::vga::text::write(reinterpret_cast<const char *>(buffer),
+ video::vga::text::write(reinterpret_cast<char const *>(buffer),
video::vga::text::common_attributes::green_on_black);
video::vga::text::newline();
return {error::OK};
@@ -22,11 +22,14 @@ namespace teachos::arch::context_switching::syscall
auto expand_user_heap() -> response
{
- static auto current_heap_end = memory::heap::USER_HEAP_START;
+ auto static current_heap_end = memory::heap::USER_HEAP_START;
uint64_t const heap_start = current_heap_end;
memory::remap_heap(heap_start, memory::heap::USER_HEAP_SIZE, memory::paging::entry::USER_ACCESSIBLE);
current_heap_end += memory::heap::USER_HEAP_SIZE;
- return {error::OK, {heap_start, memory::heap::USER_HEAP_SIZE}};
+ return {
+ error::OK,
+ {heap_start, memory::heap::USER_HEAP_SIZE}
+ };
}
} // namespace
@@ -62,7 +65,7 @@ namespace teachos::arch::context_switching::syscall
result = expand_user_heap();
break;
case type::ASSERT:
- teachos::arch::exception_handling::assert(arg_0, reinterpret_cast<const char *>(arg_1));
+ teachos::arch::exception_handling::assert(arg_0, reinterpret_cast<char const *>(arg_1));
break;
default:
teachos::arch::exception_handling::panic("[Syscall Handler] Invalid syscall number");