]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoDuring shutdown, deregister the shutdown hook from the correct event
jhb [Tue, 1 Jul 2008 19:44:38 +0000 (19:44 +0000)]
During shutdown, deregister the shutdown hook from the correct event
handler.

MFC after: 2 weeks

16 years agoFix a regression: attach process PMCs to the process created when
jkoshy [Tue, 1 Jul 2008 15:20:15 +0000 (15:20 +0000)]
Fix a regression: attach process PMCs to the process created when
a command line is specified.

16 years agoFix instances of bogus #elsif directive.
dds [Tue, 1 Jul 2008 14:41:03 +0000 (14:41 +0000)]
Fix instances of bogus #elsif directive.

Found by: CScout
MFC after: 2 weeks

16 years agoFix off-by-one error.
nyan [Tue, 1 Jul 2008 11:18:51 +0000 (11:18 +0000)]
Fix off-by-one error.

MFC after: 1 week

16 years agoSet bridge MAC addresses to the MAC address of their first interface unless
philip [Tue, 1 Jul 2008 08:14:58 +0000 (08:14 +0000)]
Set bridge MAC addresses to the MAC address of their first interface unless
locally configured.  This is more in line with the behaviour of other popular
bridging implementations and makes bridges more predictable after reboots for
example.

Reviewed by: thompsa
MFC after: 1 week

16 years agoRemove unused 'td' arguments from smbfs_hash_lock() and
rwatson [Tue, 1 Jul 2008 07:51:16 +0000 (07:51 +0000)]
Remove unused 'td' arguments from smbfs_hash_lock() and
smbfs_hash_unlock().

MFC after: 3 days

16 years agoDon't try to hardlink directories. While I'm here, expand some
kientzle [Tue, 1 Jul 2008 05:45:03 +0000 (05:45 +0000)]
Don't try to hardlink directories.  While I'm here, expand some
comments to make this section of code a little clearer.

16 years agoReflect the fact that we actually have NetBSD revision 1.3.
delphij [Mon, 30 Jun 2008 23:53:15 +0000 (23:53 +0000)]
Reflect the fact that we actually have NetBSD revision 1.3.

16 years agoRemove clause 3 and 4 of NetBSD license.
delphij [Mon, 30 Jun 2008 23:23:31 +0000 (23:23 +0000)]
Remove clause 3 and 4 of NetBSD license.

Obtained from: NetBSD

16 years agoDo not set IFF_DEBUG directly from the driver.
rik [Mon, 30 Jun 2008 21:18:27 +0000 (21:18 +0000)]
Do not set IFF_DEBUG directly from the driver.

MFC after: 1 month.

16 years agoRemove spls from NFS server setup call; expand receive socket buffer
rwatson [Mon, 30 Jun 2008 20:43:06 +0000 (20:43 +0000)]
Remove spls from NFS server setup call; expand receive socket buffer
locking to cover full setup of socket upcalls; remove XXX about
locking.

MFC after: 3 weeks

16 years agoRun the privileged dhclient process in its own session.
ed [Mon, 30 Jun 2008 20:23:49 +0000 (20:23 +0000)]
Run the privileged dhclient process in its own session.

In the MPSAFE TTY branch, I noticed PTY's to be leaked, because
dhclient's privileged process was run inside the session of, say, the
login shell. Make sure we call setsid() here.

Approved by: philip (mentor), brooks

16 years agoIn udp_append() and udp_input(), make use of read locking on incpbs
rwatson [Mon, 30 Jun 2008 18:26:43 +0000 (18:26 +0000)]
In udp_append() and udp_input(), make use of read locking on incpbs
rather than write locking: while we need to maintain a valid reference
to the inpcb and fix its state, no protocol layer state is modified
during an IPv4 UDP receive -- there are only changes at the socket
layer, which is separately protected by socket locking.

While parallel concurrent receive on a single UDP socket is currently
relatively unusual, introducing read locking in the transmit path,
allowing concurrent receive and transmit, will significantly improve
performance for loads such as BIND, memcached, etc.

MFC after: 2 months
Tested by: gnn, kris, ps

16 years agoMake it clear that gzcat expects each argument to be separate files.
delphij [Mon, 30 Jun 2008 17:45:47 +0000 (17:45 +0000)]
Make it clear that gzcat expects each argument to be separate files.

PR: docs/123010
Submitted by: Andrew Wright <andrewhw ieee org>
MFC after: 2 weeks

16 years agoUpdate man page for -t.
des [Mon, 30 Jun 2008 17:16:05 +0000 (17:16 +0000)]
Update man page for -t.

