Commit graph

166816 commits

Author SHA1 Message Date
Gleb Smirnoff 1c6eeddad9 dhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
that changed 0.0.0.0/0.0.0.0 prefix to 0.0.0.0/255.0.0.0.

In the r228313 this behavior was fixed, and since dhclient-script
got broken.

I'm not sure this fix is a perfect one, it just changes
dhclient-script to set 0.0.0.0/255.0.0.0 explicitly.

PR:		kern/163206
2011-12-13 11:54:51 +00:00
Alexander Motin 88c707c819 - Fix different variable types use in different files after r121184,
causing problems on amd64.
 - s/%lud/%lu/.

MFC after:	1 month
2011-12-13 11:13:28 +00:00
Alexander Motin 45210a2512 Fix few bugs in isp(4) target mode support:
- in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
 - fix hold count leak inside rls_lun_statep() that also fired above assert;
 - in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
 - make isp_disable_lun() to set status in CCB;
 - make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by:	mjacob
Sponsored by:	iXsystems, inc.
MFC after:	1 month
2011-12-13 09:58:05 +00:00
Ed Schouten 2162cff196 Staticify dumpfs.
This tool only consists of a single C file, so we can simply mark
everything except main() static. This seems to shave off about 8% of the
binary size.
2011-12-13 09:01:44 +00:00
Ruslan Ermilov 23812e6a94 The "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
IPv4 aliases to work since network.subr@197139.

MFC after:	3 days
2011-12-13 08:23:03 +00:00
Gleb Smirnoff 6bfaa83996 Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
usage, but end up with more changes.

- Use SIOCAIFADDR instead of old rusty SIOCSIFADDR, SIOCSIFBRDADDR
  and SIOCSIFNETMASK.
- Use queue(9) instead of hand made stailq.
- Use one socket for all ifioctl() and send/receive operations.
- Use __func__ instead of cut-n-paste in logging and panics.
- Axe some dead or strange code.

Tested by:	gonzo, Stefan Bethke <stb lassitu.de>
2011-12-13 07:02:48 +00:00
Gleb Smirnoff 55174c34ef Belatedly catch up with r151555. in_scrubprefix() also needs this fix. We
should compare not only addresses, but their masks, too, when searching
for matching prefix.
2011-12-13 06:56:43 +00:00
Adrian Chadd 34415ac907 Style(9) changes. 2011-12-13 05:13:51 +00:00
Eitan Adler 3eb9ab5255 Document a large number of currently undocumented sysctls. While here
fix some style(9) issues and reduce redundancy.

PR:		kern/155491
PR:		kern/155490
PR:		kern/155489
Submitted by:	Galimov Albert <wtfcrap@mail.ru>
Approved by:	bde
Reviewed by:	jhb
MFC after:	1 week
2011-12-13 00:38:50 +00:00
Attilio Rao 77befd1d23 Revert the approach for skipping lockstat_probe_func call when doing
lock_success/lock_failure, introduced in r228424, by directly skipping
in dtrace_probe.

This mainly helps in avoiding namespace pollution and thus lockstat.h
dependency by systm.h.

As an added bonus, this also helps in MFC case.
Reviewed by:	avg
MFC after:	3 months (or never)
X-MFC:		r228424
2011-12-12 23:29:32 +00:00
Mikolaj Golub cc1ff620b9 Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.
Reviewed by:	kib
MFC after:	1 week
2011-12-12 22:01:33 +00:00
Mikolaj Golub de21500d6a Make procstat -l output similar to the output of limits(1).
Suggested by:	jhb
MFC after:	1 week
2011-12-12 21:41:05 +00:00
Eitan Adler dca400f352 - Add support for ASCII art splash screens in TheDraw format
PR:		kern/143370
Submitted by:	Antony Mawer <antony@mawer.org>
Reviewed by:	gjb (doc)
Reviewed by:	des (style)
Approved by:	ed
MFC after:	1 month
2011-12-12 21:12:07 +00:00
Matthew D Fleming 108cd49471 - Define true and false in sys/types.h for _KERNEL consumers, and
typedef bool.  Due to macro expansion it seemed better to use a
   typedef for kernel consumers (specifically ofed won't compile
   without more changes if a define is used).
 - <stdbool.h> should also not re-define bool/true/false if they are
   defined by <sys/types.h>.  It would probably be a programming error
   to define _KERNEL for user-space code, but downstream consumers
   like Isilon have already been including <stdbool.h> in kernel
   sources, and this protects that usage.
 - sizeof(_Bool) is not necessarily the same as sizeof(int), so kernel
   modules should be rebuild with this change.  Bump __FreeBSD_version.

MFC after:	2 weeks
Sponsored by:	Isilon Systems, LLC
2011-12-12 18:44:17 +00:00
Matthew D Fleming 103af58f59 Do not define bool/true/false if the symbols already exist.
MFC after:	2 weeks
Sponsored by:	Isilon Systems, LLC
2011-12-12 18:43:24 +00:00
Matthew D Fleming e5587e2e03 Do not use the sometimes-reserved work 'bool' for a variable name.
MFC after:	2 weeks
Sponsored by:	Isilon Systems, LLC
2011-12-12 18:43:18 +00:00
Matthew D Fleming 30a497c860 Consistently use types in e1000 driver code:
- Two struct members eee_disable are used in a function that expects
   an int *, so declare them int, not bool.
 - igb_tx_ctx_setup() returns a boolean value, so declare it bool, not int.
 - igb_header_split is passed to TUNABLE_INT, so delcare it int, not bool.
 - igb_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool/true/false if the symbols already exist.

