Commit Graph

143134 Commits

Author SHA1 Message Date
Jason Evans
93e34865fa Do not spin when trying to lock on a single-CPU system.
Reported by:	davidxu
2008-11-30 05:55:24 +00:00
Sam Leffler
cd0c91eb32 not needed any more 2008-11-30 05:45:18 +00:00
Sam Leffler
9f213138eb move bus+softc typedefs to ah_osdep.h so we can eliminate the opaque
write-around; it doesn't work for some platforms (e.g. ia64) and is
now pointless
2008-11-30 05:44:58 +00:00
Joseph Koshy
cb2394085d Improve a comment. 2008-11-30 05:10:14 +00:00
Alexander Motin
a2302ba6a7 According to "Intel 64 and IA-32 Architectures Software Developer's Manual
Volume 3B: System Programming Guide, Part 2", CPUs with family 0x6 and model
above or 0xE and CPUs with family 0xF and model above or 0x3 have invariant
TSC.
2008-11-30 00:11:48 +00:00
Alexander Motin
9ee5eabc3f According to "Intel 64 and IA-32 Architectures Software Developer's Manual
Volume 3B: System Programming Guide, Part 2", CPUs with family 0x6 and model
above or 0xE and CPUs with family 0xF and model above or 0x3 have invariant
TSC.
2008-11-30 00:10:55 +00:00
Konstantin Belousov
e711c6f0d1 Unlock the malloc() locks in the child process after fork(). This gives
us working malloc in the fork child of the multithreaded process.

Although POSIX requires that only async-signal safe functions shall be
operable after fork in multithreaded process, not having malloc lower
the quality of our implementation.

Tested by:	rink
Discussed with:	kan, davidxu
Reviewed by:	kan
MFC after:	1 month
2008-11-29 21:46:28 +00:00
Marcel Moolenaar
39bd58723a Parse the error string returned by the kernel. The format is:
<errno> [<parameter> <value>]
So, rather than printing the error:
	gpart: 22 scheme 'gpt'
gpart(8) now prints:
	gpart: scheme 'gpt': invalid argument
2008-11-29 21:20:07 +00:00
Tim Kientzle
5157f46024 Format the output of -itv for real. In particular:
* Lookup uname/gname if not provided by the archive (I copied the
   uname/gname lookup cache from bsdtar)
 * Format device number instead of size for device nodes
 * Format date.

There's still a few improvements that I could copy from
bsdtar, especially the locale-aware safe_fprintf() code
and the locale-aware setup for day_first date formatting.
(And, of course, I need to think through a clean way to
push this stuff down into libarchive.)

Thanks to Peter Wemm for reminding me of this overlooked TODO item.
2008-11-29 20:22:02 +00:00
Konstantin Belousov
a001bdc71d Third argument to the vi_mmap_t function is vm_paddr_t *.
MFC after:	3 days
2008-11-29 20:16:53 +00:00
Tim Kientzle
5af3583731 When deciding which characters (of a filename, for instance)
are safe to print, try to take into account the current locale.
This iterates over output strings using mbtowc() to identify
multi-byte sequences.  If iswprint() claims the corresponding
wide character is printable, the original bytes are passed
through.  Otherwise, we expand characters into C-style
\-escape sequences.

Submitted by:	Michihiro NAKAJIMA
MFC after:	30 days
2008-11-29 20:06:53 +00:00
Christian Brueffer
0d9d2de11a Add standard MLINKs. 2008-11-29 19:01:44 +00:00
Christian Brueffer
818640aabc Bring this a little closer to our manpage style. 2008-11-29 18:58:20 +00:00
Christian Brueffer
a61a804377 Add several missing MLINKs. 2008-11-29 18:21:31 +00:00
Christian Brueffer
d3e659b5e2 Fix typo. 2008-11-29 18:09:50 +00:00
Konstantin Belousov
74f5d68011 Make linux_sendmsg() and linux_recvmsg() work on linux32/amd64.
Change types used in the linux' struct msghdr and struct cmsghdr
definitions to the properly-sized architecture-specific types.
Move ancillary data handler from linux_sendit() to linux_sendmsg().

Submitted by:	dchagin
2008-11-29 17:14:06 +00:00
Bjoern A. Zeeb
d465a41d3b Unbreak the no-networks (no INET/6) build that I broke with
the commit in r185435.

Pointyhat:	no, but I could need a ski cap for the winter
2008-11-29 16:17:39 +00:00
Konstantin Belousov
862e19d312 Regenerate 2008-11-29 14:57:58 +00:00
Konstantin Belousov
41f53a3665 Fix iovec32 for linux32/amd64.
Add a custom version of copyiniov() to deal with the 32-bit iovec
pointers from userland (to be used later).

Adjust prototypes for linux_readv() and linux_writev() to use new
l_iovec32 definition and to match actual linux code. In particular,
use ulong for fd (why ?).

Submitted by:	dchagin
2008-11-29 14:55:24 +00:00
Bjoern A. Zeeb
759e7c0bbb Regen after jail support was added in r185435. 2008-11-29 14:34:30 +00:00
Bjoern A. Zeeb
413628a7e3 MFp4:
Bring in updated jail support from bz_jail branch.

