]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoCast to (unsigned long) to make printf happy on i386
Robert Noland [Tue, 17 Mar 2009 05:10:12 +0000 (05:10 +0000)]
Cast to (unsigned long) to make printf happy on i386

MFC after: 3 days

15 years agoAdd support for matching solely on vendor id.
Robert Noland [Tue, 17 Mar 2009 03:53:44 +0000 (03:53 +0000)]
Add support for matching solely on vendor id.

We will use this method with nouveau

MFC after: 3 days

15 years agoImprove the debugging output of drm_mmap
Robert Noland [Tue, 17 Mar 2009 03:50:35 +0000 (03:50 +0000)]
Improve the debugging output of drm_mmap

MFC after: 3 days

15 years agoAdd list_for_each_prev to our linux compatibility.
Robert Noland [Tue, 17 Mar 2009 03:49:24 +0000 (03:49 +0000)]
Add list_for_each_prev to our linux compatibility.

We need this for nouveau

MFC after: 3 days

15 years agoMinor code cleanup
Robert Noland [Tue, 17 Mar 2009 03:46:37 +0000 (03:46 +0000)]
Minor code cleanup

MFC after: 3 days

15 years agoWe can have more than 3 pci resources
Robert Noland [Tue, 17 Mar 2009 03:44:36 +0000 (03:44 +0000)]
We can have more than 3 pci resources

MFC after: 3 days

15 years agoCast register maps and offsets to vm_offset_t
Robert Noland [Tue, 17 Mar 2009 03:39:09 +0000 (03:39 +0000)]
Cast register maps and offsets to vm_offset_t

MFC after: 3 days

15 years agoChange the logic around to match ati_pcigart.
Robert Noland [Tue, 17 Mar 2009 03:36:24 +0000 (03:36 +0000)]
Change the logic around to match ati_pcigart.

MFC after: 3 days

15 years agoUse flsl() here rather than ffsl()
Robert Noland [Tue, 17 Mar 2009 03:32:12 +0000 (03:32 +0000)]
Use flsl() here rather than ffsl()

I discovered that we were computing page_order differently than linux.

MFC after: 3 days

15 years agoRemove the splimp()/splx() calls around the setting of the MTU. They are
Sean Farley [Tue, 17 Mar 2009 02:32:36 +0000 (02:32 +0000)]
Remove the splimp()/splx() calls around the setting of the MTU.  They are
no-op's that I inadvertently added.  Even if locking is needed in general
for the ioctl's, setting a single long will not need it due to the operation
being atomic.

Reported by: rwatson

15 years agoMFp4 //depot/projects/usb 159225,159241,159292
Andrew Thompson [Tue, 17 Mar 2009 01:46:40 +0000 (01:46 +0000)]
MFp4 //depot/projects/usb 159225,159241,159292

Fix regression issue in the USB file system interface.
 - Use cdev_privdata pointer as indicator of correct file handle.
 - Remove redundant FIFO opened flags.

Don't send ZLP at close for ulpt and uscanner devices as this causes some
models to stop working. This reverts back to the USB1 behaviour.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb 159238,159275
Andrew Thompson [Tue, 17 Mar 2009 01:42:46 +0000 (01:42 +0000)]
MFp4 //depot/projects/usb 159238,159275

Add umass quirks.

Submitted by: Michael Gmelin

15 years agoAdd Supertop IDE adapter and Quickcam entries.
Andrew Thompson [Tue, 17 Mar 2009 01:38:51 +0000 (01:38 +0000)]
Add Supertop IDE adapter and Quickcam entries.

15 years agoInitial suspend/resume support for amd64.
Jung-uk Kim [Tue, 17 Mar 2009 00:48:11 +0000 (00:48 +0000)]
Initial suspend/resume support for amd64.

This code is heavily inspired by Takanori Watanabe's experimental SMP patch
for i386 and large portion was shamelessly cut and pasted from Peter Wemm's
AP boot code.

15 years agoAdd some notes and clarify a few sections:
Doug Barton [Mon, 16 Mar 2009 23:56:28 +0000 (23:56 +0000)]
Add some notes and clarify a few sections:
1. Add a note to double-check the man page
2. Remove windows-specific items in the ctrl_interface section
3. Add a note that ap_scan must be set to 1 for use with wlan
4. Clarify the wording for scan_ssid related to APs that hide ssid
5. Clarify the wording for the priority option

15 years agoDetach GELI providers on shutdown/reboot, which will allow providers underneath
Pawel Jakub Dawidek [Mon, 16 Mar 2009 19:31:08 +0000 (19:31 +0000)]
Detach GELI providers on shutdown/reboot, which will allow providers underneath
to close properly.