MFC after:	2 weeks
Sponsored by:	Isilon Systems, LLC
2011-12-12 18:27:34 +00:00
Matthew D Fleming 117f85276f Consistently use types in ixgbe driver code:
- {ixgbe,ixv}_header_split is passed to TUNABLE_INT, so delcare it
   int, not bool.
 - {ixgbe,ixv}_tx_ctx_setup() returns a boolean value, so declare it
   bool, not int.
 - {ixgbe,ixv}_tso_setup() returns a bool, so declare it bool, not boolean_t.
 - {ixgbe,ixv}_txeof() returns a bool, so declare it bool, not boolean_t.
 - Do not re-define bool if the symbol already exists.

MFC after:	2 weeks
Sponsored by:	Isilon Systems, LLC
2011-12-12 18:27:28 +00:00
Fabien Thomas 2dde521a9a There's a small set of events on Nehalem, that are not supported in
processors with CPUID signature 06_1AH, 06_1EH, and 06_1FH.

Refuse to allocate them on unsupported model.

Submitted by:	Davide Italiano <davide.italiano@gmail.com>
MFC after:	1 month
2011-12-12 13:12:55 +00:00
Ed Schouten 4d9a3537ff Add missing static and const keywords to kbdcontrol.
None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.
2011-12-12 12:33:38 +00:00
Fabien Thomas 96ff3b75d4 Add VIA microde update support to cpuctl(4) and cpucontrol(8).
Support have been tested with X2 CPU and QuadCore CPU.

MFC after:	1 month
2011-12-12 12:30:44 +00:00
Konstantin Belousov 6be4b69715 Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
rtld on 386 and amd64. This adds runtime bits neccessary for the use
of the dispatch functions from the dynamically-linked executables and
shared libraries.

To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.

Move the init_pltgot() call before the relocations for the object are
processed.

MFC after:	3 weeks
2011-12-12 11:03:14 +00:00
Konstantin Belousov 4038b79831 Add definitions for GNU-specific STT_GNU_IFUNC symbol type,
and R_{386,X86_64}_IRELATIVE relocations.

MFC after:	3 weeks
2011-12-12 10:10:49 +00:00
Andriy Gapon 7a7ce668ef put sys/systm.h at its proper place or add it if missing
Reported by:	lstewart, tinderbox
Pointyhat to:	avg, attilio
MFC after:	1 week
MFC with:	r228430
2011-12-12 10:05:13 +00:00
Konstantin Belousov 134465d732 Fix printf.
Submitted by:	az
MFC after:	1 week
2011-12-12 10:04:04 +00:00
Fabien Thomas 61af1d1393 Add watchdog support for VIA south bridge chipset.
Tested on VT8251, VX900 but CX700, VX800, VX855 should works.

MFC after:	1 month
Sponsored by: NETASQ
2011-12-12 09:50:33 +00:00
Andriy Gapon 0e225211a0 kern_racct: move sys/systm.h inclusion to its proper place
This should fix the build failure introduced with r228424.
Also remove duplicate inclusion of sys/param.h.

Pointyhat to:	avg
MFC after:	1 week
2011-12-12 07:46:10 +00:00
Andriy Gapon 8538a18594 syscons: make sc_puts static as it is used only privately
Perhaps sc_puts should also be renamed to scputs to follow the implied
naming conventions in the file...

MFC after:	2 weeks
2011-12-11 21:10:11 +00:00
Ed Schouten 3be02c20ca Add static keywords to vidcontrol(1).
While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.
2011-12-11 21:02:33 +00:00
Andriy Gapon 353705930f panic: add a switch and infrastructure for stopping other CPUs in SMP case
Historical behavior of letting other CPUs merily go on is a default for
time being.  The new behavior can be switched on via
kern.stop_scheduler_on_panic tunable and sysctl.

Stopping of the CPUs has (at least) the following benefits:
- more of the system state at panic time is preserved intact
- threads and interrupts do not interfere with dumping of the system
  state

Only one thread runs uninterrupted after panic if stop_scheduler_on_panic
is set.  That thread might call code that is also used in normal context
and that code might use locks to prevent concurrent execution of certain
parts.  Those locks might be held by the stopped threads and would never
be released.  To work around this issue, it was decided that instead of
explicit checks for panic context, we would rather put those checks
inside the locking primitives.

This change has substantial portions written and re-written by attilio
and kib at various times.  Other changes are heavily based on the ideas
and patches submitted by jhb and mdf.  bde has provided many insights
into the details and history of the current code.

