aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/cpu/ss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/src/kernel/cpu/ss.cpp')
-rw-r--r--arch/x86_64/src/kernel/cpu/ss.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86_64/src/kernel/cpu/ss.cpp b/arch/x86_64/src/kernel/cpu/ss.cpp
index 9c8dd61..1f28e7f 100644
--- a/arch/x86_64/src/kernel/cpu/ss.cpp
+++ b/arch/x86_64/src/kernel/cpu/ss.cpp
@@ -19,15 +19,15 @@ namespace teachos::arch::kernel::cpu
auto read_ss() -> uint16_t
{
- uint16_t ss;
- asm volatile("mov %%ss, %0" : "=r"(ss));
- return ss;
+ uint16_t segment_selector;
+ asm volatile("mov %%ss, %[output]" : [output] "=r"(segment_selector));
+ return segment_selector;
}
auto write_ss(segment_selector selector) -> void
{
uint16_t ss = selector.to_uint16();
- asm volatile("mov %0, %%ss" ::"r"(ss));
+ asm volatile("mov %[input], %%ss" : /* no output from call */ : [input] "r"(ss));
}
} // namespace teachos::arch::kernel::cpu \ No newline at end of file