Reported, reviewed and tested by: guido
MFC after: 1 week

15 years agoUse the right MSI_REARM for RS600.
Robert Noland [Mon, 16 Mar 2009 19:09:59 +0000 (19:09 +0000)]
Use the right MSI_REARM for RS600.

MFC after: 3 days

15 years ago- Add Brazilian Portuguese catalog [1]
Gabor Kovesdan [Mon, 16 Mar 2009 16:33:08 +0000 (16:33 +0000)]
- Add Brazilian Portuguese catalog [1]
- Fixes for German catalog [2]

PR: kern/132694 [1], conf/80504 [2]
Submitted by: Murilo Opsfelder <mopsfelder@gmail.com> [1],
brueffer [2]

15 years agointpm: minor enhancements
Andriy Gapon [Mon, 16 Mar 2009 16:15:14 +0000 (16:15 +0000)]
intpm: minor enhancements

1. fix nointr check in intsmb_start, matters only if ENABLE_ALART is
   defined (by default, it is not);
2. drop unnecessary inspection/reporting of power-management io registers
   base address;
3. in verbose mode report errors from SMBus host controller and their
   mapping to smbus(4) errors;

Approved by: jhb (mentor)

15 years ago(finally) document -n
Sam Leffler [Mon, 16 Mar 2009 15:54:21 +0000 (15:54 +0000)]
(finally) document -n

15 years agoRemove CD input hack for ALC268 based Acer systems. Latest systems does not
Alexander Motin [Mon, 16 Mar 2009 15:50:29 +0000 (15:50 +0000)]
Remove CD input hack for ALC268 based Acer systems. Latest systems does not
implement CD input in hardware, while unconditional showing it confuse users.
Also it was made in the way that sometimes improper with present driver.

Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work.
Default configuration defines two separate playback associations, which
current driver unable to trace properly due to order they are defined and
limited codec uniformity.

Submitted by: G. Mirov <g.mirov AT gmail.com>

15 years agoFix two issues with bufdaemon, often causing the processes to hang in
Konstantin Belousov [Mon, 16 Mar 2009 15:39:46 +0000 (15:39 +0000)]
Fix two issues with bufdaemon, often causing the processes to hang in
the "nbufkv" sleep.

First, ffs background cg group block write requests a new buffer for
the shadow copy. When ffs_bufwrite() is called from the bufdaemon due
to buffers shortage, requesting the buffer deadlock bufdaemon.
Introduce a new flag for getnewbuf(), GB_NOWAIT_BD, to request getblk
to not block while allocating the buffer, and return failure
instead. Add a flag argument to the geteblk to allow to pass the flags
to getblk(). Do not repeat the getnewbuf() call from geteblk if buffer
allocation failed and either GB_NOWAIT_BD is specified, or geteblk()
is called from bufdaemon (or its helper, see below). In
ffs_bufwrite(), fall back to synchronous cg block write if shadow
block allocation failed.

Since r107847, buffer write assumes that vnode owning the buffer is
locked. The second problem is that buffer cache may accumulate many
buffers belonging to limited number of vnodes. With such workload,
quite often threads that own the mentioned vnodes locks are trying to
read another block from the vnodes, and, due to buffer cache
exhaustion, are asking bufdaemon for help. Bufdaemon is unable to make
any substantial progress because the vnodes are locked.

Allow the threads owning vnode locks to help the bufdaemon by doing
the flush pass over the buffer cache before getnewbuf() is going to
uninterruptible sleep. Move the flushing code from buf_daemon() to new
helper function buf_do_flush(), that is called from getnewbuf().  The
number of buffers flushed by single call to buf_do_flush() from
getnewbuf() is limited by new sysctl vfs.flushbufqtarget.  Prevent
recursive calls to buf_do_flush() by marking the bufdaemon and threads
that temporarily help bufdaemon by TDP_BUFNEED flag.

In collaboration with: pho
Reviewed by:  tegge (previous version)
Tested by:  glebius, yandex ...
MFC after:  3 weeks

15 years agoAdded DLT_ENC to map list, so it is now possible
VANHULLEBUS Yvan [Mon, 16 Mar 2009 15:09:47 +0000 (15:09 +0000)]
Added DLT_ENC to map list, so it is now possible
to save dumps on enc0

Reviewed by: gnn(mentor)
Obtained from: NETASQ
MFC after: 1 week

15 years agoFix spelling in message.
Alexander Motin [Mon, 16 Mar 2009 12:42:23 +0000 (12:42 +0000)]
Fix spelling in message.

15 years agocat(1) compiles fine at WARNS level 6.
Dag-Erling Smørgrav [Mon, 16 Mar 2009 12:16:17 +0000 (12:16 +0000)]
cat(1) compiles fine at WARNS level 6.

