]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoRevert a minor part of revision 211364:
delphij [Thu, 19 Aug 2010 22:55:17 +0000 (22:55 +0000)]
Revert a minor part of revision 211364:

 - Imply -h if single file is grepped, this is the GNU behaviour

This is already done by code above the change and have caused a regression
since this instance of code does not check Hflag.

Reported by: davidxu
Pointy hat to: delphij

13 years agoRevert part of the r211149 as I erroneously ported the logical_cpus from
attilio [Thu, 19 Aug 2010 22:37:43 +0000 (22:37 +0000)]
Revert part of the r211149 as I erroneously ported the logical_cpus from
Yahoo! patchset as a mask (and according manipulating variables) while
it is actually a CPU count.

Submitted by: neel
MFC after: 1 month
X-MFC: 211149

13 years ago'\0' -> 0
edwin [Thu, 19 Aug 2010 21:59:39 +0000 (21:59 +0000)]
'\0' -> 0

Fix silly mistake by being overly zeaolous[sp] of applying the style rules.

13 years agoEliminate the ambiguous queue setting logic for
jfv [Thu, 19 Aug 2010 17:00:33 +0000 (17:00 +0000)]
Eliminate the ambiguous queue setting logic for
the VF, it made it possible to have 2 queues which
we don't want, the HOST is unable to handle it.

13 years agoRemove unused KTRACE includes.
jhb [Thu, 19 Aug 2010 16:41:27 +0000 (16:41 +0000)]
Remove unused KTRACE includes.

13 years agoThere isn't really a need to hold the ktrace mutex just to read the value
jhb [Thu, 19 Aug 2010 16:40:30 +0000 (16:40 +0000)]
There isn't really a need to hold the ktrace mutex just to read the value
of p_traceflag that is stored in the kinfo_proc structure.  It is still
racey even with the lock and the code will read a consistent snapshot of
the flag without the lock.

13 years agoCall dev_rel() in error paths.
jh [Thu, 19 Aug 2010 16:39:00 +0000 (16:39 +0000)]
Call dev_rel() in error paths.

Reported by: kib
Reviewed by: kib
MFC after: 2 weeks

13 years agoFix a whitespace nit and remove a questioning comment. STAILQ_CONCAT()
jhb [Thu, 19 Aug 2010 16:38:58 +0000 (16:38 +0000)]
Fix a whitespace nit and remove a questioning comment.  STAILQ_CONCAT()
does require the STAILQ the existing list is being added to to already
be initialized (it is CONCAT() vs MOVE()).

13 years agoMigrate if_arge to use the PLL cpuops.
adrian [Thu, 19 Aug 2010 16:29:08 +0000 (16:29 +0000)]
Migrate if_arge to use the PLL cpuops.

This has been lightly tested on the AR7161 and AR9132.

13 years agoImplement PLL generalisation in preparation for use in if_arge.
adrian [Thu, 19 Aug 2010 16:25:15 +0000 (16:25 +0000)]
Implement PLL generalisation in preparation for use in if_arge.

* Add a function to write to the relevant PLL register
* Break out the PLL configuration for the AR71XX into the CPU ops,
  lifted from if_arge.c.
* Add the AR91XX PLL configuration ops, using the AR91XX register
  definitions.

13 years agoadd the PLL set functions to cpuops
adrian [Thu, 19 Aug 2010 16:15:30 +0000 (16:15 +0000)]
add the PLL set functions to cpuops

13 years agoRemove an unused macro. exit1() invokes ktrprocexit() directly.
jhb [Thu, 19 Aug 2010 15:55:50 +0000 (15:55 +0000)]
Remove an unused macro.  exit1() invokes ktrprocexit() directly.

13 years agoRemove unneeded casts in inline assembly in contrib/gcc/longlong.h,
rpaulo [Thu, 19 Aug 2010 12:59:57 +0000 (12:59 +0000)]
Remove unneeded casts in inline assembly in contrib/gcc/longlong.h,
which are apparently "heinous" GNU extensions, so clang can
compile this without using the -fheinous-gnu-extensions option.

Results in *no* binary change, neither with clang, nor with gcc.

Submitted by: Dimitry Andric <dimitry at andric.com>

13 years agoFix mistaken indenting.
adrian [Thu, 19 Aug 2010 12:52:49 +0000 (12:52 +0000)]
Fix mistaken indenting.