16 years agoQuick shot at implementing -t (test).
des [Mon, 30 Jun 2008 17:11:27 +0000 (17:11 +0000)]
Quick shot at implementing -t (test).

Requested by: ache
MFC after: 2 weeks

16 years agoMore explicit error message.
des [Mon, 30 Jun 2008 16:19:26 +0000 (16:19 +0000)]
More explicit error message.

16 years agoAdd missing $FreeBSD$
des [Mon, 30 Jun 2008 15:49:12 +0000 (15:49 +0000)]
Add missing $FreeBSD$

16 years agoAvoid NULL deference.
delphij [Mon, 30 Jun 2008 15:21:42 +0000 (15:21 +0000)]
Avoid NULL deference.

Reviewed by: ivoras

16 years ago- Forgot to bump a date after last change
danger [Mon, 30 Jun 2008 08:46:09 +0000 (08:46 +0000)]
- Forgot to bump a date after last change

16 years ago- add some missing words
danger [Mon, 30 Jun 2008 08:29:02 +0000 (08:29 +0000)]
- add some missing words
- we don't have ne(4), replace it with re(4)
- fix markup
- bump date

Submitted by: ru
MFC after: 3 days

16 years agoRev. 1.8 broke matching on lines where the failure mode is at the head
mtm [Mon, 30 Jun 2008 08:01:47 +0000 (08:01 +0000)]
Rev. 1.8 broke matching on lines where the failure mode is at the head
of the message, such as:
  Jun 30 10:49:21 rogue sshd[17553]: Invalid user iceman from 127.0.0.1

PR: conf/124569
Submitted by: Taku <taku@tekipaki.jp>

16 years agoCorrect SB600 AC97 Audio PCI ID, otherwise we will attach to the
delphij [Mon, 30 Jun 2008 05:14:44 +0000 (05:14 +0000)]
Correct SB600 AC97 Audio PCI ID, otherwise we will attach to the
SBx00 PCI to PCI Bridge which causes problems.

16 years agoDocument the layout of the address space, borrowing heavily from
alc [Mon, 30 Jun 2008 03:14:39 +0000 (03:14 +0000)]
Document the layout of the address space, borrowing heavily from
http://lists.freebsd.org/pipermail/freebsd-amd64/2005-July/005578.html

16 years agoCompute NKPDPE from NKPT. This reduces the number of knobs that must be
alc [Mon, 30 Jun 2008 02:35:55 +0000 (02:35 +0000)]
Compute NKPDPE from NKPT.  This reduces the number of knobs that must be
turned in order to change the size of the kernel virtual address space.

16 years agoFix a bogon in the previous commit and add some missing error checks.
das [Sun, 29 Jun 2008 23:46:06 +0000 (23:46 +0000)]
Fix a bogon in the previous commit and add some missing error checks.

16 years agoCorrectly handle malloc() failure. While here, reduce the code size a
das [Sun, 29 Jun 2008 22:54:26 +0000 (22:54 +0000)]
Correctly handle malloc() failure.  While here, reduce the code size a
bit by removing some calls to the inline function addtype().

16 years agoFactor out the code that builds the argument table. We don't need separate
das [Sun, 29 Jun 2008 22:04:25 +0000 (22:04 +0000)]
Factor out the code that builds the argument table. We don't need separate
normal and wide character versions of it.

No functional change.

16 years agoReduce the level of duplication between vfprintf() and vfwprintf()
das [Sun, 29 Jun 2008 21:52:40 +0000 (21:52 +0000)]
Reduce the level of duplication between vfprintf() and vfwprintf()
by moving the positional argument handling code to a new file,
printf-pos.c, and moving common definitions to printflocal.h.
No functional change intended.

16 years agoAdd some regression tests for printf() with positional arguments.
das [Sun, 29 Jun 2008 21:03:14 +0000 (21:03 +0000)]
Add some regression tests for printf() with positional arguments.
The first test comes from OpenBSD, and the others are additions or
adaptations.

This is based on OpenBSD's
src/regress/lib/libc/sprintf/sprintf_test.c, v1.3.
I deliberately did not use v1.4 because it's bogus.

16 years agoBegin de-spaghettifying the code that handles positional arguments.
das [Sun, 29 Jun 2008 21:01:27 +0000 (21:01 +0000)]
Begin de-spaghettifying the code that handles positional arguments.
In particular, encapsulate the state of the type table in a struct,
and add inline functions to initialize, free, and manipulate that
state. This replaces some ugly macros that made proper error handling
impossible.

