int segflush(void *a, ulong n) { /* flush dcache then invalidate icache */ dcflush(a, n); icflush(a, n); return 0; }
/* * initialize a processor's mach structure. each processor does this * for itself. */ void machinit(void) { int n; Hwcpu *cpu; icflush(); n = m->machno; memset(m, 0, sizeof(Mach)); m->machno = n; active.exiting = 0; active.machs = 1; cpu = (Hwcpu*) ((ulong)hwrpb + hwrpb->cpuoff + n*hwrpb->cpulen); cpu->state &= ~Cpubootinprog; if (0) cpu->state |= Cpuhaltstayhalted; }