Sun Aug 28 00:51:22 2011 UTC ()
Use __strict_weak_alias().


(dyoung)
diff -r1.128 -r1.129 src/sys/arch/x86/x86/pmap.c

cvs diff -r1.128 -r1.129 src/sys/arch/x86/x86/pmap.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/pmap.c 2011/08/14 02:31:08 1.128
+++ src/sys/arch/x86/x86/pmap.c 2011/08/28 00:51:21 1.129
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.128 2011/08/14 02:31:08 rmind Exp $ */ 1/* $NetBSD: pmap.c,v 1.129 2011/08/28 00:51:21 dyoung Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -161,27 +161,27 @@ @@ -161,27 +161,27 @@
161 * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson 161 * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson
162 * and David Greenman. 162 * and David Greenman.
163 * 163 *
164 * [3] the Mach pmap. this pmap, from CMU, seems to have migrated 164 * [3] the Mach pmap. this pmap, from CMU, seems to have migrated
165 * between several processors. the VAX version was done by 165 * between several processors. the VAX version was done by
166 * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 166 * Avadis Tevanian, Jr., and Michael Wayne Young. the i386
167 * version was done by Lance Berc, Mike Kupfer, Bob Baron, 167 * version was done by Lance Berc, Mike Kupfer, Bob Baron,
168 * David Golub, and Richard Draves. the alpha version was 168 * David Golub, and Richard Draves. the alpha version was
169 * done by Alessandro Forin (CMU/Mach) and Chris Demetriou 169 * done by Alessandro Forin (CMU/Mach) and Chris Demetriou
170 * (NetBSD/alpha). 170 * (NetBSD/alpha).
171 */ 171 */
172 172
173#include <sys/cdefs.h> 173#include <sys/cdefs.h>
174__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.128 2011/08/14 02:31:08 rmind Exp $"); 174__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.129 2011/08/28 00:51:21 dyoung Exp $");
175 175
176#include "opt_user_ldt.h" 176#include "opt_user_ldt.h"
177#include "opt_lockdebug.h" 177#include "opt_lockdebug.h"
178#include "opt_multiprocessor.h" 178#include "opt_multiprocessor.h"
179#include "opt_xen.h" 179#include "opt_xen.h"
180#if !defined(__x86_64__) 180#if !defined(__x86_64__)
181#include "opt_kstack_dr0.h" 181#include "opt_kstack_dr0.h"
182#endif /* !defined(__x86_64__) */ 182#endif /* !defined(__x86_64__) */
183 183
184#include <sys/param.h> 184#include <sys/param.h>
185#include <sys/systm.h> 185#include <sys/systm.h>
186#include <sys/proc.h> 186#include <sys/proc.h>
187#include <sys/pool.h> 187#include <sys/pool.h>
@@ -1059,27 +1059,27 @@ pmap_emap_sync(bool canload) @@ -1059,27 +1059,27 @@ pmap_emap_sync(bool canload)
1059 1059
1060void 1060void
1061pmap_emap_remove(vaddr_t sva, vsize_t len) 1061pmap_emap_remove(vaddr_t sva, vsize_t len)
1062{ 1062{
1063 pt_entry_t *pte, xpte; 1063 pt_entry_t *pte, xpte;
1064 vaddr_t va, eva = sva + len; 1064 vaddr_t va, eva = sva + len;
1065 1065
1066 for (va = sva; va < eva; va += PAGE_SIZE) { 1066 for (va = sva; va < eva; va += PAGE_SIZE) {
1067 pte = (va < VM_MIN_KERNEL_ADDRESS) ? vtopte(va) : kvtopte(va); 1067 pte = (va < VM_MIN_KERNEL_ADDRESS) ? vtopte(va) : kvtopte(va);
1068 xpte |= pmap_pte_testset(pte, 0); 1068 xpte |= pmap_pte_testset(pte, 0);
1069 } 1069 }
1070} 1070}
1071 1071
1072__weak_alias(pmap_kenter_ma, pmap_kenter_pa); 1072__strict_weak_alias(pmap_kenter_ma, pmap_kenter_pa);
1073 1073
1074#if defined(__x86_64__) 1074#if defined(__x86_64__)
1075/* 1075/*
1076 * Change protection for a virtual address. Local for a CPU only, don't 1076 * Change protection for a virtual address. Local for a CPU only, don't
1077 * care about TLB shootdowns. 1077 * care about TLB shootdowns.
1078 * 1078 *
1079 * => must be called with preemption disabled 1079 * => must be called with preemption disabled
1080 */ 1080 */
1081void 1081void
1082pmap_changeprot_local(vaddr_t va, vm_prot_t prot) 1082pmap_changeprot_local(vaddr_t va, vm_prot_t prot)
1083{ 1083{
1084 pt_entry_t *pte, opte, npte; 1084 pt_entry_t *pte, opte, npte;
1085 1085
@@ -2872,27 +2872,27 @@ pmap_extract(struct pmap *pmap, vaddr_t  @@ -2872,27 +2872,27 @@ pmap_extract(struct pmap *pmap, vaddr_t
2872 * machine-dependent code only. 2872 * machine-dependent code only.
2873 */ 2873 */
2874 2874
2875paddr_t 2875paddr_t
2876vtophys(vaddr_t va) 2876vtophys(vaddr_t va)
2877{ 2877{
2878 paddr_t pa; 2878 paddr_t pa;
2879 2879
2880 if (pmap_extract(pmap_kernel(), va, &pa) == true) 2880 if (pmap_extract(pmap_kernel(), va, &pa) == true)
2881 return (pa); 2881 return (pa);
2882 return (0); 2882 return (0);
2883} 2883}
2884 2884
2885__weak_alias(pmap_extract_ma, pmap_extract); 2885__strict_weak_alias(pmap_extract_ma, pmap_extract);
2886 2886
2887#ifdef XEN 2887#ifdef XEN
2888 2888
2889/* 2889/*
2890 * vtomach: virtual address to machine address. For use by 2890 * vtomach: virtual address to machine address. For use by
2891 * machine-dependent code only. 2891 * machine-dependent code only.
2892 */ 2892 */
2893 2893
2894paddr_t 2894paddr_t
2895vtomach(vaddr_t va) 2895vtomach(vaddr_t va)
2896{ 2896{
2897 paddr_t pa; 2897 paddr_t pa;
2898 2898
@@ -3770,27 +3770,27 @@ pmap_unwire(struct pmap *pmap, vaddr_t v @@ -3770,27 +3770,27 @@ pmap_unwire(struct pmap *pmap, vaddr_t v
3770} 3770}
3771 3771
3772/* 3772/*
3773 * pmap_copy: copy mappings from one pmap to another 3773 * pmap_copy: copy mappings from one pmap to another
3774 * 3774 *
3775 * => optional function 3775 * => optional function
3776 * void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr) 3776 * void pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
3777 */ 3777 */
3778 3778
3779/* 3779/*
3780 * defined as macro in pmap.h 3780 * defined as macro in pmap.h
3781 */ 3781 */
3782 3782
3783__weak_alias(pmap_enter, pmap_enter_default); 3783__strict_weak_alias(pmap_enter, pmap_enter_default);
3784 3784
3785int 3785int
3786pmap_enter_default(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, 3786pmap_enter_default(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot,
3787 u_int flags) 3787 u_int flags)
3788{ 3788{
3789 return pmap_enter_ma(pmap, va, pa, pa, prot, flags, 0); 3789 return pmap_enter_ma(pmap, va, pa, pa, prot, flags, 0);
3790} 3790}
3791 3791
3792/* 3792/*
3793 * pmap_enter: enter a mapping into a pmap 3793 * pmap_enter: enter a mapping into a pmap
3794 * 3794 *
3795 * => must be done "now" ... no lazy-evaluation 3795 * => must be done "now" ... no lazy-evaluation
3796 * => we set pmap => pv_head locking 3796 * => we set pmap => pv_head locking