]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoAdd WARNS?=6, because it seems to build out of the box.
ed [Sat, 5 Dec 2009 19:55:26 +0000 (19:55 +0000)]
Add WARNS?=6, because it seems to build out of the box.

14 years agoUse _ULOG_POSIX_NAMES here, to make eventual porting to <utmpx.h> easier.
ed [Sat, 5 Dec 2009 19:54:37 +0000 (19:54 +0000)]
Use _ULOG_POSIX_NAMES here, to make eventual porting to <utmpx.h> easier.

By the time we gain a real <utmpx.h>, it's just a matter of changing the
include at the top and -lulog from the Makefile.

14 years agoMassively extend libulog:
ed [Sat, 5 Dec 2009 19:53:29 +0000 (19:53 +0000)]
Massively extend libulog:

- Just like struct utmp, store strings inside struct utmpx itself. This
  is needed to make things like pututxline() work.
- Add ut_id and ut_pid fields, even though they have little use in our
  implementation.
- It turns out our "reboot" wtmp entries indicate a system boot, so
  remove REBOOT_TIME
- Implement getutxline() and pututxline
- Add getutxuser() and setutxfile(), which allows us to crawl wtmp and
  lastlog files as well.
- Add _ULOG_POSIX_NAMES, so we can already use the POSIX names if we
  really want to.

14 years agoFix many "function declaration isn't a prototype" warnings in libc.
ed [Sat, 5 Dec 2009 19:31:38 +0000 (19:31 +0000)]
Fix many "function declaration isn't a prototype" warnings in libc.

I've only fixed code that seems to be written by `us'. There are still
many warnings like this present in resolv/, rpc/, stdtime/ and yp/.

14 years agoDon't let the C library depend on <utmp.h>.
ed [Sat, 5 Dec 2009 19:04:21 +0000 (19:04 +0000)]
Don't let the C library depend on <utmp.h>.

The maximum length of a username has nothing to do with the size of the
username in the utmp files. Use MAXLOGNAME, which is defined as 17
(UT_USERSIZE + 1).

14 years agoRemove warnings from exec.c.
ed [Sat, 5 Dec 2009 18:55:16 +0000 (18:55 +0000)]
Remove warnings from exec.c.

The entries in the argv array are not const themselves, but sometimes we
want to fill in const values. Just make the array const and use
__DECONST() to make it const for the execve()-call itself.

Also convert the only K&R prototype to ANSI.

14 years agoUse ANSI C prototypes inside termios.
ed [Sat, 5 Dec 2009 18:53:04 +0000 (18:53 +0000)]
Use ANSI C prototypes inside termios.

While there, add a missing __unused to hide a warning in tcsetbreak().

14 years agoRemove (hidden) warning about missing prototypes for fdevname(3).
ed [Sat, 5 Dec 2009 18:51:44 +0000 (18:51 +0000)]
Remove (hidden) warning about missing prototypes for fdevname(3).

14 years agoAdd more obsolete files.
antoine [Sat, 5 Dec 2009 17:46:51 +0000 (17:46 +0000)]
Add more obsolete files.

14 years agoRemove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros.
antoine [Sat, 5 Dec 2009 17:45:56 +0000 (17:45 +0000)]
Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros.

MFC after: 1 month

14 years agoFix deadlock when ZVOLs are present and we are replacing dead component or
pjd [Sat, 5 Dec 2009 14:33:11 +0000 (14:33 +0000)]
Fix deadlock when ZVOLs are present and we are replacing dead component or
calling scrub when pool is in a degraded state. It will try to taste ZVOLs,
which will lead to deadlock, as ZVOL will try to acquire the same locks as
replace/scrub is holding already.

We can't simply skip provider based on their GEOM class, because ZVOL can have
providers build on top of it and we need to skip those as well.

We do it by asking for ZFS::iszvol attribute. Any ZVOL-based provider will give
us positive answer and we have to skip those providers.

This way we remove possibility to create ZFS pools on top of ZVOLs, but it is
not very useful anyway.

I believe deadlock is still possible in some very complex situations like when
we have MD provider on top of UFS file on top of ZVOL. When we try to replace
dead component in the pool mentioned ZVOL is based on, there might be a
deadlock when ZFS will try to taste MD provider. There is no easy way to detect
that, but it isn't very common.

MFC after: 1 week

14 years agoAlways check guid when opening by path, because we may end up with provider
pjd [Sat, 5 Dec 2009 14:24:22 +0000 (14:24 +0000)]
Always check guid when opening by path, because we may end up with provider
that does have the same name, but only by accident.

MFC after: 1 week

