PERFORCE change 48394 for review
Peter Wemm
peter at FreeBSD.org
Sun Mar 7 18:00:59 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=48394
Change 48394 by peter at peter_overcee on 2004/03/07 18:00:33
IFC @48391
Affected files ...
.. //depot/projects/hammer/lib/libc/stdlib/malloc.c#14 integrate
.. //depot/projects/hammer/sys/alpha/alpha/pmap.c#19 integrate
.. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#34 integrate
.. //depot/projects/hammer/sys/amd64/amd64/machdep.c#82 integrate
.. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#57 integrate
.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#57 integrate
.. //depot/projects/hammer/sys/amd64/amd64/trap.c#40 integrate
.. //depot/projects/hammer/sys/amd64/include/cpufunc.h#21 integrate
.. //depot/projects/hammer/sys/i386/i386/pmap.c#30 integrate
.. //depot/projects/hammer/sys/i386/i386/vm_machdep.c#21 integrate
.. //depot/projects/hammer/sys/ia64/ia64/pmap.c#22 integrate
.. //depot/projects/hammer/sys/kern/kern_fork.c#30 integrate
.. //depot/projects/hammer/sys/netgraph/ng_iface.c#8 integrate
.. //depot/projects/hammer/sys/netgraph/ng_iface.h#4 integrate
.. //depot/projects/hammer/sys/powerpc/powerpc/pmap.c#19 integrate
.. //depot/projects/hammer/sys/sparc64/sparc64/pmap.c#21 integrate
.. //depot/projects/hammer/sys/vm/pmap.h#15 integrate
.. //depot/projects/hammer/sys/vm/vm_glue.c#24 integrate
.. //depot/projects/hammer/sys/vm/vm_map.c#31 integrate
.. //depot/projects/hammer/usr.bin/printf/printf.c#3 integrate
Differences ...
==== //depot/projects/hammer/lib/libc/stdlib/malloc.c#14 (text+ko) ====
@@ -9,7 +9,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.86 2004/02/21 09:14:38 phk Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.87 2004/03/07 20:41:27 phk Exp $");
/*
* Defining MALLOC_EXTRA_SANITY will enable extra checks which are related
@@ -198,9 +198,6 @@
#define INIT_MMAP()
#endif
-/* Set when initialization has been done */
-static unsigned malloc_started;
-
/* Number of free pages we cache */
static unsigned malloc_cache = 16;
@@ -491,9 +488,6 @@
malloc_ninfo = malloc_pagesize / sizeof *page_dir;
- /* Been here, done that */
- malloc_started++;
-
/* Recalculate the cache size in bytes, and make sure it's nonzero */
if (!malloc_cache)
@@ -729,9 +723,6 @@
{
void *result;
- if (!malloc_started)
- malloc_init();
-
if (suicide)
abort();
@@ -764,11 +755,6 @@
if (suicide)
abort();
- if (!malloc_started) {
- wrtwarning("malloc() has never been called\n");
- return (NULL);
- }
-
index = ptr2index(ptr);
if (index < malloc_pageshift) {
@@ -1061,11 +1047,6 @@
if (ptr == NULL)
return;
- if (!malloc_started) {
- wrtwarning("malloc() has never been called\n");
- return;
- }
-
/* If we're already sinking, don't make matters any worse. */
if (suicide)
return;
@@ -1097,6 +1078,7 @@
void *r;
int err = 0;
static int malloc_active; /* Recusion flag for public interface. */
+ static unsigned malloc_started; /* Set when initialization has been done */
/*
* If a thread is inside our code with a functional lock held, and then
@@ -1115,6 +1097,18 @@
return (NULL);
}
malloc_active = 1;
+
+ if (!malloc_started) {
+ if (ptr != NULL) {
+ wrtwarning("malloc() has never been called\n");
+ malloc_active = 0;
+ _MALLOC_UNLOCK();
+ errno = EDOOFUS;
+ return (NULL);
+ }
+ malloc_init();
+ malloc_started = 1;
+ }
if (ptr == ZEROSIZEPTR)
ptr = NULL;
==== //depot/projects/hammer/sys/alpha/alpha/pmap.c#19 (text+ko) ====
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.139 2003/10/03 22:46:52 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.140 2004/03/07 21:06:46 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1109,18 +1109,6 @@
mtx_lock_spin(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
mtx_unlock_spin(&allpmaps_lock);
-}
-
-/*
- * Wire in kernel global address entries. To avoid a race condition
- * between pmap initialization and pmap_growkernel, this procedure
- * should be called after the vmspace is attached to the process
- * but before this pmap is activated.
- */
-void
-pmap_pinit2(pmap)
- struct pmap *pmap;
-{
bcopy(PTlev1 + K1SEGLEV1I, pmap->pm_lev1 + K1SEGLEV1I, nklev2 * PTESIZE);
}
==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#34 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.7 2004/01/30 00:24:45 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.8 2004/03/08 00:15:29 peter Exp $");
#include <sys/param.h>
#include <sys/systm.h>
==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#82 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.604 2004/02/25 23:12:39 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.605 2004/03/08 00:16:52 peter Exp $");
#include "opt_atalk.h"
#include "opt_atpic.h"
==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#57 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.234 2004/01/30 00:24:45 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.235 2004/03/08 00:25:03 peter Exp $");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#57 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.452 2004/02/05 00:11:05 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.453 2004/03/07 21:06:47 alc Exp $");
/*
* Manages physical address maps.
@@ -1103,19 +1103,6 @@
}
/*
- * Wire in kernel global address entries. To avoid a race condition
- * between pmap initialization and pmap_growkernel, this procedure
- * should be called after the vmspace is attached to the process
- * but before this pmap is activated.
- */
-void
-pmap_pinit2(pmap)
- struct pmap *pmap;
-{
- /* XXX: Remove this stub when no longer called */
-}
-
-/*
* this routine is called if the page table page is not
* mapped correctly.
*
==== //depot/projects/hammer/sys/amd64/amd64/trap.c#40 (text+ko) ====
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.272 2004/01/29 00:05:03 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.273 2004/03/08 00:17:27 peter Exp $");
/*
* AMD64 Trap and System call handling
==== //depot/projects/hammer/sys/amd64/include/cpufunc.h#21 (text+ko) ====
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.140 2004/03/05 09:19:59 le Exp $
+ * $FreeBSD: src/sys/amd64/include/cpufunc.h,v 1.141 2004/03/08 00:24:15 peter Exp $
*/
/*
@@ -763,6 +763,8 @@
u_int64_t rdr7(void);
u_int64_t rdtsc(void);
u_int read_rflags(void);
+u_int rfs(void);
+u_int rgs(void);
void wbinvd(void);
void write_rflags(u_int rf);
void wrmsr(u_int msr, u_int64_t newval);
==== //depot/projects/hammer/sys/i386/i386/pmap.c#30 (text+ko) ====
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.462 2004/02/01 20:14:00 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.463 2004/03/07 21:06:47 alc Exp $");
/*
* Manages physical address maps.
@@ -1147,19 +1147,6 @@
}
/*
- * Wire in kernel global address entries. To avoid a race condition
- * between pmap initialization and pmap_growkernel, this procedure
- * should be called after the vmspace is attached to the process
- * but before this pmap is activated.
- */
-void
-pmap_pinit2(pmap)
- struct pmap *pmap;
-{
- /* XXX: Remove this stub when no longer called */
-}
-
-/*
* this routine is called if the page table page is not
* mapped correctly.
*/
==== //depot/projects/hammer/sys/i386/i386/vm_machdep.c#21 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.225 2004/01/05 12:00:58 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.227 2004/03/08 01:55:34 peter Exp $");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
==== //depot/projects/hammer/sys/ia64/ia64/pmap.c#22 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.126 2004/03/07 07:43:13 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.127 2004/03/07 21:06:47 alc Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -735,17 +735,6 @@
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
}
-/*
- * Wire in kernel global address entries. To avoid a race condition
- * between pmap initialization and pmap_growkernel, this procedure
- * should be called after the vmspace is attached to the process
- * but before this pmap is activated.
- */
-void
-pmap_pinit2(struct pmap *pmap)
-{
-}
-
/***************************************************
* Pmap allocation/deallocation routines.
***************************************************/
==== //depot/projects/hammer/sys/kern/kern_fork.c#30 (text+ko) ====
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.219 2004/03/07 00:06:32 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.220 2004/03/08 00:32:34 peter Exp $");
#include "opt_ktrace.h"
#include "opt_mac.h"
==== //depot/projects/hammer/sys/netgraph/ng_iface.c#8 (text+ko) ====
@@ -35,7 +35,7 @@
*
* Author: Archie Cobbs <archie at freebsd.org>
*
- * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.28 2003/12/28 03:56:00 sam Exp $
+ * $FreeBSD: src/sys/netgraph/ng_iface.c,v 1.29 2004/03/07 23:00:44 ru Exp $
* $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $
*/
@@ -186,6 +186,13 @@
NULL,
&ng_cisco_ipaddr_type
},
+ {
+ NGM_IFACE_COOKIE,
+ NGM_IFACE_GET_IFINDEX,
+ "getifindex",
+ NULL,
+ &ng_parse_uint32_type
+ },
{ 0 }
};
@@ -667,6 +674,15 @@
break;
}
+ case NGM_IFACE_GET_IFINDEX:
+ NG_MKRESPONSE(resp, msg, sizeof(uint32_t), M_NOWAIT);
+ if (resp == NULL) {
+ error = ENOMEM;
+ break;
+ }
+ *((uint32_t *)resp->data) = priv->ifp->if_index;
+ break;
+
default:
error = EINVAL;
break;
==== //depot/projects/hammer/sys/netgraph/ng_iface.h#4 (text+ko) ====
@@ -36,7 +36,7 @@
*
* Author: Archie Cobbs <archie at freebsd.org>
*
- * $FreeBSD: src/sys/netgraph/ng_iface.h,v 1.5 2003/11/11 12:30:37 ru Exp $
+ * $FreeBSD: src/sys/netgraph/ng_iface.h,v 1.6 2004/03/07 23:00:44 ru Exp $
* $Whistle: ng_iface.h,v 1.5 1999/01/20 00:22:13 archie Exp $
*/
@@ -69,6 +69,7 @@
NGM_IFACE_GET_IFNAME = 1, /* returns struct ng_iface_ifname */
NGM_IFACE_POINT2POINT,
NGM_IFACE_BROADCAST,
+ NGM_IFACE_GET_IFINDEX,
};
struct ng_iface_ifname {
==== //depot/projects/hammer/sys/powerpc/powerpc/pmap.c#19 (text+ko) ====
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap.c,v 1.71 2004/03/02 06:49:21 grehan Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap.c,v 1.72 2004/03/07 21:06:48 alc Exp $");
/*
* Manages physical address maps.
@@ -1443,12 +1443,6 @@
bzero(&pm->pm_stats, sizeof(pm->pm_stats));
}
-void
-pmap_pinit2(pmap_t pmap)
-{
- /* XXX: Remove this stub when no longer called */
-}
-
/*
* Set the physical protection on the specified range of this map as requested.
*/
==== //depot/projects/hammer/sys/sparc64/sparc64/pmap.c#21 (text+ko) ====
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
- * $FreeBSD: src/sys/sparc64/sparc64/pmap.c,v 1.126 2003/10/03 22:46:53 alc Exp $
+ * $FreeBSD: src/sys/sparc64/sparc64/pmap.c,v 1.127 2004/03/07 21:06:48 alc Exp $
*/
/*
@@ -1027,12 +1027,6 @@
bzero(&pm->pm_stats, sizeof(pm->pm_stats));
}
-void
-pmap_pinit2(pmap_t pmap)
-{
- /* XXX: Remove this stub when no longer called */
-}
-
/*
* Release any resources held by the given physical map.
* Called when a pmap initialized by pmap_pinit is being released.
==== //depot/projects/hammer/sys/vm/pmap.h#15 (text+ko) ====
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $FreeBSD: src/sys/vm/pmap.h,v 1.65 2003/10/06 01:47:12 bms Exp $
+ * $FreeBSD: src/sys/vm/pmap.h,v 1.66 2004/03/07 21:06:48 alc Exp $
*/
/*
@@ -120,7 +120,6 @@
void pmap_page_protect(vm_page_t m, vm_prot_t prot);
void pmap_pinit(pmap_t);
void pmap_pinit0(pmap_t);
-void pmap_pinit2(pmap_t);
void pmap_protect(pmap_t, vm_offset_t, vm_offset_t, vm_prot_t);
void pmap_qenter(vm_offset_t, vm_page_t *, int);
void pmap_qremove(vm_offset_t, int);
==== //depot/projects/hammer/sys/vm/vm_glue.c#24 (text+ko) ====
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_glue.c,v 1.191 2004/03/05 22:03:11 truckman Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_glue.c,v 1.192 2004/03/07 21:06:48 alc Exp $");
#include "opt_vm.h"
#include "opt_kstack_pages.h"
@@ -675,9 +675,6 @@
if ((flags & RFMEM) == 0) {
p2->p_vmspace = vmspace_fork(p1->p_vmspace);
-
- pmap_pinit2(vmspace_pmap(p2->p_vmspace));
-
if (p1->p_vmspace->vm_shm)
shmfork(p1, p2);
}
==== //depot/projects/hammer/sys/vm/vm_map.c#31 (text+ko) ====
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.329 2004/02/12 20:56:06 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_map.c,v 1.330 2004/03/07 21:06:48 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2798,7 +2798,6 @@
* here, it is a good idea to keep this form for future mods.
*/
p->p_vmspace = newvmspace;
- pmap_pinit2(vmspace_pmap(newvmspace));
if (p == curthread->td_proc) /* XXXKSE ? */
pmap_activate(curthread);
vmspace_free(oldvmspace);
@@ -2819,7 +2818,6 @@
return;
newvmspace = vmspace_fork(oldvmspace);
p->p_vmspace = newvmspace;
- pmap_pinit2(vmspace_pmap(newvmspace));
if (p == curthread->td_proc) /* XXXKSE ? */
pmap_activate(curthread);
vmspace_free(oldvmspace);
==== //depot/projects/hammer/usr.bin/printf/printf.c#3 (text+ko) ====
@@ -44,7 +44,7 @@
static char const sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93";
#endif
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/printf/printf.c,v 1.26 2002/09/04 23:29:05 dwmalone Exp $";
+ "$FreeBSD: src/usr.bin/printf/printf.c,v 1.27 2004/03/07 22:22:13 cperciva Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -473,7 +473,7 @@
*dp = asciicode();
return (0);
}
- rval = 1;
+ rval = 0;
errno = 0;
*dp = strtod(*gargv, &ep);
if (ep == *gargv) {
More information about the p4-projects
mailing list