]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRemove now redundant mac argument.
bschmidt [Sat, 17 Dec 2011 10:32:31 +0000 (10:32 +0000)]
Remove now redundant mac argument.

Discussed with: adrian@

12 years agoFix some net80211 enum nits:
bschmidt [Sat, 17 Dec 2011 10:23:17 +0000 (10:23 +0000)]
Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by: arundel@

12 years agoFixed some of markup.
ru [Sat, 17 Dec 2011 06:57:35 +0000 (06:57 +0000)]
Fixed some of markup.

Reviewed by: jhb

12 years agoIn usr.bin/mt/mt.c, the c_code member of struct commands should really
dim [Sat, 17 Dec 2011 02:23:30 +0000 (02:23 +0000)]
In usr.bin/mt/mt.c, the c_code member of struct commands should really
be an unsigned long, since it will contain values of ioctl request
codes.  On 64-bit arches, these will not fit into an int.

MFC after: 1 week

12 years agoIn sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs. In
dim [Sat, 17 Dec 2011 01:54:51 +0000 (01:54 +0000)]
In sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs.  In
devd.hh, there are redeclared as classes.  Fix the inconsistency.

MFC after: 1 week

12 years agoDisable yet another clang warning when WARNS <= 3.
dim [Sat, 17 Dec 2011 01:51:12 +0000 (01:51 +0000)]
Disable yet another clang warning when WARNS <= 3.

MFC after: 1 week

12 years agoIn usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
dim [Sat, 17 Dec 2011 01:36:50 +0000 (01:36 +0000)]
In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
volatile, otherwise the indirection will not be emitted.

MFC after: 1 week

12 years agoIn sbin/dhclient, since we know the size of the source strings anyway,
dim [Sat, 17 Dec 2011 01:29:46 +0000 (01:29 +0000)]
In sbin/dhclient, since we know the size of the source strings anyway,
we might as well use memcpy; strlcpy is really unnecessary here.

MFC after: 1 week

12 years agoIn sbin/dhclient, work around warnings about the size argument to
dim [Sat, 17 Dec 2011 01:19:07 +0000 (01:19 +0000)]
In sbin/dhclient, work around warnings about the size argument to
strlcpy appearing to be the size of the source buffer, instead of the
destination.

MFC after: 1 week

12 years agoUse both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
dim [Sat, 17 Dec 2011 00:54:09 +0000 (00:54 +0000)]
Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
disruptive to actually fix all the warnings, and the code hasn't been
maintained for several years.

MFC after: 1 week

12 years agoIn sbin/atm/atmconfig/diag.c, fix a few warnings about format strings
dim [Sat, 17 Dec 2011 00:26:45 +0000 (00:26 +0000)]
In sbin/atm/atmconfig/diag.c, fix a few warnings about format strings
not being literals.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
dim [Sat, 17 Dec 2011 00:14:40 +0000 (00:14 +0000)]
Use NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
alignment warnings than using WARNS=3, and it also works for clang.

MFC after: 1 week

12 years agoAllow this to work on embedded systems without Open Firmware by making
nwhitehorn [Fri, 16 Dec 2011 23:46:05 +0000 (23:46 +0000)]
Allow this to work on embedded systems without Open Firmware by making
lack of a /chosen non-fatal, and manually removing memory in use by the
kernel from the physical memory map.

Submitted by: rpaulo

12 years agoUse NO_WARRAY_BOUNDS for sbin/routed/rtquery.
dim [Fri, 16 Dec 2011 23:43:58 +0000 (23:43 +0000)]
Use NO_WARRAY_BOUNDS for sbin/routed/rtquery.

MFC after: 1 week

12 years agoAdd a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
dim [Fri, 16 Dec 2011 23:42:25 +0000 (23:42 +0000)]
Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
to selectively work around warnings in programs that don't use flexible
array members, but instead define arrays of length 1 at the end of the
struct, and then access those beyond their declared bounds.

MFC after: 1 week

12 years agoZero BSS on start, in case the ELF loader that started the kernel did not
nwhitehorn [Fri, 16 Dec 2011 23:40:56 +0000 (23:40 +0000)]
Zero BSS on start, in case the ELF loader that started the kernel did not
do this for us. This can happen on some embedded systems.

Submitted by: rpaulo

12 years agoIn contrib/gperf/src/output.cc, use the correct printf length modifier
dim [Fri, 16 Dec 2011 23:15:11 +0000 (23:15 +0000)]
In contrib/gperf/src/output.cc, use the correct printf length modifier
for a ptrdiff_t.