While here, remove an unneeded test for NULL and a variable that is
initialized (many times!) but never used. The compiler didn't catch
these because of rampant use of the same variable to mean different
things in different places.

This commit should not cause any changes in functionality.

16 years agoStrictly speaking, the definition of VM_MAX_KERNEL_ADDRESS is wrong. However,
alc [Sun, 29 Jun 2008 19:13:27 +0000 (19:13 +0000)]
Strictly speaking, the definition of VM_MAX_KERNEL_ADDRESS is wrong.  However,
in practice, the error (currently) makes no difference because the computation
performed by KVADDR() hides the error.  This revision fixes the error.

Also, eliminate a (now) unused definition.

16 years agoIncrease the size of the kernel virtual address space to 6GB. Until the
alc [Sun, 29 Jun 2008 18:35:00 +0000 (18:35 +0000)]
Increase the size of the kernel virtual address space to 6GB.  Until the
maximum size of the kmem map can be greater than 4GB, there is little point
in making the kernel virtual address space larger than 6GB.

Tested by: kris@

16 years agoRemove an unneeded error variable to make clear that if reaching
bz [Sun, 29 Jun 2008 18:26:07 +0000 (18:26 +0000)]
Remove an unneeded error variable to make clear that if reaching
the end of the function we never return an error.

16 years agoAdd a new priv 'PRIV_SCHED_CPUSET' to check if manipulating cpusets is
bz [Sun, 29 Jun 2008 17:58:16 +0000 (17:58 +0000)]
Add a new priv 'PRIV_SCHED_CPUSET' to check if manipulating cpusets is
allowed and replace the suser() call. Do not allow it in jails.

Reviewed by: rwatson

16 years agoMake it clearer that it is possible to disable the generation of
das [Sun, 29 Jun 2008 17:17:14 +0000 (17:17 +0000)]
Make it clearer that it is possible to disable the generation of
SIGPIPE for individual sockets (PR: kern/118626).

While here, s/insure/ensure/.

16 years agoAdd -m option to cron(8), overriding default mail recipient for cron mails,
marck [Sun, 29 Jun 2008 16:56:18 +0000 (16:56 +0000)]
Add -m option to cron(8), overriding default mail recipient for cron mails,
unless explicitly provided by MAILTO= line in crontab.  This feature can be
useful in massive hosting environment, where most users do not care about
autogenerated mails.

Setting recipient to null string disables default mails at all.

Approved by: yar
MFC after: 4 weeks

16 years agoRemove the unused softc from the lo(4) driver.
ed [Sun, 29 Jun 2008 13:17:01 +0000 (13:17 +0000)]
Remove the unused softc from the lo(4) driver.

Now that the pseudo-interface cloner has an internal list of instances,
there is no need to create a softc. The softc only contains a pointer to
the ifp, which means there is no valid reason to keep it. While there,
remove the corresponding malloc-pool.

Approved by: philip (mentor)

16 years agoDocument messages printed in verbose mode.
jkoshy [Sun, 29 Jun 2008 10:30:06 +0000 (10:30 +0000)]
Document messages printed in verbose mode.

Requested by: Fabien Thomas <fabien.thomas at netasq dot com>

16 years agoTry to fix errors introduced in svn180085/cvs rev. 1.10:
bz [Sun, 29 Jun 2008 07:34:21 +0000 (07:34 +0000)]
Try to fix errors introduced in svn180085/cvs rev. 1.10:

