Commit Graph

138083 Commits

Author SHA1 Message Date
John Birrell
e483943791 When building a kernel module, define MAXCPU the same as SMP so
that modules work with and without SMP.
2008-03-27 05:03:26 +00:00
Alan Cox
97dbe5e48e MFamd64 with few changes:
1. Add support for automatic promotion of 4KB page mappings to 2MB page
   mappings.  Automatic promotion can be enabled by setting the tunable
   "vm.pmap.pg_ps_enabled" to a non-zero value.  By default, automatic
   promotion is disabled.  Tested by: kris

2. To date, we have assumed that the TLB will only set the PG_M bit in a
   PTE if that PTE has the PG_RW bit set.  However, this assumption does
   not hold on recent processors from Intel.  For example, consider a PTE
   that has the PG_RW bit set but the PG_M bit clear.  Suppose this PTE
   is cached in the TLB and later the PG_RW bit is cleared in the PTE,
   but the corresponding TLB entry is not (yet) invalidated.
   Historically, upon a write access using this (stale) TLB entry, the
   TLB would observe that the PG_RW bit had been cleared and initiate a
   page fault, aborting the setting of the PG_M bit in the PTE.  Now,
   however, P4- and Core2-family processors will set the PG_M bit before
   observing that the PG_RW bit is clear and initiating a page fault.  In
   other words, the write does not occur but the PG_M bit is still set.

   The real impact of this difference is not that great.  Specifically,
   we should no longer assert that any PTE with the PG_M bit set must
   also have the PG_RW bit set, and we should ignore the state of the
   PG_M bit unless the PG_RW bit is set.
2008-03-27 04:34:17 +00:00
Brooks Davis
d4df47caab Remove the C flag from slip.log. The current slip userbase does not
justify the presence of a (usually empty) /var/log/slip.log on every
FreeBSD box.
2008-03-27 03:30:14 +00:00
John Birrell
fc70c0bdd8 Regen after makesyscalls.sh change. 2008-03-27 01:55:06 +00:00
John Birrell
e994ea8e55 Generate another function for the DTrace syscall provider to specify
the syscall argument types.

This code is only compiled into the systrace kernel modul and has no
effect otherwise.
2008-03-27 01:53:44 +00:00
John Birrell
d97cdd3349 Allow awk (the one true one!) to handle 64 files instead of just 20.
The current FreeBSD syscall generation script uses all 20 and I need
another open file.

It's a shame that something named as the 'one-true-awk' is so limited
by an old denition like FOPEN_MAX when it could just make the file
handling dynamic.

This is done to avoid touching contrib sources on a vendor branch.
2008-03-27 01:33:26 +00:00
Attilio Rao
e15e150d76 Really, smb_iod_main() is not totally MPSAFE, so just acquire and drop
Giant around it in order to assume MPSAFETY.

Reported by:	jhb, rwatson
Pointy hat to:	attilio
2008-03-27 01:23:59 +00:00
John Birrell
2c2f4a605d Allow an application to define FOPEN_MAX (like we allow for OPEN_MAX
in sys/syslimits.h).
2008-03-26 23:43:11 +00:00
Ruslan Ermilov
cbdcc7cb91 Removed no longer existing CTL_MACHDEP defines.
Inspired by:	phk
2008-03-26 23:02:17 +00:00
Poul-Henning Kamp
dad3b6c6fd Back in the good old days, PC's had random pieces of rock for
frequency generation and what frequency the generated was anyones
guess.

In general the 32.768kHz RTC clock x-tal was the best, because that
was a regular wrist-watch Xtal, whereas the X-tal generating the
ISA bus frequency was much lower quality, often costing as much as
several cents a piece, so it made good sense to check the ISA bus
frequency against the RTC clock.

The other relevant property of those machines, is that they
typically had no more than 16MB RAM.

These days, CPU chips croak if their clocks are not tightly within
specs and all necessary frequencies are derived from the master
crystal by means if PLL's.

Considering that it takes on average 1.5 second to calibrate the
frequency of the i8254 counter, that more likely than not, we will
not actually use the result of the calibration, and as the final
clincher, we seldom use the i8254 for anything besides BEL in
syscons anyway, it has become time to drop the calibration code.

