Change cpu_tlb_info definition based on PMAP_TLB_MAX instead of MULTIPROCESSOR

This commit is contained in:
matt 2014-04-03 14:46:25 +00:00
parent dfe09fda34
commit 21b604c9f8
2 changed files with 16 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $ */
/* $NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.7 2014/04/03 14:23:38 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $");
/*
* Manages address spaces in a TLB.
@ -947,8 +947,8 @@ pmap_tlb_asid_release_all(struct pmap *pm)
KASSERT(pm != pmap_kernel());
#if defined(MULTIPROCESSOR)
//KASSERT(!kcpuset_iszero(pm->pm_onproc)); // XXX
struct cpu_info * const ci __diagused = curcpu();
#if PMAP_TLB_MAX > 1
struct cpu_info * const ci __diagused = curcpu();
for (u_int i = 0; !kcpuset_iszero(pm->pm_active); i++) {
KASSERT(i < pmap_ntlbs);
struct pmap_tlb_info * const ti = pmap_tlbs[i];

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_tlb.h,v 1.5 2014/03/30 15:26:15 matt Exp $ */
/* $NetBSD: pmap_tlb.h,v 1.6 2014/04/03 14:46:25 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@ -76,8 +76,12 @@
#include <sys/kcpuset.h>
#if defined(MULTIPROCESSOR) && !defined(PMAP_TLB_MAX)
#define PMAP_TLB_MAX MAXCPUS
#if !defined(PMAP_TLB_MAX)
# if defined(MULTIPROCESSOR)
# define PMAP_TLB_MAX MAXCPUS
# else
# define PMAP_TLB_MAX 1
# endif
#endif
/*
@ -145,14 +149,14 @@ extern u_int pmap_ntlbs;
#endif
#ifndef cpu_set_tlb_info
#define cpu_set_tlb_info(ci, ti) ((void)((ci)->ci_tlb_info = (ti)))
# define cpu_set_tlb_info(ci, ti) ((void)((ci)->ci_tlb_info = (ti)))
#endif
#ifndef cpu_tlb_info
#ifdef MULTIPROCESSOR
#define cpu_tlb_info(ci) ((ci)->ci_tlb_info)
#else
#define cpu_tlb_info(ci) (&pmap_tlb0_info)
#endif
# if PMAP_TLB_MAX > 1
# define cpu_tlb_info(ci) ((ci)->ci_tlb_info)
# else
# define cpu_tlb_info(ci) (&pmap_tlb0_info)
# endif
#endif
#ifdef MULTIPROCESSOR