提交 5c948d49 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Merge branch 'scale-amd64' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 into scale-amd64

......@@ -24,7 +24,6 @@
// These are arbitrarily chosen, but with care not to overlap
// processor defined exceptions or interrupt vectors.
#define T_SYSCALL 64 // system call
#define T_TLBFLUSH 65 // flush TLB
#define T_SAMPCONF 66 // configure event counters
#define T_DEFAULT 500 // catchall
......
......@@ -8,12 +8,12 @@ start:
movq $argv, %rsi
movq $init, %rdi
movq $SYS_exec, %rax
int $T_SYSCALL
syscall
# for(;;) exit();
exit:
movq $SYS_exit, %rax
int $T_SYSCALL
syscall
jmp exit
# char init[] = "/init\0";
......
......@@ -431,7 +431,7 @@ sys_chdir(const char *path)
return 0;
}
//SYSCALL INT
//SYSCALL
int
sys_exec(const char *upath, userptr<userptr<const char> > uargv)
{
......
......@@ -89,21 +89,6 @@ trap(struct trapframe *tf)
panic("NMI");
}
if(tf->trapno == T_SYSCALL){
sti();
if(myproc()->killed) {
mtstart(trap, myproc());
exit();
}
myproc()->tf = tf;
tf->rax = syscall(tf->rdi, tf->rsi, tf->rdx, tf->rcx, tf->r8, tf->rax);
if(myproc()->killed) {
mtstart(trap, myproc());
exit();
}
return;
}
#if MTRACE
if (myproc()->mtrace_stacks.curr >= 0)
mtpause(myproc());
......@@ -226,8 +211,6 @@ inittrap(void)
entry = trapentry[i];
idt[i] = INTDESC(KCSEG, entry, bits);
}
entry = trapentry[T_SYSCALL];
idt[T_SYSCALL] = INTDESC(KCSEG, entry, SEG_DPL(3) | SEG_INTR64 |INT_P);
}
void
......
......@@ -55,13 +55,11 @@ SYS_%(uname)s = %(num)d
.globl %(uname)s
%(uname)s:
movq $%(num)d, %%rax""" % syscall.__dict__
if "INT" in syscall.flags:
print " int $T_SYSCALL"
else:
print " movq %rcx, %r10\n syscall"
print " ret"
print
movq $%(num)d, %%rax
movq %%rcx, %%r10
syscall
ret
""" % syscall.__dict__
if options.udecls:
for syscall in syscalls:
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论