提交 04d2a8a3 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

64-bit %fs segment

上级 7e161483
......@@ -133,6 +133,20 @@ ltr(u16 sel)
}
static inline void
writefs(u16 v)
{
__asm volatile("movw %0, %%fs" : : "r" (v));
}
static inline u16
readfs(void)
{
u16 v;
__asm volatile("movw %%fs, %0" : "=r" (v));
return v;
}
static inline void
writegs(u16 v)
{
__asm volatile("movw %0, %%gs" : : "r" (v));
......
......@@ -127,6 +127,8 @@ switchvm(struct proc *p)
lcr3(v2p(p->vmap->pml4)); // switch to new address space
else
switchkvm();
writefs(UDSEG);
writemsr(MSR_FS_BASE, p->user_fs_);
popcli();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论