15 years agouse usb2_desc_foreach() to iterate the USB config descriptor instread of
Weongyo Jeong [Mon, 16 Mar 2009 11:19:07 +0000 (11:19 +0000)]
use usb2_desc_foreach() to iterate the USB config descriptor instread of
accessing structures directly to check some invalid descriptors.

Pointed by: hps

15 years agoDefine and use two macros for loopback checksum offload:
Robert Watson [Mon, 16 Mar 2009 10:56:50 +0000 (10:56 +0000)]
Define and use two macros for loopback checksum offload:

LO_CSUM_FEATURES - a bitmask of supported transmit offload features, which
  will be stored in if_hwassist if IFCAP_TXCSUM is enabled, and be cleared
  from mbuf packet header csum flags on transmit. (1)

LO_CSUM_SET - a bitmask of supported receive offload features, which will
  be set on the mbuf packet header csum flags on transmit if IFCAP_RXCSUM
  is enabled.

While here, fix SCTP offload for loopback: offer generation on the
transmit side, don't just skip validation on the receive side.

Obtained from:  DragonflyBSD (1)
MFC after:      1 week

15 years agoChase the k8temp->amdtemp rename in NOTES and loader.conf.
Dmitry Chagin [Mon, 16 Mar 2009 10:36:24 +0000 (10:36 +0000)]
Chase the k8temp->amdtemp rename in NOTES and loader.conf.

Approved by: kib (mentor)

15 years agoif_hwassist should be initialized with CSUM, rather than IFCAP, flags.
Robert Watson [Mon, 16 Mar 2009 09:22:34 +0000 (09:22 +0000)]
if_hwassist should be initialized with CSUM, rather than IFCAP, flags.

Submitted by: yongari
MFC after: 1 week

15 years agoTeach psm about O_ASYNC
Robert Noland [Mon, 16 Mar 2009 08:21:51 +0000 (08:21 +0000)]
Teach psm about O_ASYNC

This makes Xorg happy if you aren't using moused.

MFC after: 3 days

15 years agoGet rid of any remaining PZERO flags in mtx_sleep()
Robert Noland [Mon, 16 Mar 2009 08:19:11 +0000 (08:19 +0000)]
Get rid of any remaining PZERO flags in mtx_sleep()

Also, clean up some ifdef mess while I'm here.

MFC after: 3 days

15 years agoFix R600 writeback across suspend/resume.
Robert Noland [Mon, 16 Mar 2009 08:15:35 +0000 (08:15 +0000)]
Fix R600 writeback across suspend/resume.

This is likely a NOOP for us, since I haven't ported the suspend/resume
code yet.

MFC after: 3 days

15 years agoSort include files in the alphabetical order.
Dmitry Chagin [Mon, 16 Mar 2009 05:39:37 +0000 (05:39 +0000)]
Sort include files in the alphabetical order.

Approved by: kib (mentor)
MFC after: 2 weeks

15 years agoAdd the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to
Sean Farley [Mon, 16 Mar 2009 03:11:02 +0000 (03:11 +0000)]
Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to
have its MTU set higher than 1500 (ETHERMTU).  Its new limit is now
65535 as enforced by ifhwioctl() in if.c

This allows a tap(4) device to be added to a bridge, which requires all
interface members to have the same MTU, with an interface configured for
jumbo frames.  QEMU may now connect to a network via tap(4) without
requiring the real interface to have its MTU set to 1500 or lower.

Reviewed by: rpaulo, bms
MFC after: 1 week

15 years agoRestore missing OSREL definition that accidetnally dropped from an
Warner Losh [Sun, 15 Mar 2009 23:52:13 +0000 (23:52 +0000)]
Restore missing OSREL definition that accidetnally dropped from an
earlier version of this patch.

15 years agoDefault to AF_LOCAL instead of AF_INET sockets for non-family-specific
Jamie Gritton [Sun, 15 Mar 2009 22:33:18 +0000 (22:33 +0000)]
Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
operations.  This allows the query operations to work in non-IPv4 jails,
and will be necessary in a future of possible non-INET networking.

Approved by: bz (mentor)

15 years agoTeach the loopback interface about checksum generation and validation
Robert Watson [Sun, 15 Mar 2009 20:17:44 +0000 (20:17 +0000)]
Teach the loopback interface about checksum generation and validation
avoidance:

- Enable setting the RXCSUM and TXCSUM flags for loopback interfaces;
  set both by default.
- When RXCSUM is set, flag packets sent over the loopback interface as
  having checked and valid IP, UDP, TCP checksums so that higher
  protocol layers won't check them.
