]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoAllocate a stack for thread0 and switch to it before calling
marcel [Mon, 4 Feb 2008 02:21:33 +0000 (02:21 +0000)]
Allocate a stack for thread0 and switch to it before calling
mi_startup(). This frees up kstack for static PAL/SAL calls
and double-fault handling.

16 years agoAdd pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
des [Sun, 3 Feb 2008 22:38:10 +0000 (22:38 +0000)]
Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
locked.  This is intended primarily to support the userland equivalent
of the various *_ASSERT_LOCKED() macros we have in the kernel.

MFC after: 2 weeks

16 years agoAdd a regression test for pthread_mutex_islocked_np().
des [Sun, 3 Feb 2008 22:35:45 +0000 (22:35 +0000)]
Add a regression test for pthread_mutex_islocked_np().

MFC after: 2 weeks

16 years agoRemove incomplete support of AI_ALL and AI_V4MAPPED.
ume [Sun, 3 Feb 2008 19:07:55 +0000 (19:07 +0000)]
Remove incomplete support of AI_ALL and AI_V4MAPPED.

Reported by: "Heiko Wundram (Beenic)" <wundram__at__beenic.net>

16 years agoMove all possible node logic out of the rcvdata() function
mav [Sun, 3 Feb 2008 18:55:45 +0000 (18:55 +0000)]
Move all possible node logic out of the rcvdata() function
to the newhook()/disconnect().
Unify function names with other nodes.

16 years agocorrect tx rate displayed by list sta: the reported legacy tx rate
sam [Sun, 3 Feb 2008 18:29:58 +0000 (18:29 +0000)]
correct tx rate displayed by list sta: the reported legacy tx rate
is still an index into the rate set and not (yet) the rate code

Noticed by: JoaoBR

16 years agofix list mac; broken in delta 1.48
sam [Sun, 3 Feb 2008 18:21:13 +0000 (18:21 +0000)]
fix list mac; broken in delta 1.48

Noticed by: JoaoBR

16 years agoAdd -P <port> option to allow binding to a specific port.
matteo [Sun, 3 Feb 2008 17:39:37 +0000 (17:39 +0000)]
Add -P <port> option to allow binding to a specific port.

PR: bin/109494
Submitted by: mtm
MFC after: 1 week

16 years agoFix printing of unionfs mounts when using the -p option
matteo [Sun, 3 Feb 2008 17:23:58 +0000 (17:23 +0000)]
Fix printing of unionfs mounts when using the -p option

PR:  bin/75585
MFC after: 1 week

16 years agoRemove an empty line that crept into the previous commit.
brueffer [Sun, 3 Feb 2008 16:42:22 +0000 (16:42 +0000)]
Remove an empty line that crept into the previous commit.

16 years agoMLINK hptrr(4) to rr232x(4).
brueffer [Sun, 3 Feb 2008 16:38:44 +0000 (16:38 +0000)]
MLINK hptrr(4) to rr232x(4).

Requested by: scottl

16 years agoUpdate the hptiop man page for the new driver.
scottl [Sun, 3 Feb 2008 16:16:38 +0000 (16:16 +0000)]
Update the hptiop man page for the new driver.

16 years agoUpdate the hptiop driver to version 1.3. This adds support for the 4xxx
scottl [Sun, 3 Feb 2008 16:07:12 +0000 (16:07 +0000)]
Update the hptiop driver to version 1.3.  This adds support for the 4xxx
series of adapters.  Thanks again to Highpoint for their continued support
of FreeBSD.

Submitted by: Highpoint Technologies

16 years agoGive sendfile(2) a SF_SYNC flag which makes it wait until all mbufs
phk [Sun, 3 Feb 2008 15:54:41 +0000 (15:54 +0000)]
Give sendfile(2) a SF_SYNC flag which makes it wait until all mbufs
referencing the files VM pages are returned from the network stack,
making changes to the file safe.

This flag does not guarantee that the data has been transmitted to the
other end.

16 years ago- Correctly handle ALTQ in ieee80211_deliver_data()
sephe [Sun, 3 Feb 2008 12:00:03 +0000 (12:00 +0000)]
- Correctly handle ALTQ in ieee80211_deliver_data()
- Add comment from sam that ALTQ probably does not work well with WME

PR: kern/119548
Approved by: sam (mentor)

16 years agoVarious bug fixes for 2560 parts of ral(4):
sephe [Sun, 3 Feb 2008 11:47:38 +0000 (11:47 +0000)]
Various bug fixes for 2560 parts of ral(4):
- Rename rt2560_read_eeprom to rt2560_read_config, we already have
  rt2560_eeprom_read
- If hardware gives us wrong encryption done index, shout out loudly and
  terminate the processing loop
- Process encryption done if RX done bit is set in interrupt status register
  (according to Ralink Linux driver)
- Turn VALID/BUSY bits in TX descriptor only after TX descriptor is fully setup
- Fix BBP read: RT2560_BBPCSR can't be written until its RT2560_BBP_BUSY bit is
  off (according to Ralink Linux driver)