* Include ip6_var.h for ip6stat.
* Use the correct name under ip6stat: `ip6s_cantforward' instead
  of its IPv4 counterpart.

MFC after: 10 days

16 years agoRevice the way the CTF conversion is done per object. Avoid creating a second
jb [Sun, 29 Jun 2008 07:15:57 +0000 (07:15 +0000)]
Revice the way the CTF conversion is done per object. Avoid creating a second
shell (which was the problem with the original implementation) and avoid
letting make see an empty definition (which was the problem with the current
implementation).

16 years agoRepair botched variable rename.
kan [Sun, 29 Jun 2008 04:33:45 +0000 (04:33 +0000)]
Repair botched variable rename.

Pointy hat to: julian

16 years agoIt may be #if 0'd out code, but change a varname to not shadow a global.
julian [Sun, 29 Jun 2008 01:04:48 +0000 (01:04 +0000)]
It may be #if 0'd out code, but change a varname to not shadow a global.

16 years agoEnter the 1990s. Use real function declaration.
julian [Sun, 29 Jun 2008 00:49:50 +0000 (00:49 +0000)]
Enter the 1990s. Use real function declaration.

16 years agoOops, we've been incrementing the wrong cantforward variable.
julian [Sun, 29 Jun 2008 00:25:16 +0000 (00:25 +0000)]
Oops, we've been incrementing the wrong cantforward variable.

Obtained from: vimage tree

16 years agoRename two vars so that they are different from the same vars in ipv4.
julian [Sun, 29 Jun 2008 00:17:45 +0000 (00:17 +0000)]
Rename two vars so that they are different from the same vars in ipv4.
They are static so it was not a problem 'per se' but it was confusing to
the reader.

Obtained from: vimage tree

16 years agoWe should also save and restore the MXCSR as on amd64, but detecting
das [Sat, 28 Jun 2008 17:58:06 +0000 (17:58 +0000)]
We should also save and restore the MXCSR as on amd64, but detecting
whether the CPU supports SSE or not here is rather odious.

16 years agoTwo FP-related setjmp/longjmp changes:
das [Sat, 28 Jun 2008 17:55:43 +0000 (17:55 +0000)]
Two FP-related setjmp/longjmp changes:

1. Save and restore the control part of the MXCSR in addition to the
   i387 control word to ensure that the two are consistent.

   Note that standards don't require longjmp to restore either control
   word, and none of Linux, MacOS X 10.3 and earlier, NetBSD, OpenBSD,
   or Solaris do it. However, it is historical FreeBSD behavior, and
   bde points out that it is needed to make longjmping out of a signal
   handler work properly, given the way FreeBSD clobbers the FPU state
   on signal handler entry.

2. Don't clobber the FPU exception flags in longjmp. C99 requires them
   to remain unchanged.

16 years agoWhite space fixes.
obrien [Sat, 28 Jun 2008 15:28:17 +0000 (15:28 +0000)]
White space fixes.

16 years agoReduce diff to vendor.
obrien [Sat, 28 Jun 2008 15:17:02 +0000 (15:17 +0000)]
Reduce diff to vendor.

16 years agoRemove stray "miibus0" reference from ancient kernel config file times.
philip [Sat, 28 Jun 2008 13:38:53 +0000 (13:38 +0000)]
Remove stray "miibus0" reference from ancient kernel config file times.

MFC after: 1 day

16 years agoModify the DoParseCommand() to work on (const char *) instead of just
mtm [Sat, 28 Jun 2008 12:31:30 +0000 (12:31 +0000)]
Modify the DoParseCommand() to work on (const char *) instead of just
(char *). This is a slightly simplified version of the patch in the PR. It
fixes compilitation issues with -O3.

PR: misc/124385

16 years agoStyle fix (space into tab).
remko [Sat, 28 Jun 2008 08:36:47 +0000 (08:36 +0000)]
Style fix (space into tab).

Approved by: imp (mentor, implicit)

16 years agoFix a typo in the cosl() prototype.
das [Sat, 28 Jun 2008 01:43:24 +0000 (01:43 +0000)]
Fix a typo in the cosl() prototype.

16 years agoImprove r180011 by explicitly adding the condition codes to the
marius [Fri, 27 Jun 2008 22:17:14 +0000 (22:17 +0000)]
Improve r180011 by explicitly adding the condition codes to the
clobber list.

Suggested by: Christoph Mallon

16 years agoAdd explicit PCI IDs for the following Adaptec RAID Series 2 adapters:
emaste [Fri, 27 Jun 2008 19:34:47 +0000 (19:34 +0000)]
Add explicit PCI IDs for the following Adaptec RAID Series 2 adapters:

  Adaptec RAID 2045
  Adaptec RAID 2405
  Adaptec RAID 2445
  Adaptec RAID 2805

Without this change these devices are supported by the driver's family
support, but they then appear as "Adaptec RAID Controller" in boot
messages and the dev.aac.0.%desc sysctl.

16 years ago- markup fixes
danger [Fri, 27 Jun 2008 16:32:04 +0000 (16:32 +0000)]
- markup fixes
- advise to use rc script to SIGHUP mountd
- add information about possiblity of using /prefix network notation [1]

PR: docs/124373
Reviewed by: jhb
Obtained from: NetBSD [1]
MFC after: 3 days

16 years agoBackout r179941. The nfsclient knob always confuses me. I should have
mtm [Fri, 27 Jun 2008 15:45:17 +0000 (15:45 +0000)]
Backout r179941. The nfsclient knob always confuses me. I should have
double-checked my setup before commiting.

Noticed by: Florian Smeets
Pointy hat to: mtm

16 years agoFixing NO_INET6 build.
avatar [Fri, 27 Jun 2008 15:29:48 +0000 (15:29 +0000)]
Fixing NO_INET6 build.

16 years agoInstead of using .POSIX:, use the cool looking "@:" rule.
obrien [Fri, 27 Jun 2008 14:59:23 +0000 (14:59 +0000)]
Instead of using .POSIX:, use the cool looking "@:" rule.

Submitted by: ru

16 years agoNote that the .POSIX special target disables the "Remaking Makefiles" feature.
obrien [Fri, 27 Jun 2008 14:35:33 +0000 (14:35 +0000)]
Note that the .POSIX special target disables the "Remaking Makefiles" feature.

16 years agoInclude <sys/pcpu.h> for curthread.
dfr [Fri, 27 Jun 2008 14:35:05 +0000 (14:35 +0000)]
Include <sys/pcpu.h> for curthread.

16 years agoAdd the missing support for Asus Eee PC in acpi_asus(4).
rpaulo [Fri, 27 Jun 2008 12:04:36 +0000 (12:04 +0000)]
Add the missing support for Asus Eee PC in acpi_asus(4).
This includes hotkeys support and sysctl variables to control camera
and card reader. These new sysctls don't have CTFLAG_ANYBODY set.

While there add entries to devd.conf related to the Eee volume keys.

Reviewed by: phillip
MFC after: 1 week
Also tested by: lme (previous version)

16 years agoAdd USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
luigi [Fri, 27 Jun 2008 10:30:08 +0000 (10:30 +0000)]
Add USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
card reader. Tested operation of the scanner part with Sane,
card and printer correctly recognised as /dev/da0 and /dev/ulpt0

MFC after: 3 days

16 years agoSupport for filtering on major device number was removed in rev. 1.7 or
mtm [Fri, 27 Jun 2008 09:09:50 +0000 (09:09 +0000)]
Support for filtering on major device number was removed in rev. 1.7 or
rule.c. Update man page example accordingly.

Submitted by: Mateusz Guzik <mjguzik@gmail.com>
PR: docs/124892

16 years agoRework the lifetime management of the kernel implementation of POSIX
jhb [Fri, 27 Jun 2008 05:39:04 +0000 (05:39 +0000)]
Rework the lifetime management of the kernel implementation of POSIX
semaphores.  Specifically, semaphores are now represented as new file
descriptor type that is set to close on exec.  This removes the need for
all of the manual process reference counting (and fork, exec, and exit
event handlers) as the normal file descriptor operations handle all of
that for us nicely.  It is also suggested as one possible implementation
in the spec and at least one other OS (OS X) uses this approach.

Some bugs that were fixed as a result include:
- References to a named semaphore whose name is removed still work after
  the sem_unlink() operation.  Prior to this patch, if a semaphore's name
  was removed, valid handles from sem_open() would get EINVAL errors from
  sem_getvalue(), sem_post(), etc.  This fixes that.
- Unnamed semaphores created with sem_init() were not cleaned up when a
  process exited or exec'd.  They were only cleaned up if the process
  did an explicit sem_destroy().  This could result in a leak of semaphore
  objects that could never be cleaned up.
- On the other hand, if another process guessed the id (kernel pointer to
  'struct ksem' of an unnamed semaphore (created via sem_init)) and had
  write access to the semaphore based on UID/GID checks, then that other
  process could manipulate the semaphore via sem_destroy(), sem_post(),
  sem_wait(), etc.
- As part of the permission check (UID/GID), the umask of the proces
  creating the semaphore was not honored.  Thus if your umask denied group
  read/write access but the explicit mode in the sem_init() call allowed
  it, the semaphore would be readable/writable by other users in the
  same group, for example.  This includes access via the previous bug.
- If the module refused to unload because there were active semaphores,
  then it might have deregistered one or more of the semaphore system
  calls before it noticed that there was a problem.  I'm not sure if
  this actually happened as the order that modules are discovered by the
  kernel linker depends on how the actual .ko file is linked.  One can
  make the order deterministic by using a single module with a mod_event
  handler that explicitly registers syscalls (and deregisters during
  unload after any checks).  This also fixes a race where even if the
  sem_module unloaded first it would have destroyed locks that the
  syscalls might be trying to access if they are still executing when
  they are unloaded.

  XXX: By the way, deregistering system calls doesn't do any blocking
  to drain any threads from the calls.
- Some minor fixes to errno values on error.  For example, sem_init()
  isn't documented to return ENFILE or EMFILE if we run out of semaphores
  the way that sem_open() can.  Instead, it should return ENOSPC in that
  case.

Other changes:
- Kernel semaphores now use a hash table to manage the namespace of
  named semaphores nearly in a similar fashion to the POSIX shared memory
  object file descriptors.  Kernel semaphores can now also have names
  longer than 14 chars (up to MAXPATHLEN) and can include subdirectories
  in their pathname.
- The UID/GID permission checks for access to a named semaphore are now
  done via vaccess() rather than a home-rolled set of checks.
- Now that kernel semaphores have an associated file object, the various
  MAC checks for POSIX semaphores accept both a file credential and an
  active credential.  There is also a new posixsem_check_stat() since it
  is possible to fstat() a semaphore file descriptor.
- A small set of regression tests (using the ksem API directly) is present
  in src/tools/regression/posixsem.

Reported by: kris (1)
Tested by: kris
Reviewed by: rwatson (lightly)
MFC after: 1 month

16 years agoIntroduce locking around use of ifindex_table, whose use was previously
rwatson [Thu, 26 Jun 2008 23:05:28 +0000 (23:05 +0000)]
Introduce locking around use of ifindex_table, whose use was previously
unsynchronized.  While races were extremely rare, we've now had a
couple of reports of panics in environments involving large numbers of
IPSEC tunnels being added very quickly on an active system.

- Add accessor functions ifnet_byindex(), ifaddr_byindex(),
  ifdev_byindex() to replace existing accessor macros.  These functions
  now acquire the ifnet lock before derefencing the table.
- Add IFNET_WLOCK_ASSERT().
- Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
  which set values in the table either asserting of acquiring the ifnet
  lock.
- Use accessor functions throughout if.c to modify and read
  ifindex_table.
- Rework ifnet attach/detach to lock around ifindex_table modification.

Note that these changes simply close races around use of ifindex_table,
and make no attempt to solve the probem of disappearing ifnets.  Further
refinement of this work, including with respect to ifindex_table
resizing, is still required.

In a future change, the ifnet lock should be converted from a mutex to an
rwlock in order to reduce contention.

Reviewed and tested by: brooks

16 years agochange a variable name ot stop it from colliding with other names in
julian [Thu, 26 Jun 2008 22:59:49 +0000 (22:59 +0000)]
change a variable name ot stop it from colliding with other names in
some situations. (i.e. in vimage)

MFC after: 1 week

16 years agoSomeone cut and pasted a bunch of stuff here so lots of
julian [Thu, 26 Jun 2008 22:45:04 +0000 (22:45 +0000)]
Someone cut and pasted a bunch of stuff here so lots of
indents were spaces when they should have been tabs,
screwing up diffs and patches..

Whitespace commit as my first SVN commit. (yay)

MFC after: 1 week

16 years agoTweak the output of event log messages from the controller:
jhb [Thu, 26 Jun 2008 22:36:38 +0000 (22:36 +0000)]
Tweak the output of event log messages from the controller:
- Each log entry contains a text description in the "description" field of
  the entry.  The existing decode logic always ended up duplicating
  information that was already in the description string.  This made the
  logs overly verbose.  Now we just print out the description string.
- Add some simple parsing of the timestamp and event classes.

Reviewed by: ambrisko, scottl
MFC after: 2 weeks

16 years agoAdjust the handling of pending log events during boot:
jhb [Thu, 26 Jun 2008 22:33:24 +0000 (22:33 +0000)]
Adjust the handling of pending log events during boot:
- Fetch events from the controller in batches of 15 rather than a single
  event at a time.
- When fetching events from the controller, honor the event class and
  locale settings (via hw.mfi tunables).  This also allows the firmware to
  skip over unwanted log entries resulting in fewer requests to the
  controller if there many unwanted log entries since the last clean
  shutdown.
- Don't drop the driver mutex while decoding an event.
- If we get an error other than MFI_STAT_NOT_FOUND (basically EOF for
  hitting the end of the event log) then emit a warning and bail on
  processing further log entries.

Reviewed by: ambrisko, scottl
MFC after: 2 weeks

16 years agoFix compile on 64-bit platforms.
jhb [Thu, 26 Jun 2008 21:26:34 +0000 (21:26 +0000)]
Fix compile on 64-bit platforms.

16 years agoRemove the non-existent rt2860 subdir. Note, the ralfw module is not used in
thompsa [Thu, 26 Jun 2008 18:58:01 +0000 (18:58 +0000)]
Remove the non-existent rt2860 subdir. Note, the ralfw module is not used in
the build yet.

PR: kern/125015
Submitted by: Dan Cojocar

16 years agoAs reported by Alexey Shuvaev, -dumpl overwrote files after
kientzle [Thu, 26 Jun 2008 15:46:01 +0000 (15:46 +0000)]
As reported by Alexey Shuvaev, -dumpl overwrote files after
linking them, with predictably bad results.

16 years agoChange SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
jhb [Thu, 26 Jun 2008 13:51:25 +0000 (13:51 +0000)]
Change SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
to INT_MAX.  Otherwise, a process could create a semaphore (or increase
its value via ksem_post()) beyond INT_MAX and sem_getvalue() would return
a negative value.  sem_getvalue() is only supposed to return a negative
value if that is the number of waiters for that semaphore.

MFC after: 2 weeks

16 years agoAdd missing counter increments for posix shm checks.
jhb [Thu, 26 Jun 2008 13:49:32 +0000 (13:49 +0000)]
Add missing counter increments for posix shm checks.

16 years ago- add description of the MLINK error
danger [Thu, 26 Jun 2008 12:15:38 +0000 (12:15 +0000)]
- add description of the MLINK error

PR: docs/123019
MFC after: 3 days

16 years agoSome tests won't build at WARNS level 6 due to aliasing violations.
des [Thu, 26 Jun 2008 11:58:26 +0000 (11:58 +0000)]
Some tests won't build at WARNS level 6 due to aliasing violations.
Add missing -I. so the tests will build when ${.OBJDIR} != ${.CURDIR}.
${.OBJDIR} does not need to be spelled out.

16 years agoAdd regression test for CRC32 check. The test file has been modified to
des [Thu, 26 Jun 2008 11:50:11 +0000 (11:50 +0000)]
Add regression test for CRC32 check.  The test file has been modified to
include an invalid checksum for file2.

Approved by: kientzle

16 years agoImplement CRC32 verification. Note that you have to read until EOF to
des [Thu, 26 Jun 2008 11:48:19 +0000 (11:48 +0000)]
Implement CRC32 verification.  Note that you have to read until EOF to
trigger the check.

Requested by: ache
Approved by: kientzle

16 years agoAllow the tests to build without libdmalloc.
des [Thu, 26 Jun 2008 10:53:05 +0000 (10:53 +0000)]
Allow the tests to build without libdmalloc.

16 years agoRe-implement the client side of rpc.lockd in the kernel. This implementation
dfr [Thu, 26 Jun 2008 10:21:54 +0000 (10:21 +0000)]
Re-implement the client side of rpc.lockd in the kernel. This implementation
provides the correct semantics for flock(2) style locks which are used by the
lockf(1) command line tool and the pidfile(3) library. It also implements
recovery from server restarts and ensures that dirty cache blocks are written
to the server before obtaining locks (allowing multiple clients to use file
locking to safely share data).

Sponsored by: Isilon Systems
PR: 94256
MFC after: 2 weeks

16 years agoMark the section describing return values with an appropriate section flag.
danger [Thu, 26 Jun 2008 08:24:59 +0000 (08:24 +0000)]
Mark the section describing return values with an appropriate section flag.

PR: docs/122818
MFC after: 3 days

16 years agoFix a fallout from SSP commit, and make this compile again.
ru [Thu, 26 Jun 2008 07:56:16 +0000 (07:56 +0000)]
Fix a fallout from SSP commit, and make this compile again.
Bonus: including kern.mk just to pick kernel warning flags
was an extremely bad idea anyway, because it also picked
up CFLAGS (it probably wasn't the case at the time of CVS
rev. 1.1, I haven't checked).  Remove duplicate CWARNFLAGS
from CFLAGS.

16 years agoFix a chicken-and-egg problem: this files implements SSP support,
ru [Thu, 26 Jun 2008 07:52:45 +0000 (07:52 +0000)]
Fix a chicken-and-egg problem: this files implements SSP support,
so we cannot compile it with -fstack-protector[-all] flags (or
it will self-recurse); this is ensured in sys/conf/files.  This
OTOH means that checking for defines __SSP__ and __SSP_ALL__ to
determine if we should be compiling the support is impossible
(which it was trying, resulting in an empty object file).  Fix
this by always compiling the symbols in this files.  It's good
because it allows us to always have SSP support, and then compile
with SSP selectively.

Repoted by: tinderbox

16 years agoGcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
mtm [Thu, 26 Jun 2008 07:12:35 +0000 (07:12 +0000)]
Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
and return (const Char *) pointers instead of just (Char *) and get rid of
all the type casting.

PR: kern/124334

16 years agoThe signature for a pthread function requires that it
mtm [Thu, 26 Jun 2008 07:05:35 +0000 (07:05 +0000)]
The signature for a pthread function requires that it
return a pointer to a void. The send_thread() and disk_thread()
funtions; however, do not have a return value because they run for
the duration of the daemon's lifetime. This causes gcc to barf when
running with -O3. Make these functions return a null pointer to quiet it.

PR: bin/124342
Submitted by: Garrett Cooper <gcooper@FreeBSD.org> (minus his comments)
MFC after: 1 week

16 years agoFix 6-year old cut&paste error. The # could be escaped with '\', not
sobomax [Thu, 26 Jun 2008 07:02:47 +0000 (07:02 +0000)]
Fix 6-year old cut&paste error. The # could be escaped with '\', not
with '\\'.

MFC after: 2 weeks

16 years agoSplit out the reference zip file for ease of maintenance.
kientzle [Thu, 26 Jun 2008 04:48:42 +0000 (04:48 +0000)]
Split out the reference zip file for ease of maintenance.

16 years agoRegen properly.
ru [Wed, 25 Jun 2008 21:42:23 +0000 (21:42 +0000)]
Regen properly.

16 years agoRegen.
ru [Wed, 25 Jun 2008 21:36:25 +0000 (21:36 +0000)]
Regen.

16 years agoEnable GCC stack protection (aka Propolice) for userland:
ru [Wed, 25 Jun 2008 21:33:28 +0000 (21:33 +0000)]
Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>

16 years agoUse "__asm __volatile" rather than "__asm" for instruction sequences
marius [Wed, 25 Jun 2008 21:04:59 +0000 (21:04 +0000)]
Use "__asm __volatile" rather than "__asm" for instruction sequences
that modify condition codes (the carry bit, in this case). Without
"__volatile", the compiler might add the inline assembler instructions
between unrelated code which also uses condition codes, modifying the
latter.
This prevents the TCP pseudo header checksum calculation done in
tcp_output() from having effects on other conditions when compiled
with GCC 4.2.1 at "-O2" and "options INET6" left out. [1]

Reported & tested by: Boris Kochergin [1]
MFC after: 3 days

16 years agoGiven that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
marius [Wed, 25 Jun 2008 21:03:26 +0000 (21:03 +0000)]
Given that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
<machine/in_cksum.h> here also.

MFC after: 3 days

16 years agosrc/compat/ is gone back in March.
ru [Wed, 25 Jun 2008 20:29:22 +0000 (20:29 +0000)]
src/compat/ is gone back in March.

Reported by: Mars G Miro

16 years agoDocument spindown constraints as given in the original commit
bz [Wed, 25 Jun 2008 18:11:22 +0000 (18:11 +0000)]
Document spindown constraints as given in the original commit
message[1] and later clarification provided by phk.

[1] http://docs.freebsd.org/cgi/mid.cgi?200803171033.m2HAXOeN055116

Reviewed by: brueffer, phk, ed

16 years agoRemove the unused M_MEMDEV from the kernel.
ed [Wed, 25 Jun 2008 07:52:10 +0000 (07:52 +0000)]
Remove the unused M_MEMDEV from the kernel.

The M_MEMDEV memory allocation pool does not seem to be used. We can
live without it.

Approved by: philip (mentor)

16 years agoRemove the unused major/minor numbers from iodev and memdev.
ed [Wed, 25 Jun 2008 07:45:31 +0000 (07:45 +0000)]
Remove the unused major/minor numbers from iodev and memdev.

Now that st_rdev is being automatically generated by the kernel, there
is no need to define static major/minor numbers for the iodev and
memdev. We still need the minor numbers for the memdev, however, to
distinguish between /dev/mem and /dev/kmem.

Approved by: philip (mentor)

16 years agoFix links to online gcc docs.
ale [Wed, 25 Jun 2008 06:07:03 +0000 (06:07 +0000)]
Fix links to online gcc docs.

Reported by: Andre Guibert de Bruet <andy@siliconlandmark.com>
MFC after: 1 day

16 years agoPass the entry down into the core write loop, so we
kientzle [Wed, 25 Jun 2008 05:01:02 +0000 (05:01 +0000)]
Pass the entry down into the core write loop, so we
can include the filename when reporting errors.

Thanks to: Dan Nelson