- Always clear CSUM_{IP,UDP_TCP} checksum required flags on transmit,
  as they will have gotten there as a result of TXCSUM being set.

This is done only for packets explicitly sent over the loopback, not
simulated loopback via if_simloop() due to !SIMPLEX interfaces, etc.

Note that enabling TXCSUM but not RXCSUM will lead to unhappiness, as
checksums won't be generated but will be validated.

Kris reports that this leads to significant performance improvements
in loopback benchmarking with TCP and UDP for throughput:

RXCSUM  RXCSUM+TXCSUM
TCP 15% 37%
UDP 10% 74%

Update man page.

Reviewed by: sam
Tested by: kris
MFC after: 1 week

15 years agoIgnore FUTEX_FD op, as it is done by linux.
Dmitry Chagin [Sun, 15 Mar 2009 19:38:34 +0000 (19:38 +0000)]
Ignore FUTEX_FD op, as it is done by linux.

Approved by: kib (mentor)
MFC after: 2 weeks

15 years agoInclude linux_futex.h before linux_emul.h
Dmitry Chagin [Sun, 15 Mar 2009 19:16:12 +0000 (19:16 +0000)]
Include linux_futex.h before linux_emul.h

Approved by: kib (mentor)
MFC after: 6 days

15 years agoMention specifically in UPDATING that non-MPSAFE device drivers are no
Robert Watson [Sun, 15 Mar 2009 16:12:50 +0000 (16:12 +0000)]
Mention specifically in UPDATING that non-MPSAFE device drivers are no
longer supported.

15 years agoBump __FreeBSD_version for the removal of IFF_NEEDSGIANT; network
Robert Watson [Sun, 15 Mar 2009 16:10:25 +0000 (16:10 +0000)]
Bump __FreeBSD_version for the removal of IFF_NEEDSGIANT; network
device drivers that require Giant to be held over calls to the ifnet
interface are no longer supported in the FreeBSD 8.x kernel.

15 years agoRemove IFF_NEEDSGIANT, a compatibility infrastructure introduced
Robert Watson [Sun, 15 Mar 2009 14:21:05 +0000 (14:21 +0000)]
Remove IFF_NEEDSGIANT, a compatibility infrastructure introduced
in FreeBSD 5.x to allow network device drivers to run with Giant
despite the network stack being Giant-free.  This significantly
simplifies calls into ioctl() on network interfaces, especially
in the multicast code, as well as eliminates deferred invocation
of interface if_start routines.

Disable the build on device drivers still depending on
IFF_NEEDSGIANT as they no longer compile.  They will be removed
in a few weeks if they haven't been made MPSAFE in that time.
Disabled drivers:

        if_ar
        if_axe
        if_aue
        if_cdce
        if_cue
        if_kue
        if_ray
        if_rue
        if_rum
        if_sr
        if_udav
        if_ural
        if_zyd

Drivers that were already disabled because of tty changes:

        if_ppp
        if_sl

Discussed on: arch@

15 years ago- Create the buildworld object directories with mtree instead of various
Gabor Kovesdan [Sun, 15 Mar 2009 13:14:06 +0000 (13:14 +0000)]
- Create the buildworld object directories with mtree instead of various
  mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
  these directories

15 years agoCorrect a number of evolved problems with inp_vflag and inp_flags:
Robert Watson [Sun, 15 Mar 2009 09:58:31 +0000 (09:58 +0000)]
Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted.  Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):

  INP_TIMEWAIT
  INP_SOCKREF
  INP_ONESBCAST
  INP_DROPPED

Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.

MFC after:      1 week (or after dependencies are MFC'd)
Reviewed by:    bz

15 years ago - Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks.
Jeff Roberson [Sun, 15 Mar 2009 08:03:54 +0000 (08:03 +0000)]
 - Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks.

15 years ago - Implement a new mechanism for resetting lock profiling. We now
Jeff Roberson [Sun, 15 Mar 2009 06:41:47 +0000 (06:41 +0000)]
 - Implement a new mechanism for resetting lock profiling.  We now
   guarantee that all cpus have acknowledged the cleared enable int by
   scheduling the resetting thread on each cpu in succession.  Since all
   lock profiling happens within a critical section this guarantees that
   all cpus have left lock profiling before we clear the datastructures.
 - Assert that the per-thread queue of locks lock profiling is aware of
   is clear on thread exit.  There were several cases where this was not
   true that slows lock profiling and leaks information.
 - Remove all objects from all lists before clearing any per-cpu
   information in reset.  Lock profiling objects can migrate between
   per-cpu caches and previously these migrated objects could be zero'd
   before they'd been removed

Discussed with: attilio
Sponsored by: Nokia

15 years agoDon't adjust ranges at all for subtractive bridges. The simple-minded
Warner Losh [Sun, 15 Mar 2009 06:40:57 +0000 (06:40 +0000)]
Don't adjust ranges at all for subtractive bridges.  The simple-minded
stuff we're doing is too simple-minded, so back it out for now.

15 years agoGeneralize the workaround for the Hitachi HT-4840-11. The Contec
Warner Losh [Sun, 15 Mar 2009 02:31:34 +0000 (02:31 +0000)]
Generalize the workaround for the Hitachi HT-4840-11.  The Contec
C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it
matches pc98 machines, so maybe it was a flag for pc98 operation) as
well as a memory map.  Since this driver doesn't know how to cope, we
start with cfe2, which is purely an I/O space mapped and that seems to
make it work.  I say 'seems' here, because the card I have doesn't
seem to have the right dongle for full testing...

