Commit Graph

114624 Commits

Author SHA1 Message Date
Stefan Farfeleder
0ba01198fc Replace buggy for-loops to skip certain character with strspn(). If *fmt was
'\0' (eg in the invocation 'printf %'), the for-loop would miss the terminating
null character.

MFC after:	1 week
2005-04-11 10:57:54 +00:00
Gleb Smirnoff
d6bd5ec90c Remove goto. 2005-04-11 10:16:17 +00:00
Jeff Roberson
070898b1b3 - Change the VOP_LOCK UPGRADE in vput() to do a LK_NOWAIT to avoid a
potential lock order reversal.  Also, don't unlock the vnode if this
   fails, lockmgr has already unlocked it for us.
 - Restructure vget() now that vn_lock() does all of VI_DOOMED checking
   for us and also handles the case where there is no real lock type.
 - If VI_OWEINACT is set, we need to upgrade the lock request to EXCLUSIVE
   so that we can call inactive.  It's not legal to vget a vnode that hasn't
   had INACTIVE called yet.

Sponsored by:	Isilon Systems, Inc.
2005-04-11 09:28:32 +00:00
Jeff Roberson
1b19c74d73 - Assert that we're no longer doing recursive vn_locks in inactive/reclaim
as I'd like to get rid of the vxthread.
 - Handle lock requests which don't actually want a lock as this is a
   much more convenient place to handle this condition than in vget().
   These requests simply want to know that VI_DOOMED isn't set.
 - Correct a test at the end of vn_lock, if error !=0 should be
   if error == 0, this has been broken since I comitted the VI_DOOMED
   changes, but no one ran into it because vget() duplicated this
   functionality.

Sponsored by:	Isilon Systems, Inc.
2005-04-11 09:23:56 +00:00
Jeff Roberson
836c5b4149 - vput(tvp) before vrele(tdvp) in kern_rename() to avoid lock order issues. 2005-04-11 09:19:08 +00:00
Hartmut Brandt
797bb929c6 Parse_Init() is gone so remove comments that mention it. 2005-04-11 07:40:54 +00:00
Hartmut Brandt
9e1e6570f3 Remove an unneccesary forward declaration for MainParseArgs().
getopt() may be called several times - make sure to set optreset
to reset it. Cleanup handling of non-option arguments.
Remove some misleading comments.

Patch:		7.171

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-04-11 07:32:49 +00:00
Hartmut Brandt
8f5850c6f4 Remove the call to Parse_Init() - there is no need to initialize
a static variable to NULL. Forgot this in the previous commit to
parse.[ch].
2005-04-11 07:26:21 +00:00
Hartmut Brandt
f520690c2c Rework the directive parsing code. Instead of using a lot of strcmp()s
on every line that starts with a dot use a minimal perfect hash
function and a single strcmp() on the first word after the dot
to find out whether it is really a directive call and, if yes, which
one. Then directly dispatch to a handler function for that directive
(or fall through to the dependency handling code). This makes the
directive parse a little bit more strict about the syntax: the directive
word must be followed by a character that is not alphanumerical and not
an underline (making .undefFOO illegal); .endif and .else can only be
followed by comments.
2005-04-11 07:20:10 +00:00
Hartmut Brandt
84aac27381 Make sure the only thing that follows .endif or .else is a comment. 2005-04-11 07:13:29 +00:00
David Xu
213a268eec Increase PTHREAD_STACK_MIN to MINSIGSTKSZ because thread libraries now use
makecontext which enforces a minimum stack size to be MINSIGSTKSZ.

Bug report: Bill Middleton <flashdict at gmail dot com>, BSD-sharp project.
2005-04-11 03:47:42 +00:00
Doug Barton
f297a20e30 The alternative suggested for /entropy as a shutdown
save file was /var/db/entropy, which also happens to
be the directory where the individual entropy files
created by /usr/libexec/save-entropy are stored.
Change the suggestion to be /var/db/entropy-file
instead.

