nwhitehorn [Sat, 17 Dec 2011 15:31:00 +0000 (15:31 +0000)]
Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot()
caused the icache to be invalidated at the wrong time, resulting in
an icache full of nonsense in the PLT section.
avg [Sat, 17 Dec 2011 15:16:54 +0000 (15:16 +0000)]
introduce cngets, a method for kernel to read a string from console
This is intended as a replacement for libkern's gets and mostly borrows
its implementation. It uses cngrab/cnungrab to delimit kernel's access
to console input.
Note: libkern's gets obviously doesn't share any bits of implementation
iwth libc's gets. They also have different APIs and the former doesn't
have the overflow problems of the latter.
avg [Sat, 17 Dec 2011 15:08:43 +0000 (15:08 +0000)]
kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of
console input. In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).
dim [Sat, 17 Dec 2011 14:26:16 +0000 (14:26 +0000)]
In contrib/ee/ee.c, fix a few warnings about format strings not being
literals. Also, change the direction argument to move_rel() from char
to int; K&R function definions cause it to be promoted to an int anyway,
and this way we avoid clang warning about it.
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
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.
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.
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.
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.
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.)
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).
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.
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.
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.
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.
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.
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.
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.
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
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!
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.
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)
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.
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.)
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.
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).
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
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.
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.
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
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.
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.
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.
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.