This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..

SCTP support was updated and supports IPv6 in jails as well.

Cpuset support permits jails to be bound to specific processor
sets after creation.

Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.

DDB 'show jails' command was added to aid debugging.

Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.

Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.

Bump __FreeBSD_version for the afore mentioned and in kernel changes.

Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
  and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
  help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
  suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
  on cluster machines as well as all the testers and people
  who provided feedback the last months on freebsd-jail and
  other channels.
- My employer, CK Software GmbH, for the support so I could work on this.

Reviewed by:	(see above)
MFC after:	3 months (this is just so that I get the mail)
X-MFC Before:   7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
Rui Paulo
f0f4475a13 Check the return value of config_intrhook_establish().
Found with:	Coverity Prevent(tm)
CID:		2115
2008-11-29 14:26:22 +00:00
Rui Paulo
4710587722 Check for non-existing model DMI string.
Submitted by:	ganbold
Found with:	Coverity Prevent(tm)
CID:         	2434
MFC after:	1 week
2008-11-29 14:20:36 +00:00
Konstantin Belousov
6179164448 In the nfsrv_fhtovp(), after the vfs_getvfs() function found the pointer
to the fs, but before a vnode on the fs is locked, unmount may free fs
structures, causing access to destroyed data and freed memory.

Introduce a vfs_busymp() function that looks up and busies found
fs while mountlist_mtx is held. Use it in nfsrv_fhtovp() and in the
implementation of the handle syscalls.

Two other uses of the vfs_getvfs() in the vfs_subr.c, namely in
sysctl_vfs_ctl and vfs_getnewfsid seems to be ok. In particular,
sysctl_vfs_ctl is protected by Giant by being a non-sleeping sysctl
handler, that prevents Giant-locked unmount code to interfere with it.

Noted by:	tegge
Reviewed by:	dfr
Tested by:	pho
MFC after:	1 month
2008-11-29 13:34:59 +00:00
Pawel Jakub Dawidek
0c6a80e78d Improve KASSERT() call a bit:
- Print flags in hex.
- Note that flags can be fine and panic can be due unexpected error condition.
- Remove redundant new line character.

Eventhough panic message excess 80 characters keep it in one line so it is
easier to grep.
2008-11-29 12:40:14 +00:00
Pawel Jakub Dawidek
35a15332f3 MFp4: Remove assertion that is no longer valid - we now use VOP_CLOSE() in
more places (ie vdev_file.c).
2008-11-29 12:32:42 +00:00
Bjoern A. Zeeb
ac8fd4f437 make 'make universe' not complain about
In file included from /src/sys/modules/powermac_nvram/../../dev/powermac_nvram/powermac_nvram.c:38:
  @/dev/ofw/ofw_bus.h:36:24: error: ofw_bus_if.h: No such file or directory
I am not sure for how long this had not worked and if it was just the
latest vimage commit that had revealed this or if nobody had built
universe successfully in a while. Btw, the tinderbox did not complain
either so that is probably the reason noone had noticed.
2008-11-29 08:45:20 +00:00
Warner Losh
1f2c9f3b84 Unbreak mips build by taking first WAG at mb(), wmb() and rmb(). The
latter two are likely pessimal...
2008-11-29 05:16:14 +00:00
Warner Losh
44e6d7240a Noticed the following error message:
mount_msdosfs: /dev/cf0s1: : Operation not supported by device

and thought I'd fix it to be:

mount_msdosfs: /dev/cf0s1: Operation not supported by device

Not sure why errmsg isn't getting filled in, or why this error is even
happening at all... (fsck_msdosfs is clean, and I can mount this same
CF elsewhere).
2008-11-29 02:28:05 +00:00
Bjoern A. Zeeb
1e7d7466b7 Renamed the FRAMELEN macro to TRUEPHY_FRAMELEN as for powerpc
it seems to be possible to collide with FRAMELEN from machine/frame.h.

Found by:	zec
2008-11-28 23:44:13 +00:00
Marko Zec
5c890d3c4f Add an essential .h file that skipped from the last commit (r185419).
Pointy hat #1 on...

Pointed out by:	bz
2008-11-28 23:39:25 +00:00
Marko Zec
f02493cbbd Unhide declarations of network stack virtualization structs from
underneath #ifdef VIMAGE blocks.

This change introduces some churn in #include ordering and nesting
throughout the network stack and drivers but is not expected to cause
any additional issues.

In the next step this will allow us to instantiate the virtualization
container structures and switch from using global variables to their
"containerized" counterparts.

