From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 11:53:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C52059CE; Sun, 28 Oct 2012 11:53:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788A08FC0A; Sun, 28 Oct 2012 11:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SBrtlj099268; Sun, 28 Oct 2012 11:53:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SBrtAv099265; Sun, 28 Oct 2012 11:53:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210281153.q9SBrtAv099265@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Oct 2012 11:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242218 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 11:53:56 -0000 Author: kib Date: Sun Oct 28 11:53:54 2012 New Revision: 242218 URL: http://svn.freebsd.org/changeset/base/242218 Log: Fix compilation on ia64 when page size is configured for 16KB. Reviewed by: alc, marcel Modified: head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sun Oct 28 11:27:54 2012 (r242217) +++ head/sys/ia64/ia64/pmap.c Sun Oct 28 11:53:54 2012 (r242218) @@ -140,6 +140,29 @@ extern uint64_t ia64_gateway_page[]; #define pmap_set_wired(lpte) (lpte)->pte |= PTE_WIRED /* + * Individual PV entries are stored in per-pmap chunks. This saves + * space by eliminating the need to record the pmap within every PV + * entry. + */ +#if PAGE_SIZE == 8192 +#define _NPCM 6 +#define _NPCPV 337 +#define _NPCS 2 +#elif PAGE_SIZE == 16384 +#define _NPCM 11 +#define _NPCPV 677 +#define _NPCS 1 +#endif +struct pv_chunk { + pmap_t pc_pmap; + TAILQ_ENTRY(pv_chunk) pc_list; + u_long pc_map[_NPCM]; /* bitmap; 1 = free */ + TAILQ_ENTRY(pv_chunk) pc_lru; + u_long pc_spare[_NPCS]; + struct pv_entry pc_pventry[_NPCPV]; +}; + +/* * The VHPT bucket head structure. */ struct ia64_bucket { @@ -693,8 +716,6 @@ pmap_growkernel(vm_offset_t addr) ***************************************************/ CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); -CTASSERT(_NPCM == 6); -CTASSERT(_NPCPV == 337); static __inline struct pv_chunk * pv_to_chunk(pv_entry_t pv) @@ -705,13 +726,23 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) -#define PC_FREE0_4 0xfffffffffffffffful -#define PC_FREE5 0x000000000001fffful +#define PC_FREE_FULL 0xfffffffffffffffful +#define PC_FREE_PARTIAL \ + ((1UL << (_NPCPV - sizeof(u_long) * 8 * (_NPCM - 1))) - 1) +#if PAGE_SIZE == 8192 static const u_long pc_freemask[_NPCM] = { - PC_FREE0_4, PC_FREE0_4, PC_FREE0_4, - PC_FREE0_4, PC_FREE0_4, PC_FREE5 + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_PARTIAL }; +#elif PAGE_SIZE == 16384 +static const u_long pc_freemask[_NPCM] = { + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_PARTIAL +}; +#endif static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Sun Oct 28 11:27:54 2012 (r242217) +++ head/sys/ia64/include/pmap.h Sun Oct 28 11:53:54 2012 (r242218) @@ -105,21 +105,6 @@ typedef struct pv_entry { TAILQ_ENTRY(pv_entry) pv_list; } *pv_entry_t; -/* - * pv_entries are allocated in chunks per-process. This avoids the - * need to track per-pmap assignments. - */ -#define _NPCM 6 -#define _NPCPV 337 -struct pv_chunk { - pmap_t pc_pmap; - TAILQ_ENTRY(pv_chunk) pc_list; - u_long pc_map[_NPCM]; /* bitmap; 1 = free */ - TAILQ_ENTRY(pv_chunk) pc_lru; - u_long pc_spare[2]; - struct pv_entry pc_pventry[_NPCPV]; -}; - #ifdef _KERNEL extern vm_paddr_t phys_avail[];