From 0bd47e8362e1eee02d034e0479dd79673ec06bcc Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Wed, 18 May 2011 17:39:28 +0000 Subject: [PATCH 01/21] As requested by many people, with final prodding from Jason Hall, fix this so that running make release causes make obj to be run before doing anything. This fixes a bug wherein, when run for the first time, and without -DNOSRC, make release would attempt to recursively tar up the src directory including its own output and enter an infinite loop. While here, make the cross-building stuff work a little more the way it should if only one of TARGET/TARGET_ARCH is specified. --- release/Makefile | 10 ++++++---- release/generate-release.sh | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/release/Makefile b/release/Makefile index 1dde3b106149..081cdbf75115 100644 --- a/release/Makefile +++ b/release/Makefile @@ -25,11 +25,11 @@ PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 -TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == ${MACHINE_ARCH} TARGET?= ${MACHINE} +.if ${TARGET} == ${MACHINE} +TARGET_ARCH?= ${MACHINE_ARCH} .else -TARGET?= ${TARGET_ARCH} +TARGET_ARCH?= ${TARGET} .endif IMAKE= ${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET} DISTDIR= ${.OBJDIR}/dist @@ -169,7 +169,9 @@ ftp: packagesystem mkdir ftp cp *.txz MANIFEST ftp -release: obj ${RELEASE_TARGETS} +release: + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj + ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} clean: chflags -R noschg ${.OBJDIR} diff --git a/release/generate-release.sh b/release/generate-release.sh index 62d052813f55..080512a89ee8 100755 --- a/release/generate-release.sh +++ b/release/generate-release.sh @@ -63,7 +63,6 @@ if [ -d $2/usr/doc ]; then fi chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel -chroot $2 make -C /usr/src/release obj chroot $2 make -C /usr/src/release release chroot $2 make -C /usr/src/release install DESTDIR=/R From b70cddba44edd768b7ee4c659a6dbdf189c98fb3 Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Wed, 18 May 2011 18:36:40 +0000 Subject: [PATCH 02/21] Add a sanity check for the existence of an "addr" option to both NFS clients. This avoids the crash reported by Sergey Kandaurov (pluknet@gmail.com) to the freebsd-fs@ list with subject "[old nfsclient] different nmount() args passed from mount vs mount_nfs" dated May 17, 2011. Tested by: pluknet at gmail.com (old nfs client) MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clvfsops.c | 20 +++++++++++++------- sys/nfsclient/nfs_vfsops.c | 4 ++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index b062d2cd46c6..8dc5b0b4b0f2 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1079,15 +1079,21 @@ nfs_mount(struct mount *mp) dirpath[0] = '\0'; dirlen = strlen(dirpath); - if (has_nfs_args_opt == 0 && vfs_getopt(mp->mnt_optnew, "addr", - (void **)&args.addr, &args.addrlen) == 0) { - if (args.addrlen > SOCK_MAXADDRLEN) { - error = ENAMETOOLONG; + if (has_nfs_args_opt == 0) { + if (vfs_getopt(mp->mnt_optnew, "addr", + (void **)&args.addr, &args.addrlen) == 0) { + if (args.addrlen > SOCK_MAXADDRLEN) { + error = ENAMETOOLONG; + goto out; + } + nam = malloc(args.addrlen, M_SONAME, M_WAITOK); + bcopy(args.addr, nam, args.addrlen); + nam->sa_len = args.addrlen; + } else { + vfs_mount_error(mp, "No server address"); + error = EINVAL; goto out; } - nam = malloc(args.addrlen, M_SONAME, M_WAITOK); - bcopy(args.addr, nam, args.addrlen); - nam->sa_len = args.addrlen; } args.fh = nfh; diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 04fd37500669..79659d04ddba 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -1149,6 +1149,10 @@ nfs_mount(struct mount *mp) goto out; } } + } else if (has_addr_opt == 0) { + vfs_mount_error(mp, "No server address"); + error = EINVAL; + goto out; } error = mountnfs(&args, mp, nam, args.hostname, &vp, curthread->td_ucred, negnametimeo); From b7e08865e8437cb1638bc842f70aa3428438ab38 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Wed, 18 May 2011 19:49:39 +0000 Subject: [PATCH 03/21] Unbreak INET-less build. Reported by bz@ MFC after: 1 week --- sys/netinet/sctp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index aea43b2dbe37..a7d22bdf241b 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3129,8 +3129,8 @@ sctp_choose_boundall(struct sctp_inpcb *inp, } #endif out: - if (sifa) { #ifdef INET + if (sifa) { if (retried == 1) { LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { From 278ea85a0386cadbb16be8fc77b99c8726d988cd Mon Sep 17 00:00:00 2001 From: Josh Paetzel Date: Wed, 18 May 2011 20:29:07 +0000 Subject: [PATCH 04/21] Extracting optional components requires mounting devfs Submitted by: Kris Moore Approved by: kib (mentor) Sponsored by: iXsystems --- usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh b/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh index c46c9c53959e..05e4d49c36e2 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh @@ -120,9 +120,11 @@ COMPTMPDIR=\"${COMPTMPDIR}\" export COMPTMPDIR CFILE=\"${CFILE}\" export CFILE +mount -t devfs devfs /dev sh ${COMPTMPDIR}/install.sh +umount /dev " >${FSMNT}/.componentwrapper.sh chmod 755 ${FSMNT}/.componentwrapper.sh From 098c92cc133163a010706c98aa97e782d2c65828 Mon Sep 17 00:00:00 2001 From: Josh Paetzel Date: Wed, 18 May 2011 20:38:28 +0000 Subject: [PATCH 05/21] Wipeout the end of disks, home to things like gmirror metadata, backup GPT tables, and other potential evil. Submitted by: Kris Moore Approved by: kib (mentor) Sponsored by: iXsystems --- usr.sbin/pc-sysinstall/backend/functions-disk.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/usr.sbin/pc-sysinstall/backend/functions-disk.sh b/usr.sbin/pc-sysinstall/backend/functions-disk.sh index 94fb436792dc..c63f7afd7ecf 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-disk.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-disk.sh @@ -582,17 +582,9 @@ stop_gjournal() # Function to wipe the potential backup gpt table from a disk clear_backup_gpt_table() { - # Get the disk block size - local dSize="`gpart show $1 | grep $1 | tr -s ' ' | cut -d ' ' -f 3`" - - # Make sure this is a valid number - is_num "${dSize}" >/dev/null 2>/dev/null - [ $? -ne 0 ] && return - - # Die backup label, DIE echo_log "Clearing gpt backup table location on disk" - rc_nohalt "dd if=/dev/zero of=${1} bs=512 seek=${dSize}" - + rc_nohalt "dd if=/dev/zero of=${1} bs=1m count=1" + rc_nohalt "dd if=/dev/zero of=${1} bs=1m oseek=`diskinfo ${1} | awk '{print int($3 / (1024*1024)) - 4;}'`" } ; From 9bde021a87c14ad5f680d8427e0f124325091f42 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 18 May 2011 20:52:52 +0000 Subject: [PATCH 06/21] Fix clang warnings. Note: these were actually bugs (printf with no format string). Approved by: philip (mentor) --- usr.bin/rpcgen/rpc_hout.c | 2 +- usr.bin/rpcgen/rpc_svcout.c | 2 +- usr.bin/rpcgen/rpc_tblout.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/rpcgen/rpc_hout.c b/usr.bin/rpcgen/rpc_hout.c index 7607ef74d6c9..6aa6ff7b4667 100644 --- a/usr.bin/rpcgen/rpc_hout.c +++ b/usr.bin/rpcgen/rpc_hout.c @@ -500,7 +500,7 @@ pdeclaration(const char *name, declaration *dec, int tab, const char *separator) break; } } - f_print(fout, separator); + fputs(separator, fout); } static int diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 40fc61cb9ec4..122408b720fc 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -349,7 +349,7 @@ write_real_program(definition *def) f_print(fout, "("); /* arg name */ if (proc->arg_num > 1) - f_print(fout, proc->args.argname); + fputs(proc->args.argname, fout); else ptype(proc->args.decls->decl.prefix, proc->args.decls->decl.type, 0); diff --git a/usr.bin/rpcgen/rpc_tblout.c b/usr.bin/rpcgen/rpc_tblout.c index f96bdfcbc187..618d1f998bbe 100644 --- a/usr.bin/rpcgen/rpc_tblout.c +++ b/usr.bin/rpcgen/rpc_tblout.c @@ -103,7 +103,7 @@ write_table(definition *def) expected = 0; } else { expected = 1; - f_print(fout, null_entry); + fputs(null_entry, fout); } for (proc = vp->procs; proc != NULL; proc = proc->next) { current = atoi(proc->proc_num); @@ -141,7 +141,7 @@ write_table(definition *def) } /* print the table trailer */ - f_print(fout, tbl_end); + fputs(tbl_end, fout); f_print(fout, tbl_nproc, progvers, progvers, progvers); } } From 198a158f99bb44be9ac17615a61542b41836e63e Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 18 May 2011 20:57:23 +0000 Subject: [PATCH 07/21] Fix clang warning (why is there nowhere yyparse() is declared?). Approved by: philip (mentor) --- crypto/heimdal/lib/sl/slc-gram.y | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/heimdal/lib/sl/slc-gram.y b/crypto/heimdal/lib/sl/slc-gram.y index 7d9fadcb55bd..d58edfbf2867 100644 --- a/crypto/heimdal/lib/sl/slc-gram.y +++ b/crypto/heimdal/lib/sl/slc-gram.y @@ -49,6 +49,7 @@ RCSID("$Id: slc-gram.y 20767 2007-06-01 11:24:52Z lha $"); #include "slc.h" extern FILE *yyin; extern struct assignment *assignment; +extern int yyparse(void); %} %union { From 7f49567fa480d5dac34816fc3395fd81137e5184 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 18 May 2011 21:00:27 +0000 Subject: [PATCH 08/21] Fix clang warnings. Approved by: philip (mentor) --- contrib/gcc/genmodes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/gcc/genmodes.c b/contrib/gcc/genmodes.c index 0a70dea23e6f..5a91a50edef3 100644 --- a/contrib/gcc/genmodes.c +++ b/contrib/gcc/genmodes.c @@ -787,7 +787,7 @@ calc_wider_mode (void) #define tagged_printf(FMT, ARG, TAG) do { \ int count_; \ - printf (" " FMT ",%n", ARG, &count_); \ + count_ = printf (" " FMT ",", ARG); \ printf ("%*s/* %s */\n", 27 - count_, "", TAG); \ } while (0) @@ -822,7 +822,7 @@ enum machine_mode\n{"); for (m = modes[c]; m; m = m->next) { int count_; - printf (" %smode,%n", m->name, &count_); + count_ = printf (" %smode,", m->name); printf ("%*s/* %s:%d */\n", 27 - count_, "", trim_filename (m->file), m->line); } From d74336e632308cae12c544d430b7e663c71c57a0 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 18 May 2011 21:04:29 +0000 Subject: [PATCH 09/21] Fix clang warnings. Note: possible minor security issues fixed (untrusted string used as printf format string). Approved by: philip (mentor) --- contrib/groff/src/devices/grohtml/post-html.cpp | 2 +- contrib/groff/src/libs/libdriver/input.cpp | 2 +- contrib/groff/src/roff/troff/mtsm.cpp | 6 ++++-- contrib/groff/src/roff/troff/node.cpp | 2 +- contrib/groff/src/utils/hpftodit/hpftodit.cpp | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/contrib/groff/src/devices/grohtml/post-html.cpp b/contrib/groff/src/devices/grohtml/post-html.cpp index 1283e06139a7..6834e844f801 100644 --- a/contrib/groff/src/devices/grohtml/post-html.cpp +++ b/contrib/groff/src/devices/grohtml/post-html.cpp @@ -1587,7 +1587,7 @@ void header_desc::write_headings (FILE *f, int force) buffer += as_string(h); buffer += '\0'; - fprintf(f, buffer.contents()); + fputs(buffer.contents(), f); } else fputs(g->text_string, f); h++; diff --git a/contrib/groff/src/libs/libdriver/input.cpp b/contrib/groff/src/libs/libdriver/input.cpp index bf8a74e1066c..c2b262af8f03 100644 --- a/contrib/groff/src/libs/libdriver/input.cpp +++ b/contrib/groff/src/libs/libdriver/input.cpp @@ -995,7 +995,7 @@ next_command(void) inline bool odd(const int n) { - return (n & 1 == 1) ? true : false; + return ((n & 1) == 1) ? true : false; } ////////////////////////////////////////////////////////////////////// diff --git a/contrib/groff/src/roff/troff/mtsm.cpp b/contrib/groff/src/roff/troff/mtsm.cpp index 630e973209cd..38efc0a343a5 100644 --- a/contrib/groff/src/roff/troff/mtsm.cpp +++ b/contrib/groff/src/roff/troff/mtsm.cpp @@ -611,14 +611,16 @@ int state_set::is_in(int_value_state i) return (intset & (1 << (int)i)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(units_value_state u) { - return (unitsset & (1 << (int)u) != 0); + return (unitsset & (1 << (int)u)) != 0; } +// Note: this used to have a bug s.t. it always tested for bit 0 (benl 18/5/11) int state_set::is_in(string_value_state s) { - return (stringset & (1 << (int)s) != 0); + return (stringset & (1 << (int)s)) != 0; } void state_set::add(units_value_state, int n) diff --git a/contrib/groff/src/roff/troff/node.cpp b/contrib/groff/src/roff/troff/node.cpp index 0d874d35758d..0e440b210580 100644 --- a/contrib/groff/src/roff/troff/node.cpp +++ b/contrib/groff/src/roff/troff/node.cpp @@ -2157,7 +2157,7 @@ void glyph_node::debug_node() if (c) fprintf(stderr, "%c", c); else - fprintf(stderr, ci->nm.contents()); + fputs(ci->nm.contents(), stderr); if (push_state) fprintf(stderr, " "); if (state) diff --git a/contrib/groff/src/utils/hpftodit/hpftodit.cpp b/contrib/groff/src/utils/hpftodit/hpftodit.cpp index 5910fb2f39e6..d5d524fdf1b2 100644 --- a/contrib/groff/src/utils/hpftodit/hpftodit.cpp +++ b/contrib/groff/src/utils/hpftodit/hpftodit.cpp @@ -870,9 +870,9 @@ output_charset(const int tfm_type) else if (!all_flag) continue; else if (tfm_type == MSL) - printf(hp_msl_to_ucode_name(charcode)); + fputs(hp_msl_to_ucode_name(charcode), stdout); else - printf(unicode_to_ucode_name(charcode)); + fputs(unicode_to_ucode_name(charcode), stdout); printf("\t%d,%d", scale(char_table[i].width), scale(char_table[i].ascent)); From 8b8c683f2254f04f0416fd1e1028c3084d99b673 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Wed, 18 May 2011 21:06:20 +0000 Subject: [PATCH 10/21] Fix clang warnings. Approved by: philip (mentor) --- contrib/gperf/src/gen-perf.cc | 2 +- contrib/gperf/src/key-list.cc | 48 +++++++++++++++++------------------ contrib/gperf/src/options.cc | 2 +- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/contrib/gperf/src/gen-perf.cc b/contrib/gperf/src/gen-perf.cc index 0b5109d4ff4d..8840dc60040f 100644 --- a/contrib/gperf/src/gen-perf.cc +++ b/contrib/gperf/src/gen-perf.cc @@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List_Node *curr) { if (option[DEBUG]) { - fprintf (stderr, " by changing asso_value['%c'] (char #%d) to %d\n", + fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); fflush (stderr); } diff --git a/contrib/gperf/src/key-list.cc b/contrib/gperf/src/key-list.cc index 1c941a453579..2461470177c4 100644 --- a/contrib/gperf/src/key-list.cc +++ b/contrib/gperf/src/key-list.cc @@ -497,8 +497,8 @@ Key_List::merge (List_Node *list1, List_Node *list2) *resultp = list1; break; } - if (occurrence_sort && list1->occurrence < list2->occurrence - || hash_sort && list1->hash_value > list2->hash_value) + if ((occurrence_sort && list1->occurrence < list2->occurrence) + || (hash_sort && list1->hash_value > list2->hash_value)) { *resultp = list2; resultp = &list2->next; list2 = list1; list1 = *resultp; @@ -1035,17 +1035,16 @@ Key_List::output_hash_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_hash_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option [ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Note that when the hash function is called, it has already been verified that min_key_len <= len <= max_key_len. */ @@ -1442,7 +1441,7 @@ Key_List::output_lookup_array (void) if (option[DEBUG]) fprintf (stderr, - "dup_ptr[%d]: hash_value = %d, index = %d, count = %d\n", + "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n", dup_ptr - duplicates, dup_ptr->hash_value, dup_ptr->index, dup_ptr->count); @@ -1986,17 +1985,16 @@ Key_List::output_lookup_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_function_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option[ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Output the function's body. */ printf ("{\n"); diff --git a/contrib/gperf/src/options.cc b/contrib/gperf/src/options.cc index d15e21cee8ce..77068480cf5b 100644 --- a/contrib/gperf/src/options.cc +++ b/contrib/gperf/src/options.cc @@ -237,7 +237,7 @@ Options::print_options (void) { putchar (*arg); arg++; - if (*arg >= 'A' && *arg <= 'Z' || *arg >= 'a' && *arg <= 'z') + if ((*arg >= 'A' && *arg <= 'Z') || (*arg >= 'a' && *arg <= 'z')) { putchar (*arg); arg++; From bc14b14d62d03e69cb35e20e604a425c56ef67d8 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 18 May 2011 22:09:04 +0000 Subject: [PATCH 11/21] - Enable per-channel congestion notification. - Enable PCIe relaxed ordering for all egress queues and rx data buffers. MFC after: 3 days --- sys/dev/cxgbe/t4_main.c | 9 ++++++++- sys/dev/cxgbe/t4_sge.c | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e336566d3804..e9516814c5a1 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -366,7 +366,13 @@ t4_attach(device_t dev) sc->mbox = sc->pf; pci_enable_busmaster(dev); - pci_set_max_read_req(dev, 4096); + if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { + pci_set_max_read_req(dev, 4096); + v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); + v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE; + pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2); + } + snprintf(sc->lockname, sizeof(sc->lockname), "%s", device_get_nameunit(dev)); mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF); @@ -3206,6 +3212,7 @@ filter_rpl(struct adapter *sc, const struct cpl_set_tcb_rpl *rpl) } } +/* XXX: use pci_find_cap */ int t4_os_find_pci_capability(struct adapter *sc, int cap) { diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 5f59db63343f..a0ef17226eb4 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -100,7 +100,7 @@ static int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *, static int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t, void *); static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *, - int); + int, int); static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *); static int alloc_iq(struct sge_iq *, int); static int free_iq(struct sge_iq *); @@ -1104,7 +1104,7 @@ free_ring(struct adapter *sc, bus_dma_tag_t tag, bus_dmamap_t map, */ static int alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl, - int intr_idx) + int intr_idx, int cong) { int rc, i, cntxt_id; size_t len; @@ -1155,6 +1155,8 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl, V_FW_IQ_CMD_IQESIZE(ilog2(iq->esize) - 4)); c.iqsize = htobe16(iq->qsize); c.iqaddr = htobe64(iq->ba); + if (cong >= 0) + c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN); if (fl) { mtx_init(&fl->fl_lock, fl->lockname, NULL, MTX_DEF); @@ -1198,7 +1200,15 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl, fl->needed = fl->cap; c.iqns_to_fl0congen = - htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE)); + htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | + F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO | + F_FW_IQ_CMD_FL0PADEN); + if (cong >= 0) { + c.iqns_to_fl0congen |= + htobe32(V_FW_IQ_CMD_FL0CNGCHMAP(cong) | + F_FW_IQ_CMD_FL0CONGCIF | + F_FW_IQ_CMD_FL0CONGEN); + } c.fl0dcaen_to_fl0cidxfthresh = htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) | V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B)); @@ -1325,7 +1335,7 @@ free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl) static int alloc_iq(struct sge_iq *iq, int intr_idx) { - return alloc_iq_fl(NULL, iq, NULL, intr_idx); + return alloc_iq_fl(NULL, iq, NULL, intr_idx, -1); } static int @@ -1342,7 +1352,7 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx) struct sysctl_oid_list *children; char name[16]; - rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx); + rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, 1 << pi->tx_chan); if (rc != 0) return (rc); @@ -1436,7 +1446,7 @@ alloc_ctrlq(struct adapter *sc, struct sge_ctrlq *ctrlq, int idx) c.physeqid_pkd = htobe32(0); c.fetchszm_to_iqid = htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_CTRL_CMD_PCIECHN(idx) | + V_FW_EQ_CTRL_CMD_PCIECHN(idx) | F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | @@ -1561,7 +1571,7 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx) c.viid_pkd = htobe32(V_FW_EQ_ETH_CMD_VIID(pi->viid)); c.fetchszm_to_iqid = htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | - V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | + V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO | V_FW_EQ_ETH_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) | From dbe66680b0eeca111740b149fac4ed45b0fdbf09 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 18 May 2011 22:36:58 +0000 Subject: [PATCH 12/21] The CDP_ACTIVE flag is cleared at the beginning of destroy_devl(), and destroy_devl() drops dev_mtx. The protection against the race with dev_rel(), introduced in r163328, should be extended to cover destroy_devl() calls for the children of the destroyed dev. Reported and tested by: joerg MFC after: 1 week --- sys/kern/kern_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index b2be5cc12d1a..59b876c18e55 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -981,6 +981,8 @@ destroy_devl(struct cdev *dev) /* Remove name marking */ dev->si_flags &= ~SI_NAMED; + dev->si_refcount++; /* Avoid race with dev_rel() */ + /* If we are a child, remove us from the parents list */ if (dev->si_flags & SI_CHILD) { LIST_REMOVE(dev, si_siblings); @@ -997,7 +999,6 @@ destroy_devl(struct cdev *dev) dev->si_flags &= ~SI_CLONELIST; } - dev->si_refcount++; /* Avoid race with dev_rel() */ csw = dev->si_devsw; dev->si_devsw = NULL; /* already NULL for SI_ALIAS */ while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) { From 0855e42386b6846ae819eaae298257d2f8a70286 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Wed, 18 May 2011 22:43:56 +0000 Subject: [PATCH 13/21] - Add support for AF_INET6 sockets for %S format character. - Use inet_ntop(3) instead of reimplementing it. - Use %hhu for unsigned char instead of casting it to unsigned int and using %u. MFC after: 1 week --- sbin/hastd/pjdlog.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/sbin/hastd/pjdlog.c b/sbin/hastd/pjdlog.c index 59d3ffac0023..16ecf4d9c8cc 100644 --- a/sbin/hastd/pjdlog.c +++ b/sbin/hastd/pjdlog.c @@ -31,8 +31,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include #include @@ -103,22 +105,39 @@ pjdlog_printf_render_sockaddr(struct __printf_io *io, switch (ss->ss_family) { case AF_INET: { + char addr[INET_ADDRSTRLEN]; const struct sockaddr_in *sin; - in_addr_t ip; unsigned int port; sin = (const struct sockaddr_in *)ss; - ip = ntohl(sin->sin_addr.s_addr); port = ntohs(sin->sin_port); + if (inet_ntop(ss->ss_family, &sin->sin_addr, addr, + sizeof(addr)) == NULL) { + PJDLOG_ABORT("inet_ntop(AF_INET) failed: %s.", + strerror(errno)); + } + snprintf(buf, sizeof(buf), "%s:%u", addr, port); + break; + } + case AF_INET6: + { + char addr[INET6_ADDRSTRLEN]; + const struct sockaddr_in6 *sin; + unsigned int port; - snprintf(buf, sizeof(buf), "%u.%u.%u.%u:%u", - ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), - ((ip >> 8) & 0xff), (ip & 0xff), port); + sin = (const struct sockaddr_in6 *)ss; + port = ntohs(sin->sin6_port); + if (inet_ntop(ss->ss_family, &sin->sin6_addr, addr, + sizeof(addr)) == NULL) { + PJDLOG_ABORT("inet_ntop(AF_INET6) failed: %s.", + strerror(errno)); + } + snprintf(buf, sizeof(buf), "[%s]:%u", addr, port); break; } default: - snprintf(buf, sizeof(buf), "[unsupported family %u]", - (unsigned int)ss->ss_family); + snprintf(buf, sizeof(buf), "[unsupported family %hhu]", + ss->ss_family); break; } ret = __printf_out(io, pi, buf, strlen(buf)); From 0163af236079a6c999635d270ff92f9c3519f22b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 19 May 2011 05:13:25 +0000 Subject: [PATCH 14/21] Implement WITH{,OUT}_{GCC,BINUTILS} to provide finer-grained control over building gcc and binutils. They default to true, unless MK_TOOLCHAIN is no. Reviewed by: ru@ --- Makefile.inc1 | 12 ++++++++++-- gnu/usr.bin/Makefile | 6 ++++-- share/mk/bsd.own.mk | 4 ++++ tools/build/options/WITHOUT_BINUTILS | 7 +++++++ tools/build/options/WITHOUT_GCC | 6 ++++++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 tools/build/options/WITHOUT_BINUTILS create mode 100644 tools/build/options/WITHOUT_GCC diff --git a/Makefile.inc1 b/Makefile.inc1 index 1e613affecda..9ebc1e34a73b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1132,6 +1132,10 @@ _kgzip= usr.sbin/kgzip .endif .endif +.if ${MK_BINUTILS} != "no" +_binutils= gnu/usr.bin/binutils +.endif + .if ${MK_CLANG} != "no" .if ${CC:T:Mclang} == "clang" _clang= usr.bin/clang @@ -1139,12 +1143,16 @@ _clang_libs= lib/clang .endif .endif +.if ${MK_GCC} != "no" +_cc= gnu/usr.bin/cc +.endif + cross-tools: .for _tool in \ ${_clang_libs} \ ${_clang} \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ + ${_cc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index 7eaad9f590f1..0ee257f9867c 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -47,12 +47,14 @@ _texinfo= texinfo _rcs= rcs .endif -.if ${MK_TOOLCHAIN} != "no" +.if ${MK_BINUTILS} != "no" _binutils= binutils +.endif +.if ${MK_GCC} != "no" _cc= cc +.endif .if ${MK_GDB} != "no" _gdb= gdb .endif -.endif .include diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index cbbe7c92d71e..3669fac9e416 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -297,6 +297,7 @@ __DEFAULT_YES_OPTIONS = \ BIND_MTREE \ BIND_NAMED \ BIND_UTILS \ + BINUTILS \ BLUETOOTH \ BOOT \ BSD_CPIO \ @@ -317,6 +318,7 @@ __DEFAULT_YES_OPTIONS = \ FP_LIBC \ FREEBSD_UPDATE \ GAMES \ + GCC \ GCOV \ GDB \ GNU \ @@ -529,7 +531,9 @@ MK_GROFF:= no .endif .if ${MK_TOOLCHAIN} == "no" +MK_BINUTILS:= no MK_CLANG:= no +MK_GCC:= no MK_GDB:= no .endif diff --git a/tools/build/options/WITHOUT_BINUTILS b/tools/build/options/WITHOUT_BINUTILS new file mode 100644 index 000000000000..9d57c62d000c --- /dev/null +++ b/tools/build/options/WITHOUT_BINUTILS @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, +ld, nm, objcopy, objdump, readelf, size and strip) +.Bf -symbolic +The option does not generally work for build targets, unless some alternative +toolchain is enabled. +.Ef diff --git a/tools/build/options/WITHOUT_GCC b/tools/build/options/WITHOUT_GCC new file mode 100644 index 000000000000..5717f64019e6 --- /dev/null +++ b/tools/build/options/WITHOUT_GCC @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not install gcc and g++. +.Bf -symbolic +The option does not generally work for build targets, unless some alternative +toolchain is enabled. +.Ef From 10414b71e348d2397f254f22af4771596ea9b5df Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 19 May 2011 11:41:12 +0000 Subject: [PATCH 15/21] Add support for the SIIG Cyber 2S PCIe adapter. It is based on an Oxford Semiconductor OX16PCI954 but uses only two ports with a non-default clock rate. PR: kern/152034 Tested by: Hans Fiedler hans of hermes louisville edu MFC after: 1 week --- sys/dev/puc/pucdata.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c index 6b1dedaa5aef..83b02eafd6ab 100644 --- a/sys/dev/puc/pucdata.c +++ b/sys/dev/puc/pucdata.c @@ -656,6 +656,12 @@ const struct puc_cfg puc_pci_devices[] = { PUC_PORT_4S, 0x10, 0, 8, }, + { 0x1415, 0x950a, 0x131f, 0x2030, + "SIIG Cyber 2S PCIe", + DEFAULT_RCLK * 10, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1415, 0x950a, 0xffff, 0, "Oxford Semiconductor OX16PCI954 UARTs", DEFAULT_RCLK, From dac74062036c5ffc66a62a50664b34b0599488f0 Mon Sep 17 00:00:00 2001 From: Edwin Groothuis Date: Thu, 19 May 2011 13:09:39 +0000 Subject: [PATCH 16/21] Put AN back after finding out that tzsetup(1) will complain that it doesn't exist. It will be removed again once the tzdata distribution files have been updated with the replacements for AN. --- share/misc/iso3166 | 1 + 1 file changed, 1 insertion(+) diff --git a/share/misc/iso3166 b/share/misc/iso3166 index 23c9bd65e312..d8d5972c9cb3 100644 --- a/share/misc/iso3166 +++ b/share/misc/iso3166 @@ -176,6 +176,7 @@ NA NAM 516 Namibia NR NRU 520 Nauru NP NPL 524 Nepal NL NLD 528 Netherlands +AN ANT 530 Netherlands Antilles NC NCL 540 New Caledonia NZ NZL 554 New Zealand NI NIC 558 Nicaragua From c920aa7a9dac734af63c90ff1fd6cf561342dd52 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 19 May 2011 13:42:19 +0000 Subject: [PATCH 17/21] When adding examples to man-pages, try to make them at least look like they might work. Prodded by: Vadim Goncharov --- share/man/man9/sbuf.9 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/man/man9/sbuf.9 b/share/man/man9/sbuf.9 index 500bfbdc9e98..0e6da36b417c 100644 --- a/share/man/man9/sbuf.9 +++ b/share/man/man9/sbuf.9 @@ -492,13 +492,13 @@ will return zero for success and \-1 and set errno on error. struct sbuf *sb; sb = sbuf_new_auto(); -sbuf_cat("Customers found:\en"); +sbuf_cat(sb, "Customers found:\en"); TAILQ_FOREACH(foo, &foolist, list) { - sbuf_printf(" %4d %s\en", foo->index, foo->name); - sbuf_printf(" Address: %s\en", foo->address); - sbuf_printf(" Zip: %s\en", foo->zipcode); + sbuf_printf(sb, " %4d %s\en", foo->index, foo->name); + sbuf_printf(sb, " Address: %s\en", foo->address); + sbuf_printf(sb, " Zip: %s\en", foo->zipcode); } -if (sbuf_finish(sb)) +if (sbuf_finish(sb)) /* Check for any and all errors */ err(1,"Could not generate message"); transmit_msg(sbuf_data(sb), sbuf_len(sb)); sbuf_delete(sb); From a5b05a8d85b0a836bc8f5970ce71cabf2a78c71f Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Thu, 19 May 2011 15:18:35 +0000 Subject: [PATCH 18/21] Fix clang warnings. Approved by: philip (mentor) --- contrib/gcc/genattrtab.c | 2 +- contrib/gcc/genautomata.c | 26 +++++++++++++------------- contrib/gcc/gengtype-lex.l | 2 +- share/misc/committers-src.dot | 4 ++++ 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/contrib/gcc/genattrtab.c b/contrib/gcc/genattrtab.c index f11532f19bea..2555e10750ae 100644 --- a/contrib/gcc/genattrtab.c +++ b/contrib/gcc/genattrtab.c @@ -1652,7 +1652,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index) rtx ret; /* This lets us free all storage allocated below, if appropriate. */ - obstack_finish (rtl_obstack); + (void) obstack_finish (rtl_obstack); memcpy (tests, XVEC (exp, 0)->elem, len * sizeof (rtx)); diff --git a/contrib/gcc/genautomata.c b/contrib/gcc/genautomata.c index fd8edebcea84..8434030d54f5 100644 --- a/contrib/gcc/genautomata.c +++ b/contrib/gcc/genautomata.c @@ -1099,7 +1099,7 @@ create_node (size_t size) obstack_blank (&irp, size); result = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Default values of members are NULL and zero. */ memset (result, 0, size); return result; @@ -1170,7 +1170,7 @@ next_sep_el (const char **pstr, int sep, int par_flag) } obstack_1grow (&irp, '\0'); out_str = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); *pstr = p; if (**pstr == sep) @@ -1221,7 +1221,7 @@ get_str_vect (const char *str, int *els_num, int sep, int paren_p) return NULL; obstack_blank (&irp, sizeof (char *) * (*els_num + 1)); vect = (char **) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); pstr = &str; for (i = 0; i < *els_num; i++) vect [i] = next_sep_el (pstr, sep, paren_p); @@ -3343,7 +3343,7 @@ alloc_empty_reserv_sets (void) obstack_blank (&irp, els_in_reservs * sizeof (set_el_t)); result = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); memset (result, 0, els_in_reservs * sizeof (set_el_t)); return result; } @@ -4117,10 +4117,10 @@ initiate_excl_sets (void) obstack_blank (&irp, els_in_cycle_reserv * sizeof (set_el_t)); excl_set = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (reserv_sets_t)); unit_excl_set_table = (reserv_sets_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Evaluate unit exclusion sets. */ for (i = 0; i < description->decls_num; i++) { @@ -4129,7 +4129,7 @@ initiate_excl_sets (void) { obstack_blank (&irp, els_in_cycle_reserv * sizeof (set_el_t)); unit_excl_set = (reserv_sets_t) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); memset (unit_excl_set, 0, els_in_cycle_reserv * sizeof (set_el_t)); for (el = DECL_UNIT (decl)->excl_list; el != NULL; @@ -4224,16 +4224,16 @@ initiate_presence_absence_pattern_sets (void) obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_presence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_final_presence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_absence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); obstack_blank (&irp, description->units_num * sizeof (pattern_reserv_t)); unit_final_absence_set_table = (pattern_reserv_t *) obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); /* Evaluate unit presence/absence sets. */ for (i = 0; i < description->decls_num; i++) { @@ -4935,7 +4935,7 @@ store_alt_unit_usage (regexp_t regexp, regexp_t unit, int cycle, obstack_blank (&unit_usages, sizeof (struct unit_usage)); unit_usage_ptr = (struct unit_usage *) obstack_base (&unit_usages); - obstack_finish (&unit_usages); + (void) obstack_finish (&unit_usages); unit_usage_ptr->unit_decl = unit_decl; index = cycle * REGEXP_ONEOF (regexp)->regexps_num + alt_num; unit_usage_ptr->next = VEC_index (unit_usage_t, cycle_alt_unit_usages, index); @@ -8975,7 +8975,7 @@ initiate_automaton_gen (int argc, char **argv) strlen (STANDARD_OUTPUT_DESCRIPTION_FILE_SUFFIX) + 1); obstack_1grow (&irp, '\0'); output_description_file_name = obstack_base (&irp); - obstack_finish (&irp); + (void) obstack_finish (&irp); } /* The following function checks existence at least one arc marked by diff --git a/contrib/gcc/gengtype-lex.l b/contrib/gcc/gengtype-lex.l index 51cd95a63103..ebe66675c2de 100644 --- a/contrib/gcc/gengtype-lex.l +++ b/contrib/gcc/gengtype-lex.l @@ -590,7 +590,7 @@ macro_input (char *buffer, unsigned size) void yyerror (const char *s) { - error_at_line (&lexer_line, s); + error_at_line (&lexer_line, "%s", s); } void diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 2199590c7f83..d450c8a2d677 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -100,6 +100,7 @@ antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] art [label="Artem Belevich\nart@FreeBSD.org\n2011/03/29"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] +benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] brian [label="Brian Somers\nbrian@FreeBSD.org\n1996/12/16"] @@ -486,6 +487,7 @@ peter -> asmodai peter -> jayanth peter -> ps +philip -> benl philip -> ed philip -> jls philip -> matteo @@ -546,6 +548,8 @@ sheldonh -> iedowse shin -> ume +simon -> benl + sos -> marcel thompsa -> weongyo From a1e9b6750c103eb93140fd8a494ccd16d8d9fc17 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 19 May 2011 17:22:48 +0000 Subject: [PATCH 19/21] Style fixes: - Sort forward declarations of structures. - Prefer uint64_t to u_int64_t. --- sys/sys/proc.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index e74da83176ad..4d7b540c2e6b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -157,21 +157,21 @@ struct pargs { * either lock is sufficient for read access, but both locks must be held * for write access. */ -struct racct; -struct kaudit_record; -struct td_sched; -struct nlminfo; +struct cpuset; struct kaioinfo; +struct kaudit_record; +struct kdtrace_proc; +struct kdtrace_thread; +struct mqueue_notifier; +struct nlminfo; struct p_sched; struct proc; +struct racct; struct sleepqueue; +struct td_sched; struct thread; struct trapframe; struct turnstile; -struct mqueue_notifier; -struct kdtrace_proc; -struct kdtrace_thread; -struct cpuset; /* * XXX: Does this belong in resource.h or resourcevar.h instead? @@ -185,13 +185,13 @@ struct cpuset; * Locking for td_rux: (t) for all fields. */ struct rusage_ext { - u_int64_t rux_runtime; /* (cj) Real time. */ - u_int64_t rux_uticks; /* (cj) Statclock hits in user mode. */ - u_int64_t rux_sticks; /* (cj) Statclock hits in sys mode. */ - u_int64_t rux_iticks; /* (cj) Statclock hits in intr mode. */ - u_int64_t rux_uu; /* (c) Previous user time in usec. */ - u_int64_t rux_su; /* (c) Previous sys time in usec. */ - u_int64_t rux_tu; /* (c) Previous total time in usec. */ + uint64_t rux_runtime; /* (cj) Real time. */ + uint64_t rux_uticks; /* (cj) Statclock hits in user mode. */ + uint64_t rux_sticks; /* (cj) Statclock hits in sys mode. */ + uint64_t rux_iticks; /* (cj) Statclock hits in intr mode. */ + uint64_t rux_uu; /* (c) Previous user time in usec. */ + uint64_t rux_su; /* (c) Previous sys time in usec. */ + uint64_t rux_tu; /* (c) Previous total time in usec. */ }; /* From b0775aef7700ba06d72cea4bc170dbe00fcbdc0c Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Thu, 19 May 2011 19:37:41 +0000 Subject: [PATCH 20/21] Simplify t4_os_find_pci_capability. MFC after: 3 days --- sys/dev/cxgbe/t4_main.c | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e9516814c5a1..469af8d506c5 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3212,45 +3212,12 @@ filter_rpl(struct adapter *sc, const struct cpl_set_tcb_rpl *rpl) } } -/* XXX: use pci_find_cap */ int t4_os_find_pci_capability(struct adapter *sc, int cap) { - device_t dev; - struct pci_devinfo *dinfo; - pcicfgregs *cfg; - uint32_t status; - uint8_t ptr; + int i; - dev = sc->dev; - dinfo = device_get_ivars(dev); - cfg = &dinfo->cfg; - - status = pci_read_config(dev, PCIR_STATUS, 2); - if (!(status & PCIM_STATUS_CAPPRESENT)) - return (0); - - switch (cfg->hdrtype & PCIM_HDRTYPE) { - case 0: - case 1: - ptr = PCIR_CAP_PTR; - break; - case 2: - ptr = PCIR_CAP_PTR_2; - break; - default: - return (0); - break; - } - ptr = pci_read_config(dev, ptr, 1); - - while (ptr != 0) { - if (pci_read_config(dev, ptr + PCICAP_ID, 1) == cap) - return (ptr); - ptr = pci_read_config(dev, ptr + PCICAP_NEXTPTR, 1); - } - - return (0); + return (pci_find_cap(sc->dev, cap, &i) == 0 ? i : 0); } int From b2bf146e3e3ef526b82b435c80a344299ff6e1ed Mon Sep 17 00:00:00 2001 From: Benedict Reuschling Date: Thu, 19 May 2011 20:35:40 +0000 Subject: [PATCH 21/21] Fix typos in comments, no functional changes. Found by: codespell Reviewed by: alfred MFC after: 1 week --- usr.bin/truss/amd64-fbsd.c | 2 +- usr.bin/truss/amd64-fbsd32.c | 2 +- usr.bin/truss/i386-fbsd.c | 2 +- usr.bin/truss/ia64-fbsd.c | 2 +- usr.bin/truss/main.c | 2 +- usr.bin/truss/powerpc-fbsd.c | 2 +- usr.bin/truss/powerpc64-fbsd.c | 2 +- usr.bin/truss/sparc64-fbsd.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.bin/truss/amd64-fbsd.c b/usr.bin/truss/amd64-fbsd.c index a4e531173218..6ed3812e65f3 100644 --- a/usr.bin/truss/amd64-fbsd.c +++ b/usr.bin/truss/amd64-fbsd.c @@ -128,7 +128,7 @@ amd64_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ reg = 0; syscall_num = regs.r_rax; diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c index b25b8182c60d..c3dd18357bb4 100644 --- a/usr.bin/truss/amd64-fbsd32.c +++ b/usr.bin/truss/amd64-fbsd32.c @@ -136,7 +136,7 @@ amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_rax; switch (syscall_num) { diff --git a/usr.bin/truss/i386-fbsd.c b/usr.bin/truss/i386-fbsd.c index 70b051c5412c..82f1db0765b9 100644 --- a/usr.bin/truss/i386-fbsd.c +++ b/usr.bin/truss/i386-fbsd.c @@ -131,7 +131,7 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_eax; switch (syscall_num) { diff --git a/usr.bin/truss/ia64-fbsd.c b/usr.bin/truss/ia64-fbsd.c index 285e31400731..8fc06c60c366 100644 --- a/usr.bin/truss/ia64-fbsd.c +++ b/usr.bin/truss/ia64-fbsd.c @@ -128,7 +128,7 @@ ia64_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_scratch.gr15; /* XXX double-check. */ if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index e828046abee5..a74fe1c5e7e8 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); /* - * The main module for truss. Suprisingly simple, but, then, the other + * The main module for truss. Surprisingly simple, but, then, the other * files handle the bulk of the work. And, of course, the kernel has to * do a lot of the work :). */ diff --git a/usr.bin/truss/powerpc-fbsd.c b/usr.bin/truss/powerpc-fbsd.c index 5643f72d3551..285b10a61f4f 100644 --- a/usr.bin/truss/powerpc-fbsd.c +++ b/usr.bin/truss/powerpc-fbsd.c @@ -137,7 +137,7 @@ powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ regargs = NARGREG; syscall_num = regs.fixreg[0]; diff --git a/usr.bin/truss/powerpc64-fbsd.c b/usr.bin/truss/powerpc64-fbsd.c index f072544bab6d..145c330fb8c9 100644 --- a/usr.bin/truss/powerpc64-fbsd.c +++ b/usr.bin/truss/powerpc64-fbsd.c @@ -129,7 +129,7 @@ powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ regargs = NARGREG; syscall_num = regs.fixreg[0]; diff --git a/usr.bin/truss/sparc64-fbsd.c b/usr.bin/truss/sparc64-fbsd.c index 779d6d8cc556..47302cc3de06 100644 --- a/usr.bin/truss/sparc64-fbsd.c +++ b/usr.bin/truss/sparc64-fbsd.c @@ -135,7 +135,7 @@ sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { /* * FreeBSD has two special kinds of system call redirctions -- * SYS_syscall, and SYS___syscall. The former is the old syscall() - * routine, basicly; the latter is for quad-aligned arguments. + * routine, basically; the latter is for quad-aligned arguments. */ syscall_num = regs.r_global[1]; if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) {