In an error condition where the shutdown file is not
created, the error message accessed a variable that
doesn't exist.

PR:		conf/75722
Submitted by:	Nicolas Rachinsky <list@rachinsky.de>
2005-04-11 02:45:05 +00:00
Warner Losh
ca44abece9 It isn't a whinable offence to want memory when the bar says ioport.
Put that behind bootverbose to make the ata driver less chatty on
advanced hardware.

Requested by: sos
2005-04-11 02:08:05 +00:00
Doug Barton
2005d17979 The script mistakenly ignores the entropy_save_sz variable from
rc.conf[.local]. Fix this, and leave the default as 2048.

Update the copyright year to include the present.

Update the assignment of the copyright to be me personally,
instead of "The FreeBSD Project" which is not a legal entity,
and therefore not a proper assignee. My intention remains the
same however, that this code continue to be BSD licensed, and
freely available to anyone that wants it under those terms.

PR:		conf/75722
Submitted by:	Nicolas Rachinsky <list@rachinsky.de>
2005-04-11 02:07:33 +00:00
Bill Paul
d02239a3af Create new i386 windows/bsd thunking layer, similar to the amd64 thunking
layer, but with a twist.

The twist has to do with the fact that Microsoft supports structured
exception handling in kernel mode. On the i386 arch, exception handling
is implemented by hanging an exception registration list off the
Thread Environment Block (TEB), and the TEB is accessed via the %fs
register. The problem is, we use %fs as a pointer to the pcpu stucture,
which means any driver that tries to write through %fs:0 will overwrite
the curthread pointer and make a serious mess of things.

To get around this, Project Evil now creates a special entry in
the GDT on each processor. When we call into Windows code, a context
switch routine will fix up %fs so it points to our new descriptor,
which in turn points to a fake TEB. When the Windows code returns,
or calls out to an external routine, we swap %fs back again. Currently,
Project Evil makes use of GDT slot 7, which is all 0s by default.
I fully expect someone to jump up and say I can't do that, but I
couldn't find any code that makes use of this entry anywhere. Sadly,
this was the only method I could come up with that worked on both
UP and SMP. (Modifying the LDT works on UP, but becomes incredibly
complicated on SMP.) If necessary, the context switching stuff can
be yanked out while preserving the convention calling wrappers.

