void acsyscall(void) { panic("acsyscall"); #if 0 Proc *p; /* * If we saved the Ureg into m->proc->dbgregs, * There's nothing else we have to do. * Otherwise, we should m->proc->dbgregs = u; */ DBG("acsyscall: cpu%d\n", machp()->machno); _pmcupdate(m); p = m->proc; p->actime1 = fastticks(nil); m->syscall++; /* would also count it in the TS core */ m->icc->rc = ICCSYSCALL; m->cr2 = cr2get(); fpuprocsave(p); _pmcupdate(m); mfence(); m->icc->fn = nil; ready(p); /* * The next call is probably going to make us jmp * into user code, forgetting all our state in this * stack, upon the next syscall. * We don't nest calls in the current stack for too long. */ acsched(); #endif }
/* * Save the mach dependent part of the process state. */ void procsave(Proc* p) { uvlong t; cycles(&t); p->pcycles += t; fpuprocsave(p); }
/* * Save the mach dependent part of the process state. * NB: the caller should mmuflushtlb after procsave(). * procsave/procrestore don't touch the mmu, they * care about fpu, mostly. */ void procsave(Proc *p) { uint64_t t; cycles(&t); p->pcycles += t; fpuprocsave(p); }
/* * Save the mach dependent part of the process state. */ void procsave(Proc* p) { uvlong t; cycles(&t); p->pcycles += t; // TODO: save and restore VFPv3 FP state once 5[cal] know the new registers. fpuprocsave(p); }
/* * Save the mach dependent part of the process state. */ void procsave(Proc* p) { uvlong t; cycles(&t); p->pcycles += t; fpuprocsave(p); l1cache->wbse(p, sizeof *p); /* is this needed? */ l1cache->wb(); /* is this needed? */ }
/* * Entered in AP core context, upon traps (system calls go through acsyscall) * using up->dbgreg means cores MUST be homogeneous. * * BUG: We should setup some trapenable() mechanism for the AC, * so that code like fpu.c could arrange for handlers specific for * the AC, instead of doint that by hand here. * * All interrupts are masked while in the "kernel" */ void actrap(Ureg *u) { panic("actrap"); #if 0 char *n; ACVctl *v; n = nil; _pmcupdate(m); if(m->proc != nil){ m->proc->nactrap++; m->proc->actime1 = fastticks(nil); } if(u->type < nelem(acvctl)){ v = acvctl[u->type]; if(v != nil){ DBG("actrap: cpu%d: %ulld\n", machp()->machno, u->type); n = v->f(u, v->a); if(n != nil) goto Post; return; } } switch(u->type){ case IdtDF: print("AC: double fault\n"); dumpregs(u); ndnr(); case IdtIPI: m->intr++; DBG("actrap: cpu%d: IPI\n", machp()->machno); apiceoi(IdtIPI); break; case IdtTIMER: apiceoi(IdtTIMER); panic("timer interrupt in an AC"); break; case IdtPF: /* this case is here for debug only */ m->pfault++; DBG("actrap: cpu%d: PF cr2 %#ullx\n", machp()->machno, cr2get()); break; default: print("actrap: cpu%d: %ulld\n", machp()->machno, u->type); } Post: m->icc->rc = ICCTRAP; m->cr2 = cr2get(); memmove(m->proc->dbgreg, u, sizeof *u); m->icc->note = n; fpuprocsave(m->proc); _pmcupdate(m); mfence(); m->icc->fn = nil; ready(m->proc); mwait(&m->icc->fn); if(m->icc->flushtlb) acmmuswitch(); if(m->icc->fn != actrapret) acsched(); DBG("actrap: ret\n"); memmove(u, m->proc->dbgreg, sizeof *u); if(m->proc) m->proc->actime += fastticks2us(fastticks(nil) - m->proc->actime1); #endif }
/* * Save the mach dependent part of the process state. */ void procsave(Proc *p) { fpuprocsave(p); }