- Skip invalid (0 of 0xffff) BBP register/value entries stored in EEPROM
- Fix channel TX power location in EEPROM, if channel TX power is above 31 set
  it to 24 (TX power only has 5bits in RF register, "24" is according to Ralink
  Linux driver)
- Configure BBP according to the BBP register/value stored in EEPROM, restore
  BBP17 (RX sensitivity tuning) to default value after this.
- Set TX/RX antenna after BBP is initialized; these two operation will try to
  set BBP registers
- Reconfigure ACK TX time registers according to 802.11g standard (TX @36Mb,
  other side's ACK should be sent @24Mb).
- 2560 parts have two TX ring: one for management/control packets, one for data
  packets.  Add private OACTIVE flag for each of them.  Turn on IFF_DRV_OACTIVE
  if one of private OACTIVE is on; turn off IFF_DRV_OACTIVE iff all of them are
  off.
- Rework watchdog to mimic old if_watchdog action.  Process TX done/encryption
  done in watchdog function (according to Ralink Linux driver)

Obtained from: DragonFly
Approved by: sam (mentor)
Tested by: sam
Related to PR: kern/117655

# Forcing long slot time setting is not included in this commit, comment and
# related code is in place, so if problem pops up, quick tests could be done.

16 years agoNormally, when a header file is removed from the build (as i4b headers
des [Sun, 3 Feb 2008 11:34:56 +0000 (11:34 +0000)]
Normally, when a header file is removed from the build (as i4b headers
were recently), a simple 'make cleandepend; make depend' is sufficient
to keep the tree buildable after a cvs update when doing incremental
builds.

However, kdump and truss use a script which searches for header files
that define ioctls, and generates C code that includes them.  This
script will usually not need updating when a header file is removed,
so the normal dependency mechanism will not realize that it needs to
be re-run.  One is therefore left with code that references dead files
but will only be removed by a full 'make clean', which defeats the
purpose of incremental builds.

To work around this, modify the cleandepend target in bsd.dep.mk to
also remove any files listed in a new variable named CLEANDEPFILES,
and modify kdump's and truss's Makefiles accordingly.

MFC after: 2 weeks

16 years agoThese are files are shell scripts; give smart editors a chance to figure
des [Sun, 3 Feb 2008 11:33:27 +0000 (11:33 +0000)]
These are files are shell scripts; give smart editors a chance to figure
it out by adding the usual shebang.

MFC after: 2 weeks

16 years agoRevert previous commit.
mav [Sun, 3 Feb 2008 10:30:45 +0000 (10:30 +0000)]
Revert previous commit.
glebius@ noticed that it was not a bug, but undocumented feature.

16 years agoDon't build the rr232x module, it has been removed.
brueffer [Sun, 3 Feb 2008 10:05:00 +0000 (10:05 +0000)]
Don't build the rr232x module, it has been removed.

Approved by: rwatson (mentor)

16 years agoThe rr232x driver has been removed, kill it here as well.
brueffer [Sun, 3 Feb 2008 09:43:08 +0000 (09:43 +0000)]
The rr232x driver has been removed, kill it here as well.

16 years agoRemove the rr232x manual page.
scottl [Sun, 3 Feb 2008 07:31:49 +0000 (07:31 +0000)]
Remove the rr232x manual page.

16 years agoRemove the rr232x driver. It has been superceded by the hptrr driver.
scottl [Sun, 3 Feb 2008 07:07:30 +0000 (07:07 +0000)]
Remove the rr232x driver.  It has been superceded by the hptrr driver.

16 years agoCorrect a typo.
jkoshy [Sun, 3 Feb 2008 06:04:38 +0000 (06:04 +0000)]
Correct a typo.

16 years agoEliminate xargs in favor of find -exec {} +
des [Sun, 3 Feb 2008 00:33:05 +0000 (00:33 +0000)]
Eliminate xargs in favor of find -exec {} +

16 years agoAdd a few more CPUID feature bits while here. We don't support these
das [Sat, 2 Feb 2008 23:17:27 +0000 (23:17 +0000)]
Add a few more CPUID feature bits while here. We don't support these
features yet.

16 years agoSSE4 CPUID bits
das [Sat, 2 Feb 2008 22:40:17 +0000 (22:40 +0000)]
SSE4 CPUID bits

16 years agoAdd comment that bpfread() has multi-threading issues.
rwatson [Sat, 2 Feb 2008 20:35:05 +0000 (20:35 +0000)]
Add comment that bpfread() has multi-threading issues.

Fix minor white space nit.

16 years agopc98 lint builds w/o warnings. Remove the last special case from our
imp [Sat, 2 Feb 2008 19:55:28 +0000 (19:55 +0000)]
pc98 lint builds w/o warnings.  Remove the last special case from our
compiler upgrade.

# if tinderbox breaks, I'll fix it, but it shouldn't...

16 years agoThis commit was generated by cvs2svn to compensate for changes in r175898,
obrien [Sat, 2 Feb 2008 18:26:53 +0000 (18:26 +0000)]
This commit was generated by cvs2svn to compensate for changes in r175898,
which included commits to RCS files with non-trunk default branches.

16 years agoFix some bugs in dealing with DCMD'd without data. MegaCli was sending
ambrisko [Sat, 2 Feb 2008 17:29:28 +0000 (17:29 +0000)]
Fix some bugs in dealing with DCMD'd without data.  MegaCli was sending
down some DCMD's without any data.  Thanks to Dell and LSI for helping
to provide clues to figure out this problem.  Now MegaCli can upgrade
the firmware and should work identical when run on Linux.

Reviewed by: scottl, LSI
MFC after: 1 day

16 years agoArm should build fine with -Werror as well.
cognet [Sat, 2 Feb 2008 16:47:15 +0000 (16:47 +0000)]
Arm should build fine with -Werror as well.

16 years agosun4v has a MACHINE_ARCH of sparc64, so it was covered under that clause and
imp [Sat, 2 Feb 2008 16:40:40 +0000 (16:40 +0000)]
sun4v has a MACHINE_ARCH of sparc64, so it was covered under that clause and
shouldn't have been added.  Remove it.

16 years agoRather than passing around a cached 'priv', pass in an ucred to
bz [Sat, 2 Feb 2008 14:11:31 +0000 (14:11 +0000)]
Rather than passing around a cached 'priv', pass in an ucred to
ipsec*_set_policy and do the privilege check only if needed.

Try to assimilate both ip*_ctloutput code blocks calling ipsec*_set_policy.

Reviewed by: rwatson

16 years agoRewrite to consume significantly less memory, by using find -s instead of
des [Sat, 2 Feb 2008 12:27:37 +0000 (12:27 +0000)]
Rewrite to consume significantly less memory, by using find -s instead of
find | sort.  As a bonus, this simplifies the logic considerably.  Also
remove the bogus "overruning the args to ls" comment and the corresponding
"-n 20" argument to xargs; the whole point with xargs is precisely that it
knows how large the argument list can safely get.

Note that the first run of the updated script may hypotheticall produce
false positives due to differences between find's and sort's sorting
algorithm.  I haven't seen this during testing, but others might.

MFC after: 2 weeks

16 years agoFix one more grammo.
marck [Sat, 2 Feb 2008 08:41:53 +0000 (08:41 +0000)]
Fix one more grammo.

Noticed by: ru

16 years agoSome platforms that are currently under development have to cope with
imp [Sat, 2 Feb 2008 07:52:24 +0000 (07:52 +0000)]
Some platforms that are currently under development have to cope with
a variety of bootloaders.  This sometimes means that different loader
scripts are required within one ${MACHINE_ARCH}, which makes the
current practice of using ldscript.${MACHINE_ARCH} unsuitable.
Instead, make the default the current convention and allow the ld
scripts to be overridden as necessary.

16 years agoWall of shame rather than wall of fame for the -Werror suppression.
imp [Sat, 2 Feb 2008 07:43:38 +0000 (07:43 +0000)]
Wall of shame rather than wall of fame for the -Werror suppression.
If we aren't arm, pc98 or sun4v, then enable treating warnings like
errors.  That doesn't mean these platforms aren't -Werror clean, just
that we haven't enforced it before.  Someone with some spare time
should investigate these three platforms to see if any can be removed.

16 years agoThis commit was generated by cvs2svn to compensate for changes in r175882,
obrien [Sat, 2 Feb 2008 07:19:01 +0000 (07:19 +0000)]
This commit was generated by cvs2svn to compensate for changes in r175882,
which included commits to RCS files with non-trunk default branches.

16 years agoFix nit in version 4.23 in which -p does not work (thus updating access
obrien [Sat, 2 Feb 2008 07:19:01 +0000 (07:19 +0000)]
Fix nit in version 4.23 in which -p does not work (thus updating access
times when it shouldn't).  The PR's patch has been incorporated upstream
as magic.c rev 1.46.

PR: 107676
Submitted by: Dr. Markus Waldeck <waldeck@gmx.de>

16 years agoadd opaque pointer to tx ampdu state for drivers
sam [Sat, 2 Feb 2008 00:38:02 +0000 (00:38 +0000)]
add opaque pointer to tx ampdu state for drivers

MFC after: 3 days

16 years agoWhen the state of the interface changes rapidly enough (usually due to
brooks [Fri, 1 Feb 2008 23:43:58 +0000 (23:43 +0000)]
When the state of the interface changes rapidly enough (usually due to
rapid wireless association changes in my experience), there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.

MFC after: 1 week

16 years agoo correct typo that broke check when handling addba response
sam [Fri, 1 Feb 2008 21:31:10 +0000 (21:31 +0000)]
o correct typo that broke check when handling addba response
o add a comment about the ht rates being for 20MHz channels w/ long GI;
  needs a separate fix after more thought

MFC after: 3 days

16 years agoRelax the check for a PCI-express chipset by assuming the system is a
jhb [Fri, 1 Feb 2008 20:31:09 +0000 (20:31 +0000)]
Relax the check for a PCI-express chipset by assuming the system is a
PCI-express chipset (and thus has functional MSI) if there are any
PCI-express devices in the system, not requiring a root port device.

With PCI-X the chipset detection has to be very conservative because there
are known systems with PCI-X devices that do not appear to have PCI-X
chipsets.  However, with PCI-express I'm not sure it is possible to have
a PCI-express device in a system with a non-PCI-express chipset.  If we
assume that is the case then this change is valid.  It is also required
for at least some PCI-express systems that don't have any devices with
a root port capability (some ICH9 systems).

MFC after: 1 week
Reported by: jfv

16 years agoUpdate korean locale messages:
jkim [Fri, 1 Feb 2008 20:15:21 +0000 (20:15 +0000)]
Update korean locale messages:

- Remove redundant `s' and `S' from yesexpr.
- Add fullwidth latin letters to yesexpr and noexpr (inspired by ja_JP.UTF-8).
- Add korean translated yesexpr (`Ye') and noexpr (`Anio').
- Add yesstr and nostr entries (inspired by zh_CN.*).
- Add UTF-8 encoded file and connect to build.

16 years agoGive MEXTADD() another argument to make both void pointers to the
phk [Fri, 1 Feb 2008 19:36:27 +0000 (19:36 +0000)]
Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.

Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.

Likely break the only non-convetional user of the API, after informing
the relevant committer.

Update the mbuf(9) manual page, which was already out of sync on
this point.

Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.

This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.

This does not affect the memory layout or size of mbufs.

Parental oversight by: sam and rwatson.

No MFC is anticipated.

16 years agoReword recent comment a bit.
marck [Fri, 1 Feb 2008 17:35:46 +0000 (17:35 +0000)]
Reword recent comment a bit.

16 years agoUse FEATURE() macro to advertise aio availability.
rwatson [Fri, 1 Feb 2008 11:59:14 +0000 (11:59 +0000)]
Use FEATURE() macro to advertise aio availability.

16 years agoAdd comments about stack protection mechanism.
mav [Fri, 1 Feb 2008 11:01:15 +0000 (11:01 +0000)]
Add comments about stack protection mechanism.

16 years agoTune the message for better informativity.
mav [Fri, 1 Feb 2008 07:25:06 +0000 (07:25 +0000)]
Tune the message for better informativity.
Print the hook pointer as other functions do.

16 years agoBand-aid recent commit by mav by replacing a variable in a CTR statement with
benno [Fri, 1 Feb 2008 07:17:26 +0000 (07:17 +0000)]
Band-aid recent commit by mav by replacing a variable in a CTR statement with
the variable that appears as if it should've been there.

Pointy hat to: mav
Not tested either by: benno

16 years agoImplement Session-ID hashing to improve receive performance scalability
mav [Thu, 31 Jan 2008 22:42:37 +0000 (22:42 +0000)]
Implement Session-ID hashing to improve receive performance scalability
for big number of concurrent sessions.

16 years agoWhen reinitializing a lockuser, don't assume that the lock is in
deischen [Thu, 31 Jan 2008 19:38:26 +0000 (19:38 +0000)]
When reinitializing a lockuser, don't assume that the lock is in
use.  If it is in use, use the watched request, otherwise use the
lockuser's own request.  Only allocate a lockuser request if both
requests are null.

PR: 119920
Tested by (6.x): Landon Fuller <landonf -at- bikemonkey -dot- org>

16 years agoFix an indentation.
jkim [Thu, 31 Jan 2008 16:58:07 +0000 (16:58 +0000)]
Fix an indentation.

16 years agoThe devstat(3) manpage claims that only <devstat.h> is needed as a
jhb [Thu, 31 Jan 2008 16:55:12 +0000 (16:55 +0000)]
The devstat(3) manpage claims that only <devstat.h> is needed as a
prerequisite for using this interface.  However, the 'statinfo' struct
actually references CPUSTATES from <sys/resource.h>, so in fact it
requires <sys/resource.h> to compile.  Use a nested include of
<sys/resource.h> to make the code match the docs.

Reported by: Pietro Cerutti  gahr | gahr.ch

16 years agoDo not sanitize disk geometry if it is set by scripts in non-interactive mode.
jkim [Thu, 31 Jan 2008 16:54:02 +0000 (16:54 +0000)]
Do not sanitize disk geometry if it is set by scripts in non-interactive mode.

MFC after: 3 days

16 years agoFor no good reason I had assumed that ACPI table headers would be page
jhb [Thu, 31 Jan 2008 16:51:43 +0000 (16:51 +0000)]
For no good reason I had assumed that ACPI table headers would be page
aligned (or at least not cross a page boundary).  However, it turns out
that on at least one machine one table header does cross a page boundary.
This caused problems with the MADT early probe as it uses the crash dump
map to load ACPI tables by loading the RSDT/XSDT into pages 1 ... N and
loading the header of each ACPI table header into page 0 looking for the
MADT.  However, if a table header crossed a page boundary, then page 1
would get trashed resulting in a panic.  Fix this by reserving the first
2 pages for ACPI table headers (headers are less than a page in size,
so 2 pages will be sufficient) and use pages 2 .. N for the RSDT and XSDT.

Note: amd64 should probably be simplified to just use pmap_mapbios()
for all these tables which will use the direct map and not need the
crash dump hack.

MFC after: 5 days
Tested on: i386
Reported by: Pete French  petefrench of ticketswitch.com

16 years agoUse dump_write() instead of direct calls to di->dumper() in textdumps.
rwatson [Thu, 31 Jan 2008 16:22:14 +0000 (16:22 +0000)]
Use dump_write() instead of direct calls to di->dumper() in textdumps.
Textdumps already do pretty much the same sanity checking, but
abstractions and seatbelts are both useful.

MFC after: 2 months

16 years agoDe-sparc64-ify (now that it's also installed on PowerPC).
ru [Thu, 31 Jan 2008 14:58:55 +0000 (14:58 +0000)]
De-sparc64-ify (now that it's also installed on PowerPC).

16 years agoSpot two more bugs WRT adherence to the local prompt style.
yar [Thu, 31 Jan 2008 13:22:13 +0000 (13:22 +0000)]
Spot two more bugs WRT adherence to the local prompt style.

16 years agoUse consistent style in user prompts: the question is in a new line
yar [Thu, 31 Jan 2008 13:16:29 +0000 (13:16 +0000)]
Use consistent style in user prompts: the question is in a new line
and begins with a capital letter.  The rest of pwarn/ask pairs here
follows this style.

Requested by: bde

16 years agoSome code reformat.
mav [Thu, 31 Jan 2008 10:13:04 +0000 (10:13 +0000)]
Some code reformat.

16 years agoImplement stack protection based on GET_STACK_USAGE() macro.
mav [Thu, 31 Jan 2008 08:51:48 +0000 (08:51 +0000)]
Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.

16 years agoMove GET_STACK_USAGE from MI header to i386/amd64 MD ones.
mav [Thu, 31 Jan 2008 08:24:27 +0000 (08:24 +0000)]
Move GET_STACK_USAGE from MI header to i386/amd64 MD ones.
Somebody who can, please feel free to implement it for other archs
or copy this one if it suits.

16 years agoCorrect two problems relating to sorflush(), which is called to flush
rwatson [Thu, 31 Jan 2008 08:22:24 +0000 (08:22 +0000)]
Correct two problems relating to sorflush(), which is called to flush
read socket buffers in shutdown() and close():

- Call socantrcvmore() before sblock() to dislodge any threads that
  might be sleeping (potentially indefinitely) while holding sblock(),
  such as a thread blocked in recv().

- Flag the sblock() call as non-interruptible so that a signal
  delivered to the thread calling sorflush() doesn't cause sblock() to
  fail.  The sblock() is required to ensure that all other socket
  consumer threads have, in fact, left, and do not enter, the socket
  buffer until we're done flushin it.

To implement the latter, change the 'flags' argument to sblock() to
accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
acquisition, regardless of the setting of the disposition of SB_NOINTR
on the socket buffer; without this change it would be possible for
another thread to clear SB_NOINTR between when the socket buffer mutex
is released and sblock() is invoked.

Reviewed by: bz, kmacy
Reported by: Jos Backus <jos at catnook dot com>

16 years agoAdd hook routine archive_write_ar_finish() which writes the 'ar'
kaiw [Thu, 31 Jan 2008 08:11:01 +0000 (08:11 +0000)]
Add hook routine archive_write_ar_finish() which writes the 'ar'
global header if nothing else has been written before the closing of
the archive. This will change the behaviour when creating archives
without members, i.e., instead of generating a 0-size archive file, an
archive with just the global header (8 bytes in total) will be created
and it is indeed a valid archive by the definition of libarchive, thus
subsequent operation on this archive will be accepted. This especially
solves the failure caused by following sequence: (several ports do)

% ar cru libfoo.a       # without specifying obj files
% ranlib libfoo.a

Reviewed by: kientzle, jkoshy
Approved by: kientzle
Approved by: jkoshy (mentor)
Reported by: erwin
MFC after: 1 month

16 years agoAdd a test to verify compatibility with archives with
kientzle [Thu, 31 Jan 2008 07:47:38 +0000 (07:47 +0000)]
Add a test to verify compatibility with archives with
odd hardlinks.  I need to extend this to test pax extended
archives with bodies attached to hardlinks and other less-common cases.

16 years agoTighten up the heuristic that decides whether or not we should
kientzle [Thu, 31 Jan 2008 07:41:45 +0000 (07:41 +0000)]
Tighten up the heuristic that decides whether or not we should
obey or ignore the size field on a hardlink entry.  In particular,
if we're reading a non-POSIX archive, we should always ignore
the size field.

This should fix both the audio/xmcd port and the math/unixstat port.

Thanks to: Pav Lucistnik for pointing these two ports out to me.
MFC after: 7 days

16 years agoEnable ofwdump on powerpc (finally). Tested on G3 & G4 machines.
grehan [Thu, 31 Jan 2008 01:57:33 +0000 (01:57 +0000)]
Enable ofwdump on powerpc (finally). Tested on G3 & G4 machines.

Submitted by: Dan Stekloff  <dsteklof at c i s c o dot com>
Discussed with: marcel

16 years agoBring in the nice work from Mark Tinguely on arm pmap.
cognet [Thu, 31 Jan 2008 00:05:40 +0000 (00:05 +0000)]
Bring in the nice work from Mark Tinguely on arm pmap.
The only downside is that it renames pmap_vac_me_harder() to pmap_fix_cache().
From Mark's email on -arm :
pmap_get_vac_flags(), pmap_vac_me_harder(), pmap_vac_me_kpmap(), and
pmap_vac_me_user() has been rewritten as pmap_fix_cache() to be more
efficient in the kernel map case. I also removed the reference to
the md.kro_mappings, md.krw_mappings, md.uro_mappings, and md.urw_mappings
counts.

In pmap_clearbit(), we can also skip over tests and writeback/invalidations
in the PVF_MOD and PVF_REF cases if those bits are not set in the pv_flag.
PVF_WRITE will turn caching back on and remove the PV_MOD bit.

In pmap_nuke_pv(), the vm_page_flag_clear(pg, PG_WRITEABLE) has been moved
to the pmap_fix_cache().

We can be more agressive in attempting to turn caching back on by calling
pmap_fix_cache() at times that may be appropriate to turn cache on
(a kernel mapping has been removed, a write has been removed or a read
has been removed and we know the mapping does not have multiple write
mappings to a page).

In pmap_remove_pages() the cpu_idcache_wbinv_all() is moved to happen
before the page tables are NULLed because the caches are virtually
indexed and virtually tagged.

In pmap_remove_all(), the pmap_remove_write(m) is added before the
page tables are NULLed because the caches are virtually indexed and
virtually tagged. This also removes the need for the caches fixing routine
(whichever is being used pmap_vac_me_harder() or pmap_fix_cache()) to be
called on any of these mappings.

In pmap_remove(), I simplified the cache cleaning process and removed
extra TLB removals. Basically if more than PMAP_REMOVE_CLEAN_LIST_SIZE
are removed, then just flush the entire cache.

16 years agoFix two typos.
delphij [Wed, 30 Jan 2008 22:11:59 +0000 (22:11 +0000)]
Fix two typos.

16 years agoImplement GET_STACK_USAGE() macro to get the current kernel thread stack usage.
mav [Wed, 30 Jan 2008 21:24:10 +0000 (21:24 +0000)]
Implement GET_STACK_USAGE() macro to get the current kernel thread stack usage.
This implemntation made for growing down stack organization like i386/amd64
platforms have, but prefers different machine dependent version if it is present.

16 years agoAdd a note pointing to build(7) for more info.
jhb [Wed, 30 Jan 2008 19:33:18 +0000 (19:33 +0000)]
Add a note pointing to build(7) for more info.

MFC after: 1 week
Reviewed by: ru

16 years agoAllow watch(8) to use more than 10 snp* devices. This limitation was purely
rink [Wed, 30 Jan 2008 13:55:32 +0000 (13:55 +0000)]
Allow watch(8) to use more than 10 snp* devices. This limitation was purely
due to the way watch(8) looks for available snoop devices.

PR: bin/118286
Submitted by: Mykola Zubach <zuborg@advancedhosters.com>
Reviewed by: rwatson, csjp, imp (all a long time ago)
Approved by: imp (mentor) (long time ago)
MFC after: 1 week

16 years agoFix bootparamd on 64 bit platforms - at least amd64 was broken due to the
rink [Wed, 30 Jan 2008 13:48:37 +0000 (13:48 +0000)]
Fix bootparamd on 64 bit platforms - at least amd64 was broken due to the
code believing long == 64 bits and using it to store/compare IPv4 addresses.

PR: bin/112163
Submitted by: Tyler Spivey <tspivey@pcdesk.net>
Reviewed by: imp
Approved by: imp (mentor)
MFC after: 1 week

16 years agoMap 'boot' to GPT_ENT_TYPE_FREEBSD_BOOT when parsuing UUIDs so that things
jhb [Wed, 30 Jan 2008 13:29:10 +0000 (13:29 +0000)]
Map 'boot' to GPT_ENT_TYPE_FREEBSD_BOOT when parsuing UUIDs so that things
like 'gpt add -t boot' work.

MFC after: 1 week
Submitted by:  Niki Denev nike_d of cytexbg.com

16 years agoAdd unix_sorflush, a regression test for the following scenario:
rwatson [Wed, 30 Jan 2008 13:23:34 +0000 (13:23 +0000)]
Add unix_sorflush, a regression test for the following scenario:

 - Process (a) is blocked in read on a socket waiting on data.
 - Process (b) is blocked in shutdown() on a socket waiting on (a).
 - Process (c) delivers a signal to (b) interrupting its wait.

When the signal is delivered, the kernel panics as sblock() fails in
sorflush().  Even if it didn't panic, shutdown() would block potentially
indefinitely waiting for recv() to succeeded.  Fixes to follow.

Reported by: Jos Backus <jos at catnook dot com>

16 years agoChristos decided to keep the manpages in mdoc(7) format,
ru [Wed, 30 Jan 2008 12:56:59 +0000 (12:56 +0000)]
Christos decided to keep the manpages in mdoc(7) format,
so stop using our own versions of these.

16 years agoUpdate for the 4.23 import.
obrien [Wed, 30 Jan 2008 02:48:24 +0000 (02:48 +0000)]
Update for the 4.23 import.

16 years ago- Rework the kld support to hook into GDB's shared library support.
jhb [Tue, 29 Jan 2008 23:44:34 +0000 (23:44 +0000)]
- Rework the kld support to hook into GDB's shared library support.
  kgdb(8) now treats kld's as shared libraries relative to the kernel
  "binary".  Thus, you can use 'info sharedlibrary' to list the kld's
  along with 'sharedlibrary' and 'nosharedlibrary' to manage symbol
  loading and unloading.  Note that there isn't an easy way to force GDB
  to use a specific path for a shared library.  However, you can use
  'nosharedlibrary' to unload all the klds and then use 'sharedlibrary'
  to load specific klds where it gets the kld correct and use
  'add-kld' for the kld's where the default open behavior doesn't work.
  klds opened via 'sharedlibrary' (and during startup) do have their
  sections listed in 'info files'.
- Change the 'add-kld' command to use filename completion to complete its
  argument.

16 years agoDon't close the kernel bfd object during startup. Instead, leave it open
jhb [Tue, 29 Jan 2008 23:37:59 +0000 (23:37 +0000)]
Don't close the kernel bfd object during startup.  Instead, leave it open
and build a section table from the kernel file so that 'info files' output
for kgdb now matches the usage of gdb on a regular file with the exception
that we don't list sections for memory in the crash dump.

16 years agoUse target_read_memory() and extract_unsigned_integer() instead of direct
jhb [Tue, 29 Jan 2008 23:36:42 +0000 (23:36 +0000)]
Use target_read_memory() and extract_unsigned_integer() instead of direct
KVM access to read kernel pointers.

16 years agoDon't look for "foo.ko.symbols" files. GDB is smart enough to open the
jhb [Tue, 29 Jan 2008 23:36:10 +0000 (23:36 +0000)]
Don't look for "foo.ko.symbols" files.  GDB is smart enough to open the
".symbols" file automatically when you tell it to load "foo.ko" because of
the debug link.

16 years agoThis commit was generated by cvs2svn to compensate for changes in r175801,
des [Tue, 29 Jan 2008 20:22:00 +0000 (20:22 +0000)]
This commit was generated by cvs2svn to compensate for changes in r175801,
which included commits to RCS files with non-trunk default branches.

16 years agoMerge r412 from vendor, which reintroduces _OPENPAM. See comment in the
des [Tue, 29 Jan 2008 20:22:00 +0000 (20:22 +0000)]
Merge r412 from vendor, which reintroduces _OPENPAM.  See comment in the
code for explanation.  Hopefully, this will forestall any reports of
breakage in OpenPAM-aware ports.

MFC after: 3 days

16 years agoSome clarifications to make keyboard configuration under syscons.
trhodes [Tue, 29 Jan 2008 18:28:50 +0000 (18:28 +0000)]
Some clarifications to make keyboard configuration under syscons.

PR: 89325
Submitted by: Oliver Fromme <olli@secnetix.de>
Reviewed by: emax

16 years agoUpdate this manual page to describe the extattr_list_file() and the
trhodes [Tue, 29 Jan 2008 18:15:38 +0000 (18:15 +0000)]
Update this manual page to describe the extattr_list_file() and the
extattr_list_fd() functions.

PR: 108142
Submitted by: Richard Dawe <rich@phekda.gotadsl.co.uk>
Reviewed by: kientzle

16 years agoAn average consumer of fts(3) that avoids keeping pointers to old
yar [Tue, 29 Jan 2008 17:50:29 +0000 (17:50 +0000)]
An average consumer of fts(3) that avoids keeping pointers to old
FTSENTs and uses only what fts_read() has just returned can rely
on fts_path being NUL-terminated.  Under these conditions, a plain
vanilla "%s" format can be safely used to printf an fts_path.

OK'ed by: rwatson

16 years ago\jedi-mind-trick{this is not the file you were looking for}
obrien [Tue, 29 Jan 2008 16:17:42 +0000 (16:17 +0000)]
\jedi-mind-trick{this is not the file you were looking for}

16 years agoThis commit was generated by cvs2svn to compensate for changes in r175790,
obrien [Tue, 29 Jan 2008 16:12:06 +0000 (16:12 +0000)]
This commit was generated by cvs2svn to compensate for changes in r175790,
which included commits to RCS files with non-trunk default branches.

16 years agoBring in fix for Binutils PR other/16240: Check for a failure return from
obrien [Tue, 29 Jan 2008 16:12:06 +0000 (16:12 +0000)]
Bring in fix for Binutils PR other/16240: Check for a failure return from
cplus_demangle_type.  This is the rev 1.50-1.51 change.

Our addr2line, etc.. would crash if used on C++ code that contains
certain symbol types.  One example is
_ZN13PatternDriver23StringScalarDeleteValueC1ERKNS_25ConflateStringScalarValueERKNS_25AbstractStringScalarValueERKNS_12TemplateEnumINS_12pdcomplementELZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE

16 years agoFix link state handling in bfe(4).
yongari [Tue, 29 Jan 2008 02:15:11 +0000 (02:15 +0000)]
Fix link state handling in bfe(4).
 o conversion to callout(9) API.
 o add a missing driver lock in bfe_ifmedia_sts().
 o use our callout to drive watchdog timer.
 o restart Tx routine if pending queued packets are present in
   watchdog handler.
 o unarm watchdog timer only if there are no queued packets.
 o don't blindly reset phy and let phy driver handle link change
   request in bfe_init_locked().
 o return the status of mii_mediachg() to caller in
   bfe_ifmedia_upd(). Previously it always returned 0 to caller.
 o add check for IFF_DRV_RUNNING flag as well as IFF_DRV_OACTIVE
   in bfe_start_locked().
 o implement miibus_statchg method that keeps track of current
   link state changes as well as negotiated speed/duplex/
   flow-control configuration.
   Reprogram MAC to appropriate duplex state. Flow-control
   configuration was also implemented but commented out at the
   moment. The flow-control configuration will be enabled again
   after we have general flow-control framework in mii layer.

Reported by: Yousif Hassan < yousif () alumni ! jmu ! edu >
Tesdted by: Yousif Hassan < yousif () alumni ! jmu ! edu >

16 years agoDon't coredump when executed with -o.
delphij [Tue, 29 Jan 2008 00:20:00 +0000 (00:20 +0000)]
Don't coredump when executed with -o.

16 years agoProperly Xref device.hints.5.
trhodes [Tue, 29 Jan 2008 00:13:20 +0000 (00:13 +0000)]
Properly Xref device.hints.5.

Noticed by: ru

16 years agoUse calloc() when requesting zero'ed memory allocation rather than rolling
delphij [Tue, 29 Jan 2008 00:06:44 +0000 (00:06 +0000)]
Use calloc() when requesting zero'ed memory allocation rather than rolling
our own.

16 years agoForced commit to note that the previous revision also covered:
brueffer [Mon, 28 Jan 2008 23:08:18 +0000 (23:08 +0000)]
Forced commit to note that the previous revision also covered:

PR: 119683
Submitted by: Adam McDougall <mcdouga9@egr.msu.edu>

16 years agoAvoid data copying when it is possible.
mav [Mon, 28 Jan 2008 22:37:17 +0000 (22:37 +0000)]
Avoid data copying when it is possible.
bpf_filter() is able to work directly on mbuf chain.

16 years agoUse a for loop in find_kld_address() as in kgdb_auto_load_klds() and
jhb [Mon, 28 Jan 2008 21:45:09 +0000 (21:45 +0000)]
Use a for loop in find_kld_address() as in kgdb_auto_load_klds() and
replace the remaining goto's with continues as a result.

16 years agoAdd support for automatically loading symbols for kld's on startup:
jhb [Mon, 28 Jan 2008 21:40:10 +0000 (21:40 +0000)]
Add support for automatically loading symbols for kld's on startup:
- Add a new 'kgdb_auto_load_klds()' routine which is invoked during
  startup that walks the list of linker files and tries to find a matching
  kld on disk for each non-kernel kld.  If a kld file is found, then it
  is added as if the 'add-kld' command is invoked.  One change from
  'add-kld' is that this method attempts to use the 'pathname' from the
  linker_file structure first to try to load the file.  If that fails
  it then looks in the kernel directory followed by the directories in
  the module path.
- Move the kld file suffix handling into a separate routine so that it
  can be called standalone and to reduce duplicate code in find_kld_path().
- Cache the offsets of members of 'struct linker_file' during startup
  instead of computing them for each 'add-kld'.
- Use GDB's target_read_string() instead of direct KVM access.
- Add all resident sections from a kld by using bfd_map_over_sections() to
  build the section list rather than just adding symbols for ".text",
  ".data", ".bss", and ".rodata".
- Change the 'add-kld' command to do a y/n prompt before adding the
  symbols when run interactively to match 'add-symbol-file'.

MFC after: 1 week

16 years agoRemove the warnx() from kgdb_lookup() so that we don't emit a warning about
jhb [Mon, 28 Jan 2008 20:33:19 +0000 (20:33 +0000)]
Remove the warnx() from kgdb_lookup() so that we don't emit a warning about
optional symbols that are missing (e.g. kgdb complains about _stoppcbs and
_stopped_cpus on UP kernels).  Instead, callers that really want their
symbols to be present now do explicitly warnx() about the missing symbol.