(Fortunately, it looks like Microsoft uses some special epilog/prolog
code on amd64 to implement exception handling, so the same nastiness
won't be necessary on that arch.)

The advantages are:

- Any driver that uses %fs as though it were a TEB pointer won't
  clobber pcpu.
- All the __stdcall/__fastcall/__regparm stuff that's specific to
  gcc goes away.

Also, while I'm here, switch NdisGetSystemUpTime() back to using
nanouptime() again. It turns out nanouptime() is way more accurate
than just using ticks(). On slower machines, the Atheros drivers
I tested seem to take a long time to associate due to the loss
in accuracy.
2005-04-11 02:02:35 +00:00
Warner Losh
69c5c40b2d Go ahead and try to allocate PCI_BAR(5) for ata devices. 2005-04-10 23:49:04 +00:00
Søren Schmidt
186ba2b70d Use the ata_suspend/resume functions instaead of the bus_generic ones.
This should unbreak suspend/resume.

Contributed by:	Wiktor Niesiobedzki
2005-04-10 21:43:29 +00:00
Søren Schmidt
b0e99d441c Fix FreeBSD native SPAN arrays.
Prodded by: Ian Dowse
2005-04-10 21:39:25 +00:00
Alan Cox
16f571bd18 Align the entry point to assembly language functions to a 16-byte boundary.
(The Opteron's instruction fetcher reads instructions from the L1 cache in
16-byte, aligned packets.)
2005-04-10 20:49:21 +00:00
Nate Lawson
2f8ad6c087 Drop the default running value to 60% from 80%. Testing shows that we
cycle too much, wasting power if we trigger a jump to full speed too
easily.  CPU-bound tasks quickly push idle below this level.
2005-04-10 20:42:55 +00:00
Nate Lawson
0a133d67f3 Set CPU speed to 100% in acpi_throttle attach. This is needed for some
systems that boot with this value at the lowest setting.  Change the
default boot config back to "leave frequency as BIOS set it".  Also, fix
buglet where acpi_throttle wouldn't be used if p4tcc was present but
disabled by the user.

MFC after:	1 week
2005-04-10 20:04:30 +00:00
Nate Lawson
273efb3d32 Properly terminate the table generated from ACPI info. The cpufreq
settings are length-counted while the EST table is null-terminated.
This fixes extra garbage states being reported with ACPI probing.
2005-04-10 19:57:47 +00:00
Nate Lawson
f41eb02c89 Update for verbose debugging support and add Bruno Ducrot author note. 2005-04-10 19:27:03 +00:00
Nate Lawson
f2d942579b Advertise that we can handle unified SMP control of processor power
states, idling, etc.  This has been supported since the cpufreq import.
2005-04-10 19:21:42 +00:00
Nate Lawson
25554b1f2b Advertise p4tcc via acpi_get_features() _PDC support. 2005-04-10 19:16:27 +00:00
Nate Lawson
8d9134815e Add debugging prints to all the methods in case there are problems with
managing levels.  This can be enabled with the debug.cpufreq.verbose
tunable and sysctl.
2005-04-10 19:11:23 +00:00
Nate Lawson
bce9288570 Fix support for _PDC by using the proper version/length format for the
buffer.  Also, reference the Intel document where the _PDC values were
found.  This now supports ACPI-assisted SpeedStep on my borrowed T42.
2005-04-10 19:07:08 +00:00
Remko Lodder
4b61852d3d Add myself to the calendar.
MFC after: 	1 week
Approved by:	simon (mentor)
2005-04-10 19:03:48 +00:00
Nate Lawson
ab19351c39 Add support for recording the total energy used (in joules) when in
verbose mode.  This is useful for profiling new adaptive algorithms
in performance (via time(1)) and total energy consumed for a given
workload.
2005-04-10 19:02:29 +00:00
Alan Cox
7e266fcd1f Add a machine-specific, optimized implementation of strcat.
PR: 73111
Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD)
MFC after: 3 weeks
2005-04-10 18:58:49 +00:00
Alan Cox
fb41e04787 Eliminate a conditional branch and as a side-effect eliminate a branch to
a return instruction.  (The latter is discouraged by the Opteron
optimization manual because it disables branch prediction for the return
instruction.)

Reviewed by: bde
2005-04-10 18:12:07 +00:00
Robert Watson
313bcc9cb8 Update copyright: parts of the netipx implementation are covered by a
2005 copyright.

MFC after:	3 days
2005-04-10 18:05:46 +00:00
Robert Watson
e1968df17f Compare (mbuf *) with NULL, not 0.
MFC after:	3 days
2005-04-10 18:05:02 +00:00
Scott Long
c5cb8d604c Fix the output ports on the AD1988 codec. From the submitter:
Affects to people WITH an AD1888 codec, the system will output to the port
labeled "speaker" instead of microphone.  System will work the same in
multiple operating systems.

If people are currently using their systems with this codec they will need
to swap their output ports.

I have _not_ checked audio input or line input (basically, I have checked
nothing other than line-out).