14 years agoAvoid using additional variable for storing an error if we are not going
pjd [Sat, 5 Dec 2009 14:21:42 +0000 (14:21 +0000)]
Avoid using additional variable for storing an error if we are not going
to do anything with it.

14 years agoMake sure enough memory is allocated for a struct pft_entry when
syrinx [Sat, 5 Dec 2009 13:45:21 +0000 (13:45 +0000)]
Make sure enough memory is allocated for a struct pft_entry when
refreshing the list of pf tables.

OKed by: philip
MFC after: 1 week

14 years agoDo not ignore device interrupt if bus mastering is still active. It is
mav [Sat, 5 Dec 2009 13:40:51 +0000 (13:40 +0000)]
Do not ignore device interrupt if bus mastering is still active. It is
normal in case of media read error and some ATAPI cases, when transfer size
is unknown beforehand. PCI ATA BM specification tells that in case of such
underrun driver should just manually stop DMA engine. DMA engine should
same time guarantie that all bus mastering transfers completed at the moment
of driver reads interrupt flag asserted.
This change should fix interrupt storms and command timeouts in many cases.

PR: kern/103602, sparc64/121539, kern/133122, kern/139654

14 years agoAdd a missing space to the error message when execvp() failed.
stefanf [Sat, 5 Dec 2009 13:12:04 +0000 (13:12 +0000)]
Add a missing space to the error message when execvp() failed.

14 years agoadjust comment in previous commit after Julian's explanation
luigi [Sat, 5 Dec 2009 11:51:32 +0000 (11:51 +0000)]
adjust comment in previous commit after Julian's explanation

14 years agoOn Soft Reset, read device signature from FIS receive area, instead of
mav [Sat, 5 Dec 2009 10:30:54 +0000 (10:30 +0000)]
On Soft Reset, read device signature from FIS receive area, instead of
PxSIG register. It works better for NVidia chipsets. ahci(4) does the same.

PR: kern/140472, i386/138668

14 years agoremove a dead block of code, document how the ipfw clients are
luigi [Sat, 5 Dec 2009 09:13:06 +0000 (09:13 +0000)]
remove a dead block of code, document how the ipfw clients are
hooked and the difference in handling the 'enable' variable
for layer2 and layer3. The latter needs fixing once i figure out
how it worked pre-vnet.

MFC after: 7 days

14 years agofix build with VNET enabled
luigi [Sat, 5 Dec 2009 08:32:12 +0000 (08:32 +0000)]
fix build with VNET enabled

Reported by: David Wolfskill

14 years agoRegenerate.
kib [Fri, 4 Dec 2009 21:53:20 +0000 (21:53 +0000)]
Regenerate.

14 years agoAdd several syscall compat32 entries for acl manipulation.
kib [Fri, 4 Dec 2009 21:52:31 +0000 (21:52 +0000)]
Add several syscall compat32 entries for acl manipulation.
They do not require translation of the arguments.

Tested by: bsam
MFC after: 1 week

14 years agoThis is v4l support for the linuxulator. This allows to access FreeBSD
netchild [Fri, 4 Dec 2009 21:06:54 +0000 (21:06 +0000)]
This is v4l support for the linuxulator. This allows to access FreeBSD
native devices which support the v4l API from processes running within
the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver.

Not tested is firmware upload, framebuffer stuff and video tuner stuff
due to lack of hardware.
The clipping part (VIDIOCSWIN) needs a little bit of further work (partly
in progress, but can not be tested due to lack of a suitable device).

The submitter tested this sucessfully with Skype and flash apps on amd64 and
i386 with the multimedia/pwcbsd driver.

Submitted by: J.R. Oldroyd <fbsd@opal.com>

14 years agoImport the unchanged v4l videodev.h from the vendor branch.
netchild [Fri, 4 Dec 2009 20:46:45 +0000 (20:46 +0000)]
Import the unchanged v4l videodev.h from the vendor branch.

14 years agoImport the interface description of the video for linux (v4l) subsystem.
netchild [Fri, 4 Dec 2009 20:42:08 +0000 (20:42 +0000)]
Import the interface description of the video for linux (v4l) subsystem.
The header is importet from linux 2.6.17.

The header does not come with a license, the author
(Alan Cox <alan@redhat.com>) gave his permission to use it (note, X.org
has a copy of the header too):
---snip---
> Alan Cox <alan@redhat.com> said:
>
> > On Tue, Apr 12, 2005 at 03:13:15PM -0700, Julian Elischer wrote:
> > > How does the licensing of the include files stand?
>
> Basically you cannot copyright an interface - its a fact rather
> than creative expression normally.
>
> > > Of course there's always the "type it all in again" approach
> > > where we define a functionally equivalent but completely
> > > differntly spelled API,
>
> Wouldn't even need to be differently spelled.
>
> I'm all for this kind of sharing.
>
> Alan
---snip---

