Date: Mon, 21 Jan 2008 23:29:10 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 133827 for review Message-ID: <200801212329.m0LNTAAU024679@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133827 Change 133827 by gonzo@gonzo_jeeves on 2008/01/21 23:29:06 o Back out a bit hackerish solution for kstack0 located in KSEG0 while cpu_thread_alloc expects to get it in KSEG2 presented by changesets 133821 and 133822. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#10 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/vm_machdep.c#10 (text+ko) ==== @@ -140,22 +140,13 @@ td2->td_frame->v1 = 1; td2->td_frame->a3 = 0; - /* - * thread 0 has its stack in KSEG0 space. In that case, there's - * nothing to do since we're not going to change the physical address - * of where we're swapped in at... - */ - pte = pmap_segmap(kernel_pmap, (vm_offset_t)td2->td_kstack); - if (pte == NULL) { - if ((vm_offset_t)td2->td_kstack < MIPS_KSEG0_START && - (vm_offset_t)td2->td_kstack > MIPS_KSEG0_END) - panic("cpu_fork: invalid segmap"); - } else { - pte += ((vm_offset_t)td2->td_kstack >> PGSHIFT) & (NPTEPG - 1); - for (i = 0; i < KSTACK_PAGES; i++) { - td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED); - pte++; - } + if (!(pte = pmap_segmap(kernel_pmap, (vm_offset_t)td2->td_kstack))) + panic("cpu_fork: invalid segmap"); + pte += ((vm_offset_t)td2->td_kstack >> PGSHIFT) & (NPTEPG - 1); + + for (i = 0; i < KSTACK_PAGES; i++) { + td2->td_md.md_upte[i] = *pte & ~(PG_RO|PG_WIRED); + pte++; } if (td1 == PCPU_GET(fpcurthread)) @@ -258,15 +249,6 @@ td->td_kstack_pages * PAGE_SIZE) - 1; td->td_frame = &td->td_pcb->pcb_regs; - /* - * thread 0 has its stack in KSEG0 space. In that case, there's - * nothing to do since we're not going to change the physical address - * of where we're swapped in at... - */ - if ((vm_offset_t)td->td_kstack > MIPS_KSEG0_START && - (vm_offset_t)td->td_kstack < MIPS_KSEG0_END) - return; - if (!(pte = pmap_segmap(kernel_pmap, (vm_offset_t)td->td_kstack))) panic("cpu_thread_alloc: invalid segmap"); pte += ((vm_offset_t)td->td_kstack >> PGSHIFT) & (NPTEPG - 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801212329.m0LNTAAU024679>