13 years agoAdd some initial AR724X chipset support.
adrian [Thu, 19 Aug 2010 11:53:55 +0000 (11:53 +0000)]
Add some initial AR724X chipset support.

This is untested but should at least allow an AR724X to boot.

The current code is lacking the detail needed to expose the PCIe bus.
It is also lacking any NIC, PLL or flush/WB code.

13 years agoAdd initial Atheros AR91XX support.
adrian [Thu, 19 Aug 2010 11:40:10 +0000 (11:40 +0000)]
Add initial Atheros AR91XX support.

This works well enough to bring a system up to single-user mode
using an MDROOT.

Known Issues:

* The EHCI USB doesn't currently work and will panic the kernel during
  attach.
* The onboard ethernet won't work until the PLL routines have been
  fleshed out and shoe-horned into if_arge.
* The WMAC device glue (and quite likely the if_ath support)
  hasn't yet been implemented.

13 years agoMFp4: anchie_soc2009 branch:
anchie [Thu, 19 Aug 2010 11:31:03 +0000 (11:31 +0000)]
MFp4: anchie_soc2009 branch:

Add kernel side support for Secure Neighbor Discovery (SeND), RFC 3971.

The implementation consists of a kernel module that gets packets from
the nd6 code, sends them to user space on a dedicated socket and reinjects
them back for further processing.

Hooks are used from nd6 code paths to divert relevant packets to the
send implementation for processing in user space.  The hooks are only
triggered if the send module is loaded. In case no user space
application is connected to the send socket, processing continues
normaly as if the module would not be loaded. Unloading the module
is not possible at this time due to missing nd6 locking.

The native SeND socket is similar to a raw IPv6 socket but with its own,
internal pseudo-protocol.

Approved by: bz (mentor)

13 years agoexpand_number(3) takes a uint64_t * now; intmax_t was never correct
des [Thu, 19 Aug 2010 11:20:24 +0000 (11:20 +0000)]
expand_number(3) takes a uint64_t * now; intmax_t was never correct
except by accident.

MFC after: 3 weeks

13 years agoexpand_number(3) takes a uint64_t * now.
des [Thu, 19 Aug 2010 11:19:21 +0000 (11:19 +0000)]
expand_number(3) takes a uint64_t * now.

MFC after: 3 weeks

13 years agoAdd missing licence.
adrian [Thu, 19 Aug 2010 11:18:50 +0000 (11:18 +0000)]
Add missing licence.

13 years agostyle(9) pick from imp@ .
adrian [Thu, 19 Aug 2010 11:16:52 +0000 (11:16 +0000)]
style(9) pick from imp@ .

13 years agoUTFize my name.
des [Thu, 19 Aug 2010 09:28:59 +0000 (09:28 +0000)]
UTFize my name.

13 years agoThis patch to pc-sysinstall allows the setting of a new config
imp [Thu, 19 Aug 2010 06:11:06 +0000 (06:11 +0000)]
This patch to pc-sysinstall allows the setting of a new config
variable for installation, which lets the user/front-end select
between MBR or GPT partitioning schemes when doing a dedicated disk
installation.

PR: 149772
Submitted by: Kris Moore

13 years agoAdded "-m" option to "disk-list" to list memory disks along with
imp [Thu, 19 Aug 2010 06:07:49 +0000 (06:07 +0000)]
Added "-m" option to "disk-list" to list memory disks along with
standard disks.

PR: 149749
Submitted by: John Hixson

13 years agoSimple patch to add support zpool virtual devices that are not
imp [Thu, 19 Aug 2010 06:05:05 +0000 (06:05 +0000)]
Simple patch to add support zpool virtual devices that are not
currently supported.

PR: 149599
Submitted by: John Hixson

13 years agoSome cleanup, changed some echo's to echo_log, check for PROGDIR so
imp [Thu, 19 Aug 2010 06:02:31 +0000 (06:02 +0000)]
Some cleanup, changed some echo's to echo_log, check for PROGDIR so
that different PROGDIR's can be set.

PR: 148806
Submitted by: John Hixson

13 years agoUpdates to pc-sysinstall that allow FTP installation of FreeBSD.
imp [Thu, 19 Aug 2010 06:01:25 +0000 (06:01 +0000)]
Updates to pc-sysinstall that allow FTP installation of FreeBSD.

PR: 148661
Submitted by: John Hixson

