]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agogeneral LOCK_PROFILING cleanup
kmacy [Mon, 26 Feb 2007 08:26:44 +0000 (08:26 +0000)]
general LOCK_PROFILING cleanup

- only collect timestamps when a lock is contested - this reduces the overhead
  of collecting profiles from 20x to 5x

- remove unused function from subr_lock.c

- generalize cnt_hold and cnt_lock statistics to be kept for all locks

- NOTE: rwlock profiling generates invalid statistics (and most likely always has)
  someone familiar with that should review

17 years agoUpdate the dump program to save extended attributes. Update
mckusick [Mon, 26 Feb 2007 08:15:56 +0000 (08:15 +0000)]
Update the dump program to save extended attributes. Update
the restore program to restore all dumped extended attributes.

If the restore is running as root, it will always be able
to restore all extended attributes. If it is not running
as root, it makes a best effort to set them. Using the -v
command line flag or the `verbose' command in interactive
mode will display all the extended attributes being set on
files (and at the end on directories) that are being restored.
It will note any extended attributes that could not be set.

The extended attributes are placed on the dump image immediately
following each file's data. Older versions of restore can work
with the newer dump images. Old versions of restore will
correctly restore the file data and then (silently) skip
over the extended attribute data and proceed to the next file.

This resolves PR 93085 which will be closed once the code
has been MFC'ed.

Note that this code will not compile until these header
files have been updated: <protocols/dumprestore.h> and
<sys/extattr.h>.

PR: bin/93085
Comments from: Poul-Henning Kamp and Robert Watson
MFC after: 3 weeks

17 years agoDeclare a `struct extattr' that defines the format of an extended
mckusick [Mon, 26 Feb 2007 06:18:53 +0000 (06:18 +0000)]
Declare a `struct extattr' that defines the format of an extended
attribute. Also define some macros to manipulate one of these
structures. Explain their use in the extattr.9 manual page.

The next step will be to make a sweep through the kernel replacing
the old pointer manipulation code. To get an idea of how they would
be used, the ffs_findextattr() function in ufs/ffs/ffs_vnops.c is
currently written as follows:

/*
 * Vnode operating to retrieve a named extended attribute.
 *
 * Locate a particular EA (nspace:name) in the area (ptr:length), and return
 * the length of the EA, and possibly the pointer to the entry and to the data.
 */
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
    u_char **eap, u_char **eac)
{
u_char *p, *pe, *pn, *p0;
int eapad1, eapad2, ealength, ealen, nlen;
uint32_t ul;

pe = ptr + length;
nlen = strlen(name);

for (p = ptr; p < pe; p = pn) {
p0 = p;
bcopy(p, &ul, sizeof(ul));
pn = p + ul;
/* make sure this entry is complete */
if (pn > pe)
break;
p += sizeof(uint32_t);
if (*p != nspace)
continue;
p++;
eapad2 = *p++;
if (*p != nlen)
continue;
p++;
if (bcmp(p, name, nlen))
continue;
ealength = sizeof(uint32_t) + 3 + nlen;
eapad1 = 8 - (ealength % 8);
if (eapad1 == 8)
eapad1 = 0;
ealength += eapad1;
ealen = ul - ealength - eapad2;
p += nlen + eapad1;
if (eap != NULL)
*eap = p0;
if (eac != NULL)
*eac = p;
return (ealen);
}
return(-1);
}

After applying the structure and macros, it would look like this:

/*
 * Vnode operating to retrieve a named extended attribute.
 *
 * Locate a particular EA (nspace:name) in the area (ptr:length), and return
 * the length of the EA, and possibly the pointer to the entry and to the data.
 */
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
    u_char **eapp, u_char **eac)
{
struct extattr *eap, *eaend;

eaend = (struct extattr *)(ptr + length);
for (eap = (struct extattr *)ptr; eap < eaend; eap = EXTATTR_NEXT(eap)){
/* make sure this entry is complete */
if (EXTATTR_NEXT(eap) > eaend)
break;
if (eap->ea_namespace != nspace ||
    eap->ea_namelength != length ||
    bcmp(eap->ea_name, name, length))
continue;
if (eapp != NULL)
*eapp = eap;
if (eac != NULL)
*eac = EXTATTR_CONTENT(eap);
return (EXTATTR_CONTENT_SIZE(eap));
}
return(-1);
}

Not only is it considerably shorter, but it hopefully more readable :-)

17 years agoRemove unused header file <machine/katelib.h>
kevlo [Mon, 26 Feb 2007 05:17:47 +0000 (05:17 +0000)]
Remove unused header file <machine/katelib.h>

17 years agomii_phy_dev_probe returns its third argument on match, not 0, so pass 0
imp [Mon, 26 Feb 2007 04:48:24 +0000 (04:48 +0000)]
mii_phy_dev_probe returns its third argument on match, not 0, so pass 0
in if we're going to test against 0.

Noticed by: marius@

17 years agoClose race conditions between fork() and [sg]etpriority()'s
delphij [Mon, 26 Feb 2007 03:38:09 +0000 (03:38 +0000)]
Close race conditions between fork() and [sg]etpriority()'s
PRIO_USER case, possibly also other places that deferences
p_ucred.

In the past, we insert a new process into the allproc list right
after PID allocation, and release the allproc_lock sx.  Because
most content in new proc's structure is not yet initialized,
this could lead to undefined result if we do not handle PRS_NEW
with care.

The problem with PRS_NEW state is that it does not provide fine
grained information about how much initialization is done for a
new process.  By defination, after PRIO_USER setpriority(), all
processes that belongs to given user should have their nice value
set to the specified value.  Therefore, if p_{start,end}copy
section was done for a PRS_NEW process, we can not safely ignore
it because p_nice is in this area.  On the other hand, we should
be careful on PRS_NEW processes because we do not allow non-root
users to lower their nice values, and without a successful copy
of the copy section, we can get stale values that is inherted
from the uninitialized area of the process structure.

This commit tries to close the race condition by grabbing proc
mutex *before* we release allproc_lock xlock, and do copy as
well as zero immediately after the allproc_lock xunlock.  This
guarantees that the new process would have its p_copy and p_zero
sections, as well as user credential informaion initialized.  In
getpriority() case, instead of grabbing PROC_LOCK for a PRS_NEW
process, we just skip the process in question, because it does
not affect the final result of the call, as the p_nice value
would be copied from its parent, and we will see it during
allproc traverse.

Other potential solutions are still under evaluation.

Discussed with: davidxu, jhb, rwatson
PR: kern/108071
MFC after: 2 weeks

17 years agoMove _posix1e_acl_name_to_id out of acl_support.c and into
kientzle [Mon, 26 Feb 2007 02:07:02 +0000 (02:07 +0000)]
Move _posix1e_acl_name_to_id out of acl_support.c and into
acl_from_text.c.  Since acl_from_text.c is the only place it
is used, we can now make this internal utility function "static."

As a bonus, acl_set_fd() no longer pulls in getpwuid() for no reason.

MFC after: 7 days

17 years agoDefine FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot a
cognet [Mon, 26 Feb 2007 02:04:24 +0000 (02:04 +0000)]
Define FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot a
kernel from the onboard flash.

17 years agoErm we can't change the value of arm_memcpy if we're running from flash.
cognet [Mon, 26 Feb 2007 02:03:48 +0000 (02:03 +0000)]
Erm we can't change the value of arm_memcpy if we're running from flash.
Instead, make memcpy() check if we're running from flash, and avoid
using arm_memcpy if we're doing so.

17 years agoImplement the -h flag (set an ACL on a symbolic link).
mckusick [Mon, 26 Feb 2007 00:42:17 +0000 (00:42 +0000)]
Implement the -h flag (set an ACL on a symbolic link).
Before this fix the -h flag was ignored (i.e. setfacl
always set the ACL on the file pointed to by the symbolic
link even when the -h flag requested that the ACL be set
on the symbolic link itself).

17 years agoUpdate for the new prototype of bus_setup_intr().
cognet [Sun, 25 Feb 2007 22:17:54 +0000 (22:17 +0000)]
Update for the new prototype of bus_setup_intr().

17 years agoDon't assert() the TLS allocation requested is big enough; just
kientzle [Sun, 25 Feb 2007 21:23:50 +0000 (21:23 +0000)]
Don't assert() the TLS allocation requested is big enough; just
fix the argument.

In particular, this is a step towards breaking crt1's dependence on stdio.

17 years agoMark the vm_page_unmanage(9) manpage as obsolete.
ru [Sun, 25 Feb 2007 17:34:16 +0000 (17:34 +0000)]
Mark the vm_page_unmanage(9) manpage as obsolete.

Reminded by: maxim

17 years agoCatch up with bus_setup_intr() modification and garbage collect a
piso [Sun, 25 Feb 2007 15:04:08 +0000 (15:04 +0000)]
Catch up with bus_setup_intr() modification and garbage collect a
reference to INTR_FAST.

17 years agoCatch up with bus_setup_intr() modification and garbage collect two
piso [Sun, 25 Feb 2007 15:02:03 +0000 (15:02 +0000)]
Catch up with bus_setup_intr() modification and garbage collect two
references to INTR_FAST.

17 years agoGarbage collect a reference to INTR_FAST.
piso [Sun, 25 Feb 2007 14:53:55 +0000 (14:53 +0000)]
Garbage collect a reference to INTR_FAST.

17 years agoFix attach of at91_pio() after bus_setup_intr() modification.
piso [Sun, 25 Feb 2007 14:34:59 +0000 (14:34 +0000)]
Fix attach of at91_pio() after bus_setup_intr() modification.

Reported and tested by: Krassimir Slavchev

17 years agoUpdate multicast(4) manual page to reflect the new reality of the code.
bms [Sun, 25 Feb 2007 14:31:41 +0000 (14:31 +0000)]
Update multicast(4) manual page to reflect the new reality of the code.

17 years agoUnlock a mutex which should be unlocked before returning.
bms [Sun, 25 Feb 2007 14:22:03 +0000 (14:22 +0000)]
Unlock a mutex which should be unlocked before returning.

MFC after: 1 week

17 years agosemi-automatic style(9)
netchild [Sun, 25 Feb 2007 13:51:52 +0000 (13:51 +0000)]
semi-automatic style(9)

17 years agoMFp4 (110541):
netchild [Sun, 25 Feb 2007 12:43:07 +0000 (12:43 +0000)]
MFp4 (110541):
Sync with rev 1.7 in NetBSD.

Obtained from: NetBSD

17 years agoMFp4 (110523, parts which apply cleanly):
netchild [Sun, 25 Feb 2007 12:40:35 +0000 (12:40 +0000)]
MFp4 (110523, parts which apply cleanly):
semi-automatic style(9)

The futex stuff already differs a lot (only a small part does not differ)
from NetBSD, so we are already way off and can't apply changes from NetBSD
automatically. As we need to merge everything by hand already, we can even
make the files comply to our world order.

17 years agoUse uma_set_align().
marius [Sun, 25 Feb 2007 10:52:47 +0000 (10:52 +0000)]
Use uma_set_align().

17 years agoRemove the traces of vm_page_unmanage().
ru [Sun, 25 Feb 2007 06:51:11 +0000 (06:51 +0000)]
Remove the traces of vm_page_unmanage().

17 years agoFix ALC883 microphone / recording issues. Setting high(er) VRef on
ariff [Sun, 25 Feb 2007 06:17:56 +0000 (06:17 +0000)]
Fix ALC883 microphone / recording issues. Setting high(er) VRef on
(external) microphone pin tend to screw it. Internal microphone (found
on several laptops) still need high VRef.

Tested by: Pietro Cerutti <pietro.cerutti@gmail.com>
           lenix <irc.freenode.net>

17 years agoChange the way that unmanaged pages are created. Specifically,
alc [Sun, 25 Feb 2007 06:14:58 +0000 (06:14 +0000)]
Change the way that unmanaged pages are created.  Specifically,
immediately flag any page that is allocated to a OBJT_PHYS object as
unmanaged in vm_page_alloc() rather than waiting for a later call to
vm_page_unmanage().  This allows for the elimination of some uses of
the page queues lock.

Change the type of the kernel and kmem objects from OBJT_DEFAULT to
OBJT_PHYS.  This allows us to take advantage of the above change to
simplify the allocation of unmanaged pages in kmem_alloc() and
kmem_malloc().

Remove vm_page_unmanage().  It is no longer used.

17 years agoAdd a regression test for ethernet link-layer multicast memberships.
bms [Sun, 25 Feb 2007 01:58:02 +0000 (01:58 +0000)]
Add a regression test for ethernet link-layer multicast memberships.

17 years agoAdd support for selecting from multiple tuners.
grog [Sun, 25 Feb 2007 01:28:37 +0000 (01:28 +0000)]
Add support for selecting from multiple tuners.

Suggested by: usleepless <usleepless@gmail.com>

17 years agoTidy up forrmat. No functional changes.
grog [Sun, 25 Feb 2007 01:08:17 +0000 (01:08 +0000)]
Tidy up forrmat.  No functional changes.

17 years agoFurther style(9) for ipx_ip.
rwatson [Sun, 25 Feb 2007 00:17:56 +0000 (00:17 +0000)]
Further style(9) for ipx_ip.

17 years agoImprove ipx_ip.c's approximation of style(9).
rwatson [Sun, 25 Feb 2007 00:10:59 +0000 (00:10 +0000)]
Improve ipx_ip.c's approximation of style(9).

17 years agouse getifaddrs from libc instead of private code
sam [Sat, 24 Feb 2007 23:55:46 +0000 (23:55 +0000)]
use getifaddrs from libc instead of private code

Reviewed by: bms
MFC after: 1 month

17 years agodon't call ath_reset when processing sysctl's before the device
sam [Sat, 24 Feb 2007 23:23:29 +0000 (23:23 +0000)]
don't call ath_reset when processing sysctl's before the device
is marked running; we don't have all the needed state in place

Noticed by: Hugo Silva <hugo@barafranca.com>
MFC after: 1 week

17 years agoset the antenna switch when fixing the tx antenna using the
sam [Sat, 24 Feb 2007 23:12:58 +0000 (23:12 +0000)]
set the antenna switch when fixing the tx antenna using the
dev.ath.X.txantenna sysctl; this is typically what folks
want but beware this has the side effect of disabling rx
diversity

MFC after: 2 weeks

17 years ago- Use a permanent URL to reference piso's mail.
simon [Sat, 24 Feb 2007 21:59:18 +0000 (21:59 +0000)]
- Use a permanent URL to reference piso's mail.
- Put URL on seperate line to not get very long lines.

17 years agoUse sysctl(2), not kvm(3), to read IPv6 multicast information from
bms [Sat, 24 Feb 2007 21:58:30 +0000 (21:58 +0000)]
Use sysctl(2), not kvm(3), to read IPv6 multicast information from
the running system.
Use the name 'IPv6 Forwarding Table', not 'IPv6 Routing Table', to be
consistent with what the code actually does and is.

17 years agoUse the names 'IPv4' and 'Forwarding Table' in program output, not
bms [Sat, 24 Feb 2007 21:56:52 +0000 (21:56 +0000)]
Use the names 'IPv4' and 'Forwarding Table' in program output, not
'Routing Table', to be consistent with what the code actually does and is.

17 years agoAdd comments about where netstat is using KVM to read things which
bms [Sat, 24 Feb 2007 21:42:21 +0000 (21:42 +0000)]
Add comments about where netstat is using KVM to read things which
should really be available via sysctl for a running system.

17 years agoReword addition about MROUTING.
bms [Sat, 24 Feb 2007 21:21:53 +0000 (21:21 +0000)]
Reword addition about MROUTING.

Submitted by: ru

17 years agoFix tinderbox. ip6_mrouter should be defined in raw_ip6.c as it is
bms [Sat, 24 Feb 2007 21:09:35 +0000 (21:09 +0000)]
Fix tinderbox. ip6_mrouter should be defined in raw_ip6.c as it is
tested to determine if the userland socket is open; this, in turn, is
used to determine if the module has been loaded.

Tested with: LINT

17 years agoUpdate my previous note about newbus API breakage mentioning the
piso [Sat, 24 Feb 2007 20:15:04 +0000 (20:15 +0000)]
Update my previous note about newbus API breakage mentioning the
__FreeBSD_version bump.

17 years agoNote newbus API & ABI breakage.
piso [Sat, 24 Feb 2007 19:45:09 +0000 (19:45 +0000)]
Note newbus API & ABI breakage.

17 years agoUpdated ia64 isa support with the new bus_setup_intr() syntax.
piso [Sat, 24 Feb 2007 16:56:22 +0000 (16:56 +0000)]
Updated ia64 isa support with the new bus_setup_intr() syntax.

Approved by: re (implicit?)

17 years agoPartial MFp4 of 114977:
netchild [Sat, 24 Feb 2007 16:49:25 +0000 (16:49 +0000)]
Partial MFp4 of 114977:
Whitespace commit: Fix grammar, spelling and punctuation.

Submitted by: "Scot Hetzel" <swhetzel@gmail.com>

17 years agoexca->pccarddev should always be non-null now. Only call it when the
imp [Sat, 24 Feb 2007 15:56:06 +0000 (15:56 +0000)]
exca->pccarddev should always be non-null now.  Only call it when the
device is actually attached.

17 years agoConvert sis(4) to use its own watchdog procedure.
delphij [Sat, 24 Feb 2007 14:27:36 +0000 (14:27 +0000)]
Convert sis(4) to use its own watchdog procedure.

Submitted by: Florian C. Smeets <flo kasimir com>

17 years agoNote that IPv6 multicast forwarding is now dynamically loadable.
bms [Sat, 24 Feb 2007 11:41:05 +0000 (11:41 +0000)]
Note that IPv6 multicast forwarding is now dynamically loadable.

17 years agoMake IPv6 multicast forwarding dynamically loadable from a GENERIC kernel.
bms [Sat, 24 Feb 2007 11:38:47 +0000 (11:38 +0000)]
Make IPv6 multicast forwarding dynamically loadable from a GENERIC kernel.
It is built in the same module as IPv4 multicast forwarding, i.e. ip_mroute.ko,
if and only if IPv6 support is enabled for loadable modules.
Export IPv6 forwarding structs to userland netstat(1) via sysctl(9).

17 years agoo break newbus api: add a new argument of type driver_filter_t to
piso [Sat, 24 Feb 2007 02:28:07 +0000 (02:28 +0000)]
o break newbus api: add a new argument of type driver_filter_t to
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Approved by: re (implicit?)

17 years agoRedo previous newbus related change to be kinder to
mjacob [Fri, 23 Feb 2007 23:13:46 +0000 (23:13 +0000)]
Redo previous newbus related change to be kinder to
multi-release support.

17 years agoUse tsleep() rather than msleep() with a NULL mtx parameter.
jhb [Fri, 23 Feb 2007 23:06:10 +0000 (23:06 +0000)]
Use tsleep() rather than msleep() with a NULL mtx parameter.

17 years agoWhitespace fix.
jhb [Fri, 23 Feb 2007 23:05:31 +0000 (23:05 +0000)]
Whitespace fix.

17 years agoFix a case in rman_manage_region() where the resource list would get missorted.
scottl [Fri, 23 Feb 2007 22:53:56 +0000 (22:53 +0000)]
Fix a case in rman_manage_region() where the resource list would get missorted.
This would in turn confuse rman_reserve_resource().  This was only seen for
MSI resources that can get allocated and deallocated after boot.

17 years agoMFp4 (114193 (i386 part), 114194, 114195, 114200):
netchild [Fri, 23 Feb 2007 22:39:26 +0000 (22:39 +0000)]
MFp4 (114193 (i386 part), 114194, 114195, 114200):
 - Dont "return" in linux_clone() after we forked the new process in a case
   of problems.
 - Move the copyout of p2->p_pid outside the emul_lock coverage in
   linux_clone().
 - Cache the em->pdeath_signal in a local variable and move the copyout
   out of the emul_lock coverage.
 - Move the free() out of the emul_shared_lock coverage in a preparation
   to switch emul_lock to non-sleepable lock (mutex).

Submitted by: rdivacky

17 years agoMFp4 (part of 114132):
netchild [Fri, 23 Feb 2007 22:29:24 +0000 (22:29 +0000)]
MFp4 (part of 114132):
 - Fix a LOR caused by holding emul_lock and proctree_lock at once.

Submitted by: rdivacky

17 years agoDon't attempt to load illegal hard loop addresses into
mjacob [Fri, 23 Feb 2007 21:59:21 +0000 (21:59 +0000)]
Don't attempt to load illegal hard loop addresses into
an ICB. This shows up on card restarts, and usually for
2200-2300 cards. What happens is that we start up,
attempting to acquire a hard address. We end up instead
being an F-port topology, which reports out a loop id
of 0xff (or 0xffff for 2K Login f/w). Then, if we restart,
we end up telling the card to go off an acquire this loop
address, which the card then rejects. Bah.

Compilation fixes from Solaris port.

17 years agoOnly match on log messages containing fail,invalid,
remko [Fri, 23 Feb 2007 21:42:54 +0000 (21:42 +0000)]
Only match on log messages containing fail,invalid,
bad or illegal. This prevents matching on systems that
have a name that matches the query.

PR: conf/107560
Submitted by: Christian Laursen <cfsl at pil dot dk>
MFC after: 3 days
Approved by: imp (mentor)

17 years agoUse the RB_AUTOBOOT define over 0.
ceri [Fri, 23 Feb 2007 21:15:14 +0000 (21:15 +0000)]
Use the RB_AUTOBOOT define over 0.

Approved by: ru (mentor)

17 years agoFix the cdboot twiddle display.
remko [Fri, 23 Feb 2007 21:07:44 +0000 (21:07 +0000)]
Fix the cdboot twiddle display.
I created and tested this with a custom FreeSBIE cd-image.

PR: i386/96452
Submitted by: Yuichiro Goto <y7goto at gmail dot com>
MFC after: 3 days
Approved by: imp (mentor)

17 years agoAccount for di_blocks allocations when IN_SPACECOUNTED is set in an
brian [Fri, 23 Feb 2007 20:23:35 +0000 (20:23 +0000)]
Account for di_blocks allocations when IN_SPACECOUNTED is set in an
inode's i_flag.

It's possible that after ufs_infactive() calls softdep_releasefile(),
i_nlink stays >0 for a considerable amount of time (> 60 seconds here).
During this period, any ffs allocation routines that alter di_blocks
must also account for the blocks in the filesystem's fs_pendingblocks
value.

This change fixes an eventual df/du discrepency that will happen as
the result of fs_pendingblocks being reduced to <0.

The only manifestation of this that people may recognise is the
following message on boot:

    /somefs: update error: blocks -N files M

at which point the negative pending block count is adjusted to zero.

Reviewed by: tegge
MFC after: 3 weeks

17 years agoo break newbus api: add a new argument of type driver_filter_t to
piso [Fri, 23 Feb 2007 20:11:27 +0000 (20:11 +0000)]
o break newbus api: add a new argument of type driver_filter_t to
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Approved by: re (implicit?)

17 years agoUse ih_filter instead of ih_handler in a couple of places. This fixes
jhb [Fri, 23 Feb 2007 20:03:24 +0000 (20:03 +0000)]
Use ih_filter instead of ih_handler in a couple of places.  This fixes
most INTR_FAST handlers on i386.

Reviewed by: piso

17 years agoDrop the global kernel linker lock while executing the sysinit's for a
jhb [Fri, 23 Feb 2007 19:46:59 +0000 (19:46 +0000)]
Drop the global kernel linker lock while executing the sysinit's for a
freshly-loaded kernel module.  To avoid various unload races, hide linker
files whose sysinit's are being run from userland so that they can't be
kldunloaded until after all the sysinit's have finished.

Tested by: gallatin

17 years agoCatchup with filters
imp [Fri, 23 Feb 2007 19:41:34 +0000 (19:41 +0000)]
Catchup with filters

17 years ago- Revert arguments for several functions to pre bus_get_dma_tag()
ariff [Fri, 23 Feb 2007 19:41:16 +0000 (19:41 +0000)]
- Revert arguments for several functions to pre bus_get_dma_tag()
  changes. Each softc contains information about their own device_t,
  use that instead.
- bus_setup_intr() -> snd_setup_intr().

17 years ago- Compile time compatibility for pre/post newbus API (intr filter)
ariff [Fri, 23 Feb 2007 19:40:13 +0000 (19:40 +0000)]
- Compile time compatibility for pre/post newbus API (intr filter)
  changes. This should ease the job of maintaining codebase since much
  of the regression tests are done across os versions.
- bus_setup_intr() -> snd_setup_intr().

17 years agoUse snd_setup_intr() instead of bus_setup_intr() , like other drivers.
ariff [Fri, 23 Feb 2007 19:39:06 +0000 (19:39 +0000)]
Use snd_setup_intr() instead of bus_setup_intr() , like other drivers.

17 years agoMove the lock init until after if_alloc in case the allocation fails and we
thompsa [Fri, 23 Feb 2007 19:37:55 +0000 (19:37 +0000)]
Move the lock init until after if_alloc in case the allocation fails and we
free the softc and return.

MFC after: 3 days

17 years agoCheck that the length of the received message is at least as big as a PDU
emax [Fri, 23 Feb 2007 19:37:47 +0000 (19:37 +0000)]
Check that the length of the received message is at least as big as a PDU
before we use pdu->len.

Submitted by: Iain Hibbert
MFC after: 3 days

17 years agoCatchup with filters
imp [Fri, 23 Feb 2007 19:34:52 +0000 (19:34 +0000)]
Catchup with filters

17 years agoCatchup to filters by piso.
imp [Fri, 23 Feb 2007 19:27:49 +0000 (19:27 +0000)]
Catchup to filters by piso.

17 years agoMove to the preferred syntax for nice (-n) instead
remko [Fri, 23 Feb 2007 18:44:20 +0000 (18:44 +0000)]
Move to the preferred syntax for nice (-n) instead
of the depricated one.

PR: conf/108611
Submitted by: TAOKA Fumiyoshi <fmysh at iijmio-mail dot jp>
Approved by: imp (mentor)

17 years agoMake cu/tip handle when $HOME is not set in the environment.
jls [Fri, 23 Feb 2007 18:41:12 +0000 (18:41 +0000)]
Make cu/tip handle when $HOME is not set in the environment.

Approved by: philip
Submitted by: ale
PR: bin/108775

17 years agoCorrect two grammos.
schweikh [Fri, 23 Feb 2007 16:50:17 +0000 (16:50 +0000)]
Correct two grammos.

17 years agoUse 'pause' in several places rather than trying to tsleep() on NULL (which
jhb [Fri, 23 Feb 2007 16:25:08 +0000 (16:25 +0000)]
Use 'pause' in several places rather than trying to tsleep() on NULL (which
triggers a KASSERT) or local variables.  In the case of kern_ndis, the
tsleep() actually used a common sleep address (curproc) making it
susceptible to a premature wakeup.

17 years agoAdd a new kernel sleep function pause(9). pause(9) is for places that
jhb [Fri, 23 Feb 2007 16:22:09 +0000 (16:22 +0000)]
Add a new kernel sleep function pause(9).  pause(9) is for places that
want an equivalent of DELAY(9) that sleeps instead of spins.  It accepts
a wmesg and a timeout and is not interrupted by signals.  It uses a private
wait channel that should never be woken up by wakeup(9) or wakeup_one(9).

Glanced at by: phk

17 years agoBump __FreeBSD_version after newbus api modification.
piso [Fri, 23 Feb 2007 16:21:08 +0000 (16:21 +0000)]
Bump __FreeBSD_version after newbus api modification.

Reviewed by: re@
Approved by: re@

17 years ago o break newbus api: add a new argument of type driver_filter_t to
piso [Fri, 23 Feb 2007 15:55:37 +0000 (15:55 +0000)]
  o break newbus api: add a new argument of type driver_filter_t to
    bus_setup_intr()

  o add an int return code to all fast handlers

  o retire INTR_FAST/IH_FAST

  For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

  Approved by: re (implicit?)

17 years agoMore unnecessary include reduction.
rwatson [Fri, 23 Feb 2007 14:39:04 +0000 (14:39 +0000)]
More unnecessary include reduction.

17 years agoMFp4 (114068):
netchild [Fri, 23 Feb 2007 13:47:34 +0000 (13:47 +0000)]
MFp4 (114068):
        Use bus_get_dma_tag() to obtain the parent DMA tag to make the drivers
        a little bit more non-ia32/amd64 friendly.

        There is no man page for bus_get_dma_tag, so this is modelled after
        rev. 1.62 of src/sys/dev/sound/pci/es137x.c by marius.

        Inspired by: commit by marius

17 years agoo break newbus api: add a new argument of type driver_filter_t to
piso [Fri, 23 Feb 2007 12:19:07 +0000 (12:19 +0000)]
o break newbus api: add a new argument of type driver_filter_t to
  bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@

17 years agoRemove many unneeded includes, update copyright.
rwatson [Fri, 23 Feb 2007 11:21:26 +0000 (11:21 +0000)]
Remove many unneeded includes, update copyright.

17 years agoRemove empty entry point functions (init, destroy, syscall) from
rwatson [Fri, 23 Feb 2007 11:15:35 +0000 (11:15 +0000)]
Remove empty entry point functions (init, destroy, syscall) from
policies that don't need them.

17 years agomac_none sample policy has nothing to enforce, so remove sysctls.
rwatson [Fri, 23 Feb 2007 11:08:45 +0000 (11:08 +0000)]
mac_none sample policy has nothing to enforce, so remove sysctls.
mac_stub acts as a template policy and holds sample sysctls.

17 years agoUse the new xpt_rescan function to truly now have dynamic
mjacob [Fri, 23 Feb 2007 05:51:57 +0000 (05:51 +0000)]
Use the new xpt_rescan function to truly now have dynamic
attachment of new devices that arrive (and we notice them
via async Fibre Channel events). We've always had the
right thing (of sorts) happen when devices go away- this
is the corollary function that makes multipath failover
actually work.

MFC after: 2 weeks

17 years agoAdd an xpt_rescan function and a thread that will field
mjacob [Fri, 23 Feb 2007 05:47:36 +0000 (05:47 +0000)]
Add an xpt_rescan function and a thread that will field
rescan requests. The purpose of this is to allow a SIM
(or other entities) to request a bus rescan and have it
then fielded in a different (process) context from the
caller.

There are probably better ways to accomplish this, but
it's a very small change that helps solve a number of
problems.

Reviewed by: Justin, Ken and Scott.
MFC after: 2 weeks

17 years agoThere is a problem in setting/getting 'options'- if we check things
mjacob [Fri, 23 Feb 2007 05:42:41 +0000 (05:42 +0000)]
There is a problem in setting/getting 'options'- if we check things
early, we haven't set board type, so we can't correctly check for
some options.  Fix this by splitting option setting/getting into
generic, pci and then later board specific, option setting/getting.

This was noticed when setting 'iid' (or 'hard loop id') didn't work
all of a sudden.

Noticed by: Mike Drangula (thanks!) via Jung-uk Kim (thanks!)

17 years agoBe a bit more restrictive about printing out 'bad' pdb entries
mjacob [Fri, 23 Feb 2007 05:39:58 +0000 (05:39 +0000)]
Be a bit more restrictive about printing out 'bad' pdb entries
during loop rescans. They're not bad so much as unstable, so
don't print this stuff out unless ISP_LOGSANCFG is set.

17 years agoIf floppies are used to boot the machine, the user lets the machine
kensmith [Thu, 22 Feb 2007 20:29:53 +0000 (20:29 +0000)]
If floppies are used to boot the machine, the user lets the machine
complete the boot and enter into sysinstall, and only then inserts
a CD into the CDROM drive and tries to select that as the install
media the first call to mount(2) generates EIO but the second call
to mount(2) will succeed.  This was 100% reproducible on 6.2-RELEASE,
RELENG_6, and HEAD.  If the user inserts the disc into the CDROM
while the machine is booting off the floppies the first call to mount(2)
succeeds with no problems.  The problem was originally reported in
PR #56952 against 5.1-CURRENT so it's been there for a while now.

PR: bin/56952
MFC after: 2 weeks

17 years agoCorrect typo.
pjd [Thu, 22 Feb 2007 19:25:37 +0000 (19:25 +0000)]
Correct typo.

Spotted by: Tomasz Dudzisz

17 years agoModify chunk_alloc() to prefer mmap()ed memory over sbrk()ed memory.
jasone [Thu, 22 Feb 2007 19:10:30 +0000 (19:10 +0000)]
Modify chunk_alloc() to prefer mmap()ed memory over sbrk()ed memory.
This has no impact unless USE_BRK is defined (32-bit platforms), in
which case user allocations are allocated via mmap() if at all possible,
in order to avoid the possibility of unreclaimable chunks in the data
segment.

Fix an obscure bug in base_alloc() that could have allowed undefined
behavior if an application were to use sbrk() in conjunction with a
USE_BRK-enabled malloc.

17 years agoUse LIST_EMPTY() instead of unrolled version (LIST_FIRST() [!=]= NULL)
delphij [Thu, 22 Feb 2007 14:52:59 +0000 (14:52 +0000)]
Use LIST_EMPTY() instead of unrolled version (LIST_FIRST() [!=]= NULL)

17 years agoUse ETHER_BPF_MTAP() instead of BPF_MTAP() here. It's possible
csjp [Thu, 22 Feb 2007 14:50:31 +0000 (14:50 +0000)]
Use ETHER_BPF_MTAP() instead of BPF_MTAP() here.  It's possible
incoming packets have had their 802.1Q tags processed by the
hardware, resulting in them being stripped from the packets, and
placed on the mbuf.  This fixes the processing of 802.1Q tags when
hardware offload of 802.1Q tags is enabled.

17 years agoFixes build breakage.. invalid type casts.. and invalid
rrs [Thu, 22 Feb 2007 14:48:12 +0000 (14:48 +0000)]
Fixes build breakage.. invalid type casts.. and invalid
type for size in one place.

17 years agoFirst cut of the sctp man pages. Still need work.
rrs [Thu, 22 Feb 2007 14:32:39 +0000 (14:32 +0000)]
First cut of the sctp man pages. Still need work.

17 years agoFixes __FreeBSD__ being present (they should not)
rrs [Thu, 22 Feb 2007 13:39:57 +0000 (13:39 +0000)]
Fixes __FreeBSD__ being present (they should not)
and also trailing garbage on undef of magic numbers.

17 years agoAdds a performance improvement for when sctp_sendx is
rrs [Thu, 22 Feb 2007 12:42:43 +0000 (12:42 +0000)]
Adds a performance improvement for when sctp_sendx is
called with only one address, we then can call the
generic system call. Also fixes some socket api
type issues and cleans up the "magic" numbers that
were being used in the code.

Reviewed by: gnn

17 years agoAdd an additional MAC check to the UNIX domain socket connect path:
rwatson [Thu, 22 Feb 2007 09:37:44 +0000 (09:37 +0000)]
Add an additional MAC check to the UNIX domain socket connect path:
check that the subject has read/write access to the vnode using the
vnode MAC check.

MFC after: 3 weeks
Submitted by: Spencer Minear <spencer_minear at securecomputing dot com>
Obtained from: TrustedBSD Project

17 years agoChange the page's CLEANCHK flag from being a page queue mutex synchronized
alc [Thu, 22 Feb 2007 06:15:52 +0000 (06:15 +0000)]
Change the page's CLEANCHK flag from being a page queue mutex synchronized
flag to a vm object mutex synchronized flag.

17 years agoImprove readability of the version string.
njl [Thu, 22 Feb 2007 05:59:23 +0000 (05:59 +0000)]
Improve readability of the version string.