MFC after: 1 week

12 years agoIn sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
dim [Fri, 16 Dec 2011 23:09:31 +0000 (23:09 +0000)]
In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
format warnings and conditional operators.  (See LLVM PR 11313 for more
information.)

MFC after: 1 week

12 years agoIn sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
dim [Fri, 16 Dec 2011 22:35:19 +0000 (22:35 +0000)]
In sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
not being literals.

MFC after: 1 week

12 years agoDefine YY_NO_INPUT when building libbinutils, to prevent warnings about
dim [Fri, 16 Dec 2011 22:19:13 +0000 (22:19 +0000)]
Define YY_NO_INPUT when building libbinutils, to prevent warnings about
unused input() functions emitted by lex.

MFC after: 1 week

12 years agoFix the incompatible enum conversions in libexec/ypxfr in another, more
dim [Fri, 16 Dec 2011 22:05:10 +0000 (22:05 +0000)]
Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to
convert the incompatible enums, as the numerical values are the same
(either by accident, design, or the phase of the moon at that time).

MFC after: 1 week

12 years agoRevert r228592, as the non-messy way of fixing ypxfr breaks other yp
dim [Fri, 16 Dec 2011 21:57:44 +0000 (21:57 +0000)]
Revert r228592, as the non-messy way of fixing ypxfr breaks other yp
programs (e.g. usr.sbin/rpc.yppasswdd).

Spotted by: np
MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
dim [Fri, 16 Dec 2011 21:48:09 +0000 (21:48 +0000)]
In cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
snprintf tricks.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c, a size_t is passed
dim [Fri, 16 Dec 2011 21:29:46 +0000 (21:29 +0000)]
In cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c, a size_t is passed
to fprintf as a field width.  It should be an int instead, so cast it.

MFC after: 1 week

12 years agoIn games/factor/factor.c, fix a warning about a format string not being
dim [Fri, 16 Dec 2011 21:24:11 +0000 (21:24 +0000)]
In games/factor/factor.c, fix a warning about a format string not being
a literal.

MFC after: 1 week

12 years agoFix some obtuse fprintf tricks in bin/ed.
dim [Fri, 16 Dec 2011 21:12:23 +0000 (21:12 +0000)]
Fix some obtuse fprintf tricks in bin/ed.

MFC after: 1 week

12 years agoCatch up with new driver ioctls in cxgbe.
np [Fri, 16 Dec 2011 20:38:22 +0000 (20:38 +0000)]
Catch up with new driver ioctls in cxgbe.

MFC after: 1 month

12 years agoFire a kevent if necessary after seeking on a regular file. This fixes a
jhb [Fri, 16 Dec 2011 20:10:00 +0000 (20:10 +0000)]
Fire a kevent if necessary after seeking on a regular file.  This fixes a
case where a kevent would not fire on a regular file if an application read
to EOF and then seeked backwards into the file.

Reviewed by: kib
MFC after: 2 weeks

12 years agoAttempt to fix the numerous incompatible enum conversions in
dim [Fri, 16 Dec 2011 19:39:49 +0000 (19:39 +0000)]
Attempt to fix the numerous incompatible enum conversions in
libexec/ypxfr in the least disruptive way.

MFC after: 1 week

12 years agoFix typos in the comments about clang warnings in several
dim [Fri, 16 Dec 2011 17:02:25 +0000 (17:02 +0000)]
Fix typos in the comments about clang warnings in several
sendmail-related Makefiles.

Spotted by: arundel
MFC after: 1 week

12 years agoIn contrib/telnet/telnetd/utility.c, fix a few warnings about format
dim [Fri, 16 Dec 2011 16:53:54 +0000 (16:53 +0000)]
In contrib/telnet/telnetd/utility.c, fix a few warnings about format
strings not being literals.

MFC after: 1 week