13 years agoVarious updates to support new pc-sysinstall directive
imp [Thu, 19 Aug 2010 05:59:27 +0000 (05:59 +0000)]
Various updates to support new pc-sysinstall directive
"installPackages" that will install packages and all package
dependencies.

PR: 148606
Submitted by: John Hixon

13 years agoFirst cut at mips n64 ABI support
imp [Thu, 19 Aug 2010 03:31:26 +0000 (03:31 +0000)]
First cut at mips n64 ABI support

13 years agoUnbreak the LINT kernel on powerpc64. Note that the LINT kernel
nwhitehorn [Thu, 19 Aug 2010 03:19:26 +0000 (03:19 +0000)]
Unbreak the LINT kernel on powerpc64. Note that the LINT kernel
configuration is TARGET_ARCH specific and must be generated with
TARGET_ARCH set.

Reviewed by: imp

13 years agoRemove now unused 'reg'.
adrian [Thu, 19 Aug 2010 02:15:39 +0000 (02:15 +0000)]
Remove now unused 'reg'.

13 years agoInitialise the USB system using cpuops rather than the AR71XX specific method.
adrian [Thu, 19 Aug 2010 02:14:53 +0000 (02:14 +0000)]
Initialise the USB system using cpuops rather than the AR71XX specific method.

13 years agoMigrate the CPU reset path to use the new cpuops.
adrian [Thu, 19 Aug 2010 02:12:04 +0000 (02:12 +0000)]
Migrate the CPU reset path to use the new cpuops.

13 years agoRemove the now-unused DDR flush register value.
adrian [Thu, 19 Aug 2010 02:10:05 +0000 (02:10 +0000)]
Remove the now-unused DDR flush register value.

13 years agoMake the PCI initialisation path use the new cpuops rather than directly
adrian [Thu, 19 Aug 2010 02:05:16 +0000 (02:05 +0000)]
Make the PCI initialisation path use the new cpuops rather than directly
programming the reset register.

13 years agoMake if_arge use the new cpuops rather than hard coding the DDR flush registers.
adrian [Thu, 19 Aug 2010 02:04:35 +0000 (02:04 +0000)]
Make if_arge use the new cpuops rather than hard coding the DDR flush registers.

13 years agoPreparation work for supporting the AR91xx and AR724x.
adrian [Thu, 19 Aug 2010 02:03:12 +0000 (02:03 +0000)]
Preparation work for supporting the AR91xx and AR724x.

* Implement a SoC probe function, from Linux, which determines the
  SoC family, type and revision. This only probes the AR71xx series
  SoC and (currently) panics on others.