15 years agono need to for gnu89 any more
Sam Leffler [Sun, 15 Mar 2009 01:39:16 +0000 (01:39 +0000)]
no need to for gnu89 any more

15 years agoremove gcc-ism; tsinfo isn't used anyway
Sam Leffler [Sun, 15 Mar 2009 01:38:37 +0000 (01:38 +0000)]
remove gcc-ism; tsinfo isn't used anyway

15 years agoOpps.. I missed a file on the commit :-)
Randall Stewart [Sat, 14 Mar 2009 23:13:16 +0000 (23:13 +0000)]
Opps.. I missed a file on the commit :-)

15 years agoFix build breakage due to the interplay between r189801 and r189824.
David Schultz [Sat, 14 Mar 2009 22:50:03 +0000 (22:50 +0000)]
Fix build breakage due to the interplay between r189801 and r189824.
In particular, vendor sources that aren't ready for gnu99 should
still be compiled with gnu89. (Before r189824, these would have
generated warnings if you tried to compile them in gnu99 mode,
but the warnings went unheeded due to -Wno-error.)

15 years agoOops. Correct comment in the LICENSE file.
Pawel Jakub Dawidek [Sat, 14 Mar 2009 21:59:12 +0000 (21:59 +0000)]
Oops. Correct comment in the LICENSE file.

15 years agoRegression tests for mac_portacl(4).
Pawel Jakub Dawidek [Sat, 14 Mar 2009 21:54:19 +0000 (21:54 +0000)]
Regression tests for mac_portacl(4).

15 years ago- Correct logic in if statement - we want to allocate temporary buffer
Pawel Jakub Dawidek [Sat, 14 Mar 2009 20:40:06 +0000 (20:40 +0000)]
- Correct logic in if statement - we want to allocate temporary buffer
  when someone is passing new rules, not when he only want to read them.
  Because of this bug, even if the given rules were incorrect, they
  ended up in rule_string.
- Add missing protection for rule_string when coping it.

Reviewed by: rwatson
MFC after: 1 week

15 years agoNamespace: Defining htonl() and friends here instead of arpa/inet.h is
David Schultz [Sat, 14 Mar 2009 20:16:54 +0000 (20:16 +0000)]
Namespace: Defining htonl() and friends here instead of arpa/inet.h is
a BSD extension.

15 years agoFix the visibility of several prototypes. Also move pthread_kill() and
David Schultz [Sat, 14 Mar 2009 20:10:14 +0000 (20:10 +0000)]
Fix the visibility of several prototypes. Also move pthread_kill() and
pthread_sigmask() to signal.h. In principle, this shouldn't break anything,
since they're already in signal.h on other systems, and the FreeBSD
manpage says that both pthread.h and signal.h need to be included to
get these functions.

Add a hack to declare pthread_t in the P1003.1-2008 namespace
in signal.h.

15 years agoHide dbopen() in the POSIX namespace, and use standard type names
David Schultz [Sat, 14 Mar 2009 20:05:27 +0000 (20:05 +0000)]
Hide dbopen() in the POSIX namespace, and use standard type names
throughout so that this compiles in strict POSIX mode.

15 years agoHide numerous BSD extensions in the POSIX namespace.
David Schultz [Sat, 14 Mar 2009 20:04:28 +0000 (20:04 +0000)]
Hide numerous BSD extensions in the POSIX namespace.

15 years agoBump __FreeBSD_version to 800071 for gcc patch to add support for C99
David Schultz [Sat, 14 Mar 2009 19:44:13 +0000 (19:44 +0000)]
Bump __FreeBSD_version to 800071 for gcc patch to add support for C99
inline functions in c99 and gnu99 mode.