I believe this is an appropriate change, it makes us consistent with
documentation, and other operating systems.  Furthermore, this feature
(playing) is the vast majority of sound activities, so if this makes is
right for playback and wrong for recording... playback is more important,
and we can fix recoding in the future without worries of screwing people
again in the future (since we'll be "right" on the playback).

Submitted by: David Cross
2005-04-10 14:45:27 +00:00
Maxim Konovalov
f868afbd41 o Add DragonFly 1.2.0.
o s/DFD/DFB/g as DragonFly people did.
2005-04-10 14:26:58 +00:00
Xin LI
13c273c81a Remove duplicated "bytes".
Submitted by:	Wojciech A. Koszek [dunstan freebsd czest pl]
PR:		79747
2005-04-10 12:15:25 +00:00
Jens Schweikhardt
6f3997749c s/self-distruction/self-destruction 2005-04-10 10:53:26 +00:00
Søren Schmidt
abacbfaf5c Refine the SATA PHY code so the time consumed during probe is reduced.
Add the older nVidia nForce2 SATA chip to supported HW.
2005-04-10 10:20:25 +00:00
Paul Saab
cf09195ba5 - Tighten up the Timestamp checks to prevent a spoofed segment from
setting ts_recent to an arbitrary value, stopping further
  communication between the two hosts.
- If the Echoed Timestamp is greater than the current time,
  fall back to the non RFC 1323 RTT calculation.

Submitted by:	Raja Mukerji (raja at moselle dot com)
Reviewed by:	Noritoshi Demizu, Mohan Srinivasan
2005-04-10 05:24:59 +00:00
Paul Saab
e346eeff65 - If the reassembly queue limit was reached or if we couldn't allocate
a reassembly queue state structure, don't update (receiver) sack
  report.
- Similarly, if tcp_drain() is called, freeing up all items on the
  reassembly queue, clean the sack report.

Found, Submitted by:	Noritoshi Demizu <demizu at dd dot iij4u dot or dot jp>
Reviewed by:	Mohan Srinivasan (mohans at yahoo-inc dot com),
		Raja Mukerji (raja at moselle dot com).
2005-04-10 05:21:29 +00:00
Paul Saab
b962fa74b5 When the rightmost SACK block expands, rcv_lastsack should be updated.
(Fix for kern/78226).

Submitted by : Noritoshi Demizu <demizu at dd dot iij4u dot or dot jp>
Reviewed by  : Mohan Srinivasan (mohans at yahoo-inc dot com),
               Raja Mukerji (raja at moselle dot com).
2005-04-10 05:20:10 +00:00
Paul Saab
da39f5b963 Remove some unused sack fields.
Submitted by : Noritoshi Demizu, Mohan Srinivasan.
2005-04-10 05:19:22 +00:00
Alan Cox
6524eb94a1 Add a machine-specific, optimized implementation of strcpy.
PR: 73111
Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD)
MFC after: 3 weeks
2005-04-10 05:11:06 +00:00
Yoshihiro Takahashi
07665b88f4 Oops, correct typo. 2005-04-10 03:36:13 +00:00
Xin LI
e8943128a9 Initialize vp before using it. Failing to do this can cause instant
panic when trying to access a file on mounted smbfs.

Submitted by:	takawata at jp freebsd org
2005-04-10 03:17:42 +00:00
David Schultz
f97c3df18d Suspend all other threads in the process while generating a core dump.
The main reason for doing this is that the ELF dump handler expects
the thread list to be fixed while the dump header is generated, so an
upcall that occurs at the wrong time can lead to buffer overruns and
other Bad Things.

Another solution would be to grab sched_lock in the ELF dump handler,
but we might as well single-thread, since the process is about to die.
Furthermore, I think this should ensure that the register sets in the
core file are sequentially consistent.
2005-04-10 02:31:24 +00:00
Robert Watson
11853de0a1 Centralize usage in usage(), and use in preference to fprintf().
List possible tests in usage().

When running a test, print the test name.
2005-04-10 02:06:49 +00:00
Alan Cox
e5dd4df84c Add a machine-specific, optimized implementation of strcmp.
PR: 73111
Submitted by: Ville-Pertti Keinonen <will@iki.fi> (taken from NetBSD)
MFC after: 3 weeks
2005-04-09 20:47:08 +00:00
Pawel Jakub Dawidek
c5e1d51bcd Create links to crypto.9 for every crypto(9) function.
OK'ed by:	sam
MFC after:	2 weeks
2005-04-09 18:38:54 +00:00
John Baldwin
85a4f4d527 Fix another instance of TDP_OWEPREEMPT -> td_owepreempt.
Reported by:	tinderbox
2005-04-09 18:15:17 +00:00