* Migrate some of the AR71XX specific hardware init (USB device, determining
  system frequencies) into using the cpuops introduced in an earlier commit.
  Other SoC specific hardware stuff (per-device flush/WB, GPIO pin wiring,
  Ethernet PLL setup, other things I've likely missed) will be introduced in
  subsequent commits.

Reviewed by: imp@
Obtained from: (partially) Linux

13 years agoCheck return value of dup(), it could be -1 when the system is running
delphij [Thu, 19 Aug 2010 01:34:00 +0000 (01:34 +0000)]
Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance.

Found with: Coverity Prevent(tm)
CID: 6084
MFC after: 1 month

13 years agoMore tests.
pjd [Wed, 18 Aug 2010 22:06:43 +0000 (22:06 +0000)]
More tests.

13 years agosh: Add a test for break from a trap action.
jilles [Wed, 18 Aug 2010 20:26:50 +0000 (20:26 +0000)]
sh: Add a test for break from a trap action.

13 years agoIf a TCP connection has been idle for one retransmit timeout or more
andre [Wed, 18 Aug 2010 18:05:54 +0000 (18:05 +0000)]
If a TCP connection has been idle for one retransmit timeout or more
it must reset its congestion window back to the initial window.

RFC3390 has increased the initial window from 1 segment to up to
4 segments.

The initial window increase of RFC3390 wasn't reflected into the
restart window which remained at its original defaults of 4 segments
for local and 1 segment for all other connections.  Both values are
controllable through sysctl net.inet.tcp.local_slowstart_flightsize
and net.inet.tcp.slowstart_flightsize.

The increase helps TCP's slow start algorithm to open up the congestion
window much faster.

Reviewed by: lstewart
MFC after: 1 week

13 years ago- Refactor file reading code to use pure syscalls and an internal buffer
gabor [Wed, 18 Aug 2010 17:40:10 +0000 (17:40 +0000)]
- Refactor file reading code to use pure syscalls and an internal buffer
  instead of stdio.  This gives BSD grep a very big performance boost,
  its speed is now almost comparable to GNU grep.

Submitted by: Dimitry Andric <dimitry@andric.com>
Approved by: delphij (mentor)

13 years agoUntangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug
andre [Wed, 18 Aug 2010 17:39:47 +0000 (17:39 +0000)]
Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug
sysctl's and remove any side effects.

Both sysctl's share the same backend infrastructure and due to the
way it was implemented enabling net.inet.tcp.log_in_vain would also
cause log_debug output to be generated.  This was surprising and
eventually annoying to the user.

The log output backend is kept the same but a little shim is inserted
to properly separate log_in_vain and log_debug and to remove any side
effects.

PR: kern/137317
MFC after: 1 week

13 years agoRemove bintime_cmp() function, unused since r200086.
mav [Wed, 18 Aug 2010 15:38:10 +0000 (15:38 +0000)]
Remove bintime_cmp() function, unused since r200086.

MFC after: 1 week

13 years agoMIPS n64 support - continued...
jchandra [Wed, 18 Aug 2010 12:52:21 +0000 (12:52 +0000)]
MIPS n64 support - continued...

1. On n64, use XKPHYS to map page table pages instead of KSEG0. Maintain
   just one freepages list on n64.

   The changes are mainly to introduce MIPS_PHYS_TO_DIRECT(pa),
   MIPS_DIRECT_TO_PHYS(), which will use KSEG0 in 32 bit compilation
   and XKPHYS in 64 bit compilation.

2. Change macro based PMAP_LMEM_MAP1(), PMAP_LMEM_MAP2(), PMAP_LMEM_UNMAP()
  to inline functions.

3. Introduce MIPS_DIRECT_MAPPABLE(pa), which will further reduce the cases
   in which we will need to have a special case for 64 bit compilation.

4. Update CP0 hazard definitions for CPU_RMI - the cpu does not need any
   nops

Reviewed by: neel

13 years agoFor some setups sending data in 128kB chunks makes communication very slow. No
pjd [Wed, 18 Aug 2010 12:09:27 +0000 (12:09 +0000)]
For some setups sending data in 128kB chunks makes communication very slow. No
idea why. 32kB on the other hand seems to work properly everywhere.

Reported by: Thomas Steen Rasmussen <thomas@gibfest.dk>
MFC after: 3 weeks

13 years agoWhen calculating the expected memory size for userspace, also take the
bz [Wed, 18 Aug 2010 09:28:12 +0000 (09:28 +0000)]
When calculating the expected memory size for userspace, also take the
number of syncache entries into account for the surplus we add to account
for a possible increase of records in the re-entry window.

Discussed with: jhb, silby
MFC after: 1 week

13 years agoRevert r211436; it was a good idea, but not fully thought out.
des [Wed, 18 Aug 2010 09:18:37 +0000 (09:18 +0000)]
Revert r211436; it was a good idea, but not fully thought out.

13 years agoAdd a DDR flush function, inspired by both Linux and if_arge.c.
adrian [Wed, 18 Aug 2010 09:11:45 +0000 (09:11 +0000)]
Add a DDR flush function, inspired by both Linux and if_arge.c.

13 years agoAdd a further register definition for USB device initialisation.
adrian [Wed, 18 Aug 2010 08:22:58 +0000 (08:22 +0000)]
Add a further register definition for USB device initialisation.

Obtained from: Linux

13 years agoBring over the first cut of the Atheros-specific SoC operations.
adrian [Wed, 18 Aug 2010 08:22:09 +0000 (08:22 +0000)]
Bring over the first cut of the Atheros-specific SoC operations.

Each of these SoCs have different devices, different hardware initialisation
methods and, quite likely, different quirks. These functions will abstract
out the SoC differences and keep these differences out of the drivers (eg
USB init, if_arge, etc.)

13 years agoMake return statements style(9) compliant in MIPS pmap.c
jchandra [Wed, 18 Aug 2010 07:38:13 +0000 (07:38 +0000)]
Make return statements style(9) compliant in MIPS pmap.c

Reported by: neel

Reviewed by: neel (earlier version)

13 years agoImport initial AR91XX and AR724X CPU register definitions.
adrian [Wed, 18 Aug 2010 00:26:14 +0000 (00:26 +0000)]
Import initial AR91XX and AR724X CPU register definitions.

Obtained from: Linux

13 years agoKeep the process locked when calling ktrops() or ktrsetchildren() instead
jhb [Tue, 17 Aug 2010 21:34:19 +0000 (21:34 +0000)]
Keep the process locked when calling ktrops() or ktrsetchildren() instead
of dropping the lock only to immediately reacquire it.

13 years agoFor every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
rpaulo [Tue, 17 Aug 2010 20:39:28 +0000 (20:39 +0000)]
For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
of the compiler command (excluding any arguments) is considered.

This allows you to use, for example, CC="/nondefault/path/clang -xxx",
and still have the various tests in bsd.*.mk identify your compiler as
clang correctly.

ICC if cases were also changed.

Submitted by: Dimitry Andric <dimitry at andric.com>

13 years agoSplit kernel stage 3.2 (build everything) into 3.2 (build the kernel)
des [Tue, 17 Aug 2010 20:26:17 +0000 (20:26 +0000)]
Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
and 3.3 (build the modules).  IMHO, this makes it a little easier to
track the progress of a kernel build using whereintheworld et al.

MFC after: 3 weeks

13 years agoMake `ping6 -I' work with net.inet6.ip6.use_defaultzone=1.
ume [Tue, 17 Aug 2010 17:30:56 +0000 (17:30 +0000)]
Make `ping6 -I' work with net.inet6.ip6.use_defaultzone=1.

MFC after: 2 weeks

13 years agoNow is as good a time as any to find out if we induce breakage
mjacob [Tue, 17 Aug 2010 17:11:15 +0000 (17:11 +0000)]
Now is as good a time as any to find out if we induce breakage
by issueing aborts for any pending commands when we're decommssioning
a disk.

MFC after: 3 months

13 years agoEnsure a minimum "slop" of 10 extra pcb structures when providing a
jhb [Tue, 17 Aug 2010 16:41:16 +0000 (16:41 +0000)]
Ensure a minimum "slop" of 10 extra pcb structures when providing a
memory size estimate to userland for pcb list sysctls.  The previous
behavior of a "slop" of n/8 does not work well for small values of n
(e.g. no slop at all if you have less than 8 open UDP connections).

Reviewed by: bz
MFC after: 1 week

13 years agoAdd s25sl064a, an 8mb SPI flash part.
adrian [Tue, 17 Aug 2010 16:27:13 +0000 (16:27 +0000)]
Add s25sl064a, an 8mb SPI flash part.

13 years agoAdd a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). This
jhb [Tue, 17 Aug 2010 15:44:52 +0000 (15:44 +0000)]
Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP().  This
method is used by the PCI bus driver to query the power management system
to determine the proper device state to be used for a device during suspend
and resume.  For the ACPI PCI bridge drivers this calls
acpi_device_pwr_for_sleep().  This removes ACPI-specific knowledge from
the PCI and PCI-PCI bridge drivers.

