#include <mem/vmm.h>
#include <platform/generic/fpu/fpu.h>
#include <platform/generic/system.h>
#include <platform/generic/tasking/trapframe.h>
#include <platform/riscv64/interrupts.h>
#include <security/defs.h>
#include <tasking/tasking.h>

/* switching the page dir and tss to the current proc */
void switch_uthreads(thread_t* thread)
{
    system_disable_interrupts();
    RUNNING_THREAD = thread;
    vmm_switch_address_space(thread->process->address_space);
    system_enable_interrupts();
}