A more complete mail history is provided in the README file.

Approved by: core
Thanks to: julian (he also has the OK to use the v4l2 header)

14 years agoUse INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard
ume [Fri, 4 Dec 2009 15:39:37 +0000 (15:39 +0000)]
Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard
coded number.

Spotted by: bz

14 years agofix argument type in the call to expand_number
luigi [Fri, 4 Dec 2009 14:18:30 +0000 (14:18 +0000)]
fix argument type in the call to expand_number

Submitted by: gcc 4.3
MFC after: 3 days

14 years ago- In ypproc_all_2_svc(), yp_fork() is called only when !debug case.
kuriyama [Fri, 4 Dec 2009 14:12:37 +0000 (14:12 +0000)]
- In ypproc_all_2_svc(), yp_fork() is called only when !debug case.
  So _exit() in the bottom of this function should be called with the
  same case.

14 years ago- Replace magic number with YPOLDVERS macro (which may be missed in
kuriyama [Fri, 4 Dec 2009 14:08:57 +0000 (14:08 +0000)]
- Replace magic number with YPOLDVERS macro (which may be missed in
  r14262).

14 years agoAdd disk-magic for amd64: same as i386.
phk [Fri, 4 Dec 2009 10:57:01 +0000 (10:57 +0000)]
Add disk-magic for amd64: same as i386.

Pass PORTS_OPTS wherever we invoke ports makefiles

Add a logfile where we can see the progress of distfile prefetching

14 years agoAdd a missing word to a sentence in the return values section.
trhodes [Fri, 4 Dec 2009 09:20:20 +0000 (09:20 +0000)]
Add a missing word to a sentence in the return values section.

14 years agoichsmb: drop default attachment to generic smbus hardware
avg [Fri, 4 Dec 2009 05:45:46 +0000 (05:45 +0000)]
ichsmb: drop default attachment to generic smbus hardware

Attach only to devices known to be supported.
This change overrided and undoes r200053.

Suggested by: jhb
MFC after: 2 weeks (only to stable/8)

14 years agoFix cases where we've managed to get a Loop UP event prior to initializing
mjacob [Fri, 4 Dec 2009 03:34:12 +0000 (03:34 +0000)]
Fix cases where we've managed to get a Loop UP event prior to initializing
the loop down counter, as well as other things. This was brought to my
attention with a different fix, more for RELENG_7- this one covers the
multiple channel case.

PR: 140438
MFC after: 1 month

14 years agoAdd workaround to overcome hardware limitation which allows only a
yongari [Thu, 3 Dec 2009 23:57:06 +0000 (23:57 +0000)]
Add workaround to overcome hardware limitation which allows only a
single outstanding DMA read operation. Most controllers targeted to
client with PCIe bus interface(e.g. BCM5761) may have this
limitation. All controllers for servers does not have this
limitation.
Collapsing mbuf chains to reduce number of memory reads before
transmitting was most effective way to workaround this. I got about
940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
takes a lot of CPU cycles to collapse mbuf chains so add tunable to
control the number of allowed TX buffers before collapsing. The
default value is 0 which effectively disables the forced collapsing.
For most cases 2 would yield best performance(about 930Mbps)
without much sacrificing CPU cycles.
Note the collapsing is only activated when the controller is on
PCIe bus and the frame does not need TSO operation. TSO does not
seem to suffer from the hardware limitation because the payload
size is much bigger than normal IP datagram.
Thanks to davidch@ who told me the limitation of client controllers
and actually gave possible workarounds to mitigate the limitation.

Reviewed by: davidch, marius

14 years agoAdd uhci/ehci controller ids.
thompsa [Thu, 3 Dec 2009 23:24:12 +0000 (23:24 +0000)]
Add uhci/ehci controller ids.

Submitted by: mitya_cabletv.dp.ua

14 years agoChange 'load' balancing mode algorithm:
mav [Thu, 3 Dec 2009 21:47:51 +0000 (21:47 +0000)]
Change 'load' balancing mode algorithm:
- Instead of measuring last request execution time for each drive and
choosing one with smallest time, use averaged number of requests, running
on each drive. This information is more accurate and timely. It allows to
distribute load between drives in more even and predictable way.
- For each drive track offset of the last submitted request. If new request
offset matches previous one or close for some drive, prefer that drive.
It allows to significantly speedup simultaneous sequential reads.

PR: kern/113885
Reviewed by: sobomax

14 years agoRepair breakage to last-minute API change.
ed [Thu, 3 Dec 2009 21:44:41 +0000 (21:44 +0000)]
Repair breakage to last-minute API change.

I changed ulog_log{in,out} to return a void, but forgot to change
ulog-helper as well.

Reported by: stefanf

14 years agoProperly return an error reply if an NFS remove or link operation fails.
jhb [Thu, 3 Dec 2009 20:59:28 +0000 (20:59 +0000)]
Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

PR: kern/140853
Submitted by: Ted Faber  faber at isi edu (remove)
Reviewed by: rmacklem (remove)
MFC after: 1 week

14 years agoThe first argument of dcbz interprets r0 as a literal zero, not the second.
nwhitehorn [Thu, 3 Dec 2009 20:55:09 +0000 (20:55 +0000)]
The first argument of dcbz interprets r0 as a literal zero, not the second.
This worked before by accident.

MFC after: 1 week

14 years agoRemove wrong assertion. Debugee is allowed to lose a signal.
kib [Thu, 3 Dec 2009 20:16:59 +0000 (20:16 +0000)]
Remove wrong assertion. Debugee is allowed to lose a signal.

Reported and tested by: jh
MFC after: 2 weeks

14 years agoYet another cosmetic fix.
trasz [Thu, 3 Dec 2009 20:06:03 +0000 (20:06 +0000)]
Yet another cosmetic fix.

14 years agoCosmetical fixes.
trasz [Thu, 3 Dec 2009 20:02:26 +0000 (20:02 +0000)]
Cosmetical fixes.

14 years agoCosmetical fixes.
trasz [Thu, 3 Dec 2009 19:59:27 +0000 (19:59 +0000)]
Cosmetical fixes.

14 years ago- Update the Spanish NLS catalog
gabor [Thu, 3 Dec 2009 19:27:12 +0000 (19:27 +0000)]
- Update the Spanish NLS catalog

Reviewed by: carvay,
the.infamous.paul@gmail.com,
Joan Picanyol i Puig <lists-freebsd-es@biaix.org>,
Ing . Marcos Luis Ortiz Valmaseda <mlortiz@uci.cu>,
eskanete@gmail.com,
Jose M Rodriguez <josemi@freebsd.jazztel.es>,
Guillermo Hernandez <guillermo@QuerySoft.es>,
dani.doni@gmail.com

14 years agoDescription of steps required to setup NFSv4 server is in nfsv4(4);
trasz [Thu, 3 Dec 2009 19:16:40 +0000 (19:16 +0000)]
Description of steps required to setup NFSv4 server is in nfsv4(4);
add reference to exports(5), since that's the obvious starting point
for searching for this.

14 years agoRemove unused code.
trasz [Thu, 3 Dec 2009 18:16:14 +0000 (18:16 +0000)]
Remove unused code.

14 years agoAdd manpages for ams(4), akbd(4), adb(4), and cuda(4), which describe
nwhitehorn [Thu, 3 Dec 2009 18:13:47 +0000 (18:13 +0000)]
Add manpages for ams(4), akbd(4), adb(4), and cuda(4), which describe
various drivers for Apple Desktop Bus controllers and peripherals.

MFC after: 3 days

14 years agoRemove unneeded ifdefs.
trasz [Thu, 3 Dec 2009 18:03:42 +0000 (18:03 +0000)]
Remove unneeded ifdefs.

Reviewed by: rmacklem

14 years agoConnect unzip to the build.
rdivacky [Thu, 3 Dec 2009 18:02:55 +0000 (18:02 +0000)]
Connect unzip to the build.

Approved by: ed (mentor)
Approved by: des (unzip author)
Tested by: exp ports build (miwi)

14 years agoUse USER_PROCESS instead of LOGIN_PROCESS.
ed [Thu, 3 Dec 2009 17:05:36 +0000 (17:05 +0000)]
Use USER_PROCESS instead of LOGIN_PROCESS.

POSIX isn't clear about how the fields should be used, but according to
utmpx(5) on Linux, LOGIN_PROCESS refers to a TTY that's still running a
getty.

14 years agoPort users(1) to libulog.
ed [Thu, 3 Dec 2009 16:42:18 +0000 (16:42 +0000)]
Port users(1) to libulog.

Instead of digging through the utmp database by hand, use proper API
calls to do so.  Instead of parsing entries with a non-empty ut_user, we
now look at LOGIN_PROCESS entries.

14 years agoAlso implement ut_type.
ed [Thu, 3 Dec 2009 16:33:47 +0000 (16:33 +0000)]
Also implement ut_type.

I thought we couldn't emulate this field, but we can derive this field
by looking at special values for ut_host, ut_line and ut_name.

14 years agomca: small enhancements related to cpu quirks
avg [Thu, 3 Dec 2009 16:10:21 +0000 (16:10 +0000)]
mca: small enhancements related to cpu quirks

- use utility macros for CPU family/model checking
- limit Intel P6 quirk to pre-Nehalem models (taken from OpenSolaris)
- add AMD GartTblWkEn quirk for families 0Fh and 10h; I haven't experienced
  any problems without the quirk but both Linux and OpenSolaris do this
- slightly re-arrange quirk code to provide for the future generalization
  and separation of vendor-specific quirk functions

Reviewed by: jhb
MFC after: 1 week

14 years agoFix a problem with high CPU consumption (up to 30%) by bsnmpd on a loaded system.
syrinx [Thu, 3 Dec 2009 16:08:00 +0000 (16:08 +0000)]
Fix a problem with high CPU consumption (up to 30%) by bsnmpd on a loaded system.
Instead of constantly calling the mibII_idle function when the server is not busy
call the function only once every 10 seconds to avoid bsnmpd constantly doing
gettimeofday syscalls. Make the idle polling interval confugurable via
begemotIfDataPoll.

Reported and tested by: misho (at) aitbg (dot) com
Oked by: harti
MFC after: 1 week

14 years agoAdd a new library: libulog.
ed [Thu, 3 Dec 2009 15:48:24 +0000 (15:48 +0000)]
Add a new library: libulog.

One of the things I really want to do, is to get rid of the limitations
of our current utmp(5) mechanism:

- It only allows 8 byte TTY device names.
- The hostname only allows 16 bytes of storage.

I'm not a big fan of <utmpx.h>, but I think we should at least try to
add parts of it. Unfortunately we cannot implement <utmpx.h>, because we
miss various fields, such as ut_id, ut_pid, etc. The API provided by
libulog shares some similarities with <utmpx.h>, so it shouldn't be too
hard to port these applications eventually. In most simple cases, it
should just be a matter of removing the ulog_ prefix everywhere.

As a bonus, it also implements a function called ulog_login_pseudo(),
which allows unprivileged applications to write log entries, provided
they have a valid file descriptor to a pseudo-terminal master device.

libulog will allow a smoother transition to a new file format by adding
a library interface to deal with utmp/wtmp/lastlog files. I initially
thought about adding the functionality to libutil, but because I'm not
planning on keeping this library around forever, we'd better keep it
separated.

Next items on the todo list:

1. Port applications in the base system (and ports) to libulog, instead
   of letting them use <utmp.h>.
2. Remove <utmp.h>, implement <utmpx.h> and reimplement this library on
   top.
3. Port as many applications as possible back to <utmpx.h>.

14 years agoThe fd_mask type is an unsigned long, not an int, so treat the mask as a
jhb [Thu, 3 Dec 2009 15:14:30 +0000 (15:14 +0000)]
The fd_mask type is an unsigned long, not an int, so treat the mask as a
long instead of an int when examining the results of select() to look for
RPC requests.  Previously this routine would ignore RPC requests to sockets
whose file descriptor mod 64 was greater than 31 on a 64-bit platform.

PR: amd64/141130
Submitted by: liujb of array networks
MFC after: 3 days

14 years agoUse a better check for a valid kernel stack address when capturing
jkoshy [Thu, 3 Dec 2009 14:59:42 +0000 (14:59 +0000)]
Use a better check for a valid kernel stack address when capturing
kernel call chains.

Submitted by: Mark Unangst <mju at panasas.com>
Tested by: fabient

14 years agopreparation work to replace the monster switch in ipfw_chk() with
luigi [Thu, 3 Dec 2009 14:22:15 +0000 (14:22 +0000)]
preparation work to replace the monster switch in ipfw_chk() with
table of functions.

This commit (which is heavily based on work done by Marta Carbone
in this year's GSOC project), removes the goto's and explicit
return from the inner switch(), so we will have a easier time when
putting the blocks into individual functions.

MFC after: 3 weeks

14 years agoAdd change that was somehow missed in r192586. It could manifest by
trasz [Thu, 3 Dec 2009 13:29:24 +0000 (13:29 +0000)]
Add change that was somehow missed in r192586.  It could manifest by
incorrectly returning EINVAL from acl_valid(3) for applications linked
against pre-8.0 libc.

14 years agouse qsort_r instead of heapsort;
luigi [Thu, 3 Dec 2009 12:23:48 +0000 (12:23 +0000)]
use qsort_r instead of heapsort;
staticize two functions.

MFC after: 3 days

14 years agoTeach an IPv6 to the debug prints.
ume [Thu, 3 Dec 2009 11:16:53 +0000 (11:16 +0000)]
Teach an IPv6 to the debug prints.

14 years agoDisable SSL renegotiation in order to protect against a serious
cperciva [Thu, 3 Dec 2009 09:18:40 +0000 (09:18 +0000)]
Disable SSL renegotiation in order to protect against a serious
protocol flaw. [09:15]

Correctly handle failures from unsetenv resulting from a corrupt
environment in rtld-elf. [09:16]

Fix permissions in freebsd-update in order to prevent leakage of
sensitive files. [09:17]

Approved by: so (cperciva)
Security: FreeBSD-SA-09:15.ssl
Security: FreeBSD-SA-09:16.rtld
Security: FreeBSD-SA-09:17.freebsd-udpate

14 years agoichsmb: try attaching only to intel hardware in the default case
avg [Thu, 3 Dec 2009 08:11:20 +0000 (08:11 +0000)]
ichsmb: try attaching only to intel hardware in the default case

Ideally we should attempt attaching only to known supported devices.
But I am not sure that we have all supported PCI IDs already listed,
and I am too young to die, err, I don't want to take the heat from
causing a trouble to someone.

MFC after: 1 week
X-ToDo: drop the default case

14 years agoichsmb: add pci ids for some newer supported hardware
avg [Thu, 3 Dec 2009 08:01:29 +0000 (08:01 +0000)]
ichsmb: add pci ids for some newer supported hardware

Submitted by: Dmitry S. Luhtionov <mitya@cabletv.dp.ua>
MFC after: 5 days

14 years agoMake sure bus space accesses use unorder memory loads and stores.
marcel [Thu, 3 Dec 2009 04:06:48 +0000 (04:06 +0000)]
Make sure bus space accesses use unorder memory loads and stores.
Memory accesses are posted in program order by virtue of the
uncacheable memory attribute.
Since GCC, by default, adds acquire and release semantics to
volatile memory loads and stores, we need to use inline assembly
to guarantee it. With inline assembly, we don't need volatile
pointers anymore.

Itanium does not support semaphore instructions to uncacheable
memory.

14 years agoFix cut'n paste on the AR9280 entry.
thompsa [Wed, 2 Dec 2009 21:22:10 +0000 (21:22 +0000)]
Fix cut'n paste on the AR9280 entry.

Submitted by: pluknet

14 years agoInclude <sys/sysctl.h>, to get the declarations of ostype and
marcel [Wed, 2 Dec 2009 20:24:37 +0000 (20:24 +0000)]
Include <sys/sysctl.h>, to get the declarations of ostype and
osrelease. Remove the duplicate declarations from this file.

14 years agoAdd missing parameter description.
trasz [Wed, 2 Dec 2009 18:11:14 +0000 (18:11 +0000)]
Add missing parameter description.

14 years agoDon't use ap->a_td->td_ucred when we were passed ap->a_cred.
trasz [Wed, 2 Dec 2009 18:09:22 +0000 (18:09 +0000)]
Don't use ap->a_td->td_ucred when we were passed ap->a_cred.

14 years ago- initialize src_ip in the main loop to prevent a compiler warning
luigi [Wed, 2 Dec 2009 17:50:52 +0000 (17:50 +0000)]
- initialize src_ip in the main loop to prevent a compiler warning
  (gcc 4.x under linux, not sure how real is the complaint).
- rename a macro argument to prevent name clashes.
-  add the macro name on a couple of #endif
- add a blank line for readability.

MFC after: 3 days

14 years agoBump __FreeBSD_version for sigpause(3) addition [1] and
kib [Wed, 2 Dec 2009 16:40:23 +0000 (16:40 +0000)]
Bump __FreeBSD_version for sigpause(3) addition [1] and
PIE support in csu.

Requested by: fluffy [1]

14 years agoProperly support -fPIE by linking PIE binaries with specially-built
kib [Wed, 2 Dec 2009 16:34:20 +0000 (16:34 +0000)]
Properly support -fPIE by linking PIE binaries with specially-built
Scrt1.o instead of crt1.o, since the later is built as non-PIC.

Separate i386-elf crt1.c into the pure assembler part and C code,
supplying all data extracted by assembler stub as explicit parameters [1].
Hide and localize _start1 symbol used as an interface between asm and
C code.

In collaboration with: kan
Inspired by: PR i386/127387 [1]
Prodded and tested by: rdivacky [1]
MFC after: 3 weeks

14 years agondis_scan_results() can sleep if the scan results are not ready when
jhb [Wed, 2 Dec 2009 16:26:18 +0000 (16:26 +0000)]
ndis_scan_results() can sleep if the scan results are not ready when
ndis_scan() is called.  However, ndis_scan() is invoked from softclock()
and cannot sleep.  Move ndis_scan_results() to the ndis' driver's scan_end
hook instead.

Submitted by: Paul B Mahol  onemda of gmail
MFC after: 1 week

14 years agoFix several cases where the periph lock was held over malloc.
scottl [Wed, 2 Dec 2009 16:08:33 +0000 (16:08 +0000)]
Fix several cases where the periph lock was held over malloc.

Submitted by: Jaakko Heinonen

14 years agoMake <libutil.h> work when included by itself.
ed [Wed, 2 Dec 2009 15:56:18 +0000 (15:56 +0000)]
Make <libutil.h> work when included by itself.

There are several reasons why it didn't work:

- It was missing <sys/cdefs.h> for __BEGIN_DECLS.
- It uses various primitive types that were not declared.

14 years agoDispatch sockopt calls to ipfw and dummynet
luigi [Wed, 2 Dec 2009 15:50:43 +0000 (15:50 +0000)]
Dispatch sockopt calls to ipfw and dummynet
using the new option numbers, IP_FW3 and IP_DUMMYNET3.
Right now the modules return an error if called with those arguments
so there is no danger of unwanted behaviour.

MFC after: 3 days

14 years agomca: improve status checking, recording and reporting
avg [Wed, 2 Dec 2009 15:45:55 +0000 (15:45 +0000)]
mca: improve status checking, recording and reporting

- directly print mca information in case we fail to allocate memory
  for a record
- include bank number into mca record
- print raw mca status value for extended information

Reviewed by: jhb
MFC after: 10 days

14 years agosmall changes for portability and diff reduction wrt/ FreeBSD 7.
luigi [Wed, 2 Dec 2009 15:20:31 +0000 (15:20 +0000)]
small changes for portability and diff reduction wrt/ FreeBSD 7.
No functional differences.

- use the div64() macro to wrap 64 bit divisions
  (which almost always are 64 / 32 bits) so they are easier
  to handle with compilers or OS that do not have native
  support for 64bit divisions;

- use a local variable for p_numbytes even if not strictly
  necessary on HEAD, as it reduces diffs with FreeBSD7

- in dummynet_send() check that a tag is present before
  dereferencing the pointer.

- add a couple of blank lines for readability near the end of a function

MFC after: 3 days

14 years agoUnify rc.firewall and rc.firewall6, and obsolete rc.firewall6
ume [Wed, 2 Dec 2009 15:05:26 +0000 (15:05 +0000)]
Unify rc.firewall and rc.firewall6, and obsolete rc.firewall6
and rc.d/ip6fw.

Reviewed by: dougb, jhb
MFC after: 1 month

14 years agoTeach an IPv6 to send_pkt() and ipfw_tick().
ume [Wed, 2 Dec 2009 14:32:01 +0000 (14:32 +0000)]
Teach an IPv6 to send_pkt() and ipfw_tick().
It fixes the issue which keep-alive doesn't work for an IPv6.

PR: kern/117234
Submitted by: mlaier, Joost Bekkers <joost__at__jodocus.org>
MFC after: 1 month

14 years agoUntil this moment carp(4) used a strange logging priority. It used debug
glebius [Wed, 2 Dec 2009 13:24:21 +0000 (13:24 +0000)]
Until this moment carp(4) used a strange logging priority. It used debug
priority for such important information as MASTER/BACKUP state change,
and used a normal logging priority for such innocent messages as receiving
short packet (which is a normal VRRP packet between some other routers) or
receving a CARP packet on non-carp interface (someone else running CARP).

This commit shifts message logging priorities to a more sane default.

14 years agoAdd new sockopt names for ipfw and dummynet.
luigi [Wed, 2 Dec 2009 10:36:41 +0000 (10:36 +0000)]
Add new sockopt names for ipfw and dummynet.

This commit is just grabbing entries for the new names
that will be used in the future, so you don't need to
rebuild anything now.

MFC after: 3 days

14 years agochange the type of the opcode from enum *:8 to u_int8_t
luigi [Wed, 2 Dec 2009 08:52:06 +0000 (08:52 +0000)]
change the type of the opcode from enum *:8  to u_int8_t
so the size and alignment of the ipfw_insn is not compiler dependent.
No changes in the code generated by gcc.

There was only one instance of this kind in our entire source tree,
so i suspect the old definition was a poor choice (which i made).

MFC after: 3 days

14 years agoFix the dprintf() prototype.
brueffer [Wed, 2 Dec 2009 07:51:25 +0000 (07:51 +0000)]
Fix the dprintf() prototype.

PR: 141087
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
MFC after: 3 days

14 years agoBump limits on PowerPC. This allows large executables like parts of LLVM
nwhitehorn [Wed, 2 Dec 2009 06:49:22 +0000 (06:49 +0000)]
Bump limits on PowerPC. This allows large executables like parts of LLVM
to function.

Reviewed by: grehan
Obtained from: NetBSD
MFC after: 2 weeks

14 years agoAdd missing ath_ar9* ath hal entries.
thompsa [Wed, 2 Dec 2009 00:38:11 +0000 (00:38 +0000)]
Add missing ath_ar9* ath hal entries.

14 years agoRemove unknown ath hal device entries.
thompsa [Wed, 2 Dec 2009 00:37:03 +0000 (00:37 +0000)]
Remove unknown ath hal device entries.

14 years agoAdd CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands.
mav [Tue, 1 Dec 2009 23:01:29 +0000 (23:01 +0000)]
Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands.
It is not needed for SATA controllers, but required for PATA.

14 years agoT3 firmware 7.8.0 for cxgb(4)
np [Tue, 1 Dec 2009 22:23:15 +0000 (22:23 +0000)]
T3 firmware 7.8.0 for cxgb(4)

Obtained from: Chelsio
MFC after: 3 days

14 years agoFix parenthesis typo -- copy full frame pointer for userland callchain,
emaste [Tue, 1 Dec 2009 21:54:53 +0000 (21:54 +0000)]
Fix parenthesis typo -- copy full frame pointer for userland callchain,
not just one byte.

Submitted by: Ryan Stone rysto32 at gmail dot com

14 years agoDon't allocate an input buffer for a TTY when the receiver is turned off.
ed [Tue, 1 Dec 2009 19:14:57 +0000 (19:14 +0000)]
Don't allocate an input buffer for a TTY when the receiver is turned off.

When the termios CREAD flag is not set, it makes little sense to
allocate an input buffer. Just set the size to 0 in this case to reduce
memory footprint.

Disallow CREAD to be disabled for pseudo-devices to prevent
foot-shooting.

14 years agoAdd media ioctl support and link notifications so that devd will attempt
gibbs [Tue, 1 Dec 2009 17:29:25 +0000 (17:29 +0000)]
Add media ioctl support and link notifications so that devd will attempt
to run dhclient on a netfront (xn) device that is setup for DHCP in
/etc/rc.conf.

PR: kern/136251 (fixed differently than the submitted patch)

14 years agoDon't try to bind to an anycast addeess. The KAME IPv6 stack doesn't
ume [Tue, 1 Dec 2009 16:07:50 +0000 (16:07 +0000)]
Don't try to bind to an anycast addeess.  The KAME IPv6 stack doesn't
allow bind to an anycast addeess.  It does away with an annoying
message.

Reviewed by: bz, roberto
MFC after: 2 weeks

14 years agoRemove -t from the manpage and usage.
jhb [Tue, 1 Dec 2009 15:18:25 +0000 (15:18 +0000)]
Remove -t from the manpage and usage.

14 years agoUnbreak user space after if_timer/if_watchdog removal in r199975.
bz [Tue, 1 Dec 2009 14:56:00 +0000 (14:56 +0000)]
Unbreak user space after if_timer/if_watchdog removal in r199975.

Tested by: glebius

14 years agoAdd an .Nm for strncat.
brueffer [Tue, 1 Dec 2009 07:28:56 +0000 (07:28 +0000)]
Add an .Nm for strncat.

PR: 141037
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
MFC after: 3 days

14 years agoTemporarily revert the previous change because the linker has been
green [Tue, 1 Dec 2009 06:42:47 +0000 (06:42 +0000)]
Temporarily revert the previous change because the linker has been
modified so that it will abort when the environment is bad.

14 years agoDescribe what setpgid(2) does when pgid=0. The text has been
keramida [Tue, 1 Dec 2009 06:12:31 +0000 (06:12 +0000)]
Describe what setpgid(2) does when pgid=0.  The text has been
copied from NetBSD's manpage, and it also matches the behavior
described by the Open Group's online copy of setpgid.2 at
http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html

Obtained from: NetBSD
Submitted by: Petros Barbayiannis <petrosbarbayiannis@yahoo.gr>
MFC after: 1 week

14 years agoDo not gratuitously fail *env(3) operations due to corrupt ('='-less)
green [Tue, 1 Dec 2009 05:04:31 +0000 (05:04 +0000)]
Do not gratuitously fail *env(3) operations due to corrupt ('='-less)
**environ entries.  This puts non-getenv(3) operations in line with
getenv(3) in that bad environ entries do not cause all operations to
fail.  There is still some inconsistency in that getenv(3) in the
absence of any environment-modifying operation does not emit corrupt
environ entry warnings.

I also fixed another inconsistency in getenv(3) where updating the
global environ pointer would not be reflected in the return values.
It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3)
in order to see the change.

14 years agoFix local root vulnerability.
cperciva [Tue, 1 Dec 2009 02:57:06 +0000 (02:57 +0000)]
Fix local root vulnerability.

Security: Advisory will be coming soon.
X-MFC-After: 30 seconds