Reviewed by: jkim

13 years agoMake sure any -U CFLAGS are not filtered out when calling mkdep, as
rpaulo [Tue, 17 Aug 2010 13:02:08 +0000 (13:02 +0000)]
Make sure any -U CFLAGS are not filtered out when calling mkdep, as
gnu/usr.bin/cc/libiberty first defines the PREFIX macro, and then
undefines it again, so mkdep with clang complains.

Submitted by: Dimitry Andric <dimitry at andric.com>
Reviewed by: ru

13 years ago- The iMac9,1 needs the PAT workaround as well
gahr [Tue, 17 Aug 2010 12:17:24 +0000 (12:17 +0000)]
- The iMac9,1 needs the PAT workaround as well

Approved by: cognet

13 years agoMFV of r211420, tzdata2010l
edwin [Tue, 17 Aug 2010 12:10:35 +0000 (12:10 +0000)]
MFV of r211420, tzdata2010l

- Fix start times of DST for Egypt.
- clocks were set back one hour at 2010-08-11 00:00:00 local time
  in Gaza and the West Bank.

Obtained from:  ftp://elsie.nci.nih.gov/pub/

13 years agoSince top displays the uptime including seconds, there is no need to add 30
brucec [Tue, 17 Aug 2010 09:51:08 +0000 (09:51 +0000)]
Since top displays the uptime including seconds, there is no need to add 30
onto it, which may have been used for rounding purposes in other utilities.

