use x86-64 names

This commit is contained in:
Frans Kaashoek 2018-10-03 18:13:51 -04:00
parent 23a58370a4
commit eb72653bd7
3 changed files with 6 additions and 6 deletions

4
proc.c
View file

@ -118,7 +118,7 @@ found:
sp -= sizeof *p->context; sp -= sizeof *p->context;
p->context = (struct context*)sp; p->context = (struct context*)sp;
memset(p->context, 0, sizeof *p->context); memset(p->context, 0, sizeof *p->context);
p->context->eip = (uint64)forkret; p->context->rip = (uint64)forkret;
return p; return p;
} }
@ -531,7 +531,7 @@ procdump(void)
state = "???"; state = "???";
cprintf("%d %s %s", p->pid, state, p->name); cprintf("%d %s %s", p->pid, state, p->name);
if(p->state == SLEEPING){ if(p->state == SLEEPING){
getcallerpcs((uint64*)p->context->ebp+2, pc); getcallerpcs((uint64*)p->context->rbp+2, pc);
for(i=0; i<10 && pc[i] != 0; i++) for(i=0; i<10 && pc[i] != 0; i++)
cprintf(" %p", pc[i]); cprintf(" %p", pc[i]);
} }

4
proc.h
View file

@ -33,8 +33,8 @@ struct context {
uint64 r12; uint64 r12;
uint64 r11; uint64 r11;
uint64 rbx; uint64 rbx;
uint64 ebp; //rbp uint64 rbp;
uint64 eip; //rip; uint64 rip;
}; };
enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE }; enum procstate { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE };

4
trap.c
View file

@ -87,13 +87,13 @@ trap(struct trapframe *tf)
default: default:
if(myproc() == 0 || (tf->cs&3) == 0){ if(myproc() == 0 || (tf->cs&3) == 0){
// In kernel, it must be our mistake. // In kernel, it must be our mistake.
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", cprintf("unexpected trap %d from cpu %d rip %x (cr2=0x%x)\n",
tf->trapno, cpuid(), tf->rip, rcr2()); tf->trapno, cpuid(), tf->rip, rcr2());
panic("trap"); panic("trap");
} }
// In user space, assume process misbehaved. // In user space, assume process misbehaved.
cprintf("pid %d %s: trap %d err %d on cpu %d " cprintf("pid %d %s: trap %d err %d on cpu %d "
"eip 0x%x addr 0x%x--kill proc\n", "rip 0x%x addr 0x%x--kill proc\n",
myproc()->pid, myproc()->name, tf->trapno, myproc()->pid, myproc()->name, tf->trapno,
tf->err, cpuid(), tf->rip, rcr2()); tf->err, cpuid(), tf->rip, rcr2());
myproc()->killed = 1; myproc()->killed = 1;