Reviewed by:	bz, julian
Approved by:	julian (mentor)
Obtained from:	//depot/projects/vimage-commit2/...
X-MFC after:	never
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
2008-11-28 23:30:51 +00:00
Sam Leffler
82bf290a5a add chip+rf names for debug msgs, showing compiled-in support, etc. 2008-11-28 22:27:26 +00:00
Sam Leffler
e488aee2e4 use os shim for linker set walking 2008-11-28 22:26:36 +00:00
Sam Leffler
d0f7743df9 remove ath_hal_buildopts and ath_hal_version; they are not needed any more 2008-11-28 22:25:31 +00:00
Sam Leffler
3eb701279d kill AH_DISABLE_WME stuff; it's been posible to do this from the
driver for a while
2008-11-28 20:26:33 +00:00
Sam Leffler
665f466da0 bump for linke set changes 2008-11-28 19:58:31 +00:00
Sam Leffler
60177845fd Replace most compile-time support options with linker sets for
chip and RF backend support:
o add OS_DATA_SET and OS_SET_DECLARE os requirements for setting
  up linker sets
o add AH_CHIP macro for registering chip support (e.g. 5210)
o add AH_RF macro for registering RF support (e.g. 2413); note
  this isn't required for single chip solutions where there's no
  ambiguity (e.g. 5416/9160+2133) but for 5212 class parts it's
  required because of the multi-chip solutions
o remove all uses of AH_SUPPORT_AR5210, AH_SUPPORT_AR5211, AH_SUPPORT_5212,
  and AH_SUPPORT_AR9160; still need AH_SUPPORT_AR5416 to enable the 11n
  descriptor formats and 5312 support is presently broken
o remove all uses of AH_SUPPORT_2133, AH_SUPPORT_2413, AH_SUPPORT_5111,
  AH_SUPPORT_5112, AH_SUPPORT_2417, AH_SUPPORT_2425, and AH_SUPPORT_5413;
  5312-related support still requires fixup

Remaining issues:
o fixup SoC attach
o ath_hal_attach uses a hack to probe w/o access to the vendorid
o fallback handling of parts w/o a macrev needs to be restored
2008-11-28 19:58:09 +00:00
Maxim Konovalov
39a7471508 o FreeBSD 6.4-RELEASE added. 2008-11-28 19:35:48 +00:00
Bjoern A. Zeeb
b9f0b66c75 With the permissions of phk@ change the license on kern_jail.c
to a 2 clause BSD license.
2008-11-28 19:23:46 +00:00
Warner Losh
26775f91c1 Add missing 'THE'. This was discussed with core@ in the larger
context of making this text match the OSL text, but the changes that
OSL silently made to the license to approve it haven't been brought
back yet.  Still working on that issue.

We likely should start using the UTF-8 copyright symbol (What &copy;
expands to in HTML), but I'm not 100% confident in my ability to tell
Emacs to save it like that.  And I haven't gotten approval for that
change.

Approved by:	core@
2008-11-28 19:21:10 +00:00
Stefan Farfeleder
b0cb038bc5 Update for 185401, errors now go to stderr. 2008-11-28 18:59:04 +00:00
Stefan Farfeleder
f7bbf3ffcf Report error messages of the builtins 'type' and 'command -V' to stderr instead
of stdout.

Noticed by:	Zajcev Evgeny
2008-11-28 18:55:42 +00:00
George V. Neville-Neil
94f138fe60 Fix a printing problem when using the -L flag to netstat caused
by adding the -x flag earlier.

Submitted by:	Anton Yuzhaninov
MFC after:	3 days
2008-11-28 18:35:14 +00:00
Ed Schouten
1cbae70533 Fix matching of message queues by name.
The mqfs_search() routine uses strncmp() to match message queue objects
by name. This is because it can be called from environments where the
file name is not null terminated (the VFS for example).

Unfortunately it doesn't compare the lengths of the message queue names,
which means if a system has "Queue12345", the name "Queue" will also
match.

I noticed this when a student of mine handed in an exercise using
message queues with names "Queue2" and "Queue".

Reviewed by:	rink
2008-11-28 14:53:18 +00:00
Dag-Erling Smørgrav
3b6fe5fcd9 missing V_ 2008-11-28 13:13:44 +00:00
Bjoern A. Zeeb
bb7ca0c71a Add a reference to hwpmc_core.c most likely missed in r185363
to try to unbreak universe (untested).
2008-11-28 12:23:02 +00:00
Sam Leffler
d143488650 Update to later code from my repository:
o many bug fixes
o add new periodic calibration api
o break up 5416 periodic calibration code in preparation for 928x
o move get noise floor to rf backends
o 5416-specific ani (still disabled)
o modularize 5210 eeprom format a la other eeprom formats
o start cleaning up regdomain code
o prepare for proper 1/2 and 1/4 width channel support
o bring back 900MHz card support
o clean up 5212 rf version handling
o add 1/2 and 1/4 width channel support for 5212 parts
o split 5212 rfgain handling out
o improve ani debugging
o add AH_USE_INIPDGAIN compile option
o purge a bunch of dead 5212 state
o add 1/2 and 1/4 rate modes
o remove HAL_CAP_CHAN_HALFRATE and HAL_CAP_CHAN_QUARTERRATE; the
  same info can now be deduced from the set of supported modes
2008-11-28 00:48:05 +00:00
Sam Leffler
89eac01a28 not needed 2008-11-28 00:17:12 +00:00
Sam Leffler
dbc3938b08 remove unneeded stuff 2008-11-28 00:16:30 +00:00