PR: bin/147934
Submitted by: Janne Snabb <snabb at epipe.com>
Approved by: rrs (mentor)
MFC after: 2 weeks

13 years agoAdd simple test to check the functioning of retrieval of
kib [Tue, 17 Aug 2010 09:42:50 +0000 (09:42 +0000)]
Add simple test to check the functioning of retrieval of
pagesize()/pagesizes() after change to use aux vector. Note that
public function getosreldate() is different from libc-internal
__getosreldate() and does not use aux to fetch osreldate value.

MFC after: 1 month

13 years agoTo restart, sysinstall calls execl. Since it will create a new process, we
brucec [Tue, 17 Aug 2010 09:39:06 +0000 (09:39 +0000)]
To restart, sysinstall calls execl. Since it will create a new process, we
can't check to see if sysinstall is running as init just by checking if the
PID is 0. Introduce a new option that sets the RunningAsInit flag, and update
the code to check RunningAsInit intstead of getpid().

PR: bin/38854
Submitted by: Peter Sedeffow <peter at trumanbrewery.com>
Approved by: rrs (mentor)
MFC after: 1 month

13 years agoUse aux vector to get values for SSP canary, pagesize, pagesizes array,
kib [Tue, 17 Aug 2010 09:13:26 +0000 (09:13 +0000)]
Use aux vector to get values for SSP canary, pagesize, pagesizes array,
number of host CPUs and osreldate.

This eliminates the last sysctl(2) calls from the dynamically linked image
startup.

No objections from: kan
Tested by: marius (sparc64)
MFC after: 1 month

13 years agoAdd -m and -M options to control the minimum and maximum frequency.
brucec [Tue, 17 Aug 2010 09:11:38 +0000 (09:11 +0000)]
Add -m and -M options to control the minimum and maximum frequency.

PR: bin/145063
Submitted by: Boris Kochergin <spawk at acm.poly.edu>
Reviewed by: cperciva
Approved by: rrs (mentor)
MFC after: 2 weeks

13 years agoProvide the starting image with the pointer to ELF aux vector. It is
kib [Tue, 17 Aug 2010 09:08:28 +0000 (09:08 +0000)]
Provide the starting image with the pointer to ELF aux vector. It is
written into the __elf_aux_vector variable, if the symbol is present.

Idea from: kan
Tested by: marius (sparc64)
MFC after: 1 month

13 years agoUse the newly provided aux vectors to get pagesize and osreldate information.
kib [Tue, 17 Aug 2010 09:05:39 +0000 (09:05 +0000)]
Use the newly provided aux vectors to get pagesize and osreldate information.
Use local version of getpagesize(), rtld_getpagesize() in private allocator.
Override the __getosreldate() previously fetched from libc_pic.a with
local version that uses aux value if present. Note that __getosreldate()
is used by rtld indirectly, by mmap(2) libc wrapper.

To be able to utilize aux, split digest_dynamic() for use by init_rtld()
into two parts, where the first one does not call malloc(), and the
second part uses it. init_rtld() is able to initialize global variables
before digest_dynamic2() calls. In particular, pagesize and osreldate are
set up from the aux values.

Now, rtld avoids (two) sysctl calls in startup.

Tested by: marius (sparc64)
MFC after: 1 month

13 years agoSupply some useful information to the started image using ELF aux vectors.
kib [Tue, 17 Aug 2010 08:55:45 +0000 (08:55 +0000)]
Supply some useful information to the started image using ELF aux vectors.
In particular, provide pagesize and pagesizes array, the canary value
for SSP use, number of host CPUs and osreldate.

Tested by: marius (sparc64)
MFC after: 1 month

13 years agoMore tests, especially for lchown(2).
pjd [Tue, 17 Aug 2010 06:08:09 +0000 (06:08 +0000)]
More tests, especially for lchown(2).

13 years agoTweak code a bit to be POSIX compatible, when a cancellation request
davidxu [Tue, 17 Aug 2010 02:50:12 +0000 (02:50 +0000)]
Tweak code a bit to be POSIX compatible, when a cancellation request
is acted upon, or when a thread calls pthread_exit(), the thread first
disables cancellation by setting its cancelability state to
PTHREAD_CANCEL_DISABLE and its cancelability type to
PTHREAD_CANCEL_DEFERRED. The cancelability state remains set to
PTHREAD_CANCEL_DISABLE until the thread has terminated.

