From owner-p4-projects@FreeBSD.ORG Tue Nov 28 15:36:58 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6FF7F16A417; Tue, 28 Nov 2006 15:36:58 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48DAE16A415 for ; Tue, 28 Nov 2006 15:36:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81CEB43CAD for ; Tue, 28 Nov 2006 15:36:52 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kASFat3X009267 for ; Tue, 28 Nov 2006 15:36:55 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kASFatol009264 for perforce@freebsd.org; Tue, 28 Nov 2006 15:36:55 GMT (envelope-from gonzo@FreeBSD.org) Date: Tue, 28 Nov 2006 15:36:55 GMT Message-Id: <200611281536.kASFatol009264@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 110623 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2006 15:36:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=110623 Change 110623 by gonzo@gonzo_hq on 2006/11/28 15:36:42 o Switch on ASID magic. Further work is required though. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips/pmap.c#17 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips/pmap.c#17 (text+ko) ==== @@ -186,6 +186,10 @@ * Data for the ASID allocator */ static int pmap_maxasid; +/* zero ASID is reserved for KVA */ +#define PMAP_ASID_RESERVED 0 +#define MIPS_TLB_MAX_ASID 255 + static pmap_t pmap_active; static LIST_HEAD(,pmap) allpmaps; static struct mtx allpmaps_lock; @@ -324,11 +328,14 @@ */ kernel_pmap->pm_private.pm_direct_map = kptmap; kernel_pmap->pm_active = ~0; - kernel_pmap->pm_asid = 0; + kernel_pmap->pm_asid = PMAP_ASID_RESERVED; kernel_pmap->pm_asidgen = 1; PMAP_LOCK_INIT(kernel_pmap); TAILQ_INIT(&kernel_pmap->pm_pvlist); + pmap_maxasid = MIPS_TLB_MAX_ASID; + PCPU_SET(next_asid, 1); + /* * Initialize list of pmaps. */ @@ -484,7 +491,7 @@ * * Invalidate all per-process mappings and I-cache */ - PCPU_SET(next_asid, 0); + PCPU_SET(next_asid, 1); PCPU_SET(current_asidgen, (PCPU_GET(current_asidgen) + 1) & ASIDGEN_MASK); @@ -704,8 +711,10 @@ pmap->pm_private.pm_direct_map = kptmap; pmap->pm_ptphint = NULL; pmap->pm_active = 0; - pmap->pm_asid = 0; - pmap->pm_asidgen = 0; + + pmap->pm_asid = PMAP_ASID_RESERVED; + pmap->pm_asidgen = 1; + TAILQ_INIT(&pmap->pm_pvlist); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN | MTX_QUIET);