If you need to tell the system what frequency your i8254 runs,
you can do so from the loader using hw.i8254.freq or using the
sysctl kern.timecounter.tc.i8254.frequency.
2008-03-26 22:12:00 +00:00
Poul-Henning Kamp
1d73a9dc74 Further cleanup of sound generation in syscons:
The timer_spkr_*() functions take care of the enabling/disabling
of the speaker.

Test on the existence of timer_spkr_*() functions, rather than
architectures.
2008-03-26 22:02:51 +00:00
Brooks Davis
6ea3dc3746 Allow the characters .-+/ to appear in ppp profile names by folding them
to _ when evaluating ppp_<profile>_nat and ppp_<profile>_mode.  Document
the per-profile variables.

PR:		conf/121452, conf/122127 (partial)
MFC after:	1 week
2008-03-26 21:54:48 +00:00
Poul-Henning Kamp
93f5134aaf Make speaker a pseudo device driver instead of attaching to a PnP id.
If somebody cleaned this code up to proper style(9), it could become
a great educational starting point for aspiring kernel hackers.
2008-03-26 21:33:41 +00:00
Robert Watson
61e175d59d Add a comment explaining that we initialize the 'a' buffer for
zero-copy to the store buffer position on the BPF descriptor,
and the 'b' buffer as the free buffer in order to fill them in
the order documented in bpf(4).

MFC after:	4 months
Suggested by:	csjp
2008-03-26 21:29:13 +00:00
Alexander Motin
714f558be1 Some minor code and math optimizations. 2008-03-26 21:19:03 +00:00
John Baldwin
d952ba1bd5 Fix a nit with the 'nofoo' options where 'foo' is mapped to 'nonofoo'
(such as 'atime' vs 'noatime').  The filesystems will always see either
'nofoo' or 'nonofoo', never plain 'foo'.  As such, their list of valid
mount options should include 'nofoo' instead of 'foo'.  With this fix,
you can do 'mount -u -o atime' on a FFS filesystem that isn't marked as
noatime without getting an error.  You can also update a noatime FFS
filesystem mounted via mount(2) (e.g. 6.x /sbin/mount binary) to 'atime'
using nmount(2) (e.g. 7.x /sbin/mount binary).

MFC after:	1 week
Reviewed by:	crodig
2008-03-26 20:48:07 +00:00
Poul-Henning Kamp
8c0b6469bf Remove two variables which are handled MI now. 2008-03-26 20:28:52 +00:00
Poul-Henning Kamp
3a995824f6 Eliminate unnecessary #includes 2008-03-26 20:26:12 +00:00
Poul-Henning Kamp
e465985885 The "free-lance" timer in the i8254 is only used for the speaker
these days, so de-generalize the acquire_timer/release_timer api
to just deal with speakers.

The new (optional) MD functions are:
	timer_spkr_acquire()
	timer_spkr_release()
and
	timer_spkr_setfreq()

the last of which configures the timer to generate a tone of a given
frequency, in Hz instead of 1/1193182th of seconds.

Drop entirely timer2 on pc98, it is not used anywhere at all.

Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if
they exist, and do nothing otherwise.

Remove prototypes and empty acquire-/release-timer() and sysbeep()
functions from the non-beeping archs.

This eliminate the need for the speaker driver to know about
i8254frequency at all.  In theory this makes the speaker driver MI,
contingent on the timer_spkr_*() functions existing but the driver
does not know this yet and still attaches to the ISA bus.

Syscons is more tricky, in one function, sc_tone(), it knows the hz
and things are just fine.

In the other function, sc_bell() it seems to get the period from
the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode
the 1193182 and leave it at that.  It's probably not important.

Change a few other sysbeep() uses which obviously knew that the
argument was in terms of i8254 frequency, and leave alone those
that look like people thought sysbeep() took frequency in hertz.