It has no effect if a cancellation cleanup handler or thread-specific
data destructor routine changes the cancelability state to
PTHREAD_CANCEL_ENABLE.

13 years agosh: Reduce unnecessary testsuite failures with other shells.
jilles [Mon, 16 Aug 2010 22:23:19 +0000 (22:23 +0000)]
sh: Reduce unnecessary testsuite failures with other shells.

13 years agoThe 'size' variable is there to limit how many bytes we want to copy from
pjd [Mon, 16 Aug 2010 21:59:56 +0000 (21:59 +0000)]
The 'size' variable is there to limit how many bytes we want to copy from
'addr'. It is very likely that size of 'addr' is larger than 'size', so checking
strlcpy() return value is bogus.

MFC after: 3 weeks

13 years agoPut parentheses around a few macros to prevent mdoc warnings.
joel [Mon, 16 Aug 2010 21:26:47 +0000 (21:26 +0000)]
Put parentheses around a few macros to prevent mdoc warnings.

13 years agosh: Split off a more dubious test from parser/heredoc2.0.
jilles [Mon, 16 Aug 2010 21:14:49 +0000 (21:14 +0000)]
sh: Split off a more dubious test from parser/heredoc2.0.

13 years agoFix two minor typos.
joel [Mon, 16 Aug 2010 21:12:26 +0000 (21:12 +0000)]
Fix two minor typos.

13 years agoBump document date after content changes.
uqs [Mon, 16 Aug 2010 19:05:10 +0000 (19:05 +0000)]
Bump document date after content changes.

Pointy hat to: uqs

13 years agoWordsmithing of bsnmpd.1
uqs [Mon, 16 Aug 2010 18:47:35 +0000 (18:47 +0000)]
Wordsmithing of bsnmpd.1

PR: docs/149157
Submitted by: Warren Block <wblock@wonkity.com>
MFC after: 1 week

13 years agoRemove unnecessary clean target in em(4), igb(4) and ixgbe(4).
yongari [Mon, 16 Aug 2010 17:48:55 +0000 (17:48 +0000)]
Remove unnecessary clean target in em(4), igb(4) and ixgbe(4).
While here also remove man target in igb(4).

Reviewed by: jfv

13 years agosh: Get rid of unnecessary non-standard empty lists.
jilles [Mon, 16 Aug 2010 17:18:08 +0000 (17:18 +0000)]
sh: Get rid of unnecessary non-standard empty lists.

POSIX does not allow constructs like:
  if cmd; then fi
  { }
Add a colon dummy command, except in a test that verifies that such empty
lists do not cause crashes when used as a function definition.

13 years agoFix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
joel [Mon, 16 Aug 2010 15:18:30 +0000 (15:18 +0000)]
Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>

13 years agoAdd uma_zone_get_max() to obtain the effective limit after a call
andre [Mon, 16 Aug 2010 14:24:00 +0000 (14:24 +0000)]
Add uma_zone_get_max() to obtain the effective limit after a call
to uma_zone_set_max().

The UMA zone limit is not exactly set to the value supplied but
rounded up to completely fill the backing store increment (a page
normally).  This can lead to surprising situations where the number
of elements allocated from UMA is higher than the supplied limit
value.  The new get function reads back the effective value so that
the supplied limit value can be adjusted to the real limit.

Reviewed by: jeffr
MFC after: 1 week

13 years agoFix .Dd from last commit.
joel [Mon, 16 Aug 2010 12:37:17 +0000 (12:37 +0000)]
Fix .Dd from last commit.

Submitted by Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>

13 years agoMark functions and variables as static.
ed [Mon, 16 Aug 2010 12:19:36 +0000 (12:19 +0000)]
Mark functions and variables as static.

All these functions and variables are local to this compilation unit, so
there is no reason why we shouldn't mark them static. This slightly
reduces the binary size.

13 years agoIn setusercontext(), do not apply user settings unless running as the
des [Mon, 16 Aug 2010 11:32:20 +0000 (11:32 +0000)]
In setusercontext(), do not apply user settings unless running as the
user in question (usually but not necessarily because we were called
with LOGIN_SETUSER).  This plugs a hole where users could raise their
resource limits and expand their CPU mask.

