svn commit: r246821 - head/sys/netgraph
Author: glebius Date: Fri Feb 15 07:58:51 2013 New Revision: 246821 URL: http://svnweb.freebsd.org/changeset/base/246821 Log: Fix compilation warning. Sponsored by: Nginx, Inc Modified: head/sys/netgraph/ng_parse.c Modified: head/sys/netgraph/ng_parse.c == --- head/sys/netgraph/ng_parse.cFri Feb 15 07:13:27 2013 (r246820) +++ head/sys/netgraph/ng_parse.cFri Feb 15 07:58:51 2013 (r246821) @@ -1236,6 +1236,7 @@ ng_parse_composite(const struct ng_parse distinguish name from values by seeing if the next token is an equals sign */ if (ctype != CT_STRUCT) { + u_long ul; int len2, off2; char *eptr; @@ -1259,11 +1260,12 @@ ng_parse_composite(const struct ng_parse } /* Index was specified explicitly; parse it */ - index = (u_int)strtoul(s + *off, &eptr, 0); - if (index < 0 || eptr - (s + *off) != len) { + ul = strtoul(s + *off, &eptr, 0); + if (ul == ULONG_MAX || eptr - (s + *off) != len) { error = EINVAL; goto done; } + index = (u_int)ul; nextIndex = index + 1; *off += len + len2; } else {/* a structure field */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246812 - head/sbin/fsck_ffs
Author: mckusick Date: Fri Feb 15 01:00:48 2013 New Revision: 246812 URL: http://svnweb.freebsd.org/changeset/base/246812 Log: Update fsck_ffs buffer cache manager to use TAILQ macros. No functional changes. Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsck.h == --- head/sbin/fsck_ffs/fsck.h Fri Feb 15 00:58:00 2013(r246811) +++ head/sbin/fsck_ffs/fsck.h Fri Feb 15 01:00:48 2013(r246812) @@ -67,10 +67,13 @@ #include #include +#include + #defineMAXDUP 10 /* limit on dup blks (per inode) */ #defineMAXBAD 10 /* limit on bad blks (per inode) */ -#defineMAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */ -#defineINOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */ +#defineMINBUFS 10 /* minimum number of buffers required */ +#defineMAXBUFS 40 /* maximum space to allocate to buffers */ +#defineINOBUFSIZE 64*1024 /* size of buffer to read inodes in pass1 */ union dinode { struct ufs1_dinode dp1; @@ -130,8 +133,7 @@ struct inostatlist { * buffer cache structure. */ struct bufarea { - struct bufarea *b_next; /* free list queue */ - struct bufarea *b_prev; /* free list queue */ + TAILQ_ENTRY(bufarea) b_list;/* buffer list */ ufs2_daddr_t b_bno; int b_size; int b_errs; @@ -159,10 +161,11 @@ struct bufarea { (bp)->b_un.b_indir2[i] = (val); \ } while (0) -#defineB_INUSE 1 +/* + * Buffer flags + */ +#defineB_INUSE 0x0001 /* Buffer is in use */ -#defineMINBUFS 5 /* minimum number of buffers required */ -struct bufarea bufhead;/* head of list of other blks in filesys */ struct bufarea sblk; /* file system superblock */ struct bufarea cgblk; /* cylinder group blocks */ struct bufarea *pdirbp;/* current directory contents */ Modified: head/sbin/fsck_ffs/fsutil.c == --- head/sbin/fsck_ffs/fsutil.c Fri Feb 15 00:58:00 2013(r246811) +++ head/sbin/fsck_ffs/fsutil.c Fri Feb 15 01:00:48 2013(r246812) @@ -67,6 +67,8 @@ long diskreads, totalreads; /* Disk cach struct timeval slowio_starttime; int slowio_delay_usec = 1; /* Initial IO delay for background fsck */ int slowio_pollcnt; +static TAILQ_HEAD(buflist, bufarea) bufhead; /* head of buffer cache list */ +static int numbufs;/* size of buffer cache */ int ftypeok(union dinode *dp) @@ -162,8 +164,8 @@ bufinit(void) errx(EEXIT, "cannot allocate buffer pool"); cgblk.b_un.b_buf = bufp; initbarea(&cgblk); - bufhead.b_next = bufhead.b_prev = &bufhead; - bufcnt = MAXBUFSPACE / sblock.fs_bsize; + TAILQ_INIT(&bufhead); + bufcnt = MAXBUFS; if (bufcnt < MINBUFS) bufcnt = MINBUFS; for (i = 0; i < bufcnt; i++) { @@ -175,13 +177,10 @@ bufinit(void) errx(EEXIT, "cannot allocate buffer pool"); } bp->b_un.b_buf = bufp; - bp->b_prev = &bufhead; - bp->b_next = bufhead.b_next; - bufhead.b_next->b_prev = bp; - bufhead.b_next = bp; + TAILQ_INSERT_HEAD(&bufhead, bp, b_list); initbarea(bp); } - bufhead.b_size = i; /* save number of buffers */ + numbufs = i;/* save number of buffers */ } /* @@ -192,23 +191,19 @@ getdatablk(ufs2_daddr_t blkno, long size { struct bufarea *bp; - for (bp = bufhead.b_next; bp != &bufhead; bp = bp->b_next) + TAILQ_FOREACH(bp, &bufhead, b_list) if (bp->b_bno == fsbtodb(&sblock, blkno)) goto foundit; - for (bp = bufhead.b_prev; bp != &bufhead; bp = bp->b_prev) + TAILQ_FOREACH_REVERSE(bp, &bufhead, buflist, b_list) if ((bp->b_flags & B_INUSE) == 0) break; - if (bp == &bufhead) + if (bp == NULL) errx(EEXIT, "deadlocked buffer pool"); getblk(bp, blkno, size); /* fall through */ foundit: - bp->b_prev->b_next = bp->b_next; - bp->b_next->b_prev = bp->b_prev; - bp->b_prev = &bufhead; - bp->b_next = bufhead.b_next; - bufhead.b_next->b_prev = bp; - bufhead.b_next = bp; + TAILQ_REMOVE(&bufhead, bp, b_list); + TAILQ_INSERT_HEAD(&bufhead, bp, b_list); bp->b_flags |= B_INUSE; return (bp); } @@ -274,7 +269,7 @@ void ckfini(int markclean) { struct bufarea *bp, *nbp; - int ofsmodified, cnt = 0; + int ofsmodified, cnt; if (bkg
svn commit: r246809 - head/lib/libc/net
Author: zeising (doc,ports committer) Date: Thu Feb 14 21:29:55 2013 New Revision: 246809 URL: http://svnweb.freebsd.org/changeset/base/246809 Log: Change examples to be consistent with what style(9) says. Approved by: joel (mentor) MFC After:2 weeks Modified: head/lib/libc/net/getaddrinfo.3 head/lib/libc/net/getnameinfo.3 Modified: head/lib/libc/net/getaddrinfo.3 == --- head/lib/libc/net/getaddrinfo.3 Thu Feb 14 21:02:18 2013 (r246808) +++ head/lib/libc/net/getaddrinfo.3 Thu Feb 14 21:29:55 2013 (r246809) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2009 +.Dd February 14, 2013 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -339,7 +339,7 @@ hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("www.kame.net", "http", &hints, &res0); if (error) { errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ + /* NOTREACHED */ } s = -1; for (res = res0; res; res = res->ai_next) { @@ -361,7 +361,7 @@ for (res = res0; res; res = res->ai_next } if (s < 0) { err(1, "%s", cause); - /*NOTREACHED*/ + /* NOTREACHED */ } freeaddrinfo(res0); .Ed @@ -383,7 +383,7 @@ hints.ai_flags = AI_PASSIVE; error = getaddrinfo(NULL, "http", &hints, &res0); if (error) { errx(1, "%s", gai_strerror(error)); - /*NOTREACHED*/ + /* NOTREACHED */ } nsock = 0; for (res = res0; res && nsock < MAXSOCK; res = res->ai_next) { @@ -405,7 +405,7 @@ for (res = res0; res && nsock < MAXSOCK; } if (nsock == 0) { err(1, "%s", cause); - /*NOTREACHED*/ + /* NOTREACHED */ } freeaddrinfo(res0); .Ed Modified: head/lib/libc/net/getnameinfo.3 == --- head/lib/libc/net/getnameinfo.3 Thu Feb 14 21:02:18 2013 (r246808) +++ head/lib/libc/net/getnameinfo.3 Thu Feb 14 21:29:55 2013 (r246809) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2007 +.Dd February 14, 2013 .Dt GETNAMEINFO 3 .Os .Sh NAME @@ -157,7 +157,7 @@ char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) { errx(1, "could not get numeric hostname"); - /*NOTREACHED*/ + /* NOTREACHED */ } printf("host=%s, serv=%s\en", hbuf, sbuf); .Ed @@ -170,7 +170,7 @@ char hbuf[NI_MAXHOST]; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) { errx(1, "could not resolve hostname"); - /*NOTREACHED*/ + /* NOTREACHED */ } printf("host=%s\en", hbuf); .Ed ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246808 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Thu Feb 14 21:02:18 2013 New Revision: 246808 URL: http://svnweb.freebsd.org/changeset/base/246808 Log: Eliminate real_LZ4_uncompress. It's unused and does not perform sufficient check against input stream (i.e. it could read beyond specified input buffer). Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Thu Feb 14 20:00:38 2013(r246807) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Thu Feb 14 21:02:18 2013(r246808) @@ -36,7 +36,6 @@ static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); -static int real_LZ4_uncompress(const char *source, char *dest, int osize); static int LZ4_compressBound(int isize); static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize); @@ -104,16 +103,6 @@ lz4_decompress(void *s_start, void *d_st * situations (input data not compressible) worst case size * evaluation is provided by function LZ4_compressBound(). * - * real_LZ4_uncompress() : - * osize : is the output size, therefore the original size - * return : the number of bytes read in the source buffer. - * If the source stream is malformed, the function will stop - * decoding and return a negative result, indicating the byte - * position of the faulty instruction. This function never - * writes beyond dest + osize, and is therefore protected - * against malicious data packets. - * note : destination buffer must be already allocated - * * Advanced Functions * * LZ4_compressBound() : @@ -137,7 +126,6 @@ lz4_decompress(void *s_start, void *d_st * maxOutputSize, and is therefore protected against malicious * data packets. * note : Destination buffer must be already allocated. - * This version is slightly slower than real_LZ4_uncompress() * * LZ4_compressCtx() : * This function explicitly handles the CTX memory structure. @@ -879,128 +867,16 @@ real_LZ4_compress(const char *source, ch /* Decompression functions */ /* - * Note: The decoding functions real_LZ4_uncompress() and - * LZ4_uncompress_unknownOutputSize() are safe against "buffer overflow" - * attack type. They will never write nor read outside of the provided - * output buffers. LZ4_uncompress_unknownOutputSize() also insures that - * it will never read outside of the input buffer. A corrupted input - * will produce an error result, a negative int, indicating the position - * of the error within input stream. + * Note: The decoding functionLZ4_uncompress_unknownOutputSize() is safe + * against "buffer overflow" attack type. They will never write nor + * read outside of the provided output buffers. + * LZ4_uncompress_unknownOutputSize() also insures that it will never + * read outside of the input buffer. A corrupted input will produce + * an error result, a negative int, indicating the position of the + * error within input stream. */ static int -real_LZ4_uncompress(const char *source, char *dest, int osize) -{ - /* Local Variables */ - const BYTE *restrict ip = (const BYTE *) source; - const BYTE *ref; - - BYTE *op = (BYTE *) dest; - BYTE *const oend = op + osize; - BYTE *cpy; - - unsigned token; - - size_t length; - size_t dec32table[] = {0, 3, 2, 3, 0, 0, 0, 0}; -#if LZ4_ARCH64 - size_t dec64table[] = {0, 0, 0, (size_t)-1, 0, 1, 2, 3}; -#endif - - /* Main Loop */ - for (;;) { - /* get runlength */ - token = *ip++; - if ((length = (token >> ML_BITS)) == RUN_MASK) { - size_t len; - for (; (len = *ip++) == 255; length += 255) { - } - length += len; - } - /* copy literals */ - cpy = op + length; - if unlikely(cpy > oend - COPYLENGTH) { - if (cpy != oend) - /* Error: we must necessarily stand at EOF */ - goto _output_error; - (void) memcpy(op, ip, length); - ip += length; - break; /* EOF */ - } - LZ4_WILDCOPY(ip, op, cpy); - ip -= (op - cpy); - op = cpy; - - /* get offset */ - LZ4_READ_LITTLEENDIAN_16(ref, cpy, ip); - ip += 2; - if unlikely(ref < (BYTE * const) dest) - /* -* Error: offset create reference
svn commit: r246807 - head/sys/net80211
Author: monthadar Date: Thu Feb 14 20:00:38 2013 New Revision: 246807 URL: http://svnweb.freebsd.org/changeset/base/246807 Log: Mesh: QoS Control field bit flags fix. * The following bit flags where incroccetly defined: o Mesh Control Present o Mesh Power Save Level o RSPI This is now corrected according to Table 8.4 as per IEEE 802.11 2012; Approved by: adrian (mentor) Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h == --- head/sys/net80211/ieee80211.h Thu Feb 14 19:46:41 2013 (r246806) +++ head/sys/net80211/ieee80211.h Thu Feb 14 20:00:38 2013 (r246807) @@ -200,11 +200,11 @@ struct ieee80211_qosframe_addr4 { #defineIEEE80211_QOS_EOSP_S4 #defineIEEE80211_QOS_TID 0x0f /* qos[1] byte used for all frames sent by mesh STAs in a mesh BSS */ -#define IEEE80211_QOS_MC 0x10/* Mesh control */ +#define IEEE80211_QOS_MC 0x01/* Mesh control */ /* Mesh power save level*/ -#define IEEE80211_QOS_MESH_PSL 0x20 +#define IEEE80211_QOS_MESH_PSL 0x02 /* Mesh Receiver Service Period Initiated */ -#define IEEE80211_QOS_RSPI 0x40 +#define IEEE80211_QOS_RSPI 0x04 /* bits 11 to 15 reserved */ /* does frame have QoS sequence control data */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246806 - head/usr.bin/csup
Author: joel (doc committer) Date: Thu Feb 14 19:46:41 2013 New Revision: 246806 URL: http://svnweb.freebsd.org/changeset/base/246806 Log: Fix date. Modified: head/usr.bin/csup/csup.1 Modified: head/usr.bin/csup/csup.1 == --- head/usr.bin/csup/csup.1Thu Feb 14 19:38:04 2013(r246805) +++ head/usr.bin/csup/csup.1Thu Feb 14 19:46:41 2013(r246806) @@ -24,7 +24,7 @@ .\" $Id: cvsup.1,v 1.70 2003/03/04 18:23:46 jdp Exp $ .\" $FreeBSD$ .\" -.Dd Feburary 8, 2013 +.Dd February 8, 2013 .Dt CSUP 1 .Os FreeBSD .Sh NAME ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246805 - in head/sys: conf vm x86/acpica
Author: jhb Date: Thu Feb 14 19:38:04 2013 New Revision: 246805 URL: http://svnweb.freebsd.org/changeset/base/246805 Log: Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel config file. Requested by: phk (ages ago) MFC after:1 month Modified: head/sys/conf/options head/sys/vm/vm_phys.c head/sys/x86/acpica/srat.c Modified: head/sys/conf/options == --- head/sys/conf/options Thu Feb 14 19:27:52 2013(r246804) +++ head/sys/conf/options Thu Feb 14 19:38:04 2013(r246805) @@ -588,6 +588,7 @@ VFS_BIO_DEBUG opt_global.h VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h +VM_NDOMAIN opt_vm.h VM_NRESERVLEVELopt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPINGopt_vm.h Modified: head/sys/vm/vm_phys.c == --- head/sys/vm/vm_phys.c Thu Feb 14 19:27:52 2013(r246804) +++ head/sys/vm/vm_phys.c Thu Feb 14 19:38:04 2013(r246805) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_vm.h" #include #include Modified: head/sys/x86/acpica/srat.c == --- head/sys/x86/acpica/srat.c Thu Feb 14 19:27:52 2013(r246804) +++ head/sys/x86/acpica/srat.c Thu Feb 14 19:38:04 2013(r246805) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include #include #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246804 - head/usr.sbin/jail
Author: jamie Date: Thu Feb 14 19:27:52 2013 New Revision: 246804 URL: http://svnweb.freebsd.org/changeset/base/246804 Log: Handle (ignore) when a process disappears before it can be tracked. Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c == --- head/usr.sbin/jail/command.cThu Feb 14 19:26:58 2013 (r246803) +++ head/usr.sbin/jail/command.cThu Feb 14 19:27:52 2013 (r246804) @@ -66,7 +66,7 @@ int paralimit = -1; extern char **environ; static int run_command(struct cfjail *j); -static void add_proc(struct cfjail *j, pid_t pid); +static int add_proc(struct cfjail *j, pid_t pid); static void clear_procs(struct cfjail *j); static struct cfjail *find_proc(pid_t pid); static int term_procs(struct cfjail *j); @@ -542,13 +542,12 @@ run_command(struct cfjail *j) if (pid < 0) err(1, "fork"); if (pid > 0) { - if (bg) { + if (bg || !add_proc(j, pid)) { free(j->comline); j->comline = NULL; return 0; } else { paralimit--; - add_proc(j, pid); return 1; } } @@ -622,7 +621,7 @@ run_command(struct cfjail *j) /* * Add a process to the hash, tied to a jail. */ -static void +static int add_proc(struct cfjail *j, pid_t pid) { struct kevent ke; @@ -632,8 +631,11 @@ add_proc(struct cfjail *j, pid_t pid) if (!kq && (kq = kqueue()) < 0) err(1, "kqueue"); EV_SET(&ke, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); - if (kevent(kq, &ke, 1, NULL, 0, NULL) < 0) + if (kevent(kq, &ke, 1, NULL, 0, NULL) < 0) { + if (errno == ESRCH) + return 0; err(1, "kevent"); + } ph = emalloc(sizeof(struct phash)); ph->j = j; ph->pid = pid; @@ -658,6 +660,7 @@ add_proc(struct cfjail *j, pid_t pid) TAILQ_INSERT_TAIL(&sleeping, j, tq); j->queue = &sleeping; } + return 1; } /* @@ -730,7 +733,7 @@ term_procs(struct cfjail *j) for (i = 0; i < pcnt; i++) if (ki[i].ki_jid == j->jid && kill(ki[i].ki_pid, SIGTERM) == 0) { - add_proc(j, ki[i].ki_pid); + (void)add_proc(j, ki[i].ki_pid); if (verbose > 0) { if (!noted) { noted = 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246803 - head/include
Author: zeising (doc,ports committer) Date: Thu Feb 14 19:26:58 2013 New Revision: 246803 URL: http://svnweb.freebsd.org/changeset/base/246803 Log: FreeBSD uses #if __BSD_VISIBLE to hide non-standard functions, fix this. Noticed by: kib Approved by: kib Modified: head/include/string.h Modified: head/include/string.h == --- head/include/string.h Thu Feb 14 19:22:15 2013(r246802) +++ head/include/string.h Thu Feb 14 19:26:58 2013(r246803) @@ -74,7 +74,7 @@ char *strcasestr(const char *, const cha #endif char *strcat(char * __restrict, const char * __restrict); char *strchr(const char *, int) __pure; -#if defined(_GNU_SOURCE) +#if __BSD_VISIBLE char *strchrnul(const char*, int) __pure; #endif int strcmp(const char *, const char *) __pure; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246802 - head/sys/amd64/amd64
Author: kib Date: Thu Feb 14 19:22:15 2013 New Revision: 246802 URL: http://svnweb.freebsd.org/changeset/base/246802 Log: Print slightly more useful information on the 'bad pte' panic. No objections from: alc MFC after:1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Thu Feb 14 19:21:20 2013(r246801) +++ head/sys/amd64/amd64/pmap.c Thu Feb 14 19:22:15 2013(r246802) @@ -4446,8 +4446,10 @@ pmap_remove_pages(pmap_t pmap) pte = &pte[pmap_pte_index(pv->pv_va)]; tpte = *pte & ~PG_PTE_PAT; } - if ((tpte & PG_V) == 0) - panic("bad pte"); + if ((tpte & PG_V) == 0) { + panic("bad pte va %lx pte %lx", + pv->pv_va, tpte); + } /* * We cannot remove wired pages from a process' mapping at this time ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246801 - head/sys/amd64/amd64
Author: kib Date: Thu Feb 14 19:21:20 2013 New Revision: 246801 URL: http://svnweb.freebsd.org/changeset/base/246801 Log: Assert that user address is never qremoved. No objections from: alc MFC after:1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Thu Feb 14 18:41:12 2013(r246800) +++ head/sys/amd64/amd64/pmap.c Thu Feb 14 19:21:20 2013(r246801) @@ -1481,6 +1481,7 @@ pmap_qremove(vm_offset_t sva, int count) va = sva; while (count-- > 0) { + KASSERT(va >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", va)); pmap_kremove(va); va += PAGE_SIZE; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246800 - head/usr.sbin/bhyvectl
Author: neel Date: Thu Feb 14 18:41:12 2013 New Revision: 246800 URL: http://svnweb.freebsd.org/changeset/base/246800 Log: Add option "--unassign-pptdev=" to allow 'bhyvectl' to detach passthru devices from the guest. Obtained from:NetApp Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c == --- head/usr.sbin/bhyvectl/bhyvectl.c Thu Feb 14 17:34:17 2013 (r246799) +++ head/usr.sbin/bhyvectl/bhyvectl.c Thu Feb 14 18:41:12 2013 (r246800) @@ -185,6 +185,7 @@ usage(void) " [--get-vmcs-interruptibility]\n" " [--set-x2apic-state=]\n" " [--get-x2apic-state]\n" + " [--unassign-pptdev=]\n" " [--set-lowmem=]\n" " [--get-lowmem]\n" " [--set-highmem=]\n" @@ -218,6 +219,7 @@ static int set_cs, set_ds, set_es, set_f static int get_cs, get_ds, get_es, get_fs, get_gs, get_ss, get_tr, get_ldtr; static int set_x2apic_state, get_x2apic_state; enum x2apic_state x2apic_state; +static int unassign_pptdev, bus, slot, func; static int run; /* @@ -376,6 +378,7 @@ enum { SET_VMCS_ENTRY_INTERRUPTION_INFO, SET_CAP, CAPNAME, + UNASSIGN_PPTDEV, }; int @@ -425,6 +428,7 @@ main(int argc, char *argv[]) { "set-vmcs-entry-interruption-info", REQ_ARG, 0, SET_VMCS_ENTRY_INTERRUPTION_INFO }, { "capname",REQ_ARG,0, CAPNAME }, + { "unassign-pptdev", REQ_ARG, 0, UNASSIGN_PPTDEV }, { "setcap", REQ_ARG,0, SET_CAP }, { "getcap", NO_ARG, &getcap,1 }, { "get-stats", NO_ARG, &get_stats, 1 }, @@ -672,6 +676,11 @@ main(int argc, char *argv[]) case CAPNAME: capname = optarg; break; + case UNASSIGN_PPTDEV: + unassign_pptdev = 1; + if (sscanf(optarg, "%d/%d/%d", &bus, &slot, &func) != 3) + usage(); + break; default: usage(); } @@ -805,6 +814,9 @@ main(int argc, char *argv[]) if (!error && set_x2apic_state) error = vm_set_x2apic_state(ctx, vcpu, x2apic_state); + if (!error && unassign_pptdev) + error = vm_unassign_pptdev(ctx, bus, slot, func); + if (!error && set_exception_bitmap) { error = vm_set_vmcs_field(ctx, vcpu, VMCS_EXCEPTION_BITMAP, exception_bitmap); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246799 - head/sys/dev/oce
Author: jpaetzel Date: Thu Feb 14 17:34:17 2013 New Revision: 246799 URL: http://svnweb.freebsd.org/changeset/base/246799 Log: Resolve issue that caused WITNESS to report LORs. PR: kern/171838 Submitted by: Venkat Duvvuru MFC after:2 weeks Modified: head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h Modified: head/sys/dev/oce/oce_if.c == --- head/sys/dev/oce/oce_if.c Thu Feb 14 15:43:37 2013(r246798) +++ head/sys/dev/oce/oce_if.c Thu Feb 14 17:34:17 2013(r246799) @@ -1817,6 +1817,9 @@ oce_local_timer(void *arg) } +/* NOTE : This should only be called holding + *DEVICE_LOCK. +*/ static void oce_if_deactivate(POCE_SOFTC sc) { @@ -1846,11 +1849,17 @@ oce_if_deactivate(POCE_SOFTC sc) /* Stop intrs and finish any bottom halves pending */ oce_hw_intr_disable(sc); +/* Since taskqueue_drain takes a Giant Lock, We should not acquire + any other lock. So unlock device lock and require after + completing taskqueue_drain. +*/ +UNLOCK(&sc->dev_lock); for (i = 0; i < sc->intr_count; i++) { if (sc->intrs[i].tq != NULL) { taskqueue_drain(sc->intrs[i].tq, &sc->intrs[i].task); } } +LOCK(&sc->dev_lock); /* Delete RX queue in card with flush param */ oce_stop_rx(sc); Modified: head/sys/dev/oce/oce_if.h == --- head/sys/dev/oce/oce_if.h Thu Feb 14 15:43:37 2013(r246798) +++ head/sys/dev/oce/oce_if.h Thu Feb 14 17:34:17 2013(r246799) @@ -493,7 +493,7 @@ struct oce_lock { #define LOCK_CREATE(lock, desc){ \ strncpy((lock)->name, (desc), MAX_LOCK_DESC_LEN); \ (lock)->name[MAX_LOCK_DESC_LEN] = '\0'; \ - mtx_init(&(lock)->mutex, (lock)->name, MTX_NETWORK_LOCK, MTX_DEF); \ + mtx_init(&(lock)->mutex, (lock)->name, NULL, MTX_DEF); \ } #define LOCK_DESTROY(lock) \ if (mtx_initialized(&(lock)->mutex))\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r246789 - in head: lib/libusb sys/dev/usb usr.sbin/usbconfig
On Thursday 14 February 2013 16:23:02 Eitan Adler wrote: > On 14 February 2013 07:22, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Thu Feb 14 12:22:40 2013 > > New Revision: 246789 > > URL: http://svnweb.freebsd.org/changeset/base/246789 > > > > Log: > > Add USB API to read power draw on USB devices. > > Update usbconfig to print power draw on USB devices. > > > > MFC after:2 weeks > > Submitted by: Matt Burke @ icritical.com > > I know this is nitpicking, but can we please not obfusticate emails? > It makes it difficult to grep, and does not protect against spammers. Hi, What is the correct "Submitted by:" format for non-submitters? And is this documented anywhere? --HPS ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r246789 - in head: lib/libusb sys/dev/usb usr.sbin/usbconfig
On 14 February 2013 07:22, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Feb 14 12:22:40 2013 > New Revision: 246789 > URL: http://svnweb.freebsd.org/changeset/base/246789 > > Log: > Add USB API to read power draw on USB devices. > Update usbconfig to print power draw on USB devices. > > MFC after:2 weeks > Submitted by: Matt Burke @ icritical.com I know this is nitpicking, but can we please not obfusticate emails? It makes it difficult to grep, and does not protect against spammers. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246793 - head/sys/fs/fdescfs
Author: bapt Date: Thu Feb 14 15:17:53 2013 New Revision: 246793 URL: http://svnweb.freebsd.org/changeset/base/246793 Log: Revert r246791 as it needs a security review first Reported by: gavin, rwatson Modified: head/sys/fs/fdescfs/fdesc_vfsops.c Modified: head/sys/fs/fdescfs/fdesc_vfsops.c == --- head/sys/fs/fdescfs/fdesc_vfsops.c Thu Feb 14 14:44:08 2013 (r246792) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Thu Feb 14 15:17:53 2013 (r246793) @@ -237,4 +237,4 @@ static struct vfsops fdesc_vfsops = { .vfs_unmount = fdesc_unmount, }; -VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC|VFCF_JAIL); +VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246792 - head/usr.sbin/kgmon
Author: charnier Date: Thu Feb 14 14:44:08 2013 New Revision: 246792 URL: http://svnweb.freebsd.org/changeset/base/246792 Log: remove old-style function definition reduce WARNS=6 output Modified: head/usr.sbin/kgmon/kgmon.c Modified: head/usr.sbin/kgmon/kgmon.c == --- head/usr.sbin/kgmon/kgmon.c Thu Feb 14 13:03:15 2013(r246791) +++ head/usr.sbin/kgmon/kgmon.c Thu Feb 14 14:44:08 2013(r246792) @@ -37,10 +37,11 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)kgmon.c8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -77,7 +78,7 @@ int debug = 0; intgetprof(struct kvmvars *); intgetprofhz(struct kvmvars *); void kern_readonly(int); -intopenfiles(char *, char *, struct kvmvars *); +intopenfiles(const char *, char *, struct kvmvars *); void setprof(struct kvmvars *kvp, int state); void dumpstate(struct kvmvars *kvp); void reset(struct kvmvars *kvp); @@ -88,13 +89,14 @@ main(int argc, char **argv) { int ch, mode, disp, accessmode; struct kvmvars kvmvars; - char *system, *kmemf; + const char *systemname; + char *kmemf; if (seteuid(getuid()) != 0) { err(1, "seteuid failed\n"); } kmemf = NULL; - system = NULL; + systemname = NULL; while ((ch = getopt(argc, argv, "M:N:Bbhpr")) != -1) { switch((char)ch) { @@ -104,7 +106,7 @@ main(int argc, char **argv) break; case 'N': - system = optarg; + systemname = optarg; break; case 'B': @@ -137,16 +139,16 @@ main(int argc, char **argv) #define BACKWARD_COMPATIBILITY #ifdef BACKWARD_COMPATIBILITY if (*argv) { - system = *argv; + systemname = *argv; if (*++argv) { kmemf = *argv; ++kflag; } } #endif - if (system == NULL) - system = (char *)getbootfile(); - accessmode = openfiles(system, kmemf, &kvmvars); + if (systemname == NULL) + systemname = getbootfile(); + accessmode = openfiles(systemname, kmemf, &kvmvars); mode = getprof(&kvmvars); if (hflag) disp = GMON_PROF_OFF; @@ -173,7 +175,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: kgmon [-Bbhrp] [-M core] [-N system]\n"); exit(1); @@ -183,10 +185,7 @@ usage() * Check that profiling is enabled and open any necessary files. */ int -openfiles(system, kmemf, kvp) - char *system; - char *kmemf; - struct kvmvars *kvp; +openfiles(const char *systemname, char *kmemf, struct kvmvars *kvp) { size_t size; int mib[3], state, openmode; @@ -212,11 +211,11 @@ openfiles(system, kmemf, kvp) } openmode = (Bflag || bflag || hflag || pflag || rflag) ? O_RDWR : O_RDONLY; - kvp->kd = kvm_openfiles(system, kmemf, NULL, openmode, errbuf); + kvp->kd = kvm_openfiles(systemname, kmemf, NULL, openmode, errbuf); if (kvp->kd == NULL) { if (openmode == O_RDWR) { openmode = O_RDONLY; - kvp->kd = kvm_openfiles(system, kmemf, NULL, O_RDONLY, + kvp->kd = kvm_openfiles(systemname, kmemf, NULL, O_RDONLY, errbuf); } if (kvp->kd == NULL) @@ -224,7 +223,7 @@ openfiles(system, kmemf, kvp) kern_readonly(GMON_PROF_ON); } if (kvm_nlist(kvp->kd, nl) < 0) - errx(3, "%s: no namelist", system); + errx(3, "%s: no namelist", systemname); if (!nl[N_GMONPARAM].n_value) errx(20, "profiling not defined in kernel"); return (openmode); @@ -234,8 +233,7 @@ openfiles(system, kmemf, kvp) * Suppress options that require a writable kernel. */ void -kern_readonly(mode) - int mode; +kern_readonly(int mode) { (void)fprintf(stderr, "kgmon: kernel read-only: "); @@ -256,8 +254,7 @@ kern_readonly(mode) * Get the state of kernel profiling. */ int -getprof(kvp) - struct kvmvars *kvp; +getprof(struct kvmvars *kvp) { size_t size; int mib[3]; @@ -311,9 +308,7 @@ getprof(kvp) * Enable or disable kernel profiling according to the state variable. */ void -setprof(kvp, state) - struct kvmvars *kvp; - int state; +setprof(struct kvmvars *kvp, int state) { struct gmonparam *p = (struct gmonparam *)nl[N_GMONPARAM].n_value; size_t sz; @@ -335,7 +330,7 @@ setprof(kvp, state) } (
svn commit: r246791 - head/sys/fs/fdescfs
Author: bapt Date: Thu Feb 14 13:03:15 2013 New Revision: 246791 URL: http://svnweb.freebsd.org/changeset/base/246791 Log: Allow fdescfs to be mounted from inside a jail MFC after:1 week Modified: head/sys/fs/fdescfs/fdesc_vfsops.c Modified: head/sys/fs/fdescfs/fdesc_vfsops.c == --- head/sys/fs/fdescfs/fdesc_vfsops.c Thu Feb 14 12:42:09 2013 (r246790) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Thu Feb 14 13:03:15 2013 (r246791) @@ -237,4 +237,4 @@ static struct vfsops fdesc_vfsops = { .vfs_unmount = fdesc_unmount, }; -VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC); +VFS_SET(fdesc_vfsops, fdescfs, VFCF_SYNTHETIC|VFCF_JAIL); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246790 - head/usr.sbin/pkg
Author: bapt Date: Thu Feb 14 12:42:09 2013 New Revision: 246790 URL: http://svnweb.freebsd.org/changeset/base/246790 Log: In case of failure of the pkg boostrap advice the user to either change the PACKAGESITE they use or install from ports directly indicating where the port is localted in the port collection Submitted by: kientzle Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c == --- head/usr.sbin/pkg/pkg.c Thu Feb 14 12:22:40 2013(r246789) +++ head/usr.sbin/pkg/pkg.c Thu Feb 14 12:42:09 2013(r246790) @@ -411,6 +411,8 @@ bootstrap_pkg(void) fetchfail: warnx("Error fetching %s: %s", url, fetchLastErrString); + fprintf(stderr, "A pre-built version of pkg could not be found for your system.\n"); + fprintf(stderr, "Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.\n"); cleanup: if (remote != NULL) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246789 - in head: lib/libusb sys/dev/usb usr.sbin/usbconfig
Author: hselasky Date: Thu Feb 14 12:22:40 2013 New Revision: 246789 URL: http://svnweb.freebsd.org/changeset/base/246789 Log: Add USB API to read power draw on USB devices. Update usbconfig to print power draw on USB devices. MFC after:2 weeks Submitted by: Matt Burke @ icritical.com Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_ioctl.h head/usr.sbin/usbconfig/dump.c Modified: head/lib/libusb/Makefile == --- head/lib/libusb/MakefileThu Feb 14 11:29:57 2013(r246788) +++ head/lib/libusb/MakefileThu Feb 14 12:22:40 2013(r246789) @@ -190,6 +190,7 @@ MLINKS += libusb20.3 libusb20_dev_reset. MLINKS += libusb20.3 libusb20_dev_check_connected.3 MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_power_usage.3 MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 MLINKS += libusb20.3 libusb20_dev_alloc_config.3 Modified: head/lib/libusb/libusb20.3 == --- head/lib/libusb/libusb20.3 Thu Feb 14 11:29:57 2013(r246788) +++ head/lib/libusb/libusb20.3 Thu Feb 14 12:22:40 2013(r246789) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2012 +.Dd February 14, 2013 .Dt LIBUSB20 3 .Os .Sh NAME @@ -149,6 +149,8 @@ USB access library (libusb -lusb) .Fn libusb20_dev_set_power_mode "struct libusb20_device *pdev" "uint8_t power_mode" .Ft uint8_t .Fn libusb20_dev_get_power_mode "struct libusb20_device *pdev" +.Ft uint16_t +.Fn libusb20_dev_get_power_usage "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_set_alt_index "struct libusb20_device *pdev" "uint8_t iface_index" "uint8_t alt_index" .Ft struct LIBUSB20_DEVICE_DESC_DECODED * @@ -740,6 +742,12 @@ USB device. . .Pp . +.Fn libusb20_dev_get_power_usage +returns the reported power usage in milliamps for the given USB device. +A power usage of zero typically means that the device is self powered. +. +.Pp +. .Fn libusb20_dev_set_alt_index will try to set the given alternate index for the given USB interface index. Modified: head/lib/libusb/libusb20.c == --- head/lib/libusb/libusb20.c Thu Feb 14 11:29:57 2013(r246788) +++ head/lib/libusb/libusb20.c Thu Feb 14 12:22:40 2013(r246789) @@ -71,6 +71,7 @@ dummy_callback(struct libusb20_transfer #definedummy_check_connected (void *)dummy_int #definedummy_set_power_mode (void *)dummy_int #definedummy_get_power_mode (void *)dummy_int +#definedummy_get_power_usage (void *)dummy_int #definedummy_kernel_driver_active (void *)dummy_int #definedummy_detach_kernel_driver (void *)dummy_int #definedummy_do_request_sync (void *)dummy_int @@ -717,6 +718,18 @@ libusb20_dev_get_power_mode(struct libus return (power_mode); } +uint16_t +libusb20_dev_get_power_usage(struct libusb20_device *pdev) +{ + int error; + uint16_t power_usage; + + error = pdev->methods->get_power_usage(pdev, &power_usage); + if (error) + power_usage = 0; + return (power_usage); +} + int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t ifaceIndex, uint8_t altIndex) { Modified: head/lib/libusb/libusb20.h == --- head/lib/libusb/libusb20.h Thu Feb 14 11:29:57 2013(r246788) +++ head/lib/libusb/libusb20.h Thu Feb 14 12:22:40 2013(r246789) @@ -255,6 +255,7 @@ int libusb20_dev_reset(struct libusb20_d intlibusb20_dev_check_connected(struct libusb20_device *pdev); intlibusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode); uint8_tlibusb20_dev_get_power_mode(struct libusb20_device *pdev); +uint16_t libusb20_dev_get_power_usage(struct libusb20_device *pdev); intlibusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index); intlibusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo); intlibusb20_dev_get_iface_desc(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len); Modified: head/lib/libusb/libusb20_int.h == --- head/lib/libusb/libusb20_int.h Thu Feb 14 11:29:57 2013 (r246788) +++ head/lib/libusb/libusb20_int.h Thu Feb 14 12:22:40 2013 (r246789) @@ -105,6 +105,7 @@ typedef int (libusb20_process_t)(struct typedef int (libusb20_reset_device_t)
svn commit: r246784 - in head: . usr.bin/xinstall
Author: hrs Date: Thu Feb 14 08:32:07 2013 New Revision: 246784 URL: http://svnweb.freebsd.org/changeset/base/246784 Log: - Fix libmd dependency. It is needed in the bootstrap library list because usr.bin/xinstall depends on it. - Remove libutil from usr.bin/xinstall/Makefile. No symbol was actually used. Reviewed by: brooks Modified: head/Makefile.inc1 head/usr.bin/xinstall/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Feb 14 08:16:03 2013(r246783) +++ head/Makefile.inc1 Thu Feb 14 08:32:07 2013(r246784) @@ -1207,6 +1207,7 @@ bootstrap-tools: ${_sed} \ ${_yacc} \ ${_lex} \ +lib/libmd \ usr.bin/xinstall \ ${_gensnmptree} \ usr.sbin/config \ Modified: head/usr.bin/xinstall/Makefile == --- head/usr.bin/xinstall/Makefile Thu Feb 14 08:16:03 2013 (r246783) +++ head/usr.bin/xinstall/Makefile Thu Feb 14 08:32:07 2013 (r246784) @@ -7,10 +7,12 @@ SRCS= xinstall.c getid.c MAN= install.1 .PATH: ${.CURDIR}/../../contrib/mtree +.PATH: ${.CURDIR}/../../lib/libmd CFLAGS+= -I${.CURDIR}/../../contrib/mtree CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd +CFLAGS+= -I${.CURDIR}/../../lib/libmd -DPADD+=${LIBUTIL} ${LIBMD} -LDADD+=-lutil -lmd +DPADD+=${LIBMD} +LDADD+=-lmd .include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r246783 - head/usr.bin/gprof
Author: charnier Date: Thu Feb 14 08:16:03 2013 New Revision: 246783 URL: http://svnweb.freebsd.org/changeset/base/246783 Log: rework old-style functions prototypes reduce WARNS=6 output Modified: head/usr.bin/gprof/aout.c head/usr.bin/gprof/arcs.c head/usr.bin/gprof/dfn.c head/usr.bin/gprof/gprof.c head/usr.bin/gprof/gprof.h head/usr.bin/gprof/hertz.c head/usr.bin/gprof/kernel.c head/usr.bin/gprof/lookup.c head/usr.bin/gprof/printgprof.c head/usr.bin/gprof/printlist.c Modified: head/usr.bin/gprof/aout.c == --- head/usr.bin/gprof/aout.c Thu Feb 14 04:28:49 2013(r246782) +++ head/usr.bin/gprof/aout.c Thu Feb 14 08:16:03 2013(r246783) @@ -68,7 +68,6 @@ int aout_getnfile(const char *filename, char ***defaultEs) { FILE *nfile; -intvalcmp(); nfile = fopen( filename ,"r"); if (nfile == NULL) Modified: head/usr.bin/gprof/arcs.c == --- head/usr.bin/gprof/arcs.c Thu Feb 14 04:28:49 2013(r246782) +++ head/usr.bin/gprof/arcs.c Thu Feb 14 08:16:03 2013(r246783) @@ -46,14 +46,13 @@ int newcycle; int oldcycle; #endif /* DEBUG */ +int topcmp(const void *, const void *); + /* * add (or just increment) an arc */ void -addarc( parentp , childp , count ) -nltype *parentp; -nltype *childp; -long count; +addarc(nltype *parentp, nltype *childp, long count) { arctype*arcp; @@ -106,15 +105,16 @@ addarc( parentp , childp , count ) nltype **topsortnlp; int -topcmp( npp1 , npp2 ) -nltype **npp1; -nltype **npp2; +topcmp(const void *v1, const void *v2) { +const nltype **npp1 = (const nltype **)v1; +const nltype **npp2 = (const nltype **)v2; + return (*npp1) -> toporder - (*npp2) -> toporder; } nltype ** -doarcs() +doarcs(void) { nltype *parentp, **timesortnlp; arctype*arcp; @@ -252,7 +252,7 @@ doarcs() } void -dotime() +dotime(void) { intindex; @@ -263,8 +263,7 @@ dotime() } void -timepropagate( parentp ) -nltype *parentp; +timepropagate(nltype *parentp) { arctype*arcp; nltype *childp; @@ -352,7 +351,7 @@ timepropagate( parentp ) } void -cyclelink() +cyclelink(void) { register nltype*nlp; register nltype*cyclenlp; @@ -445,7 +444,7 @@ cyclelink() * analyze cycles to determine breakup */ bool -cycleanalyze() +cycleanalyze(void) { arctype**cyclestack; arctype**stkp; @@ -521,10 +520,7 @@ cycleanalyze() } bool -descend( node , stkstart , stkp ) -nltype *node; -arctype**stkstart; -arctype**stkp; +descend(nltype *node, arctype **stkstart, arctype **stkp) { arctype*arcp; bool ret; @@ -556,9 +552,7 @@ descend( node , stkstart , stkp ) } bool -addcycle( stkstart , stkend ) -arctype**stkstart; -arctype**stkend; +addcycle(arctype **stkstart, arctype **stkend) { arctype**arcpp; arctype**stkloc; @@ -632,7 +626,7 @@ addcycle( stkstart , stkend ) } void -compresslist() +compresslist(void) { cltype *clp; cltype **prev; @@ -748,8 +742,7 @@ compresslist() #ifdef DEBUG void -printsubcycle( clp ) -cltype *clp; +printsubcycle(cltype *clp) { arctype**arcpp; arctype**endlist; @@ -764,7 +757,7 @@ printsubcycle( clp ) #endif /* DEBUG */ void -cycletime() +cycletime(void) { intcycle; nltype *cyclenlp; @@ -794,7 +787,7 @@ cycletime() * and while we're here, sum time for functions. */ void -doflags() +doflags(void) { intindex; nltype *childp; @@ -889,8 +882,7 @@ doflags() * similarly, deal with propagation fractions from parents. */ void -inheritflags( childp ) -nltype *childp; +inheritflags(nltype *childp) { nltype *headp; arctype*arcp; Modified: head/usr.bin/gprof/dfn.c == --- head/usr.bin/gprof/dfn.cThu Feb 14 04:28:49 2013(r246782) +++ head/usr.bin/gprof/dfn.cThu Feb 14 08:16:03 2013(r246783) @@ -52,7 +52,7 @@ int dfn_depth; intdfn_counter; void -dfn_init() +dfn_init(void) { dfn_depth = 0; @@ -63,8 +63,7 @@ dfn_init() * given this parent, depth first number its children. */ void -dfn( parentp ) -nltype *parentp; +dfn(nltype *parentp) { arctype*arcp; @@ -110,8 +109,7 @@ dfn( parentp ) * push a parent onto the stack and mark it busy */ void -dfn_pre_visit( parentp ) -nltype *parentp; +dfn_pre_visit(nltype *parentp) { dfn_depth += 1; @@ -133,8 +131,7 @@ dfn_pre_visit( parentp ) * are we already numbered? */ bool -