Marius Strobl [Sun, 18 Dec 2011 17:48:54 +0000 (17:48 +0000)]
Fix compilation on sparc64 by actually supplying the bus_dma_tag_t member
of the rx_ring to bus_dmamap_sync(9). Given that netmap code tries to
obtain the bus addresses of netmap buffers via vtophys(9) instead of using
bus_dma(9) it currently has zero chance of actually working on sparc64
though (and for that matter f.e. also not with MACs limited to 32-bit DMA
on x86 machines with more than 4GB of RAM).
From time to time people report space map corruption resulting in panic
(ss == NULL) on pool import. I had such a panic recently. With current version
of ZFS it is still possible to import the pool in readonly mode and backup
all the data, but in case it is impossible for some reason add tunable
vfs.zfs.space_map_last_hope, which when set to '1' will tell ZFS to remove
colliding range and retry. This seems to have worked for me, but I consider
it highly risky to use.
Dimitry Andric [Sun, 18 Dec 2011 00:55:46 +0000 (00:55 +0000)]
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
like time_t, better use %jd instead of %ju. Strangely enough, neither
gcc, clang nor gcc 4.6 warn about this discrepancy...
Dimitry Andric [Sat, 17 Dec 2011 22:32:00 +0000 (22:32 +0000)]
Revert r228650, and work around the clang false positive with printf
formats in usr.bin/netstat/atalk.c by conditionally adding NO_WFORMAT to
the Makefile instead.
Dimitry Andric [Sat, 17 Dec 2011 22:16:27 +0000 (22:16 +0000)]
Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored. Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.
Dimitry Andric [Sat, 17 Dec 2011 19:53:08 +0000 (19:53 +0000)]
In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.
Dimitry Andric [Sat, 17 Dec 2011 18:39:04 +0000 (18:39 +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.
Dimitry Andric [Sat, 17 Dec 2011 17:04:30 +0000 (17:04 +0000)]
Use NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
alignment issues in it. (Though I doubt anyone still cares about
NetWare support...)
Mikolaj Golub [Sat, 17 Dec 2011 16:59:22 +0000 (16:59 +0000)]
On start most of sysctl_kern_proc functions use the same pattern:
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.
As the function may be useful not only in kern_proc.c it is in the
kernel name space.
Nathan Whitehorn [Sat, 17 Dec 2011 16:20:27 +0000 (16:20 +0000)]
Additional icache paranoia: non-PLT relocations can modify the text segment.
It is then important to make sure the icache is synchronized again to
prevent (rare) random seg faults and illegal instructions.
Dimitry Andric [Sat, 17 Dec 2011 16:10:14 +0000 (16:10 +0000)]
In contrib/less, cast away const a bunch of times, to make it build
without conversion warnings. This code desparately needs a good dose of
const poison, but fixing all the issues would be rather disruptive.
Andriy Gapon [Sat, 17 Dec 2011 15:57:39 +0000 (15:57 +0000)]
syscons: provide a first iteration of cngrab/cnungrab implementation
- put underlying keyboard(s) into the polling mode for the whole
duration of the grab, instead of the previous behavior of going into
and out of the polling mode around each polling attempt
- ditto for setting K_XLATE mode and enabling a disabled keyboard
Dimitry Andric [Sat, 17 Dec 2011 15:33:26 +0000 (15:33 +0000)]
Correct a logic error in usr.bin/hexdump/conv.c, found by clang.
Whenever the conv_c() function encounters an incomplete multibyte char,
it peeks ahead. It also sets p to peekbuf, to indicate it is still
processing the incomplete character.
However, on the next retry, it compares buf against peekbuf, which
always returns false, since both buf and peekbuf are local char arrays,
whose addresses are never the same.
Fix this by comparing against p instead, which was the intention. Also
turn peekbuf into an array of u_char, to prevent conversion warnings.
Nathan Whitehorn [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.
Andriy Gapon [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.
Andriy Gapon [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).
Dimitry Andric [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.
Bernhard Schmidt [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
Dimitry Andric [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.
Dimitry Andric [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.
Nathan Whitehorn [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.
Dimitry Andric [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.
Dimitry Andric [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.)
Dimitry Andric [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).