MFC after: 3 weeks

13 years agoOld patch I had lying around: clean up and use stpcpy(3) instead of
des [Mon, 16 Aug 2010 11:22:12 +0000 (11:22 +0000)]
Old patch I had lying around: clean up and use stpcpy(3) instead of
sprintf(3).

13 years ago- Revert strlcpy() changes to memcpy() because it's more efficient and
gabor [Sun, 15 Aug 2010 22:15:04 +0000 (22:15 +0000)]
- Revert strlcpy() changes to memcpy() because it's more efficient and
  former may be safer but in this case it doesn't add extra
  safety [1]
- Fix -w option [2]
- Fix handling of GREP_OPTIONS [3]
- Fix --line-buffered
- Make stdin input imply --line-buffered so that tail -f can be piped
  to grep [4]
- Imply -h if single file is grepped, this is the GNU behaviour
- Reduce locking overhead to gain some more performance [5]
- Inline some functions to help the compiler better optimize the code
- Use shortcut for empty files [6]

PR: bin/149425 [6]
Prodded by: jilles [1]
Reported by: Alex Kozlov <spam@rm-rf.kiev.ua> [2] [3],
swell.k@gmail.com [2],
poyopoyo@puripuri.plala.or.jp [4]
Submitted by: scf [5],
Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> [6]
Approved by: delphij (mentor)

13 years agoFixed a typo.
brueffer [Sun, 15 Aug 2010 21:37:30 +0000 (21:37 +0000)]
Fixed a typo.

PR: 148701
Submitted by: Glen Barber <glen.j.barber@gmail.com>
MFC after: 1 week

13 years agoFixed a typo and added a comma.
brueffer [Sun, 15 Aug 2010 21:34:50 +0000 (21:34 +0000)]
Fixed a typo and added a comma.

PR: 148681
Submitted by: Glen Barber <glen.j.barber@gmail.com>
MFC after: 1 week

13 years agoFinish renaming fstest to pjdfstest.
pjd [Sun, 15 Aug 2010 21:29:03 +0000 (21:29 +0000)]
Finish renaming fstest to pjdfstest.

13 years agoTie up some loose ends r88509 left behind:
brueffer [Sun, 15 Aug 2010 21:25:52 +0000 (21:25 +0000)]
Tie up some loose ends r88509 left behind:

- chooseproc() is long gone, MLINK choosethread instead
- Update NAME section for choosethread
- Mark chooseproc.9 for removal

PR:             149549
Submitted by:   pluknet
MFC after: 1 week

13 years agoGive fstest a more unique name: pjdfstest.
pjd [Sun, 15 Aug 2010 21:24:17 +0000 (21:24 +0000)]
Give fstest a more unique name: pjdfstest.
It is released from time to time and used outside FreeBSD, so it is good to
have a name one can google.

13 years agoUpdate copyright years.
pjd [Sun, 15 Aug 2010 21:20:40 +0000 (21:20 +0000)]
Update copyright years.

13 years agoMore tests.
pjd [Sun, 15 Aug 2010 21:19:42 +0000 (21:19 +0000)]
More tests.

13 years agosh: Fix break/continue/return sometimes not skipping the rest of dot script.
jilles [Sun, 15 Aug 2010 21:06:53 +0000 (21:06 +0000)]
sh: Fix break/continue/return sometimes not skipping the rest of dot script.

In our implementation and most others, a break or continue in a dot script
can break or continue a loop outside the dot script. This should cause all
further commands in the dot script to be skipped. However, cmdloop() did not
know about this and continued to parse and execute commands from the dot
script.

As described in the man page, a return in a dot script in a function returns
from the function, not only from the dot script. There was a similar issue
as with break and continue. In various other shells, the return appears to
return from the dot script, but POSIX seems not very clear about this.

13 years agoUse our standard section 4 SYNOPSIS. While here, fixed markup whitespace
brueffer [Sun, 15 Aug 2010 20:56:13 +0000 (20:56 +0000)]
Use our standard section 4 SYNOPSIS.  While here, fixed markup whitespace
and adapted an Xref.

13 years agoFix tx pause quanta and timer calculations.
np [Sun, 15 Aug 2010 20:52:15 +0000 (20:52 +0000)]
Fix tx pause quanta and timer calculations.

MFC after: 3 days