PERFORCE change 132450 for review
John Birrell
jb at FreeBSD.org
Thu Jan 3 16:12:13 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=132450
Change 132450 by jb at jb_freebsd1 on 2008/01/04 00:11:15
IFC
Affected files ...
.. //depot/projects/dtrace/src/lib/libarchive/archive_endian.h#1 branch
.. //depot/projects/dtrace/src/lib/libarchive/archive_read.c#10 integrate
.. //depot/projects/dtrace/src/lib/libarchive/archive_read_private.h#2 integrate
.. //depot/projects/dtrace/src/lib/libarchive/archive_read_support_format_zip.c#10 integrate
.. //depot/projects/dtrace/src/lib/libc/stdlib/malloc.3#9 integrate
.. //depot/projects/dtrace/src/lib/libc/stdlib/malloc.c#16 integrate
.. //depot/projects/dtrace/src/share/man/man5/boot.config.5#2 integrate
.. //depot/projects/dtrace/src/sys/amd64/amd64/pmap.c#29 integrate
.. //depot/projects/dtrace/src/sys/arm/arm/pmap.c#25 integrate
.. //depot/projects/dtrace/src/sys/i386/i386/pmap.c#25 integrate
.. //depot/projects/dtrace/src/sys/ia64/ia64/pmap.c#12 integrate
.. //depot/projects/dtrace/src/sys/kern/kern_descrip.c#14 integrate
.. //depot/projects/dtrace/src/sys/kern/uipc_debug.c#2 integrate
.. //depot/projects/dtrace/src/sys/powerpc/powerpc/pmap_dispatch.c#10 integrate
.. //depot/projects/dtrace/src/sys/sparc64/sparc64/pmap.c#15 integrate
.. //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#26 integrate
.. //depot/projects/dtrace/src/sys/ufs/ffs/ffs_balloc.c#6 integrate
.. //depot/projects/dtrace/src/sys/vm/pmap.h#10 integrate
.. //depot/projects/dtrace/src/sys/vm/vm_fault.c#13 integrate
.. //depot/projects/dtrace/src/sys/vm/vm_kern.c#9 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/atalk.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/bpf.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/if.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/inet.c#8 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/inet6.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/ipsec.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/ipx.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/main.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/mbuf.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/mcast.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/mroute.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/mroute6.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/netgraph.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/netstat.h#6 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/pfkey.c#7 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/route.c#8 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/sctp.c#3 integrate
.. //depot/projects/dtrace/src/usr.bin/netstat/unix.c#6 integrate
.. //depot/projects/dtrace/src/usr.bin/truss/syscalls.c#7 integrate
Differences ...
==== //depot/projects/dtrace/src/lib/libarchive/archive_read.c#10 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.36 2007/12/30 04:58:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.37 2008/01/03 17:54:26 des Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -741,3 +741,14 @@
__archive_errx(1, "Not enough slots for compression registration");
return (NULL); /* Never actually executed. */
}
+
+/* used internally to simplify read-ahead */
+const void *
+__archive_read_ahead(struct archive_read *a, size_t len)
+{
+ const void *h;
+
+ if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len)
+ return (NULL);
+ return (h);
+}
==== //depot/projects/dtrace/src/lib/libarchive/archive_read_private.h#2 (text+ko) ====
@@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/lib/libarchive/archive_read_private.h,v 1.3 2007/05/29 01:00:18 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_read_private.h,v 1.4 2008/01/03 17:54:26 des Exp $
*/
#ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED
@@ -173,4 +173,7 @@
int (*bid)(const void *, size_t),
int (*init)(struct archive_read *, const void *, size_t));
+const void
+ *__archive_read_ahead(struct archive_read *, size_t);
+
#endif
==== //depot/projects/dtrace/src/lib/libarchive/archive_read_support_format_zip.c#10 (text+ko) ====
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.17 2007/12/30 04:58:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.19 2008/01/03 18:30:37 des Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -42,6 +42,7 @@
#include "archive_entry.h"
#include "archive_private.h"
#include "archive_read_private.h"
+#include "archive_endian.h"
struct zip {
/* entry_bytes_remaining is the number of bytes we expect. */
@@ -121,11 +122,6 @@
static int archive_read_format_zip_read_data_skip(struct archive_read *a);
static int archive_read_format_zip_read_header(struct archive_read *,
struct archive_entry *);
-static int i2(const char *);
-static int i4(const char *);
-static unsigned int u2(const char *);
-static unsigned int u4(const char *);
-static uint64_t u8(const char *);
static int zip_read_data_deflate(struct archive_read *a, const void **buff,
size_t *size, off_t *offset);
static int zip_read_data_none(struct archive_read *a, const void **buff,
@@ -166,18 +162,14 @@
static int
archive_read_format_zip_bid(struct archive_read *a)
{
- int bytes_read;
int bid = 0;
- const void *h;
const char *p;
if (a->archive.archive_format == ARCHIVE_FORMAT_ZIP)
bid += 1;
- bytes_read = (a->decompressor->read_ahead)(a, &h, 4);
- if (bytes_read < 4)
- return (-1);
- p = (const char *)h;
+ if ((p = __archive_read_ahead(a, 4)) == NULL)
+ return (-1);
/*
* Bid of 30 here is: 16 bits for "PK",
@@ -198,7 +190,6 @@
archive_read_format_zip_read_header(struct archive_read *a,
struct archive_entry *entry)
{
- int bytes_read;
const void *h;
const char *signature;
struct zip *zip;
@@ -213,8 +204,7 @@
zip->end_of_entry_cleanup = 0;
zip->entry_uncompressed_bytes_read = 0;
zip->entry_compressed_bytes_read = 0;
- bytes_read = (a->decompressor->read_ahead)(a, &h, 4);
- if (bytes_read < 4)
+ if ((h = __archive_read_ahead(a, 4)) == NULL)
return (ARCHIVE_FATAL);
signature = (const char *)h;
@@ -261,21 +251,17 @@
{
const struct zip_file_header *p;
const void *h;
- int bytes_read;
- bytes_read =
- (a->decompressor->read_ahead)(a, &h, sizeof(struct zip_file_header));
- if (bytes_read < (int)sizeof(struct zip_file_header)) {
+ if ((p = __archive_read_ahead(a, sizeof *p)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
}
- p = (const struct zip_file_header *)h;
zip->version = p->version[0];
zip->system = p->version[1];
- zip->flags = i2(p->flags);
- zip->compression = i2(p->compression);
+ zip->flags = le16dec(p->flags);
+ zip->compression = le16dec(p->compression);
if (zip->compression <
sizeof(compression_names)/sizeof(compression_names[0]))
zip->compression_name = compression_names[zip->compression];
@@ -287,25 +273,24 @@
zip->mode = 0;
zip->uid = 0;
zip->gid = 0;
- zip->crc32 = i4(p->crc32);
- zip->filename_length = i2(p->filename_length);
- zip->extra_length = i2(p->extra_length);
- zip->uncompressed_size = u4(p->uncompressed_size);
- zip->compressed_size = u4(p->compressed_size);
+ zip->crc32 = le32dec(p->crc32);
+ zip->filename_length = le16dec(p->filename_length);
+ zip->extra_length = le16dec(p->extra_length);
+ zip->uncompressed_size = le32dec(p->uncompressed_size);
+ zip->compressed_size = le32dec(p->compressed_size);
(a->decompressor->consume)(a, sizeof(struct zip_file_header));
/* Read the filename. */
- bytes_read = (a->decompressor->read_ahead)(a, &h, zip->filename_length);
- if (bytes_read < zip->filename_length) {
+ if ((h = __archive_read_ahead(a, zip->filename_length)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
}
if (archive_string_ensure(&zip->pathname, zip->filename_length) == NULL)
__archive_errx(1, "Out of memory");
- archive_strncpy(&zip->pathname, (const char *)h, zip->filename_length);
+ archive_strncpy(&zip->pathname, h, zip->filename_length);
(a->decompressor->consume)(a, zip->filename_length);
archive_entry_set_pathname(entry, zip->pathname.s);
@@ -315,8 +300,7 @@
zip->mode = AE_IFREG | 0777;
/* Read the extra data. */
- bytes_read = (a->decompressor->read_ahead)(a, &h, zip->extra_length);
- if (bytes_read < zip->extra_length) {
+ if ((h = __archive_read_ahead(a, zip->extra_length)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
@@ -387,21 +371,18 @@
if (zip->end_of_entry) {
if (!zip->end_of_entry_cleanup) {
if (zip->flags & ZIP_LENGTH_AT_END) {
- const void *h;
const char *p;
- int bytes_read =
- (a->decompressor->read_ahead)(a, &h, 16);
- if (bytes_read < 16) {
+
+ if ((p = __archive_read_ahead(a, 16)) == NULL) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP end-of-file record");
return (ARCHIVE_FATAL);
}
- p = (const char *)h;
- zip->crc32 = i4(p + 4);
- zip->compressed_size = u4(p + 8);
- zip->uncompressed_size = u4(p + 12);
- bytes_read = (a->decompressor->consume)(a, 16);
+ zip->crc32 = le32dec(p + 4);
+ zip->compressed_size = le32dec(p + 8);
+ zip->uncompressed_size = le32dec(p + 12);
+ (a->decompressor->consume)(a, 16);
}
/* Check file size, CRC against these values. */
@@ -696,37 +677,6 @@
return (ARCHIVE_OK);
}
-static int
-i2(const char *p)
-{
- return ((0xff & (int)p[0]) + 256 * (0xff & (int)p[1]));
-}
-
-
-static int
-i4(const char *p)
-{
- return ((0xffff & i2(p)) + 0x10000 * (0xffff & i2(p+2)));
-}
-
-static unsigned int
-u2(const char *p)
-{
- return ((0xff & (unsigned int)p[0]) + 256 * (0xff & (unsigned int)p[1]));
-}
-
-static unsigned int
-u4(const char *p)
-{
- return u2(p) + 0x10000 * u2(p+2);
-}
-
-static uint64_t
-u8(const char *p)
-{
- return u4(p) + 0x100000000LL * u4(p+4);
-}
-
/*
* The extra data is stored as a list of
* id1+size1+data1 + id2+size2+data2 ...
@@ -739,8 +689,8 @@
const char *p = (const char *)extra;
while (offset < zip->extra_length - 4)
{
- unsigned short headerid = u2(p + offset);
- unsigned short datasize = u2(p + offset + 2);
+ unsigned short headerid = le16dec(p + offset);
+ unsigned short datasize = le16dec(p + offset + 2);
offset += 4;
if (offset + datasize > zip->extra_length)
break;
@@ -752,9 +702,9 @@
case 0x0001:
/* Zip64 extended information extra field. */
if (datasize >= 8)
- zip->uncompressed_size = u8(p + offset);
+ zip->uncompressed_size = le64dec(p + offset);
if (datasize >= 16)
- zip->compressed_size = u8(p + offset + 8);
+ zip->compressed_size = le64dec(p + offset + 8);
break;
case 0x5455:
{
@@ -767,11 +717,11 @@
{
#ifdef DEBUG
fprintf(stderr, "mtime: %lld -> %d\n",
- (long long)zip->mtime, i4(p + offset));
+ (long long)zip->mtime, le32dec(p + offset));
#endif
if (datasize < 4)
break;
- zip->mtime = i4(p + offset);
+ zip->mtime = le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -779,7 +729,7 @@
{
if (datasize < 4)
break;
- zip->atime = i4(p + offset);
+ zip->atime = le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -787,7 +737,7 @@
{
if (datasize < 4)
break;
- zip->ctime = i4(p + offset);
+ zip->ctime = le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -797,12 +747,12 @@
/* Info-ZIP Unix Extra Field (type 2) "Ux". */
#ifdef DEBUG
fprintf(stderr, "uid %d gid %d\n",
- i2(p + offset), i2(p + offset + 2));
+ le16dec(p + offset), le16dec(p + offset + 2));
#endif
if (datasize >= 2)
- zip->uid = i2(p + offset);
+ zip->uid = le16dec(p + offset);
if (datasize >= 4)
- zip->gid = i2(p + offset + 2);
+ zip->gid = le16dec(p + offset + 2);
break;
default:
break;
==== //depot/projects/dtrace/src/lib/libc/stdlib/malloc.3#9 (text+ko) ====
@@ -30,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)malloc.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.75 2007/12/27 23:29:44 jasone Exp $
+.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.76 2008/01/03 23:22:13 jasone Exp $
.\"
-.Dd December 27, 2007
+.Dd January 3, 2008
.Dt MALLOC 3
.Os
.Sh NAME
@@ -245,7 +245,7 @@
Use
.Xr mmap 2
to acquire anonymously mapped memory.
-This option is disabled by default.
+This option is enabled by default.
If both the
.Dq D
and
@@ -335,24 +335,24 @@
to obtain memory, which is suboptimal for several reasons, including race
conditions, increased fragmentation, and artificial limitations on maximum
usable memory.
-This allocator uses
+This allocator uses both
.Xr sbrk 2
-by default in order to facilitate resource limits, but it can be configured at
-run time to use
-.Xr sbrk 2
-and/or
-.Xr mmap 2 .
+and
+.Xr mmap 2
+by default, but it can be configured at run time to use only one or the other.
If resource limits are not a primary concern, the preferred configuration is
.Ev MALLOC_OPTIONS=dM
or
.Ev MALLOC_OPTIONS=DM .
When so configured, the
.Ar datasize
-resource limit has little practical effect for typical applications.
-The
+resource limit has little practical effect for typical applications; use
+.Ev MALLOC_OPTIONS=Dm
+if that is a concern.
+Regardless of allocator configuration, the
.Ar vmemoryuse
-resource limit, however, can be used to bound the total virtual memory used by
-a process, as described in
+resource limit can be used to bound the total virtual memory used by a
+process, as described in
.Xr limits 1 .
.Pp
This allocator uses multiple arenas in order to reduce lock contention for
==== //depot/projects/dtrace/src/lib/libc/stdlib/malloc.c#16 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (C) 2006,2007 Jason Evans <jasone at FreeBSD.org>.
+ * Copyright (C) 2006-2008 Jason Evans <jasone at FreeBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -131,10 +131,10 @@
* unnecessary, but we are burdened by history and the lack of resource limits
* for anonymous mapped memory.
*/
-#define MALLOC_DSS
+#define MALLOC_DSS
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.160 2007/12/31 06:19:48 jasone Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.161 2008/01/03 23:22:13 jasone Exp $");
#include "libc_private.h"
#ifdef MALLOC_DEBUG
@@ -821,7 +821,7 @@
#endif
#ifdef MALLOC_DSS
static bool opt_dss = true;
-static bool opt_mmap = false;
+static bool opt_mmap = true;
#endif
static bool opt_hint = false;
#ifdef MALLOC_LAZY_FREE
@@ -1646,6 +1646,7 @@
return (NULL);
/* Clean up unneeded leading/trailing space. */
+ offset = CHUNK_ADDR2OFFSET(ret);
if (offset != 0) {
/* Leading space. */
pages_unmap(ret, chunksize - offset);
@@ -1661,11 +1662,11 @@
pages_unmap((void *)((uintptr_t)ret + size),
chunksize);
}
+ } else {
+ /* Clean up unneeded leading space. */
+ pages_unmap(ret, chunksize - offset);
+ ret = (void *)((uintptr_t)ret + (chunksize - offset));
}
-
- /* Clean up unneeded leading space. */
- pages_unmap(ret, chunksize - offset);
- ret = (void *)((uintptr_t)ret + (chunksize - offset));
}
return (ret);
==== //depot/projects/dtrace/src/share/man/man5/boot.config.5#2 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man5/boot.config.5,v 1.1 2007/08/14 15:25:32 danger Exp $
+.\" $FreeBSD: src/share/man/man5/boot.config.5,v 1.2 2008/01/03 20:54:34 danger Exp $
.Dd May 13, 2007
.Dt BOOT.CONFIG 5
.Os
@@ -78,11 +78,11 @@
# echo "1:ad(1,a)/boot/loader" > /boot.config
.Ed
.Pp
-will instruct the second boot stage of
-.Xr loader 8
-on the first disk to boot with the third boot stage of
-.Xr loader 8
-from the second disk.
+will instruct the second stage of
+.Xr boot 8
+on the first disk to boot with the third
+.Xr boot 8
+stage from the second disk.
.Pp
The command:
.Bd -literal -offset indent
==== //depot/projects/dtrace/src/sys/amd64/amd64/pmap.c#29 (text+ko) ====
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.600 2008/01/02 08:54:39 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.601 2008/01/03 07:34:32 alc Exp $");
/*
* Manages physical address maps.
@@ -2250,8 +2250,8 @@
* insert this page into the given map NOW.
*/
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
vm_paddr_t pa;
pd_entry_t *pde;
==== //depot/projects/dtrace/src/sys/arm/arm/pmap.c#25 (text+ko) ====
@@ -147,7 +147,7 @@
#include "opt_vm.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.93 2007/12/11 20:35:44 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.96 2008/01/03 07:34:33 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -3170,11 +3170,10 @@
#if defined(PMAP_DEBUG)
/*
- * XXX this makes pmap_page_protect(NONE) illegal for non-managed
- * pages!
+ * XXX This makes pmap_remove_all() illegal for non-managed pages!
*/
if (m->flags & PG_FICTITIOUS) {
- panic("pmap_page_protect: illegal for unmanaged page, va: 0x%x", VM_PAGE_TO_PHYS(m));
+ panic("pmap_remove_all: illegal for unmanaged page, va: 0x%x", VM_PAGE_TO_PHYS(m));
}
#endif
@@ -3325,8 +3324,8 @@
*/
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
vm_page_lock_queues();
==== //depot/projects/dtrace/src/sys/i386/i386/pmap.c#25 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.603 2008/01/02 08:54:39 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.604 2008/01/03 07:34:33 alc Exp $");
/*
* Manages physical address maps.
@@ -2302,8 +2302,8 @@
* insert this page into the given map NOW.
*/
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
vm_paddr_t pa;
pd_entry_t *pde;
==== //depot/projects/dtrace/src/sys/ia64/ia64/pmap.c#12 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.193 2007/11/17 22:52:29 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.196 2008/01/03 07:34:33 alc Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1458,11 +1458,10 @@
#if defined(DIAGNOSTIC)
/*
- * XXX this makes pmap_page_protect(NONE) illegal for non-managed
- * pages!
+ * XXX This makes pmap_remove_all() illegal for non-managed pages!
*/
if (m->flags & PG_FICTITIOUS) {
- panic("pmap_page_protect: illegal for unmanaged page, va: 0x%lx", VM_PAGE_TO_PHYS(m));
+ panic("pmap_remove_all: illegal for unmanaged page, va: 0x%lx", VM_PAGE_TO_PHYS(m));
}
#endif
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
@@ -1556,8 +1555,8 @@
* insert this page into the given map NOW.
*/
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
pmap_t oldpmap;
vm_offset_t pa;
==== //depot/projects/dtrace/src/sys/kern/kern_descrip.c#14 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.315 2007/12/30 01:42:13 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.316 2008/01/03 01:26:59 jeff Exp $");
#include "opt_compat.h"
#include "opt_ddb.h"
@@ -2392,7 +2392,8 @@
if (fdp == NULL)
continue;
/* overestimates sparse tables. */
- n += fdp->fd_lastfile;
+ if (fdp->fd_lastfile > 0)
+ n += fdp->fd_lastfile;
fddrop(fdp);
}
sx_sunlock(&allproc_lock);
==== //depot/projects/dtrace/src/sys/kern/uipc_debug.c#2 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/uipc_debug.c,v 1.2 2007/05/03 14:42:41 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/uipc_debug.c,v 1.3 2008/01/03 15:19:31 bz Exp $");
#include "opt_ddb.h"
@@ -394,13 +394,17 @@
db_printf("sb_lastrecord: %p\n", sb->sb_lastrecord);
db_print_indent(indent);
- db_printf("sb_cc: %d ", sb->sb_cc);
- db_printf("sb_hiwat: %d ", sb->sb_hiwat);
- db_printf("sb_mbcnt: %d ", sb->sb_mbcnt);
- db_printf("sb_mbmax: %d\n", sb->sb_mbmax);
+ db_printf("sb_sndptr: %p ", sb->sb_sndptr);
+ db_printf("sb_sndptroff: %u\n", sb->sb_sndptroff);
+
+ db_print_indent(indent);
+ db_printf("sb_cc: %u ", sb->sb_cc);
+ db_printf("sb_hiwat: %u ", sb->sb_hiwat);
+ db_printf("sb_mbcnt: %u ", sb->sb_mbcnt);
+ db_printf("sb_mbmax: %u\n", sb->sb_mbmax);
db_print_indent(indent);
- db_printf("sb_ctl: %d ", sb->sb_ctl);
+ db_printf("sb_ctl: %u ", sb->sb_ctl);
db_printf("sb_lowat: %d ", sb->sb_lowat);
db_printf("sb_timeo: %d\n", sb->sb_timeo);
==== //depot/projects/dtrace/src/sys/powerpc/powerpc/pmap_dispatch.c#10 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap_dispatch.c,v 1.11 2007/11/17 22:52:29 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/pmap_dispatch.c,v 1.12 2008/01/03 07:34:34 alc Exp $");
/*
* Dispatch MI pmap calls to the appropriate MMU implementation
@@ -107,8 +107,8 @@
}
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t p, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t p,
+ vm_prot_t prot, boolean_t wired)
{
MMU_ENTER(mmu_obj, pmap, va, p, prot, wired);
}
==== //depot/projects/dtrace/src/sys/sparc64/sparc64/pmap.c#15 (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.169 2007/12/27 03:52:14 alc Exp $
+ * $FreeBSD: src/sys/sparc64/sparc64/pmap.c,v 1.170 2008/01/03 07:34:34 alc Exp $
*/
/*
@@ -1273,8 +1273,8 @@
* will be wired down.
*/
void
-pmap_enter(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pm, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
vm_page_lock_queues();
==== //depot/projects/dtrace/src/sys/sun4v/sun4v/pmap.c#26 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/pmap.c,v 1.41 2007/11/17 22:52:29 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/pmap.c,v 1.42 2008/01/03 07:34:34 alc Exp $");
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
@@ -1039,8 +1039,8 @@
* will be wired down.
*/
void
-pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
- boolean_t wired)
+pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
+ vm_prot_t prot, boolean_t wired)
{
vm_paddr_t pa, opa;
uint64_t tte_data, otte_data;
==== //depot/projects/dtrace/src/sys/ufs/ffs/ffs_balloc.c#6 (text+ko) ====
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_balloc.c,v 1.52 2007/12/29 13:31:27 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_balloc.c,v 1.53 2008/01/03 12:28:57 kib Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -420,12 +420,6 @@
bp->b_flags &= ~B_ASYNC;
brelse(bp);
}
-
- /*
- * After the buffer is invalidated, free the block.
- */
- ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
- ip->i_number);
deallocated += fs->fs_bsize;
}
if (allocib != NULL) {
@@ -461,6 +455,14 @@
ip->i_flag |= IN_CHANGE | IN_UPDATE;
}
(void) ffs_syncvnode(vp, MNT_WAIT);
+ /*
+ * After the buffers are invalidated and on-disk pointers are
+ * cleared, free the blocks.
+ */
+ for (blkp = allociblk; blkp < allocblk; blkp++) {
+ ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
+ ip->i_number);
+ }
return (error);
}
@@ -918,12 +920,6 @@
bp->b_flags &= ~B_ASYNC;
brelse(bp);
}
-
- /*
- * After the buffer is invalidated, free the block.
- */
- ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
- ip->i_number);
deallocated += fs->fs_bsize;
}
if (allocib != NULL) {
@@ -959,5 +955,13 @@
ip->i_flag |= IN_CHANGE | IN_UPDATE;
}
(void) ffs_syncvnode(vp, MNT_WAIT);
+ /*
+ * After the buffers are invalidated and on-disk pointers are
+ * cleared, free the blocks.
+ */
+ for (blkp = allociblk; blkp < allocblk; blkp++) {
+ ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
+ ip->i_number);
+ }
return (error);
}
==== //depot/projects/dtrace/src/sys/vm/pmap.h#10 (text+ko) ====
@@ -57,7 +57,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.82 2008/01/01 20:36:04 alc Exp $
+ * $FreeBSD: src/sys/vm/pmap.h,v 1.83 2008/01/03 07:34:34 alc Exp $
*/
/*
@@ -95,8 +95,8 @@
void pmap_clear_reference(vm_page_t m);
void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t);
void pmap_copy_page(vm_page_t, vm_page_t);
-void pmap_enter(pmap_t, vm_offset_t, vm_page_t, vm_prot_t,
- boolean_t);
+void pmap_enter(pmap_t, vm_offset_t, vm_prot_t, vm_page_t,
+ vm_prot_t, boolean_t);
void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m,
vm_prot_t prot);
void pmap_enter_object(pmap_t pmap, vm_offset_t start,
==== //depot/projects/dtrace/src/sys/vm/vm_fault.c#13 (text+ko) ====
@@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.238 2007/12/29 19:53:04 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.239 2008/01/03 07:34:34 alc Exp $");
#include "opt_vm.h"
@@ -888,7 +888,7 @@
* back on the active queue until later so that the pageout daemon
* won't find it (yet).
*/
- pmap_enter(fs.map->pmap, vaddr, fs.m, prot, wired);
+ pmap_enter(fs.map->pmap, vaddr, fault_type, fs.m, prot, wired);
if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) {
vm_fault_prefault(fs.map->pmap, vaddr, fs.entry);
}
@@ -1177,9 +1177,10 @@
VM_OBJECT_UNLOCK(dst_object);
/*
- * Enter it in the pmap...
+ * Enter it in the pmap as a read and/or execute access.
*/
- pmap_enter(dst_map->pmap, vaddr, dst_m, prot, FALSE);
+ pmap_enter(dst_map->pmap, vaddr, prot & ~VM_PROT_WRITE, dst_m,
+ prot, FALSE);
/*
* Mark it no longer busy, and put it on the active list.
==== //depot/projects/dtrace/src/sys/vm/vm_kern.c#9 (text+ko) ====
@@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_kern.c,v 1.129 2007/11/07 21:56:58 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_kern.c,v 1.130 2008/01/03 07:34:34 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -406,7 +406,8 @@
/*
* Because this is kernel_pmap, this call will not block.
*/
- pmap_enter(kernel_pmap, addr + i, m, VM_PROT_ALL, 1);
+ pmap_enter(kernel_pmap, addr + i, VM_PROT_ALL, m, VM_PROT_ALL,
+ TRUE);
vm_page_wakeup(m);
}
VM_OBJECT_UNLOCK(kmem_object);
==== //depot/projects/dtrace/src/usr.bin/netstat/atalk.c#6 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -38,7 +38,7 @@
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/netstat/atalk.c,v 1.26 2007/07/16 17:15:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/netstat/atalk.c,v 1.27 2008/01/02 23:26:11 obrien Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -260,7 +260,7 @@
}
}
-#define ANY(x,y,z) if (x || sflag <= 1) \
+#define ANY(x,y,z) if (x || sflag <= 1) \
printf("\t%lu %s%s%s\n",x,y,plural(x),z)
/*
==== //depot/projects/dtrace/src/usr.bin/netstat/bpf.c#7 (text+ko) ====
@@ -22,9 +22,11 @@
* 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.
- *
- * $FreeBSD: src/usr.bin/netstat/bpf.c,v 1.9 2007/07/16 17:15:54 jhb Exp $
*/
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/netstat/bpf.c,v 1.10 2008/01/02 23:26:11 obrien Exp $");
+
#include <sys/types.h>
#include <sys/protosw.h>
#include <sys/socket.h>
@@ -84,7 +86,7 @@
*flagbuf++ = bd->bd_async ? 'a' : '-';
*flagbuf++ = bd->bd_locked ? 'l' : '-';
*flagbuf++ = '\0';
-}
+}
void
bpf_stats(char *ifname)
==== //depot/projects/dtrace/src/usr.bin/netstat/if.c#7 (text+ko) ====
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -38,7 +38,7 @@
#endif
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/netstat/if.c,v 1.69 2007/07/16 17:15:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/netstat/if.c,v 1.70 2008/01/02 23:26:11 obrien Exp $");
#include <sys/types.h>
#include <sys/protosw.h>
@@ -82,7 +82,7 @@
static char ntop_buf[INET6_ADDRSTRLEN]; /* for inet_ntop() */
#endif
-/*
+/*
* Dump pfsync statistics structure.
*/
void
@@ -105,9 +105,9 @@
printf("%s:\n", name);
-#define p(f, m) if (pfsyncstat.f || sflag <= 1) \
+#define p(f, m) if (pfsyncstat.f || sflag <= 1) \
printf(m, (uintmax_t)pfsyncstat.f, plural(pfsyncstat.f))
-#define p2(f, m) if (pfsyncstat.f || sflag <= 1) \
+#define p2(f, m) if (pfsyncstat.f || sflag <= 1) \
printf(m, (uintmax_t)pfsyncstat.f)
p(pfsyncs_ipackets, "\t%ju packet%s received (IPv4)\n");
@@ -214,10 +214,10 @@
sidewaysintpr(interval1, ifnetaddr);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list