15 years agoMake gcc use C99 inline semantics in c99 and gnu99 mode. This was the
David Schultz [Sat, 14 Mar 2009 19:36:13 +0000 (19:36 +0000)]
Make gcc use C99 inline semantics in c99 and gnu99 mode.  This was the
original intent, but the functionality wasn't implemented until after
gcc 4.2 was released. However, if you compiled a program that would
behave differently before and after this change, gcc 4.2 would have
warned you; hence, everything currently in the base system is
unaffected by this change.  This patch also adds additional warnings
about certain inline function-related bogosity, e.g., using a
static non-const local variable in an inline function.

These changes were merged from a snapshot of gcc mainline from March
2007, prior to the GPLv3 switch. I then ran the regression test suite
from a more recent gcc snapshot and fixed the important bugs it found.
I also squelched the following warning unless -pedantic is specified:

    foo is static but used in inline function bar which is not static

This is consistent with LLVM's behavior, but not consistent with gcc 4.3.

Reviewed by: arch@

15 years agoNamespace: aio_waitcomplete() is a BSD extension.
David Schultz [Sat, 14 Mar 2009 19:17:00 +0000 (19:17 +0000)]
Namespace: aio_waitcomplete() is a BSD extension.
Also, don't pollute the namespace by including <sys/time.h>.

15 years agoNamespace: adjtime(), futimes(), futimesat(), lutimes(), and settimeofday()
David Schultz [Sat, 14 Mar 2009 19:15:13 +0000 (19:15 +0000)]
Namespace: adjtime(), futimes(), futimesat(), lutimes(), and settimeofday()
are BSD extensions.

Also include <sys/select.h> in user code, since this header is
also supposed to define most of the symbols there.

15 years agoNamespace: abort2() is a BSD extension.
David Schultz [Sat, 14 Mar 2009 19:13:30 +0000 (19:13 +0000)]
Namespace: abort2() is a BSD extension.

15 years agoNamespace: endpwent, getpwent, and setpwent are XSI extensions.
David Schultz [Sat, 14 Mar 2009 19:13:01 +0000 (19:13 +0000)]
Namespace: endpwent, getpwent, and setpwent are XSI extensions.

15 years agoNamespace: dprintf() and getline() are in P1003.1-2008.
David Schultz [Sat, 14 Mar 2009 19:12:11 +0000 (19:12 +0000)]
Namespace: dprintf() and getline() are in P1003.1-2008.

15 years agoVarious namespace cleanups, including exposing fchmod() and fchmodat()
David Schultz [Sat, 14 Mar 2009 19:11:08 +0000 (19:11 +0000)]
Various namespace cleanups, including exposing fchmod() and fchmodat()
in the POSIX namespace, and hiding eaccess() and setproctitle().
Also move mknodat() from unistd.h to sys/stat.h where it belongs.
The *at() syscalls are only in CURRENT, so this shouldn't cause
problems.

15 years agoNamespace: preadv() and pwritev() are extensions.
David Schultz [Sat, 14 Mar 2009 19:07:58 +0000 (19:07 +0000)]
Namespace: preadv() and pwritev() are extensions.

15 years agoNamespace: vsyslog() is a BSD extension.
David Schultz [Sat, 14 Mar 2009 19:07:25 +0000 (19:07 +0000)]
Namespace: vsyslog() is a BSD extension.

15 years agoNamespace: semsys() and shmsys() aren't standard.
David Schultz [Sat, 14 Mar 2009 19:06:52 +0000 (19:06 +0000)]
Namespace: semsys() and shmsys() aren't standard.

15 years agoUse namespace visibility macros instead of checking for _POSIX_SOURCE.
David Schultz [Sat, 14 Mar 2009 19:06:07 +0000 (19:06 +0000)]
Use namespace visibility macros instead of checking for _POSIX_SOURCE.

15 years agoNamespace: setgrent() is an XSI extension.
David Schultz [Sat, 14 Mar 2009 19:05:18 +0000 (19:05 +0000)]
Namespace: setgrent() is an XSI extension.

15 years agoDon't prototype _tolower() and _toupper(). They're not supposed to be
David Schultz [Sat, 14 Mar 2009 19:04:24 +0000 (19:04 +0000)]
Don't prototype _tolower() and _toupper(). They're not supposed to be
functions, and there's no implementation of them in any case.

15 years agoNamespace: memccpy() and memchr() are XSI, and memrchr() is a BSD extension.
David Schultz [Sat, 14 Mar 2009 19:03:34 +0000 (19:03 +0000)]
Namespace: memccpy() and memchr() are XSI, and memrchr() is a BSD extension.

15 years agoNamespace: dbm_forder() and dbm_dirfno() are BSD extensions.
David Schultz [Sat, 14 Mar 2009 19:02:28 +0000 (19:02 +0000)]
Namespace: dbm_forder() and dbm_dirfno() are BSD extensions.

