aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/kernel/cpu/jmp.cpp
blob: 78b65f45d0f3080ca777d974b216751997e0354d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "arch/kernel/cpu/jmp.hpp"

namespace teachos::arch::kernel::cpu
{
  auto jmp(uint64_t address) -> void
  {
    asm volatile("jmp *%[input]" : /* no output from call */ : [input] "r"(address));
  }

  // auto jmp(far_pointer pointer) -> void
  // {
  //   asm volatile("ljmp $[segment_selector],$[address]"
  //                : /* no output from call */
  //                : [segment_selector] "m"(pointer.selector), [address] "m"(pointer.offset));
  // }
}  // namespace teachos::arch::kernel::cpu