Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)

- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
2013-12-06 12:04:52 +01:00
parent ff10274392
commit 84d9c625bf
4655 changed files with 379317 additions and 151059 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.1 2012/10/03 00:51:46 christos Exp $ */
/* $NetBSD: pmap.h,v 1.3 2013/07/17 23:15:20 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -113,29 +113,18 @@ void pmap_segtab_destroy(struct pmap *, pte_callback_t, uintptr_t);
extern kmutex_t pmap_segtab_lock;
#endif /* _KERNEL */
/*
* Per TLB (normally same as CPU) asid info
*/
struct pmap_asid_info {
LIST_ENTRY(pmap_asid_info) pai_link;
uint32_t pai_asid; /* TLB address space tag */
};
#define TLBINFO_LOCK(ti) mutex_spin_enter((ti)->ti_lock)
#define TLBINFO_UNLOCK(ti) mutex_spin_exit((ti)->ti_lock)
#define PMAP_PAI_ASIDVALID_P(pai, ti) ((pai)->pai_asid != 0)
#define PMAP_PAI(pmap, ti) (&(pmap)->pm_pai[tlbinfo_index(ti)])
#define PAI_PMAP(pai, ti) \
((pmap_t)((intptr_t)(pai) \
- offsetof(struct pmap, pm_pai[tlbinfo_index(ti)])))
#ifdef MULTIPROCESSOR
#include <sys/kcpuset.h>
#endif
#include <uvm/pmap/pmap_tlb.h>
/*
* Machine dependent pmap structure.
*/
struct pmap {
#ifdef MULTIPROCESSOR
__cpuset_t pm_active; /* pmap was active on ... */
__cpuset_t pm_onproc; /* pmap is active on ... */
kcpuset_t *pm_active; /* pmap was active on ... */
kcpuset_t *pm_onproc; /* pmap is active on ... */
volatile u_int pm_shootdown_pending;
#endif
pmap_segtab_t * pm_segtab; /* pointers to pages of PTEs */
@@ -148,49 +137,11 @@ struct pmap {
struct pmap_asid_info pm_pai[1];
};
enum tlb_invalidate_op {
TLBINV_NOBODY=0,
TLBINV_ONE=1,
TLBINV_ALLUSER=2,
TLBINV_ALLKERNEL=3,
TLBINV_ALL=4
};
struct pmap_tlb_info {
char ti_name[8];
uint32_t ti_asid_hint; /* probable next ASID to use */
uint32_t ti_asids_free; /* # of ASIDs free */
#define tlbinfo_noasids_p(ti) ((ti)->ti_asids_free == 0)
kmutex_t *ti_lock;
u_int ti_wired; /* # of wired TLB entries */
uint32_t ti_asid_max;
LIST_HEAD(, pmap_asid_info) ti_pais; /* list of active ASIDs */
#ifdef MULTIPROCESSOR
pmap_t ti_victim;
uint32_t ti_synci_page_bitmap; /* page indices needing a syncicache */
__cpuset_t ti_cpu_mask; /* bitmask of CPUs sharing this TLB */
enum tlb_invalidate_op ti_tlbinvop;
u_int ti_index;
#define tlbinfo_index(ti) ((ti)->ti_index)
struct evcnt ti_evcnt_synci_asts;
struct evcnt ti_evcnt_synci_all;
struct evcnt ti_evcnt_synci_pages;
struct evcnt ti_evcnt_synci_deferred;
struct evcnt ti_evcnt_synci_desired;
struct evcnt ti_evcnt_synci_duplicate;
#else
#define tlbinfo_index(ti) (0)
#endif
struct evcnt ti_evcnt_asid_reinits;
u_long ti_asid_bitmap[256 / (sizeof(u_long) * 8)];
};
#ifdef _KERNEL
struct pmap_kernel {
struct pmap kernel_pmap;
#ifdef MULTIPROCESSOR
struct pmap_asid_info kernel_pai[MAXCPUS-1];
#if defined(MULTIPROCESSOR) && PMAP_TLB_MAX > 1
struct pmap_asid_info kernel_pai[PMAP_TLB_MAX-1];
#endif
};
@@ -208,11 +159,6 @@ extern struct pool pmap_pv_pool;
extern struct pool_allocator pmap_pv_page_allocator;
extern struct pmap_kernel kernel_pmap_store;
extern struct pmap_tlb_info pmap_tlb0_info;
#ifdef MULTIPROCESSOR
extern struct pmap_tlb_info *pmap_tlbs[MAXCPUS];
extern u_int pmap_ntlbs;
#endif
extern struct pmap_limits pmap_limits;
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
@@ -231,27 +177,6 @@ void pmap_pvlist_lock_init(size_t);
#define PMAP_WBINV 1
#define PMAP_INV 2
#ifdef MULTIPROCESSOR
void pmap_tlb_shootdown_process(void);
bool pmap_tlb_shootdown_bystanders(pmap_t pmap);
void pmap_tlb_info_attach(struct pmap_tlb_info *, struct cpu_info *);
void pmap_md_tlb_info_attach(struct pmap_tlb_info *, struct cpu_info *);
void pmap_syncicache_ast(struct cpu_info *);
void pmap_syncicache_wanted(struct cpu_info *);
void pmap_syncicache(vaddr_t, uint32_t);
#endif
void pmap_tlb_info_init(struct pmap_tlb_info *);
void pmap_tlb_info_evcnt_attach(struct pmap_tlb_info *);
void pmap_tlb_asid_acquire(pmap_t, struct lwp *l);
void pmap_tlb_asid_deactivate(pmap_t);
void pmap_tlb_asid_release_all(pmap_t);
int pmap_tlb_update_addr(pmap_t, vaddr_t, uint32_t, u_int);
#define PMAP_TLB_NEED_IPI 0x01
#define PMAP_TLB_INSERT 0x02
void pmap_tlb_invalidate_addr(pmap_t, vaddr_t);
void pmap_tlb_check(pmap_t, bool (*)(void *, vaddr_t, tlb_asid_t, pt_entry_t));
void pmap_tlb_asid_check(void);
uint16_t pmap_pvlist_lock(struct vm_page_md *, bool);
#define PMAP_STEAL_MEMORY /* enable pmap_steal_memory() */

177
sys/uvm/pmap/pmap_tlb.h Normal file
View File

@@ -0,0 +1,177 @@
/* $NetBSD: pmap_tlb.h,v 1.3 2013/07/22 03:39:55 matt Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pmap.h 8.1 (Berkeley) 6/10/93
*/
/*
* Copyright (c) 1987 Carnegie-Mellon University
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pmap.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _COMMON_PMAP_TLB_H_
#define _COMMON_PMAP_TLB_H_
#include <sys/kcpuset.h>
#if defined(MULTIPROCESSOR) && !defined(PMAP_TLB_MAX)
#define PMAP_TLB_MAX MAXCPUS
#endif
/*
* Per TLB (normally same as CPU) asid info
*/
struct pmap_asid_info {
LIST_ENTRY(pmap_asid_info) pai_link;
uint32_t pai_asid; /* TLB address space tag */
};
#define TLBINFO_LOCK(ti) mutex_spin_enter((ti)->ti_lock)
#define TLBINFO_UNLOCK(ti) mutex_spin_exit((ti)->ti_lock)
#define PMAP_PAI_ASIDVALID_P(pai, ti) ((pai)->pai_asid != 0)
#define PMAP_PAI(pmap, ti) (&(pmap)->pm_pai[tlbinfo_index(ti)])
#define PAI_PMAP(pai, ti) \
((pmap_t)((intptr_t)(pai) \
- offsetof(struct pmap, pm_pai[tlbinfo_index(ti)])))
enum tlb_invalidate_op {
TLBINV_NOBODY=0,
TLBINV_ONE=1,
TLBINV_ALLUSER=2,
TLBINV_ALLKERNEL=3,
TLBINV_ALL=4
};
struct pmap_tlb_info {
char ti_name[8];
uint32_t ti_asids_free; /* # of ASIDs free */
#define tlbinfo_noasids_p(ti) ((ti)->ti_asids_free == 0)
kmutex_t *ti_lock;
u_int ti_wired; /* # of wired TLB entries */
tlb_asid_t ti_asid_hint; /* probable next ASID to use */
tlb_asid_t ti_asid_max;
LIST_HEAD(, pmap_asid_info) ti_pais; /* list of active ASIDs */
#ifdef MULTIPROCESSOR
pmap_t ti_victim;
uint32_t ti_synci_page_bitmap; /* page indices needing a syncicache */
#if PMAP_TLB_MAX > 1
kcpuset_t *ti_kcpuset; /* bitmask of CPUs sharing this TLB */
u_int ti_index;
enum tlb_invalidate_op ti_tlbinvop;
#define tlbinfo_index(ti) ((ti)->ti_index)
#else
#define tlbinfo_index(ti) (0)
#endif
struct evcnt ti_evcnt_synci_asts;
struct evcnt ti_evcnt_synci_all;
struct evcnt ti_evcnt_synci_pages;
struct evcnt ti_evcnt_synci_deferred;
struct evcnt ti_evcnt_synci_desired;
struct evcnt ti_evcnt_synci_duplicate;
#else
#define tlbinfo_index(ti) (0)
#endif
struct evcnt ti_evcnt_asid_reinits;
u_long ti_asid_bitmap[256 / (sizeof(u_long) * 8)];
};
#ifdef _KERNEL
extern struct pmap_tlb_info pmap_tlb0_info;
#ifdef MULTIPROCESSOR
extern struct pmap_tlb_info *pmap_tlbs[MAXCPUS];
extern u_int pmap_ntlbs;
#endif
#ifndef cpu_set_tlb_info
#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
#endif
#ifdef MULTIPROCESSOR
void pmap_tlb_shootdown_process(void);
bool pmap_tlb_shootdown_bystanders(pmap_t pmap);
void pmap_tlb_info_attach(struct pmap_tlb_info *, struct cpu_info *);
void pmap_md_tlb_info_attach(struct pmap_tlb_info *, struct cpu_info *);
#endif
void pmap_tlb_info_init(struct pmap_tlb_info *);
void pmap_tlb_info_evcnt_attach(struct pmap_tlb_info *);
void pmap_tlb_asid_acquire(pmap_t, struct lwp *l);
void pmap_tlb_asid_deactivate(pmap_t);
void pmap_tlb_asid_release_all(pmap_t);
int pmap_tlb_update_addr(pmap_t, vaddr_t, uint32_t, u_int);
#define PMAP_TLB_NEED_IPI 0x01
#define PMAP_TLB_INSERT 0x02
void pmap_tlb_invalidate_addr(pmap_t, vaddr_t);
void pmap_tlb_check(pmap_t, bool (*)(void *, vaddr_t, tlb_asid_t, pt_entry_t));
void pmap_tlb_asid_check(void);
#endif /* _KERNEL */
#endif /* _COMMON_PMAP_TLB_H_ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_aobj.h,v 1.22 2012/09/14 18:56:15 rmind Exp $ */
/* $NetBSD: uvm_aobj.h,v 1.23 2013/10/18 17:48:44 christos Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -61,7 +61,7 @@ void uao_dropswap(struct uvm_object *, int);
bool uao_swap_off(int, int);
void uao_dropswap_range(struct uvm_object *, voff_t, voff_t);
#else
#define uao_find_swslot(obj, off) 0
#define uao_find_swslot(obj, off) (__USE(off), 0)
#define uao_dropswap(obj, off) /* nothing */
#define uao_dropswap_range(obj, lo, hi) /* nothing */
#endif

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_extern.h,v 1.184 2012/09/01 00:26:37 matt Exp $ */
/* $NetBSD: uvm_extern.h,v 1.185 2013/11/14 12:07:11 martin Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -643,11 +643,11 @@ bool uvm_map_checkprot(struct vm_map *, vaddr_t,
vaddr_t, vm_prot_t);
int uvm_map_protect(struct vm_map *, vaddr_t,
vaddr_t, vm_prot_t, bool);
struct vmspace *uvmspace_alloc(vaddr_t, vaddr_t);
struct vmspace *uvmspace_alloc(vaddr_t, vaddr_t, bool);
void uvmspace_init(struct vmspace *, struct pmap *,
vaddr_t, vaddr_t);
void uvmspace_exec(struct lwp *, vaddr_t, vaddr_t);
void uvmspace_spawn(struct lwp *, vaddr_t, vaddr_t);
vaddr_t, vaddr_t, bool);
void uvmspace_exec(struct lwp *, vaddr_t, vaddr_t, bool);
void uvmspace_spawn(struct lwp *, vaddr_t, vaddr_t, bool);
struct vmspace *uvmspace_fork(struct vmspace *);
void uvmspace_addref(struct vmspace *);
void uvmspace_free(struct vmspace *);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_map.h,v 1.71 2012/02/19 00:05:56 rmind Exp $ */
/* $NetBSD: uvm_map.h,v 1.72 2012/10/29 16:00:05 para Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -150,7 +150,6 @@ struct vm_map_entry {
u_int8_t flags; /* flags */
#define UVM_MAP_KERNEL 0x01 /* kernel map entry */
#define UVM_MAP_KMAPENT 0x02 /* contains map entries */
#define UVM_MAP_STATIC 0x04 /* special static entries */
#define UVM_MAP_NOMERGE 0x08 /* this entry is not mergable */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_page.h,v 1.75 2012/05/05 20:45:35 rmind Exp $ */
/* $NetBSD: uvm_page.h,v 1.76 2013/10/25 14:30:21 martin Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -290,8 +290,12 @@ extern bool vm_page_zero_enable;
*/
#define VM_PHYSMEM_PTR(i) (&vm_physmem[i])
#if VM_PHYSSEG_MAX == 1
#define VM_PHYSMEM_PTR_SWAP(i, j) /* impossible */
#else
#define VM_PHYSMEM_PTR_SWAP(i, j) \
do { vm_physmem[(i)] = vm_physmem[(j)]; } while (0)
#endif
extern struct vm_physseg vm_physmem[VM_PHYSSEG_MAX];
extern int vm_nphysseg;

View File

@@ -255,11 +255,17 @@ extern u_int uvm_emap_size; /* size of emap */
#else
/* out-of-kernel versions of round_page and trunc_page */
#if !defined(__minix)
#define round_page(x) \
((((vaddr_t)(x) + (vm_page_size - 1)) / vm_page_size) * \
vm_page_size)
#define trunc_page(x) \
((((vaddr_t)(x)) / vm_page_size) * vm_page_size)
#else
/* LSC: Minix always uses the same definition of those. */
#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK)
#define trunc_page(x) ((x) & ~PAGE_MASK)
#endif /* !defined(__minix) */
#endif /* _KERNEL */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_pmap.h,v 1.37 2011/06/30 00:49:14 matt Exp $ */
/* $NetBSD: uvm_pmap.h,v 1.38 2013/02/02 14:06:58 matt Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -137,7 +137,6 @@ extern struct pmap *const kernel_pmap_ptr;
#ifndef PMAP_EXCLUDE_DECLS /* Used in Sparc port to virtualize pmap mod */
#ifdef _KERNEL
__BEGIN_DECLS
void pmap_activate(struct lwp *);
void pmap_deactivate(struct lwp *);
void pmap_unwire(pmap_t, vaddr_t);
@@ -165,7 +164,9 @@ vaddr_t pmap_growkernel(vaddr_t);
void pmap_init(void);
#if !defined(pmap_kenter_pa)
void pmap_kenter_pa(vaddr_t, paddr_t, vm_prot_t, u_int);
#endif
void pmap_kremove(vaddr_t, vsize_t);
#if !defined(pmap_is_modified)
bool pmap_is_modified(struct vm_page *);
@@ -211,7 +212,6 @@ vaddr_t pmap_steal_memory(vsize_t, vaddr_t *, vaddr_t *);
#if defined(PMAP_FORK)
void pmap_fork(pmap_t, pmap_t);
#endif
__END_DECLS
#endif /* kernel*/
#endif /* PMAP_EXCLUDE_DECLS */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: uvm_swap.h,v 1.18 2011/04/27 00:35:52 rmind Exp $ */
/* $NetBSD: uvm_swap.h,v 1.19 2013/11/23 14:32:13 christos Exp $ */
/*
* Copyright (c) 1997 Matthew R. Green
@@ -39,6 +39,7 @@
#endif
struct swapent;
struct lwp;
#if defined(VMSWAP)
int uvm_swap_get(struct vm_page *, int, int);
@@ -50,6 +51,7 @@ bool uvm_swapisfull(void);
#else /* defined(VMSWAP) */
#define uvm_swapisfull() true
#endif /* defined(VMSWAP) */
void uvm_swap_shutdown(struct lwp *);
#endif /* _KERNEL */