15 years agoNamespace: _setjmp() and _longjmp() are XSI extensions.
David Schultz [Sat, 14 Mar 2009 19:01:26 +0000 (19:01 +0000)]
Namespace: _setjmp() and _longjmp() are XSI extensions.

15 years agoNamespace: inet_ntoa_r() is a BSD extension.
David Schultz [Sat, 14 Mar 2009 19:00:16 +0000 (19:00 +0000)]
Namespace: inet_ntoa_r() is a BSD extension.

15 years agoNamespace: scalb() is withdrawn from POSIX.
David Schultz [Sat, 14 Mar 2009 18:58:53 +0000 (18:58 +0000)]
Namespace: scalb() is withdrawn from POSIX.

15 years agoMultibyte character support for cal(1).
David Schultz [Sat, 14 Mar 2009 18:55:51 +0000 (18:55 +0000)]
Multibyte character support for cal(1).

PR: 131578

15 years agoEliminate __real__ and __imag__ gccisms.
David Schultz [Sat, 14 Mar 2009 18:24:15 +0000 (18:24 +0000)]
Eliminate __real__ and __imag__ gccisms.

15 years agoSwitch over to gnu99 compilation on default for userland.
Roman Divacky [Sat, 14 Mar 2009 17:55:16 +0000 (17:55 +0000)]
Switch over to gnu99 compilation on default for userland.

Tested by: make universe
Tested by: ports exp build (done by pav)
Reviewed by: ru
Reviewed by: silence on arch
Approved by: ed (mentor)

15 years agoremove stray ;
Sam Leffler [Sat, 14 Mar 2009 17:54:58 +0000 (17:54 +0000)]
remove stray ;

15 years agoRework MAC Framework synchronization in a number of ways in order to
Robert Watson [Sat, 14 Mar 2009 16:06:06 +0000 (16:06 +0000)]
Rework MAC Framework synchronization in a number of ways in order to
improve performance:

- Eliminate custom reference count and condition variable to monitor
  threads entering the framework, as this had both significant overhead
  and behaved badly in the face of contention.

- Replace reference count with two locks: an rwlock and an sx lock,
  which will be read-acquired by threads entering the framework
  depending on whether a give policy entry point is permitted to sleep
  or not.

- Replace previous mutex locking of the reference count for exclusive
  access with write acquiring of both the policy list sx and rw locks,
  which occurs only when policies are attached or detached.

- Do a lockless read of the dynamic policy list head before acquiring
  any locks in order to reduce overhead when no dynamic policies are
  loaded; this a race we can afford to lose.

- For every policy entry point invocation, decide whether sleeping is
  permitted, and if not, use a _NOSLEEP() variant of the composition
  macros, which will use the rwlock instead of the sxlock.  In some
  cases, we decide which to use based on allocation flags passed to the
  MAC Framework entry point.

As with the move to rwlocks/rmlocks in pfil, this may trigger witness
warnings, but these should (generally) be false positives as all
acquisition of the locks is for read with two very narrow exceptions
for policy load/unload, and those code blocks should never acquire
other locks.

Sponsored by: Google, Inc.
Obtained from: TrustedBSD Project
Discussed with: csjp (idea, not specific patch)

15 years agoMFamd64 r189785
Alan Cox [Sat, 14 Mar 2009 15:37:19 +0000 (15:37 +0000)]
MFamd64 r189785
  Update the pmap's resident page count when a page table page is freed in
  pmap_remove_pde() and pmap_remove_pages().

MFC after: 6 weeks

15 years agoTwo fixes:
Warner Losh [Sat, 14 Mar 2009 14:08:53 +0000 (14:08 +0000)]
Two fixes:
(1) Fix pcib_read/write_config prototypes.
(2) When contrainting a resource request for a 'subtractive' bridge,
    it is important to select a range outside the base/limit
    registers, since those are the only values known to not
    possibly work.  On my HP laptop, the base bridge excludes I/O
    ports 0xa000-0xafff, however that was the range we were passing
    up the tree.  Instead, when a range spans the "hole" we now
    arbitrarily pick the range just above the hole to allocate from.

All of my rl and xl cards, at a minimum, started working again on this
laptop with those fixes.

15 years agoFixes several PR-SCTP releated bugs.
Randall Stewart [Sat, 14 Mar 2009 13:42:13 +0000 (13:42 +0000)]
Fixes several PR-SCTP releated bugs.
 - When sending large PR-SCTP messages over a
   lossy link we would incorrectly calculate the fwd-tsn
 - When receiving large multipart pr-sctp packets we would
   incorrectly send back a SACK that would renege improperly
   on already received packets thus causing unneeded retransmissions.

