#include
#include
static tss_t ALIGN(PAGE_SIZE) tss;
tss_t *tss_get()
{
return &tss;
}
static void tss_update(addr_t kern_stack, uint32_t kern_seg)
{
tss.esp0 = kern_stack;
tss.ss0 = kern_seg;
}
static void tss_init()
{
KPRINTF("tss_init\n");
extern struct thread_t task0;
memset(&tss, 0, sizeof(tss_t));
tss_update((uint32_t)&task0 + STACK_SIZE, KERNEL_DS_SEL);
load_tr();
}
INITFUNC(tss_init, INIT_TSS);
阅读(1488) | 评论(0) | 转发(0) |