This eliminates the knowledge of i8254_freq from all but the actual
clock.c code and the prof_machdep.c on amd64 and i386, where I think
it would be smart to ask for help from the timecounters anyway [TBD].
2008-03-26 20:09:21 +00:00
Doug Rabson
f794f567e9 Fix the __FreeBSD_version check. 2008-03-26 15:42:22 +00:00
Doug Rabson
159f35a54a Bump __FreeBSD_version for the addition of 'l_sysid' to the flock structure. 2008-03-26 15:41:00 +00:00
Doug Rabson
a94c70d79c Add some regression tests for posix record locks. 2008-03-26 15:39:44 +00:00
Ed Maste
a620bad028 Add \n to the end of a printf string and remove it from panic strings. 2008-03-26 15:28:56 +00:00
Doug Rabson
a7ac0db6cb Regen. 2008-03-26 15:24:02 +00:00
Doug Rabson
dfdcada31e Add the new kernel-mode NFS Lock Manager. To use it instead of the
user-mode lock manager, build a kernel with the NFSLOCKD option and
add '-k' to 'rpc_lockd_flags' in rc.conf.

Highlights include:

* Thread-safe kernel RPC client - many threads can use the same RPC
  client handle safely with replies being de-multiplexed at the socket
  upcall (typically driven directly by the NIC interrupt) and handed
  off to whichever thread matches the reply. For UDP sockets, many RPC
  clients can share the same socket. This allows the use of a single
  privileged UDP port number to talk to an arbitrary number of remote
  hosts.

* Single-threaded kernel RPC server. Adding support for multi-threaded
  server would be relatively straightforward and would follow
  approximately the Solaris KPI. A single thread should be sufficient
  for the NLM since it should rarely block in normal operation.

* Kernel mode NLM server supporting cancel requests and granted
  callbacks. I've tested the NLM server reasonably extensively - it
  passes both my own tests and the NFS Connectathon locking tests
  running on Solaris, Mac OS X and Ubuntu Linux.

* Userland NLM client supported. While the NLM server doesn't have
  support for the local NFS client's locking needs, it does have to
  field async replies and granted callbacks from remote NLMs that the
  local client has contacted. We relay these replies to the userland
  rpc.lockd over a local domain RPC socket.

* Robust deadlock detection for the local lock manager. In particular
  it will detect deadlocks caused by a lock request that covers more
  than one blocking request. As required by the NLM protocol, all
  deadlock detection happens synchronously - a user is guaranteed that
  if a lock request isn't rejected immediately, the lock will
  eventually be granted. The old system allowed for a 'deferred
  deadlock' condition where a blocked lock request could wake up and
  find that some other deadlock-causing lock owner had beaten them to
  the lock.

* Since both local and remote locks are managed by the same kernel
  locking code, local and remote processes can safely use file locks
  for mutual exclusion. Local processes have no fairness advantage
  compared to remote processes when contending to lock a region that
  has just been unlocked - the local lock manager enforces a strict
  first-come first-served model for both local and remote lockers.

Sponsored by:	Isilon Systems
PR:		95247 107555 115524 116679
MFC after:	2 weeks
2008-03-26 15:23:12 +00:00
Poul-Henning Kamp
ebfbcd612a Rename timer0_max_count to i8254_max_count.
Rename timer0_real_max_count to i8254_real_max_count and make it static.
Rename timer_freq to i8254_freq and make it a loader tunable.
2008-03-26 15:03:24 +00:00
Poul-Henning Kamp
f168bfa529 The RTC related pscnt and psdiv variables have no business being public. 2008-03-26 13:25:27 +00:00
Poul-Henning Kamp
b416a29043 Remove old sysctl stuff which is long gone in other arch's. 2008-03-26 13:03:51 +00:00
Christian Brueffer
662cac9f23 Fix some "in in" typos in comments.
PR:		121490
Submitted by:	Anatoly Borodin <anatoly.borodin@gmail.com>
Approved by:	rwatson (mentor), jkoshy
MFC after:	3 days
2008-03-26 07:32:08 +00:00
Remko Lodder
8e7f63ecf8 Document the removal data for usbdevs.h and usbdevs_data.h,
sort the entry into it's correct place (behind 200407XX before
200406XX because we have an explicit date here).