The new behavior may cause problems for systems that use a USB keyboard
for interfacing with system console.  This is because of some unusual
locking patterns in the ukbd code which have to be used because on one
hand ukbd is below syscons, but on the other hand it has to interface
with other usb code that uses regular mutexes/Giant for its concurrency
protection.  Dumping to USB-connected disks may also be affected.

PR:			amd64/139614 (at least)
In cooperation with:	attilio, jhb, kib, mdf
Discussed with:		arch@, bde
Tested by:		Eugene Grosbein <eugen@grosbein.net>,
			gnn,
			Steven Hartland <killing@multiplay.co.uk>,
			glebius,
			Andrew Boyer <aboyer@averesystems.com>
			(various versions of the patch)
MFC after:		3 months (or never)
2011-12-11 21:02:01 +00:00
Ed Schouten 469743871e Add static keywords to chio(1).
All other global variables are already marked static, so for consistency
sake, add them to these three arrays as well.
2011-12-11 20:53:12 +00:00
Ed Schouten c2d582b918 Add more static keywords to rcorder(8).
The global variables and functions provided by rcorder.c are not used in
the other C files, as the other C files only provide memory allocation
and hash functions. This reduces the binary size by 10%.
2011-12-11 20:48:40 +00:00
Glen Barber ee20a981df Minor whitespace cleanup to make.conf(5).
MFC after:	1 week
X-MFC-With:	228418
2011-12-11 20:01:37 +00:00
Glen Barber 0445deadb3 Document the SVN variable needs to be set in make.conf(5) when SVN_UPDATE
is set.

PR:		163162
Submitted by:	Oliver Hartmann <ohartman!zedat.fu-berlin.de>
Patch by:	Benjamin Kaduk <kaduk!mit.edu> (original)
MFC after:	1 week
2011-12-11 19:53:11 +00:00
Ed Schouten 1d23e44c17 Add missing static keyword.
All global variables and functions are marked static. Simply because
this is an enum, doesn't mean we can't do so as well.
2011-12-11 19:28:04 +00:00
Ed Schouten e120624d32 Add missing static keyword.
All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.
2011-12-11 19:22:42 +00:00
Jack F Vogel 62aca36544 Last change still had an issue, one more time... 2011-12-11 18:46:14 +00:00
Nathan Whitehorn 9932a3fefc Increase the available virtual address space for user programs on PowerPC
AIM systems to 4 GB on 32-bit systems and 2^64 bytes on 64-bit systems.
VM_MAXUSER_ADDRESS remains at 2 GB on pending Book-E, pending review of
an increase to 3 GB by those more familiar with Book-E.
2011-12-11 17:23:03 +00:00
Nathan Whitehorn 598d99ddee Keep track of PVO entries in each pmap, which allows much faster
pmap_remove() for large sparse requests. This can prevent pmap_remove()
operations on 64-bit process destruction or swapout that would take
several hundred times the lifetime of the universe to complete. This
behavior is largely indistinguishable from a hang.
2011-12-11 17:19:48 +00:00
Mikolaj Golub b2b91ddf9d Include sys/queue.h: snmpmod.h uses TAILQ.
PR:		bin/153153
MFC after:	2 weeks
2011-12-11 17:10:33 +00:00
Dimitry Andric 8f506e9e08 Add more files to cleanup with 'make delete-old' when WITHOUT_CLANG is
in effect.

MFC after:	1 week
2011-12-11 14:01:11 +00:00
Ed Schouten e802a0b31e Let reboot(8) use getprogname() to compare the program name.
While there, mark the global variable dohalt static, as reboot(8) only
consists of a single C file.
2011-12-11 11:42:44 +00:00
Ed Schouten 5111cde131 Add missing static keywords to global variables in camcontrol.
While there, make the vendor list const and add appropriate keywords to
functions that use this list.
2011-12-11 11:38:50 +00:00
Ed Schouten 7b44b80961 Move 3.5 KB from the data segment to the text segment.
The `struct modes' are only used by the getter-functions in the same
file, so we can safely mark them static and const.
2011-12-11 09:56:48 +00:00
Jack F Vogel 133f283b45 Correct LINT build issues in the ioctl code. 2011-12-11 09:37:25 +00:00
Eitan Adler a506169a2b - fix typo
Approved by:	kib@
2011-12-10 21:05:06 +00:00
Alan Cox c5ecbfb410 Avoid the possibility of integer overflow in the calculation of
VM_KMEM_SIZE_MAX.  Specifically, if the user/kernel address space split
was changed such that the kernel address space was greater than or equal
to 2 GB, then overflow would occur.

PR:		161721
MFC after:	3 weeks
2011-12-10 18:42:00 +00:00
Ed Schouten 4df6844ba3 Make comsat(8) approximately 15% smaller.
This program only consists of a single C file, so simply mark everything
except main() static.
2011-12-10 18:35:26 +00:00
Ed Schouten a02c83afc5 Add more static keywords to truss(1) source code.
There are some tables in the source code that are only used by the
individual source files themselves. Therefore there is no need to export
them.
2011-12-10 18:27:55 +00:00
Ed Schouten 8375d51296 Add missing "static const" to long options table.
This table is only used in this C file and passed to getopt_long(), so
we can safely add static and const to it.
2011-12-10 18:21:03 +00:00