12 years agoUnfortunately, clang gives warnings about sendmail code that cannot be
dim [Fri, 16 Dec 2011 16:32:08 +0000 (16:32 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after: 1 week

12 years agoIn libexec/rbootd/utils.c, use the correct printf length modifiers for
dim [Fri, 16 Dec 2011 16:29:51 +0000 (16:29 +0000)]
In libexec/rbootd/utils.c, use the correct printf length modifiers for
u_int32_t and size_t.

MFC after: 1 week

12 years agoIn libexec/pppoed/pppoed.c, use the correct printf length modifier for a
dim [Fri, 16 Dec 2011 16:07:39 +0000 (16:07 +0000)]
In libexec/pppoed/pppoed.c, use the correct printf length modifier for a
size_t.

MFC after: 1 week

12 years agoUnfortunately, clang gives warnings about sendmail code that cannot be
dim [Fri, 16 Dec 2011 15:58:38 +0000 (15:58 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after: 1 week

12 years agoIn libexec/bootpd/tools/bootptest/print-bootp.c, use the correct printf
dim [Fri, 16 Dec 2011 15:55:43 +0000 (15:55 +0000)]
In libexec/bootpd/tools/bootptest/print-bootp.c, use the correct printf
length modifier for the difference between two pointers.

MFC after: 1 week

12 years agoStyle cleanups by jh@.
pfg [Fri, 16 Dec 2011 15:47:43 +0000 (15:47 +0000)]
Style cleanups by jh@.
Fix a comment from the previous commit.
Use M_ZERO instead of bzero() in ext2_vfsops.c
Add include guards from PR.

PR: 162564
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoIn libexec/getty/chat.c, replace && with & in chat_send(). The intent
dim [Fri, 16 Dec 2011 15:44:12 +0000 (15:44 +0000)]
In libexec/getty/chat.c, replace && with & in chat_send().  The intent
is to test if the CHATDEBUG_SEND bit is set in the chat_debug global.

MFC after: 1 week

12 years agoIn libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remaining
dim [Fri, 16 Dec 2011 15:38:11 +0000 (15:38 +0000)]
In libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remaining
minutes of activity, to avoid a warning on platforms where time_t is a
32-bit integer.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, some
dim [Fri, 16 Dec 2011 15:12:42 +0000 (15:12 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, some
uint64_t values are snprintf'd using %llx.  On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
dim [Fri, 16 Dec 2011 15:04:47 +0000 (15:04 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
uint64_t values are snprintf'd using %llx.  On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.

MFC after: 1 week

12 years agoIn lib/libthread_db/arch/i386/libpthread_md.c, clang gives two incorrect
dim [Fri, 16 Dec 2011 15:00:56 +0000 (15:00 +0000)]
In lib/libthread_db/arch/i386/libpthread_md.c, clang gives two incorrect
warnings about alignment, so turn -Wcast-align off for now.

MFC after: 1 week

12 years agoRename ifcarp.c to carp.c
glebius [Fri, 16 Dec 2011 14:30:58 +0000 (14:30 +0000)]
Rename ifcarp.c to carp.c

12 years ago- Rename if_carp.ko to carp.ko.
glebius [Fri, 16 Dec 2011 14:28:34 +0000 (14:28 +0000)]
- Rename if_carp.ko to carp.ko.
- carp.ko depends on sha1.c

12 years agoSome formatting fixes.
mav [Fri, 16 Dec 2011 14:19:46 +0000 (14:19 +0000)]
Some formatting fixes.

Submitted by: ru

12 years agoSince size of struct in_aliasreq has just been changed in r228571,
glebius [Fri, 16 Dec 2011 13:30:17 +0000 (13:30 +0000)]
Since size of struct in_aliasreq has just been changed in r228571,
and thus ifconfig(8) needs recompile, it is a good chance to make
parameter checks on SIOCAIFADDR arguments more strict.

12 years agoFix format string Z --> z, since the former is a deprecated and (in FreeBSD)
se [Fri, 16 Dec 2011 12:42:02 +0000 (12:42 +0000)]
Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)
unsupported form of the latter. This change has been reviewed and accepted
in the -hackers list.

Submitted by: Alexander Best
Reviewed by: David Schulz

12 years agoA major overhaul of the CARP implementation. The ip_carp.c was started
glebius [Fri, 16 Dec 2011 12:16:56 +0000 (12:16 +0000)]
A major overhaul of the CARP implementation. The ip_carp.c was started
from scratch, copying needed functionality from the old implemenation
on demand, with a thorough review of all code. The main change is that
interface layer has been removed from the CARP. Now redundant addresses
are configured exactly on the interfaces, they run on.

The CARP configuration itself is, as before, configured and read via
SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
which makes the prefix redundant.

ifconfig(8) semantics has been changed too: now one doesn't need
to clone carpXX interface, he/she should directly configure a vhid
on a Ethernet interface.

To supply vhid data from the kernel to an application the getifaddrs(8)
function had been changed to pass ifam_data with each address. [1]

The new implementation definitely closes all PRs related to carp(4)
being an interface, and may close several others. It also allows
to run a single redundant IP per interface.

Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
idea on using ifam_data and for several rounds of reviewing!

PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
Reviewed by: bz
Submitted by: bz [1]

12 years agoDocument 'findstack'.
kib [Fri, 16 Dec 2011 11:52:33 +0000 (11:52 +0000)]
Document 'findstack'.

MFC after: 1 week

12 years agoAdd 'findstack' ddb command to search either the thread kernel stack
kib [Fri, 16 Dec 2011 11:44:20 +0000 (11:44 +0000)]
Add 'findstack' ddb command to search either the thread kernel stack
or cached stack containing the specified kernel virtual address.

Discussed with: pho
MFC after: 1 week

12 years agoShow the thread kernel stack base address for 'show threads'.
kib [Fri, 16 Dec 2011 11:42:50 +0000 (11:42 +0000)]
Show the thread kernel stack base address for 'show threads'.

Discussed with: pho
MFC after: 1 week

12 years agoMove kstack_cache_entry into the private header, and make the
kib [Fri, 16 Dec 2011 10:56:16 +0000 (10:56 +0000)]
Move kstack_cache_entry into the private header, and make the
stack cache list header accessible outside vm_glue.c.

MFC after: 1 week

12 years agoXref re_format(7) in devd.conf(5), not in devd(8).
glebius [Fri, 16 Dec 2011 10:21:01 +0000 (10:21 +0000)]
Xref re_format(7) in devd.conf(5), not in devd(8).

Pointy hat to: glebius

12 years agoXref re_format(7).
glebius [Fri, 16 Dec 2011 10:14:41 +0000 (10:14 +0000)]
Xref re_format(7).

12 years agoFix typo in macro.
ed [Fri, 16 Dec 2011 09:56:22 +0000 (09:56 +0000)]
Fix typo in macro.

I copied this macro directly from Bruce's email, as I assumed it was
awesome already.

Reported by: tijl@

12 years agoFix my braino in description of RADIX_MPATH.
glebius [Fri, 16 Dec 2011 08:27:04 +0000 (08:27 +0000)]
Fix my braino in description of RADIX_MPATH.

12 years agoProcess a lot of feedback from bde@ on <sys/cdefs.h>:
ed [Fri, 16 Dec 2011 08:22:23 +0000 (08:22 +0000)]
Process a lot of feedback from bde@ on <sys/cdefs.h>:

- Add __alignof() for non-GCC and GCC < 2.95.
- Simply implement the C1X keywords on top of the existing __macros.
- Add struct __hack to _Static_assert to require consumers to add a
  semicolon.
- Add an extra underscore to __assert_ to allow it to be combined with
  locally defined versions of CTASSERT in the tree.
- Add proper casts to __offsetof() to make it work for cases where
  sizeof(size_t) != sizeof(uintptr_t).
- Globally replace size_t and uintptr_t by __size_t and __uintptr_t.
  This removes the dependency on <sys/types.h> / <stdint.h>. Practically
  any header file ends up including <machines/_types.h> somehow.
- Change argument names of macros to match with the rest of the file.

MFC after: 3 months

12 years agoMany updates to cxgbe(4)
np [Fri, 16 Dec 2011 02:09:51 +0000 (02:09 +0000)]
Many updates to cxgbe(4)

- Device configuration via plain text config file.  Also able to operate
  when not attached to the chip as the master driver.

- Generic "work request" queue that serves as the base for both ctrl and
  ofld tx queues.

- Generic interrupt handler routine that can process any event on any
  kind of ingress queue (via a dispatch table).

- A couple of new driver ioctls.  cxgbetool can now install a firmware
  to the card ("loadfw" command) and can read the card's memory
  ("memdump" and "tcb" commands).

- Lots of assorted information within dev.t4nex.X.misc.*  This is
  primarily for debugging and won't show up in sysctl -a.

- Code to manage the L2 tables on the chip.

- Updates to cxgbe(4) man page to go with the tunables that have changed.

- Updates to the shared code in common/

- Updates to the driver-firmware interface (now at fw 1.4.16.0)

MFC after: 1 month

12 years agoPatch the new NFS server in a manner analagous to r228520 for the
rmacklem [Fri, 16 Dec 2011 00:58:41 +0000 (00:58 +0000)]
Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.

PR: kern/118126
MFC after: 2 weeks

12 years agoIn contrib/telnet/libtelnet/sra.c, use the correct number of bytes to
dim [Fri, 16 Dec 2011 00:48:53 +0000 (00:48 +0000)]
In contrib/telnet/libtelnet/sra.c, use the correct number of bytes to
zero the password buffer.

MFC after: 1 week

12 years agoUnfortunately, clang gives a warning about sendmail code that cannot be
dim [Fri, 16 Dec 2011 00:39:44 +0000 (00:39 +0000)]
Unfortunately, clang gives a warning about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after: 1 week

12 years agoIn lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
dim [Fri, 16 Dec 2011 00:13:43 +0000 (00:13 +0000)]
In lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
be of type 'enum pmc_cputype', not 'enum pmc_class'.

MFC after: 1 week

12 years agoAdd "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no
dim [Fri, 16 Dec 2011 00:04:28 +0000 (00:04 +0000)]
Add "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no
unneeded input functions will be emitted.

Spotted by: arundel
MFC after: 1 week

12 years agoIn lib/libipsec/policy_token.l, use lex's standard "%option noinput"
dim [Fri, 16 Dec 2011 00:01:19 +0000 (00:01 +0000)]
In lib/libipsec/policy_token.l, use lex's standard "%option noinput"
instead of hand-defining the YY_NO_INPUT macro.

MFC after: 1 week

12 years agoIn sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
dim [Thu, 15 Dec 2011 23:47:36 +0000 (23:47 +0000)]
In sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
tell the compiler some parameters are purposefully unused.

MFC after: 1 week

12 years agoIn contrib/file/softmagic.c, fix a potential format string security
dim [Thu, 15 Dec 2011 23:28:17 +0000 (23:28 +0000)]
In contrib/file/softmagic.c, fix a potential format string security
problem.  (This fix has already been applied upstream, but we do not
have the latest version of file in the tree at the moment.)

MFC after: 1 week

12 years agoDefine YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
dim [Thu, 15 Dec 2011 23:22:24 +0000 (23:22 +0000)]
Define YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
function does not get defined needlessly.

MFC after: 1 week

12 years agoDisable one more clang warning when WARNS <= 3.
dim [Thu, 15 Dec 2011 23:13:57 +0000 (23:13 +0000)]
Disable one more clang warning when WARNS <= 3.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dim [Thu, 15 Dec 2011 23:06:46 +0000 (23:06 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dt_popc() function assumes that either _ILP32 or _LP64 is defined,
otherwise it has no suitable implementation.

However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not
included in this file.  Add the include now, to get the macros defined.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
dim [Thu, 15 Dec 2011 22:46:04 +0000 (22:46 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
correct printf format for a key_t (aka long).

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c, use the
dim [Thu, 15 Dec 2011 22:37:33 +0000 (22:37 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c, use the
correct printf format for an unsigned long.

MFC after: 1 week

12 years agoCast away a clang alignment warning in drti.c's fixsymbol() function.
dim [Thu, 15 Dec 2011 22:10:27 +0000 (22:10 +0000)]
Cast away a clang alignment warning in drti.c's fixsymbol() function.
This code only runs on i386 and amd64, so there should be no problems if
buf + sec->dofs_offset is not aligned (which is unlikely anyway).

MFC after: 1 week

12 years agoClang has more warnings enabled by default, and when using -Wall, so if WARNS
dim [Thu, 15 Dec 2011 22:08:08 +0000 (22:08 +0000)]
Clang has more warnings enabled by default, and when using -Wall, so if WARNS
is set to low values, some of them have to be disabled explicitly.

MFC after: 1 week

12 years agoModify pw_copy:
bapt [Thu, 15 Dec 2011 22:07:36 +0000 (22:07 +0000)]
Modify pw_copy:
- if pw is NULL and oldpw is not NULL then the oldpw is deleted
- if pw->pw_name != oldpw->pw_name but pw->pw_uid == oldpw->pw_uid
then it renames the user

add new gr_* functions so now gr_util API is similar to pw_util API,
this allow to manipulate groups in a safe way.

Reviewed by: des
Approved by: des
MFC after: 1 month

12 years agoRemove redundant assignment.
pjd [Thu, 15 Dec 2011 22:05:23 +0000 (22:05 +0000)]
Remove redundant assignment.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years agoSimplify code by changing functions types from int to avoid, as the functions
pjd [Thu, 15 Dec 2011 22:03:17 +0000 (22:03 +0000)]
Simplify code by changing functions types from int to avoid, as the functions
always return 0.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years agoRemove redundant setting of the error variable.
pjd [Thu, 15 Dec 2011 22:01:34 +0000 (22:01 +0000)]
Remove redundant setting of the error variable.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years ago- Put one file into one line. This makes keeping local changes and merging
pjd [Thu, 15 Dec 2011 21:06:37 +0000 (21:06 +0000)]
- Put one file into one line. This makes keeping local changes and merging
  with FreeBSD easier for vendors.
- For optional files use variables starting with underscore.

Both changes make rc.d/Makefile look similar to sys/modules/Makefile.

Reviewed by: dim

12 years agoSince clang does not support the tls_model attribute used in malloc.c
dim [Thu, 15 Dec 2011 20:40:11 +0000 (20:40 +0000)]
Since clang does not support the tls_model attribute used in malloc.c
yet (see LLVM PR 9788), and warns about it, rub it out for now.  When
clang grows support for this attribute, I will revert this again.

MFC after: 1 week

12 years agoBring in reallocblk to ext2fs.
pfg [Thu, 15 Dec 2011 20:31:18 +0000 (20:31 +0000)]
Bring in reallocblk to ext2fs.

The feature has been standard for a while in UFS as a means to reduce
fragmentation, therefore maintaining consistent performance with
filesystem aging. This is also very similar to what ext4 calls
"delayed allocation".

In his 2010 GSoC, Zheng Liu ported and benchmarked the missing
FANCY_REALLOC code to find more consistent performance improvements than
with the preallocation approach.

PR: 159233
Author: Zheng Liu <gnehzuil AT SPAMFREE gmail DOT com>
Sponsored by: Google Inc.
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoIn lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
dim [Thu, 15 Dec 2011 20:27:36 +0000 (20:27 +0000)]
In lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
conversion between enum desdir/desmode from include/rpc/des.h, and enum
desdir/desmode from include/rpcsvc/crypt.x.  These are actually
different enums, with different value names, but by accident the integer
representation of the enum values happened to be the same.

MFC after: 1 week

12 years agoRemove meaningless self-assignment in res_send.c, otherwise clang will
dim [Thu, 15 Dec 2011 20:10:12 +0000 (20:10 +0000)]
Remove meaningless self-assignment in res_send.c, otherwise clang will
warn about it.  I guess this was originally done to silence a bogus
warning by an older version of gcc, but I could not reproduce it with
any version of gcc that I have access to.

MFC after: 1 week

12 years agoThe TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
dim [Thu, 15 Dec 2011 19:42:25 +0000 (19:42 +0000)]
The TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
versions of pthread_md.h have a special case of dereferencing a null
pointer.  Clang warns about this with:

In file included from lib/libthr/arch/i386/i386/pthread_md.c:36:
lib/libthr/arch/i386/include/pthread_md.h:96:10: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
        return (TCB_GET32(tcb_self));
                ^~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:73:13: note: expanded from:
            : "m" (*(u_int *)(__tcb_offset(name))));            \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:96:10: note: consider using __builtin_trap() or qualifying pointer with 'volatile'

Since this indirection is done relative to the fs or gs segment, to
retrieve thread-specific data, it is an exception to the rule.

Therefore, add a volatile qualifier to tell the compiler we really want
to dereference a zero address.

MFC after: 1 week

12 years agoSimplify the implementation of the identity mapping in start_all_aps().
alc [Thu, 15 Dec 2011 17:54:23 +0000 (17:54 +0000)]
Simplify the implementation of the identity mapping in start_all_aps().
Since mpboot.s enables processor support for PG_PS before enabling
paging, there is no reason that the identity must use 4 KB page mappings.

Discussed with: jhb

12 years agoUse vm_mmap_to_errno().
jhb [Thu, 15 Dec 2011 15:17:19 +0000 (15:17 +0000)]
Use vm_mmap_to_errno().

Submitted by: kib

12 years agoSimplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib().
glebius [Thu, 15 Dec 2011 12:49:10 +0000 (12:49 +0000)]
Simplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib().

12 years agoFix a bug where sctp_sendmdg() uses uninitialized memory.
tuexen [Thu, 15 Dec 2011 12:35:03 +0000 (12:35 +0000)]
Fix a bug where sctp_sendmdg() uses uninitialized memory.

MFC after: 3 days.

12 years agoARM pmap fixes:
raj [Thu, 15 Dec 2011 12:14:15 +0000 (12:14 +0000)]
ARM pmap fixes:

- Write Buffers have to be drained after write to Page Table even if caches
  are in write-through mode.

- Make sure to sync PTE in pmap_zero_page_generic().

Submitted by: Michal Mazur
Reviewed by: cognet
Obtained from: Semihalf
MFC after: 1 month

12 years agoAdd a pointless and superfluous GNUism that people at a certain large data
theraven [Thu, 15 Dec 2011 11:21:56 +0000 (11:21 +0000)]
Add a pointless and superfluous GNUism that people at a certain large data
aggregation and advertising company seem to believe is standard.

Approved by: dim (mentor)

12 years agoSmall style(9) improvements.
theraven [Thu, 15 Dec 2011 11:16:41 +0000 (11:16 +0000)]
Small style(9) improvements.

Approved by: dim (mentor)

12 years agoAdd RADIX_MPATH to LINT.
glebius [Thu, 15 Dec 2011 11:15:23 +0000 (11:15 +0000)]
Add RADIX_MPATH to LINT.

12 years agos/timout/timeout
kevlo [Thu, 15 Dec 2011 06:29:13 +0000 (06:29 +0000)]
s/timout/timeout

12 years agoRevert r228521: sometimes job output is lost
fjoe [Thu, 15 Dec 2011 06:25:19 +0000 (06:25 +0000)]
Revert r228521: sometimes job output is lost
(see tools/regression/usr.bin/make/execution/joberr test).

openpty(fd + 0, fd + 1,...) version does not have this problem but
it sometimes enters an infinite sleep in "ttywait" state in tty_drain()
when make(1) closes slave pty.

12 years agoFix last-minute typo.
fjoe [Thu, 15 Dec 2011 06:12:43 +0000 (06:12 +0000)]
Fix last-minute typo.

12 years agoAdd job error output test.
fjoe [Thu, 15 Dec 2011 06:01:06 +0000 (06:01 +0000)]
Add job error output test.

make(1) with openpty() currently fails this test: there's a race condition
and error output is sometimes lost.

12 years agoEliminate vestiges of page coloring.
alc [Thu, 15 Dec 2011 05:07:16 +0000 (05:07 +0000)]
Eliminate vestiges of page coloring.

12 years agojob make: if stdout is a tty create a pty when running a command.
fjoe [Thu, 15 Dec 2011 03:13:23 +0000 (03:13 +0000)]
job make: if stdout is a tty create a pty when running a command.

12 years agoHonor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
delphij [Thu, 15 Dec 2011 02:26:53 +0000 (02:26 +0000)]
Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
the full length from offset is being flushed.  Note that for now VOP_FSYNC
does not support offset and length parameters so we still do the same full
VOP_FSYNC.  This issue was reported at FreeNAS support site as FreeNAS
ticket #1096.

Submitted by: "ceckerle" <ce.freenas eckerle net>
Prodded by: gcooper
Reviewed by: rmacklem
MFC after: 2 weeks

12 years ago* Add in the gpio/gpioled drivers into AR91XX_BASE.
adrian [Thu, 15 Dec 2011 01:05:38 +0000 (01:05 +0000)]
* Add in the gpio/gpioled drivers into AR91XX_BASE.
* Add in a default GPIO section for AR91XX_BASE.hints, which doesn't
  define the GPIO function masks or any GPIO pines.
* Add in the GPIO line definitions for LEDs and GPIO pins for the
  TP-WR1043nd.

I've verified the LEDs work fine using gpioset.

12 years agoRe-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO
adrian [Thu, 15 Dec 2011 01:03:49 +0000 (01:03 +0000)]
Re-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO
config and function mask setup.

* "gpiomask" now specifies which GPIO pins to enable, for devices to bind to.
* "function_set" allows bits in the function register to be set at GPIO setup.
* "function_clear" allows bits in the function register to be cleared at
  GPIO setup.

The function_set/function_clear bits allow for individual GPIO pins to either
drive a GPIO line or an alternate function - eg USB, JTAG, etc. This allows
for things like CS1/CS2 be enabled for those boards w/ >1 SPI device connected,
or disabling JTAG for the AR7240 (which is apparently needed ..)

I've verified this on the AR71xx.