PR:		misc/122098
Submitted by:	"John Hein" <jhein@timing.com>
MFC after:	3 days
2008-03-26 06:45:28 +00:00
Alan Cox
fdcd29b52b Enable the automatic creation of superpage reservations. 2008-03-26 03:12:00 +00:00
Sam Leffler
658d4b51ac split out tty create part of ucom_attach into ucom_attach_tty so
derived drivers can use it

Submitted by:	Jared Go
MFC after:	3 weeks
2008-03-25 23:46:24 +00:00
Sam Leffler
162382facd add some CDMA modems
Submitted by:	Jared Go
MFC after:	1 week
2008-03-25 23:35:32 +00:00
Scott Long
478cfc7300 Implement taskqueue_block() and taskqueue_unblock(). These functions allow
the owner of a queue to block and unblock execution of the tasks in the
queue while allowing tasks to continue to be added queue.  Combining this
with taskqueue_drain() allows a queue to be safely disabled.  The unblock
function may run (or schedule to run) the queue when it is called, just as
calling taskqueue_enqueue() would.

Reviewed by: jhb, sam
2008-03-25 22:38:45 +00:00
Sam Leffler
2e76e92b45 fix botched merge of syslog support to the vendor branch; these files
were off the branch so we need to pull the changes back up
2008-03-25 21:47:03 +00:00
Ed Maste
523da39bcc Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptec
driver build 15317.

Tested on:
Adaptec 2230S, Firmware 4.2-0 (8205)
ICP ICP5085BL, Firmware 5.2-0 (12814)

Submitted by:	Adaptec
2008-03-25 21:39:06 +00:00
Sam Leffler
85a8a1ddff add __noinline
Submitted by:	imp
Reviewed by:	kan (long ago)
MFC after:	3 weeks
2008-03-25 21:30:01 +00:00
Sam Leffler
fb27dd1db3 expose if_purgemaddrs, it will be used by the vap code unless someone
redesigns the mcast support code in the next few weeks

MFC after:	3 weeks
2008-03-25 21:23:32 +00:00
Sam Leffler
acaf1de6db IFM_IEEE80211_IBSSMASTER hasn't been used in many years; replace it
with IFM_IEEE80211_WDS which will be used by the forthcoming vap code

MFC after:	3 weeks
2008-03-25 21:22:43 +00:00
Sam Leffler
9e340a6190 enable dynamic addition of "show all" commands
MFC after:	3 weeks
2008-03-25 20:36:32 +00:00
Christian Brueffer
9c8408a472 Bring this manpage more in line with other wlan driver manpages. 2008-03-25 20:32:19 +00:00
John Baldwin
5c63b21a1a Regen. 2008-03-25 19:35:34 +00:00
John Baldwin
30c6422a8a Add entries for the cpuset-related system calls. The existing system calls
can be used on little endian systems.

Pointy hat to:	jeff
2008-03-25 19:34:47 +00:00
Ed Maste
54e2ebdfc2 Correct data direction flags in aac_bio_command() in the
!AAC_FLAGS_RAW_IO && AAC_FLAGS_SG_64BIT case.

Submitted by:   Adaptec
2008-03-25 18:34:04 +00:00
Ruslan Ermilov
ec51d61f1a Add code that should catch the most common case when date/time is
set incorrectly.
2008-03-25 15:47:22 +00:00
Ruslan Ermilov
eb085c43f0 s/M_TRYWAIT/M_WAIT/ 2008-03-25 15:44:49 +00:00
Ruslan Ermilov
5a9926445a Compile libthr with warnings.
(Somehow this file sneaked from initial commit.)
2008-03-25 15:33:00 +00:00
Remko Lodder
1fa09c8b65 Add a missing ;.
PR:		misc/122069
Submitted by:	taku@tekipaki.jp
MFC after:	3 days
Approved by:	imp (mentor, implicit trivial change).
2008-03-25 15:16:19 +00:00
Ruslan Ermilov
e03efb02bc Compile libthr with warnings. 2008-03-25 13:28:12 +00:00
Ruslan Ermilov
d7a38db650 Fix build.
Reported by:	ache, tinderbox
2008-03-25 13:20:52 +00:00