15 years ago - When a mutex is destroyed while locked we need to inform lock profiling
Jeff Roberson [Sat, 14 Mar 2009 11:43:38 +0000 (11:43 +0000)]
 - When a mutex is destroyed while locked we need to inform lock profiling
   that it has been released.

15 years ago - Call lock_profile_release when we're transitioning a lock to be owned by
Jeff Roberson [Sat, 14 Mar 2009 11:43:02 +0000 (11:43 +0000)]
 - Call lock_profile_release when we're transitioning a lock to be owned by
   LK_KERNPROC.

Discussed with: attilio

15 years ago - Fix an error that occurs when mp_ncpu is an odd number. steal_thresh
Jeff Roberson [Sat, 14 Mar 2009 11:41:36 +0000 (11:41 +0000)]
 - Fix an error that occurs when mp_ncpu is an odd number.  steal_thresh
   is calculated as 0 which causes errors elsewhere.

Submitted by: KOIE Hidetaka <koie@suri.co.jp>

 - When sched_affinity() is called with a thread that is not curthread we
   need to handle the ON_RUNQ() case by adding the thread to the correct
   run queue.

Submitted by: Justin Teller <justin.teller@gmail.com>

MFC after: 1 Week

15 years agoUpdate the pmap's resident page count when a page table page is freed in
Alan Cox [Sat, 14 Mar 2009 08:28:02 +0000 (08:28 +0000)]
Update the pmap's resident page count when a page table page is freed in
pmap_remove_pde() and pmap_remove_pages().

MFC after: 6 weeks

15 years agoCorrect accounting errors in _pmap_allocpte(). Specifically, the pmap's
Alan Cox [Sat, 14 Mar 2009 05:33:09 +0000 (05:33 +0000)]
Correct accounting errors in _pmap_allocpte().  Specifically, the pmap's
resident page count and the global wired page count were not correctly
maintained when page table page allocation failed.

MFC after: 6 weeks

15 years agor189349 removed mktemp() from the XSI namespace when
David Schultz [Sat, 14 Mar 2009 02:31:48 +0000 (02:31 +0000)]
r189349 removed mktemp() from the XSI namespace when
__XOPEN_SOURCE >= 700, since mktemp() was withdrawn
from the standard. However, __XSI_VISIBLE is set to
700 in the default BSD envrionment, where mktemp()
should still exist; hence, check for this.

15 years agoDon't suggest mounting procfs in diskless configurations.
Robert Watson [Fri, 13 Mar 2009 23:42:34 +0000 (23:42 +0000)]
Don't suggest mounting procfs in diskless configurations.

MFC after: 3 days

15 years ago- Fix object directory creation when running threaded buildworld
Gabor Kovesdan [Fri, 13 Mar 2009 22:41:30 +0000 (22:41 +0000)]
- Fix object directory creation when running threaded buildworld

15 years agoHID usage minimum can be equal to the maximum.
Andrew Thompson [Fri, 13 Mar 2009 22:28:37 +0000 (22:28 +0000)]
HID usage minimum can be equal to the maximum.

Submitted by: Hans Petter Selasky
Tested by: Andreas Tobler

15 years agofix portability; linux does not have sa_len/sun_len
Sam Leffler [Fri, 13 Mar 2009 19:05:34 +0000 (19:05 +0000)]
fix portability; linux does not have sa_len/sun_len

15 years agoFix comment explaining where this driver came from.
Rui Paulo [Fri, 13 Mar 2009 16:43:31 +0000 (16:43 +0000)]
Fix comment explaining where this driver came from.

MFC after: 2 weeks

15 years agoRename the k8temp(4) man page to amdtemp(4) and update its contents for
Rui Paulo [Fri, 13 Mar 2009 16:42:24 +0000 (16:42 +0000)]
Rename the k8temp(4) man page to amdtemp(4) and update its contents for
the new families.

MFC after: 2 weeks

15 years ago- Add an entry about enabling libc NLS support
Gabor Kovesdan [Fri, 13 Mar 2009 16:40:56 +0000 (16:40 +0000)]
- Add an entry about enabling libc NLS support

15 years agoImplement new way of branding ELF binaries by looking to a
Dmitry Chagin [Fri, 13 Mar 2009 16:40:51 +0000 (16:40 +0000)]
Implement new way of branding ELF binaries by looking to a
".note.ABI-tag" section.

The search order of a brand is changed, now first of all the
".note.ABI-tag" is looked through.

Move code which fetch osreldate for ELF binary to check_note() handler.

PR: 118473
Approved by: kib (mentor)