Commit Graph

40884 Commits

Author SHA1 Message Date
Matthew N. Dodd
b02d3a97f8 Add PCI IDs for the i82855 and i82875P AGP bridges.
PR:		 i386/53136, i386/51802
Submitted by:	 Kyunghwan Kim <redjade@atropos.snu.ac.kr>, Norikatsu Shigemura <nork@FreeBSD.org>
2003-06-23 11:09:45 +00:00
Hartmut Brandt
76335e1302 Apply style(9) to this file. I'm going to touch large parts of this file
so make this beforehand.
2003-06-23 10:32:13 +00:00
Alan Cox
f566a0b6ba Assert that the vm object is locked on entry to vm_pager_get_pages(). 2003-06-23 06:15:05 +00:00
Alan Cox
0183359659 MFi386
Add vm object locking to pmap_object_init_pt().
2003-06-23 06:10:52 +00:00
John-Mark Gurney
e3f932de5a prevent the number of patterns from exceeding the number of pci devices.
Submitted by:	rwatson
2003-06-23 03:17:03 +00:00
John-Mark Gurney
d08239c1f7 cleanup /dev/pci code some:
read permision only required for listing, read/write required for
		read/write to registers
	fix a possible memory leak
	clean up error handling a bit

Reviewed by:	silence
2003-06-23 02:11:16 +00:00
Robert Watson
f51e58036e Redesign the externalization APIs from the MAC Framework to
the MAC policy modules to improve robustness against C string
bugs and vulnerabilities.  Following these revisions, all
string construction of labels for export to userspace (or
elsewhere) is performed using the sbuf API, which prevents
the consumer from having to perform laborious and intricate
pointer and buffer checks.  This substantially simplifies
the externalization logic, both at the MAC Framework level,
and in individual policies; this becomes especially useful
when policies export more complex label data, such as with
compartments in Biba and MLS.

Bundled in here are some other minor fixes associated with
externalization: including avoiding malloc while holding the
process mutex in mac_lomac, and hence avoid a failure mode
when printing labels during a downgrade operation due to
the removal of the M_NOWAIT case.

This has been running in the MAC development tree for about
three weeks without problems.

Obtained from:	TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
2003-06-23 01:26:34 +00:00
Robert Watson
6b42f0a2eb Prefer the vop_rmextattr() vnode operation for removing extended
attributes from objects over vop_setextattr() with a NULL uio; if
the file system doesn't support the vop_rmextattr() method, fall
back to the vop_setextattr() method.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-22 23:03:07 +00:00
Robert Watson
77533ed2aa Expose vop_rmextattr as an explicit operation at the vnode operation
interface, rather than relying on a NULL uio for the deletion
operation.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-22 22:45:24 +00:00
Robert Watson
4b090e41ff Add an explicit credential argument to alq_open() to allow the caller to
specify what credential to use when authorizing vn_open() and later
write operations, rather than curthread->td_ucred.

When writing KTR traces to an ALQ, specify the credential of the thread
generating the sysctl request.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-22 22:28:56 +00:00
Alan Cox
f29ba63ec9 Maintain a lock on the vm object of interest throughout vm_fault(),
releasing the lock only if we are about to sleep (e.g., vm_pager_get_pages()
or vm_pager_has_pages()).  If we sleep, we have marked the vm object with
the paging-in-progress flag.
2003-06-22 21:35:41 +00:00
Don Lewis
7144b1d4bd Don't check the state of the vnode interlock if the specification says
that the lock should not be checked.

Skip the lock assertion checks for *vpp or any other pointer to a vnode
pointer if vpp (or equivalent) is NULL.
2003-06-22 21:20:06 +00:00
Ruslan Ermilov
46205431f9 Protect against .depend file somewhere else in the .PATH.
Also consolidate building rules for special files.
2003-06-22 17:57:56 +00:00
Luigi Rizzo
44c884e134 Add support for multiple values and ranges for the "iplen", "ipttl",
"ipid" options. This feature has been requested by several users.
On passing, fix some minor bugs in the parser.  This change is fully
backward compatible so if you have an old /sbin/ipfw and a new
kernel you are not in trouble (but you need to update /sbin/ipfw
if you want to use the new features).

Document the changes in the manpage.

Now you can write things like

	ipfw add skipto 1000 iplen 0-500

which some people were asking to give preferential treatment to
short packets.

The 'MFC after' is just set as a reminder, because I still need
to merge the Alpha/Sparc64 fixes for ipfw2 (which unfortunately
change the size of certain kernel structures; not that it matters
a lot since ipfw2 is entirely optional and not the default...)

PR: bin/48015

MFC after: 1 week
2003-06-22 17:33:19 +00:00
Robert Watson
16fd30bd2a Forward declare a boatload of structures referenced in the MAC
policy definition structure; this permits policies to reduce their
number of gratuitous includes for required for entry points they
don't implement.  This also facilitates building the MAC Framework
on Darwin.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-22 16:36:00 +00:00
Hidetoshi Shimokawa
e07324646e Move KERNBASE to -2GB.
Currently, we cannot increase KVA more than 2GB.
2003-06-22 13:02:45 +00:00
Hidetoshi Shimokawa
bfcd2ec739 - Allow access to direct mapped region via /dev/kmem. This makes
'netstat -r' work.
- Use direct map for /dev/mem.
2003-06-22 12:59:43 +00:00
Hidetoshi Shimokawa
c1c1cc9c19 - Allocate a new PD Table if kernel grows beyond 1GB boundary.
Reviewed by: peter

- Use direct map in pmap_mapdev().
2003-06-22 12:55:20 +00:00
Poul-Henning Kamp
8198a1a472 Remove 256 unit limit, there is no evil minor number encoding to
deal with any more.

Spotted by:	"Darren Freestone" <df@cops.org>
2003-06-22 11:31:38 +00:00
Poul-Henning Kamp
3b6d965263 Add a f_vnode field to struct file.
Several of the subtypes have an associated vnode which is used for
stuff like the f*() functions.

By giving the vnode a speparate field, a number of checks for the specific
subtype can be replaced simply with a check for f_vnode != NULL, and
we can later free f_data up to subtype specific use.

At this point in time, f_data still points to the vnode, so any code I
might have overlooked will still work.
2003-06-22 08:41:43 +00:00
Matthew N. Dodd
5e4e521f76 Add ID for VT8233A.
PR:		 i386/38299
Submitted by:	 Rob Schulhof <rrs@there.net>
2003-06-22 06:50:02 +00:00
Yoshihiro Takahashi
403579314a Re-enabled PCI irq routing on pc98. 2003-06-22 06:09:14 +00:00
Alan Cox
c8567c3a77 As vm_fault() descends the chain of backing objects, set paging-in-
progress on the next object before clearing it on the current object.
2003-06-22 05:36:53 +00:00
Matthew N. Dodd
c27e9c5100 Implement a loader tunable/sysctl to allow the user to request that
the APM driver byte-swap battery time values.  (For broken laptops.)

PR:		i386/42439
Submitted by:	Bruce M Simpson <bms@spc.org>
2003-06-22 05:08:10 +00:00
Ian Dowse
adef9265ef When DDB is active, always send printf() output directly to the
console, even if there is a TIOCCONS console tty. We were already
doing this after a panic, but it's also useful when entering DDB
for some other reason too.
2003-06-22 03:20:24 +00:00
Ian Dowse
d29bf12ff8 Use a new message buffer `consmsgbuf' to forward messages to a
TIOCCONS console (e.g. xconsole) via a timeout routine instead of
calling into the tty code directly from printf(). This fixes a
number of cases where calling printf() at the wrong time (such as
with locks held) would cause a panic if xconsole is running.

The TIOCCONS message buffer is 8k in size by default, but this can
be changed with the kern.consmsgbuf_size sysctl. By default, messages
are checked for 5 times per second. The timer runs and the buffer
memory remains allocated only at times when a TIOCCONS console is
active.

Discussed on:	freebsd-arch
2003-06-22 02:54:33 +00:00
Alan Cox
7ca33ad1e8 Complete the vm object locking in vm_object_backing_scan(); specifically,
deal with the case where we need to sleep on a busy page with two vm object
locks held.
2003-06-22 02:35:06 +00:00
John-Mark Gurney
e3ee6a27a9 use a REG macro that was already defined.
Reorder how the pci probing in handled.  before adding devices, check to
see if the slot is a multi-function device to see if we should probe all
the functions.

Original idea by:	imp
2003-06-22 02:26:17 +00:00
Ian Dowse
4784a46912 Replace the code for reading and writing the kernel message buffer
with a new implementation that has a mostly reentrant "addchar"
routine, supports multiple message buffers in the kernel, and hides
the implementation details from callers.

The new code uses a kind of sequence number to represend the current
read and write positions in the buffer. This approach (suggested
mainly by bde) permits the read and write pointers to be maintained
separately, which reduces the number of atomic operations that are
required. The "mostly reentrant" above refers to the way that while
it is now always safe to have any number of concurrent writers,
readers could see the message buffer after a writer has advanced
the pointers but before it has witten the new character.

Discussed on:	freebsd-arch
2003-06-22 02:18:31 +00:00
John-Mark Gurney
dffca5a624 add support for peeking at pci busses on UltraSparc systems. This prevents
data access errors when trying to read/write to non-existant PCI devices.

fix the psycho bridge to use peek for probing devices.  This no longer
fakes it if the OFW node doesn't exist (and the reg == 0).

Reviewed by:	jake, tmm
2003-06-22 01:26:08 +00:00
Alan Cox
d98ddc4615 Make some style and white-space changes to the copy-on-write path through
vm_fault(); remove a pointless assignment statement from that path.
2003-06-22 00:00:11 +00:00
Kirk McKusick
98530110a2 Increase the size of the NFS server hash table to improve performance
when serving up more than about 32 active files. For details see
section 6.3 (pg 111) of Daniel Ellard and Margo Seltzer, ``NFS
Tricks and Benchmarking Traps'' in the Proceedings of the Usenix
2003 Freenix Track, June 9-14, 2003 pg 101-114.

Obtained from:	Daniel Ellard <ellard@eecs.harvard.edu>
Sponsored by:   DARPA & NAI Labs.
2003-06-21 21:01:44 +00:00
Poul-Henning Kamp
a6af4ff136 Use a do {...} while (0); and a couple of breaks to reduce the level
of indentation a bit.
2003-06-21 08:27:06 +00:00
Alan Cox
ebf7512532 Lock one of the vm objects involved in an optimized copy-on-write fault. 2003-06-21 06:31:42 +00:00
Alan Cox
06ecade7d8 - Increase the scope of the vm object lock in vm_object_collapse().
- Assert that the vm object and its backing vm object are both locked in
   vm_object_qcollapse().
2003-06-21 04:14:48 +00:00
Jeff Roberson
1a7a9d0ec2 - lticks was erroneously being updated in sched_pctcpu(). This was causing
us to skip the pctcpu_update() call which lead to inaccurate cpu usage
   statistics for processes that didn't run often.
2003-06-21 02:31:49 +00:00
Jeff Roberson
665cb285a8 - Don't allow nice to have such a large effect on priority. This was
causing poor interactive performance while unnice processes were running.
   The new scheme still allows nice to have an effect on priority but it is
   not as dramatic as the effect of the interactivity score.
2003-06-21 02:22:47 +00:00
John-Mark Gurney
efe0afa930 fix grammar in comment 2003-06-20 23:29:04 +00:00
Bosko Milekic
b2b417bb41 Fix a divide-by-zero on kern.log_wakeups_per_second tunable.
Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
PR: kern/53557
2003-06-20 22:18:38 +00:00
Alan Cox
5ea4972cd4 Make swap_pager_haspages() static; remove unused function prototypes. 2003-06-20 20:20:06 +00:00
Tim J. Robbins
a222314fe6 Merge from NetBSD src/sys/ntfs/ntfs_subr.c 1.5 & 1.30 (jdolecek):
- Avoid calling bread() with different sizes on the same blkno.
  Although the buffer cache is designed to handle differing size
  buffers, it erroneously tries to write the incorrectly-sized buffer
  buffer back to disk before reading the correctly-sized one, even
  when it's not dirty. This behaviour caused a panic for read-only
  NTFS mounts when INVARIANTS was enabled ("bundirty: buffer x still
  on queue y"), reported by NAKAJI Hiroyuki.
- Fix a bug in the code handling holes: a variable was incremented
  instead of decremented, which could cause an infinite loop.
2003-06-20 14:52:52 +00:00
Hidetoshi Shimokawa
e14720d614 Use direct map in pmap_map().
This saves much KVA for vm_pages and you don't need to increase NKPT
for large physical memory anymore.

Suggested by: dfr
2003-06-20 14:09:33 +00:00
Stefan Eßer
c2ef4dd48a Add comment about **vpp being special-cased in vnode_if.awk (1.38) 2003-06-20 12:24:06 +00:00
Stefan Eßer
86ed89620e The assertions generated to test VFS locking never included checks
for vnodes reached through double indirection (i.e. **vpp). This
is worked-around by special-casing the identifier "vpp" (adding one
level of indirection).

The alternative fix mentioned in the PR had required substantial
changes to this script.

In case there are locking violations that had been hidden without
this patch, they may suddenly show up, now ...

This change does not affect code compiled without DEBUG_VFS_LOCKS.

PR:		kern/46652
2003-06-20 12:15:37 +00:00
David Xu
ab78d4d641 cpu_set_upcall_kse needs to access userspace, release schedule lock
before calling it for bound thread. To avoid this problem, change
thread_schedule_upcall to not put new thread on run queue, let caller
do it, so we can tweak the new thread before setting it to run.

Reported by: pho
2003-06-20 09:12:12 +00:00
Poul-Henning Kamp
166400b7e6 Don't put callout_lock under #ifdef DIAGNOSTIC despite the fact that it
works anyway.
2003-06-20 08:39:04 +00:00
Poul-Henning Kamp
adece6e592 Initialize b_saveaddr when we hand out pbufs 2003-06-20 08:35:28 +00:00
Poul-Henning Kamp
568733688b Initialize b_saveaddr when we hand out buffers 2003-06-20 08:26:38 +00:00
Poul-Henning Kamp
ce6912c420 Crude but efficient:
#ifdef DIAGNOSTIC hold a mutex while calling callout's so that we hear
about it if they sleep.
2003-06-20 08:07:15 +00:00
Poul-Henning Kamp
eaaca5deee Don't (re)initialize f_gcflag to zero.
Move initialization of DTYPE_VNODE specific field f_seqcount into
the DTYPE_VNODE specific code.
2003-06-20 08:02:30 +00:00
Poul-Henning Kamp
c066b8920e Move FMARK and FDEFER til sys/file.h where they belong.
Order the fields in struct file in sections after their scope.
2003-06-20 07:59:59 +00:00
John-Mark Gurney
b9d3718a18 fix another LP64 problem. READ_IVAR takes a pointer to an uintptr_t, not
an int.
2003-06-20 07:22:54 +00:00
Alan Cox
e50346b5e0 The so-called "optimized copy-on-write fault" case should not require
the vm map lock.  What's really needed is vm object locking, which
is (for the moment) provided Giant.

Reviewed by:	tegge
2003-06-20 04:20:36 +00:00
David Xu
062cf543fc When a STOP signal is being sent to a process, it is possible all
threads in the process have already masked the signal, so job control
is delayed. But later a thread unmasking the STOP signal should enable
job control, so in issignal(), scanning all threads in process to see
if we can direct suspend some of them, not just suspend current thread.
2003-06-20 03:36:45 +00:00
David Xu
8b56079e2b Fix typo. td should be td0. 2003-06-20 01:56:28 +00:00
Jake Burkholder
d4c737a952 Avoid using v8 opcodes; use ba instead of b for unconditional branches. 2003-06-19 19:11:21 +00:00
Alfred Perlstein
bab88630ba Unlock the struct file lock before aquiring Giant, otherwise
we can deadlock because of lock order reversals.  This was not
caught because Witness ignores pool mutexes right now.

Diagnosis and help: truckman
Noticed by: pho
2003-06-19 18:13:07 +00:00
Jake Burkholder
d6c28affbd Hook openpromio up to the build. 2003-06-19 18:06:58 +00:00
Alan Cox
a38918cdbd Lock the vm object when freeing a vm page. 2003-06-19 17:56:12 +00:00
Søren Schmidt
d72d63c03e Add support for the HighPoint HPT302 & HPT371
HW sponsored by:	Martin Blapp <mbr@FreeBSD.ORG>
2003-06-19 15:11:04 +00:00
Hidetoshi Shimokawa
d25ac2fa68 Fix direct map page table for 2GB+ physical memory.
You may still need to increase NKPT for larger memory.
I have successfully booted 8GB system with NKPT=256.
2003-06-19 12:14:37 +00:00
Marcel Moolenaar
e2905ce3a0 Add TLS related relocation. 2003-06-19 06:51:43 +00:00
Mike Silbersack
b083ea5114 Add a ratelimited message of the form
"maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5)."

Which will be triggered whenever a user hits his/her maxproc limit or
the systemwide maxproc limit is reached.

MFC after:	1 week
2003-06-19 05:57:25 +00:00
Jake Burkholder
f96c24256c - Rename the IPI_WAIT macro to IPI_DONE.
- Don't require all receivers of ipis to wait for all other receivers,
  only that the sender wait for all receivers.  This should reduce the
  amount of time spent with interrupts disabled, which may be a cause
  of ipi timeouts.

Discussed with:	tmm
2003-06-19 05:27:04 +00:00
Don Lewis
6084b6c9d5 FILE_LOCK() uses a pool mutex, as does the vnode v_vnlock. Since pool
mutexes are supposed to only be used as leaf mutexes, and what appear
to be separate pool mutexes could be aliased together, it is bad idea
for a thread to attempt to hold two pool mutexes at the same time.

Slightly rearrange the code in kern_open() so that FILE_UNLOCK() is
called before calling VOP_GETVOBJECT(), which will grab the v_vnlock
mutex.
2003-06-19 04:10:56 +00:00
Mike Silbersack
4d7dfc31b8 Add a rate limited message reporting when kern.maxfiles is exceeded,
reporting who did it.

Also, fix a style bug introduced in the previous change.

MFC after:	1 week
2003-06-19 04:07:12 +00:00
Don Lewis
8d5f9131fc VOP_GETVOBJECT() wants to be called with the vnode lock held. 2003-06-19 03:55:01 +00:00
Alan Cox
82b8b18959 Lock the vm object when freeing a vm page. 2003-06-19 03:38:05 +00:00
Alan Cox
95aada383f Lock the vm object when freeing a vm page. 2003-06-19 03:08:10 +00:00
John-Mark Gurney
9c77e81b5d make iicbb_devclass and iicbb_driver globally visible. This will let
drivers that implemnt the i2c bit banging bus interface not have to
recompile iicbb in order to add an attachment for it.

This will mean the bktr and other definitions can go back to their
respective drivers.
2003-06-19 02:50:08 +00:00
Alan Cox
f873ed0327 Add vm object locking. 2003-06-19 02:01:33 +00:00
Alan Cox
37681d8642 Assert that the vm object is locked in vm_page_try_to_free(). 2003-06-19 01:50:14 +00:00
Scott Long
ed3392975b Fixing some glaring problems with aac_disk_dump().
- Mark that it cannot handle greater than 4GB of RAM at this time.  Fixing
   that will come later.  Fail any attempts to dump above thati limit.
 - If a call to aac_disk_dump() needs to be split into multiple i/o's,
   increment the virtual offset after each i/o instead of just dumping the
   same offset over and over again.
 - Bail out if bus_dmamap_load() returns an error.  Error recovery is likely
   not possible.
2003-06-19 01:49:04 +00:00
Alan Cox
d18e8afe99 Fix a vm object reference leak in the page-based copy-on-write mechanism
used by the zero-copy sockets implementation.

Reviewed by:	gallatin
2003-06-19 01:40:44 +00:00
Jake Burkholder
1de46e12a3 Add a solaris compatible ofw interface for third party software that
expects one to use.  Only the functions used by XFree86 are actually
implemented.

Glanced at by:	tmm
2003-06-19 01:40:11 +00:00
Poul-Henning Kamp
2db4b023bb Introduce a new flag on a file descriptor: DFLAG_SEEKABLE and use that
rather than assume that only DTYPE_VNODE is seekable.
2003-06-18 19:53:59 +00:00
Mike Silbersack
438f085b2f Reserve the last 5% of file descriptors for root use. This should allow
systems to fail more gracefully when a file descriptor exhaustion situation
occurs.

Original patch by:	David G. Andersen <dga@lcs.mit.edu>
PR:			45353
MFC after:		1 week
2003-06-18 18:57:58 +00:00
Poul-Henning Kamp
7c2d2efd58 Initialize struct fileops with C99 sparse initialization. 2003-06-18 18:16:40 +00:00
Jake Burkholder
d58a33063a Add FBTYPEs used by the sbus bus support in XFree86. This uses some of
the values that are "reserved", but they are not reserved anywhere else
so I'm assuming this is what they were unreserved for.  Unfortunately
some of the values for local syscons types overlap the values used for
sbus adapters elsewhere, so we can't have all the same values.
2003-06-18 17:49:52 +00:00
Jake Burkholder
26f66ceae3 Ignore fake ttes in pmap_copy, its too hard to deal with them not having
a real vm_page right now.  This fixes a panic when processes with resident
device mappings fork, such as the X server.
2003-06-18 17:03:04 +00:00
Thomas Moestl
6d3b2a3cad Further cleanup of the sparc64 busdma implementation:
- Move prototypes for sparc64-specific helper functions from bus.h to
  bus_private.h
- Move the method pointers from struct bus_dma_tag into a separate
  structure; this saves some memory, and allows to use a single method
  table for each busdma backend, so that the bus drivers need no longer
  be changed if the methods tables need to be modified.
- Remove the hierarchical tag method lookup. It was never really useful,
  since the layering is fixed, and the current implementations do not
  need to call into parent implementations anyway. Each tag inherits
  its method table pointer and cookie from the parent (or the root tag)
  now, and the method wrapper macros directly use the method table
  of the tag.
- Add a method table to the non-IOMMU backend, remove unnecessary
  prototypes, remove the extra parent tag argument.
- Rename sparc64_dmamem_alloc_map() and sparc64_dmamem_free_map() to
  sparc64_dma_alloc_map() and sparc64_dma_free_map(), move them to a
  better place and use them for all map allocations and deallocations.
- Add a method table to the iommu backend, and staticize functions,
  remove the extra parent tag argument.
- Change the psycho and sbus drivers to just set cookie and method table
  in the root tag.
- Miscellaneous small fixes.
2003-06-18 16:41:36 +00:00
Alexander Kabaev
cc2e7a0607 Add defines required for TLS support. 2003-06-18 16:38:22 +00:00
Jake Burkholder
28ab032ea9 Moved the syscons options, kbd options and DEV_SPLASH to the MI options
file.
2003-06-18 15:25:01 +00:00
Hartmut Brandt
92fe9ad65b Now that most of this file is new, stylify the rest and correct the
style bugs (space/tab) introduced by me.
2003-06-18 10:53:49 +00:00
Poul-Henning Kamp
44be139bbb Sleep on "-" in our normal state to simplify debugging. 2003-06-18 10:33:09 +00:00
Hartmut Brandt
1329537b7a Style: __FBSDID(). 2003-06-18 09:31:37 +00:00
Poul-Henning Kamp
22db1e9ff5 Add "GEOM_FOX", a class which detects and selects between multiple
redundant paths to the same device.

This class reacts to a label in the first sector of the device,
which is created the following way:

        #    "0123456789abcdef012345..."
        #    "<----magic-----><-id-...>
        echo "GEOM::FOX       someid" | dd of=/dev/da0 conv=sync

NB: Since the fact that multiple disk devices are in fact the same
    device is not known to GEOM, the geom taste/spoil process cannot
    fully catch all corner cases and this module can therefore be
    confused if you do the right wrong things.

NB: The disk level drivers need to do the right thing for this to
    be useful, and that is not by definition currently the case.
2003-06-18 09:29:28 +00:00
Poul-Henning Kamp
777ca648ab Add missing */ 2003-06-18 06:49:28 +00:00
Alan Cox
31953be936 Lock the vm object when freeing a vm page. 2003-06-18 04:27:18 +00:00
Matthew N. Dodd
da9f245470 - Add support for DT_FLAGS.
- Define various things from the most recent ELF spec.
2003-06-18 03:34:29 +00:00
Alan Cox
40ebf3e43a Fix a performance bug in all of the various implementations of
uma_small_alloc(): They always zeroed the page regardless of what the
caller requested.
2003-06-18 02:57:38 +00:00
Jake Burkholder
95343ec2e8 Handle recursion on the vm_page_queue_mtx manually in pmap_qenter and
pmap_qremove, in order to avoid making the mutex recursable.

Discussed with:	alc
2003-06-17 23:22:35 +00:00
Jeff Roberson
d07ac847ef - Use a more robust mechanism for determining whether or not a kse is on a
kseq.
2003-06-17 19:49:18 +00:00
Scott Long
04d2f20f6b Drop the proc lock around SYSCTL_OUT in the no-threads case.
Submitted by:	truckman
2003-06-17 19:14:00 +00:00
Hartmut Brandt
c594298bee This is a driver for Fore/Marconi HE155 and HE622 ATM cards. It is full
busdma and has extensively been tested on i386 and sparc64.
2003-06-17 16:12:50 +00:00
Paul Saab
fe5c322931 Fix bge at 10Mbit. The defines for 10-Half and 10-Full were swapped.
Shamed into fixing by:	John Cagle <john.cagle@hp.com>
2003-06-17 15:02:28 +00:00
Tim J. Robbins
2a4ad25895 Send the close request to the SMB server in smbfs_inactive(), instead of
smbfs_close(). This fixes paging to and from mmap()'d regions of smbfs
files after the descriptor has been closed, and makes thttpd, GNU ld,
and perhaps more things work that depend on being able to do this.

PR:		48291
2003-06-17 12:58:02 +00:00
Warner Losh
04fd143fa8 Add FREECOM PCCARD-IDE to the mix. It doesn't have a manufacturer or
product ID, so we have to use the CIS strings to ID it.

dmesg by: Christian Laursen
2003-06-17 12:33:53 +00:00
Warner Losh
6da5aafdda Sync to 1.53 2003-06-17 12:29:49 +00:00
Warner Losh
bd65adef88 Add FREECOM PCCARD-IDE 2003-06-17 12:29:20 +00:00
Hartmut Brandt
19050bee21 Add definitions for the ioctls that are used by netgraph and harp to open
and close VCCs.
2003-06-17 11:51:30 +00:00
Jeff Roberson
7cd0f83355 - Temporarily patch a problem where the interact score could be negative
because the run time exceeds the largest value a signed int can hold.
   The real solution involves calculating how far we are over the limit.
   To quickly solve this problem we loop removing 1/5th of the current value
   until it falls below the limit.  The common case requires no passes.
2003-06-17 10:21:34 +00:00
Tim J. Robbins
8e78890396 Set f_mntfromname[] to "fdescfs" instead of "fdesc" for consistency
with other synthetic filesystems, which have f_mntfromname the same
as f_fstypename. Noticed by Sean Kelly on -current.
2003-06-17 09:00:15 +00:00
Tim J. Robbins
549398753a MFp4: Fix two bugs causing possible deadlocks or panics, and one nit:
- Emulate lock draining (LK_DRAIN) in null_lock() to avoid deadlocks
  when the vnode is being recycled.
- Don't allow null_nodeget() to return a nullfs vnode from the wrong
  mount when multiple nullfs's are mounted. It's unclear why these checks
  were removed in null_subr.c 1.35, but they are definitely necessary.
  Without the checks, trying to unmount a nullfs mount will erroneously
  return EBUSY, and forcibly unmounting with -f will cause a panic.
- Bump LOG2_SIZEVNODE up to 8, since vnodes are >256 bytes now. The old
  value (7) didn't cause any problems, but made the hash algorithm
  suboptimal.

These changes fix nullfs enough that a parallel buildworld succeeds.

Submitted by:	tegge (partially; LK_DRAIN)
Tested by:	kris
2003-06-17 08:52:45 +00:00
Jeff Roberson
4b60e3242e - Add a new function "sched_interact_update()" that scales back the sleep
and run time.
 - Scale the sleep and run time back via sched_interact_update() in more
   places.  This is to keep the statistic more accurate.
 - Charge a parent one tick for forking a child.
 - Add only the run time and not the sleep time to the parents kg when a
   thread exits.  This allows us to give a penalty for having an expensive
   thread exit but does not give a bonus for having an interactive thread
   exit.
 - Change the SLP_RUN_THROTTLE to limit us to 4/5th and not 1/2.
 - Change the SLP_RUN_MAX to two seconds.  This keeps bursty interactive
   applications like mozilla and openoffice in the interactive range even
   through expensive tasks.
 - Recalculate the slice after every sleep.  This ensures that once a task
   has been marked interactive it only has a slice of 1 at the risk of
   giving tasks that sleep for a very brief period a longer time slice.
2003-06-17 06:39:51 +00:00
Mike Silbersack
fcaf9f9146 Map icmp time exceeded responses to EHOSTUNREACH rather than 0 (no error);
this makes connect act more sensibly in these cases.

PR:				50839
Submitted by:			Barney Wolff <barney@pit.databus.com>
Patch delayed by laziness of:	silby
MFC after:			1 week
2003-06-17 06:21:08 +00:00
Alan Cox
aec774abec Lock the vm object when freeing a page. 2003-06-17 05:17:00 +00:00
Mike Silbersack
51710a4597 Hide the m_defrag* statistics under MBUF_STRESS_TEST, there seems
to be no need to see them in the general case (and they aren't
smp-safe anyway.)

Suggested by:	hmp
MFC after:	1 week
2003-06-17 02:34:40 +00:00
Frank Durda IV
5f3ee7fe32 Re-introduction of the matcd CD driver.
This version of the driver code is compatible with near-release FreeBSD 5.1
kernel/driver interfaces.

modules/Makefile, man page and other bindings to follow shortly, once I get
this part of the check-in right.

Approved by:	markm(mentor)
2003-06-17 01:20:03 +00:00
Olivier Houchard
56e6821e56 Do not attempt to access to inp_socket fields if the socket is in the TIME_WAIT
state, as inp_socket will then be NULL. This fixes a panic that occurs when one
tries to bind a port that was previously binded with remaining TIME_WAIT
sockets.
2003-06-17 00:31:30 +00:00
David Xu
4184d79115 Forgot to commit code to disable creating a bound thread in same
group again except first kse_create syscall.

Noticed by: julian
2003-06-16 23:46:41 +00:00
Ian Dowse
c83b0b621f When looking for the ':' separator in the root path, don't go past
the terminating '\0'. Since the initialisation of rootpath in
libstand/bootp.c may copy junk into the rest of the buffer, it was
possible for the code to find a ':' after the '\0' and do the wrong
thing.

Reviewed by:	ps
MFC after:	1 week
2003-06-16 20:48:56 +00:00
John-Mark Gurney
81cb12571a free type too if we can't add the child. 2003-06-16 19:18:06 +00:00
John-Mark Gurney
ad0c7dea8c fix misspelling of ORIR_NOTFOUND 2003-06-16 19:06:36 +00:00
Don Lewis
bbddbed9f3 Partially back out rev 1.87 by nuking fifo_inactive() and moving the
resource deallocation back to fifo_close().  This eliminates any
stale data that might be stuck in the socket buffers after all the
readers and writers have closed the fifo.

Tested by: Thorsten Schroeder <ths@katjusha.de>
2003-06-16 17:17:09 +00:00
Hartmut Brandt
57112b8d4a Repo-copy of sys/pci/if_en_pci.c to the rest of the midway driver (sys/dev/en)
so that all of the driver sources are in one place. Adjust the configuration
files and the module build.
2003-06-16 15:25:51 +00:00
Hartmut Brandt
7d361237dc Fix the breakage introduced by rev. 1.43 of sys/dev/midway.c (don't commit
on friday 13th and without making a universe). This adds struct and
constant definitions for ATM traffic parameters and re-enables the
build of the midway driver.

Tested by: make universe
2003-06-16 13:52:27 +00:00
David Xu
075102cc4e Reset ncpus to 1 for bound thread group since there is only one
thread in such group.
Change message text from kse_rel to kserel, it is better displayed
in top.
2003-06-16 13:14:52 +00:00
Poul-Henning Kamp
b94b853bf1 This file was ignored by CVS in my last commit for some reason:
Remove pointless initialization of b_spc field, which now no longer
exists.
2003-06-16 09:31:15 +00:00
Hidetoshi Shimokawa
88e7cb59f4 Bound check for broken Configuration ROM. 2003-06-16 08:43:22 +00:00
Yaroslav Tykhiy
62cc1e0584 Force media autodetection if the device has lost its parameter table.
Previously, any normal I/O on an fdc(4) device would fail with ENXIO
if the device had been opened in non-blocking mode and then closed
prior to the conventional access; that would last until the floppy
disk was ejected and re-inserted to raise the unit attention condition.

Add a clarifying comment.
2003-06-16 08:42:20 +00:00
Hidetoshi Shimokawa
e47e35e61b Fix for big endian. 2003-06-16 08:29:24 +00:00
Yaroslav Tykhiy
f79981aca8 If in non-blocking mode, return EAGAIN instead of ENXIO
on an I/O attempt.  This is needed for consistency with
the concept of the half-opened state of fdc(4).

PR:		kern/52338
2003-06-16 07:50:17 +00:00
Poul-Henning Kamp
2ca77c355d Replace evil abuse of geteblk() with malloc(9). 2003-06-16 07:41:47 +00:00
Poul-Henning Kamp
e725c18c3a Get rid of the b_spc specialty field in struct buf by using an already
available caller private field.
2003-06-16 07:18:39 +00:00
Hidetoshi Shimokawa
0d3432eca7 Revert previos change for prior release/branch. 2003-06-16 03:44:36 +00:00
Alan Cox
4e28b22e35 Lock the vm object when freeing pages. 2003-06-15 21:50:38 +00:00
Bill Paul
20ea6dd580 In the device attach routine, don't depend on uaa->iface being
populated. Apparently, if you use an ehci controller, it's not.
Use usbd_device2interface_handle() to retrieve the interface handle.
NOTE: uaa->iface is populated in the probe routine, so I suspect the
fact that it's NULL in the attach routine is a bug in the ehci driver.

Also, don't depend on the PHY addresses returned by the AXE_CMD_READ_PHYID
command. The address is correct for my LinkSys NIC, but a user has
reported that with a D-Link NIC, the PHYID command returns address 4
while the attached Broadcom PHY is in fact strapped for address 0.
Instead, latch onto the first PHY address that returns valid data
during a readreg operation.
2003-06-15 21:45:43 +00:00
Jake Burkholder
77b12dfe8f The page queue lock is already held in pmap_remove, change acquire/release
to assertion of ownership.  Serves me right for not booting a witness
kernel.
2003-06-15 21:06:49 +00:00
Poul-Henning Kamp
13403e2803 Remove the evil BIOTOBUF macro, it is no longer used anywhere.
Retain b_bio as the first element of struct buf for now in case some code
somewhere still do the evil cast thing.
2003-06-15 20:36:22 +00:00
Poul-Henning Kamp
e04393d6de In specfs::vop_specstratey(), assert that the vnode and buffer agree about
the device.
2003-06-15 20:31:04 +00:00
Jake Burkholder
86479a0840 - Mirror vm_page_queue_mtx assertions added to the i386 pmap.
- Add vm page queue locking in certain places that are only needed on
  sparc64.

This should make pmap_qenter and pmap_qremove MP-safe.

Discussed with:	alc
2003-06-15 19:54:50 +00:00
Poul-Henning Kamp
2a0f8aeb52 I have not had any reports of trouble for a long time, so remove the
gentle versions of the vop_strategy()/vop_specstrategy() mismatch methods
and use vop_panic() instead.
2003-06-15 19:49:14 +00:00
Jake Burkholder
caa4756af5 Remember to release the loader's heap.
Reviewed by:	tmm
2003-06-15 19:16:43 +00:00
Poul-Henning Kamp
dc81367d8d Take 2: Remove _both_ KASSERTS. 2003-06-15 19:16:34 +00:00
Poul-Henning Kamp
d5bde314e9 Duh! I misread my handwritte notes: We do _not_ want to asser that
vp == bp->b_vp in specfs, that was the entire point of VOP_SPECSTRATEGY().
2003-06-15 19:14:03 +00:00
Poul-Henning Kamp
cefb5754dd Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementations
to check that the buffer points to the correct vnode.
2003-06-15 18:53:00 +00:00
Poul-Henning Kamp
e5fb1850ae Remove in toto coda_strategy which incorrectly implemented vop_panic(); 2003-06-15 18:45:15 +00:00
Yaroslav Tykhiy
83efe35a66 Always set bio_resid properly in fdstrategy(),
as should every block device strategy routine.
There was at least one evil consequence of not doing so:
Some errors returned by fdstrategy() could be lost (EAGAIN,
in particular.)

PR:		kern/52338 (in the audit-trail)
Discussed with:	bde
2003-06-15 18:13:17 +00:00
Yaroslav Tykhiy
29ec21d1e3 Check whether the floppy type pointer has been set before trying
to access floppy parameters through it.

Note: The DIOCGSECTORSIZE and DIOCGMEDIASIZE handlers withing
fdioctl() couldn't be just moved to below the existing check
for blocking mode because fd->ft can be non-NULL while still
in non-blocking mode (fd->ft can be set with the FD_STYPE ioctl.)

PR:		kern/52338
No MFC:		Not applicable to STABLE
2003-06-15 16:18:58 +00:00
Robert Watson
2bceb0f2b2 Various cr*() calls believed to be MPSAFE, since the uidinfo
code is locked down.
2003-06-15 15:57:42 +00:00
David Xu
cd4f6ebb13 1. Add code to support bound thread. when blocked, a bound thread never
schedules an upcall. Signal delivering to a bound thread is same as
   non-threaded process. This is intended to be used by libpthread to
   implement PTHREAD_SCOPE_SYSTEM thread.
2. Simplify kse_release() a bit, remove sleep loop.
2003-06-15 12:51:26 +00:00
Ian Dowse
688514ced0 If the device goes away during ulpt_reset(), make sure not to call
ulpt_status() afterwards. This fixes a crash that can occur if a
USB printer is power-cycled when printing is just starting. The
problem is similar to that fixed in revision 1.33, but it is much
less likely to occur.

MFC after:	1 week
2003-06-15 11:55:50 +00:00
Ian Dowse
4f1b457770 Don't overwrite the static panicstr buffer for secondary and further
panics. Before revision 1.38, we used to just point panicstr at the
format string if panicstr was NULL, but since we now use a static
buffer for the formatted panic message, we have to be careful to
only write to it during the first panic.

Pointed out by:	bde
2003-06-15 11:43:00 +00:00
Dag-Erling Smørgrav
070d61acdc Remove the definition of alloca(), it does not belong here. 2003-06-15 10:59:44 +00:00
Alan Cox
bf5f21b622 Remove an unnecessary forward declaration. 2003-06-15 07:28:33 +00:00
Robert Watson
44533b1722 Re-implement kernel access control for quotactl() as found in the
UFS quota implementation.  Push some quite broken access control
logic out of ufs_quotactl() into the individual command
implementations in ufs_quota.c; fix that logic.  Pass in the thread
argument to any quotactl command that will need to perform access
control.

o quotaon() requires privilege (PRISON_ROOT).

o quotaoff() requires privilege (PRISON_ROOT).

o getquota() requires that:

    If the type is USRQUOTA, either the effective uid match the
    requested quota ID, that the unprivileged_get_quota flag be
    set, or that the thread be privileged (PRISON_ROOT).

    If the type is GRPQUOTA, require that either the thread be
    a member of the group represented by the requested quota ID,
    that the unprivileged_get_quota flag be set, or that the
    thread be privileged (PRISON_ROOT).

o setquota() requires privilege (PRISON_ROOT).

o setuse() requires privilege (PRISON_ROOT).

o qsync() requires no special privilege (consistent with what
  was present before, but probably not very useful).

Add a new sysctl, security.bsd.unprivileged_get_quota, which when
set to a non-zero value, will permit unprivileged users to query user
quotas with non-matching uids and gids.  Set this to 0 by default
to be mostly consistent with the previous behavior (the same for
USRQUOTA, but not for GRPQUOTA).

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-15 06:36:19 +00:00
Yoshihiro Takahashi
47030ceaf2 Disable unneeded devices and options. 2003-06-15 04:31:52 +00:00
Yoshihiro Takahashi
6a6d2999d8 Remove CPU_ATHLON_SSE_HACK option. 2003-06-15 04:29:37 +00:00
Yoshihiro Takahashi
97caa42aea Include "../Makefile.inc" 2003-06-15 04:27:22 +00:00
Yoshihiro Takahashi
a252a7bf01 Most power management devices don't exist on pc98. 2003-06-15 04:24:28 +00:00
Warner Losh
e45d184c46 The en module has been broken for the last 40 hours. Disconnect it
from the tree until it is fixed.  Since it is an atm driver, it isn't
commonly used so this will not negatively impact too many people.
harti can reconnect it when he resurfaces and corrects the en module
problems.  This should allow snapshots to start succeeding again.

Reported by: lots of people
2003-06-15 04:15:29 +00:00
Jeff Roberson
3c12473229 - Increase the ksegrp's cpu time history buffer to 250ms.
- Decrease the history buffer divisor to 2 so that we remember more of the
   old behavior.
2003-06-15 04:14:25 +00:00
Hidetoshi Shimokawa
0bc666e09b - Enable support for building Configuration ROM.
- Improve probe message for S800 chips.
2003-06-15 04:09:26 +00:00
Hidetoshi Shimokawa
b83977f0a4 Fix crom_add_simple_text().
Bytewap Configuration ROM image.
2003-06-15 03:22:30 +00:00
Hidetoshi Shimokawa
19fc8e7c05 Add CSRVAL_VENDOR_PRIVATE. 2003-06-15 03:19:55 +00:00
David Xu
1d5a24bec6 1. Migrate TDF_UPCALLING from td_flags to td_pflags.
2. Add a flag TDF_SA, it will be used to distinguish SA
   based thread from bound thread.
2003-06-15 03:18:58 +00:00
Jeff Roberson
b41f3d22cc - Cap the growth of sleep and run time in sched_exit_kse(). 2003-06-15 02:52:29 +00:00
David Schultz
3bb3827fcf Fix some style problems, some of which are old, some new, and some
inherited from UFS.

Requested by:	bde, njl
2003-06-15 02:21:13 +00:00
Jeff Roberson
210491d3d9 - Fix the maximum slice value. I accidentally checked in a value of '2'
which meant no process would run for longer than 20ms.
 - Slightly redo the interactivity scorer.  It follows the same algorithm but
   in a slightly more correct way.  Previously values above half were
   incorrect.
 - Lower the interactivity threshold to 20.  It seems that in testing non-
   interactive tasks are hardly ever near there and expensive interactive
   tasks can sometimes surpass it.  This area needs more testing.
 - Remove an unnecessary KTR.
 - Fix a case where an idle thread that had an elevated priority due to
   priority prop. would be placed back on the idle queue.
 - Delay setting NEEDRESCHED until userret() for threads that haad their
   priority elevated while in kernel.  This gives us the same context switch
   optimization as SCHED_4BSD.
 - Limit the child's slice to 1 in sched_fork_kse() so we detect its behavior
   more quickly.
 - Inhert some of the run/slp time from the child in sched_exit_ksegrp().
 - Redo some of the priority comparisons so they are more clear.
 - Throttle the frequency of sched_pctcpu_update() so that rounding errors
   do not make it invalid.
2003-06-15 02:18:29 +00:00
Greg Lehey
be05126e24 check_drive: If the partition isn't a Vinum drive, release it again
and return NULL.

vinum_scandisk: Don't handle NULL device pointers.
	        Only look at compatibility partition for i386.  This
	        is a kludge which should go away once I have adequate
	        documentation for the New World Order.

Together, these fixes remove occasional error messages about
non-existent drives.  They may also fix a number of problems that have
been reported without a PR.

PRs: None
2003-06-15 01:42:01 +00:00
David Xu
87e31fda52 Don't set TDF_UPCALLING in cpu_set_upcall, it is not only used by
SA process.
2003-06-15 00:54:07 +00:00
David Xu
0e2a4d3aeb Rename P_THREADED to P_SA. P_SA means a process is using scheduler
activations.
2003-06-15 00:31:24 +00:00
Hidetoshi Shimokawa
ec3fab0e0c White space fix. 2003-06-15 00:17:38 +00:00
Alan Cox
a04a7f2242 Use #ifdef __alpha__, not __alpha. 2003-06-15 00:12:42 +00:00
David Schultz
ac092fb30c If someone tries to mount a union filesystem with another unionfs as
the upper layer, fail gracefully instead of panicing.

MFC after:	3 days
2003-06-14 23:56:27 +00:00
David Schultz
0614a6351f Introduce malloc types M_UNDCACHE and M_UNPATH for important
unionfs-related data structures to aid in debugging memory leaks.
Use NULL and NULLVP instead of 0 as appropriate.

MFC after: 3 days
2003-06-14 23:48:20 +00:00
David Schultz
d8c6e674a4 Factor out the process of freeing ``directory caches'', which unionfs
directory vnodes use to refer to their constituent vnodes, into
union_dircache_free().  Also s/union_dircache/union_dircache_get/ and
tweak the structure of union_dircache_r().

MFC after:	3 days
2003-06-14 23:27:29 +00:00
Alan Cox
49a2507bd1 Migrate the thread stack management functions from the machine-dependent
to the machine-independent parts of the VM.  At the same time, this
introduces vm object locking for the non-i386 platforms.

Two details:

1. KSTACK_GUARD has been removed in favor of KSTACK_GUARD_PAGES.  The
different machine-dependent implementations used various combinations
of KSTACK_GUARD and KSTACK_GUARD_PAGES.  To disable guard page, set
KSTACK_GUARD_PAGES to 0.

2. Remove the (unnecessary) clearing of PG_ZERO in vm_thread_new.  In
5.x, (but not 4.x,) PG_ZERO can only be set if VM_ALLOC_ZERO is passed
to vm_page_alloc() or vm_page_grab().
2003-06-14 23:23:55 +00:00
Nate Lawson
c7bbca402a Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* umass(4) drives exactly 1 GB in size now no longer use extended geometry.
2003-06-14 22:40:08 +00:00
Nate Lawson
2813692cc2 Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by:	scottl
2003-06-14 22:17:41 +00:00
Nate Lawson
141bdcc15a Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

PR:
Submitted by:
Looked over by:	scottl
Approved by:
Obtained from:
MFC after:
2003-06-14 22:17:38 +00:00
John-Mark Gurney
35ae09bc0e Fix the KMOD for the lpbb device. 2003-06-14 20:43:33 +00:00
Nicolas Souchu
e827419577 amdpm was omitted from the build of i2c controllers. Fixed. 2003-06-14 20:32:46 +00:00
Nicolas Souchu
49336098dd Add i2c to the list of modules to build. 2003-06-14 20:21:35 +00:00
Mark Murray
1d1f8d7c90 Some glue to allow lint(1) to work on the kernel. This is not
complete without some config(8) work. Config(8) needs to provide
some ${NORMAL_LINT} rules to make foo.ln files.
2003-06-14 17:28:13 +00:00
Tim J. Robbins
62ca80a7ff Avoid dereferencing the thread pointer in smb_iod_addrq() if it's NULL.
Fixes mdconfig -t vnode on smbfs: mdsetcred()'s "horrible kludge"
calls into smbfs VOP_READ with a NULL uio_td.
2003-06-14 15:45:34 +00:00
Tim J. Robbins
35c5de54e8 Don't follow smbnode n_parent pointer when NREFPARENT flag is not set
in smb_fphelp(): the parent vnode may have already been recycled
since we don't hold a reference to it. Fixes a panic when rebooting
with mdconfig -t vnode devices referring to vnodes on a smbfs mount.
2003-06-14 15:24:54 +00:00
Alan Cox
89f4fca265 Move the *_new_altkstack() and *_dispose_altkstack() functions out of the
various pmap implementations into the machine-independent vm.  They were
all identical.
2003-06-14 06:20:25 +00:00
David E. O'Brien
4bf015d562 Use GCC's internal built-in alloca implementation, when available.
Submitted by:	DES
2003-06-14 06:01:35 +00:00
Marcel Moolenaar
222a7e518c Remove kernel event tracing. The overhead is significant when running
under ski.
2003-06-14 00:01:24 +00:00
Bernd Walter
6ca4cf4dce Fix alignment requirements of tulip_rombuf by further increasing
tulip_boardid size.
Add a comment to tulip_rombuf about this requirement.
I have had panics on alpha while probing a de card.
2003-06-13 22:34:03 +00:00
Ruslan Ermilov
ada24e690c In the PKT_ALIAS_PROXY_ONLY mode, make sure to preserve the
original source IP address, as promised in the manual page.

Spotted by:	Vaclav Petricek
2003-06-13 21:54:01 +00:00
Ruslan Ermilov
9c88dc8855 Removed a couple of .Xo/.Xc that are leftovers of the "ninth-argument
limit" mdoc(7) atavism.
2003-06-13 21:39:22 +00:00
Ruslan Ermilov
7176089886 Clarify that original address and port when doing transparent proxying
are _destination_ address and port.
2003-06-13 21:36:24 +00:00
Ruslan Ermilov
61de149d30 Added myself to the AUTHORS section. 2003-06-13 21:32:01 +00:00
Warner Losh
309971e12e Add a comment about the MPSAFEness of this pccard_intr handler. Given
how we registered pccard_intr, it is MPSAFE.  However, since we
register the pccard_intr handler with the flags of the ISR we call,
that is the gating factor.  We need do nothing specific here.

Prompted by: seeing pccard_intr in a panic.
2003-06-13 21:30:29 +00:00
Maxime Henrion
d07c19e566 Remove code that tries to detect if the MCLSHIFT and MSIZE macros
are the same that those of the kernel in the KLD_MODULE case.  If
we ever want to detect that kind of problems, this is not the right
place to do this since every network driver would be affected by
such desynchronisation.
2003-06-13 20:46:34 +00:00
Poul-Henning Kamp
cc0815a886 Use the <sys/bitstring.h> rather than <bitstring.h> 2003-06-13 19:40:44 +00:00
Poul-Henning Kamp
24e08b26f0 Finish the repocopy of bitstring.h to sys so it can be used
from kernel code.
2003-06-13 19:40:13 +00:00
Maxime Henrion
fca737117a Style(9). 2003-06-13 19:39:21 +00:00
Alan Cox
b26ce6a4b4 Add vm object locking to pmap_object_init_pt(). 2003-06-13 19:27:52 +00:00
John-Mark Gurney
4966764cc1 Hardwire APB's PCI buses down. If we don't do this, pciconf -l returns
selectors that are incorrect to use with pciconf -[rw]

Fixes-PR: sparc64/50789
Ok's by: tmm
2003-06-13 17:44:03 +00:00
Hartmut Brandt
8789c0e019 Implement the ioctl that returns a list of currently open VCCs. 2003-06-13 13:50:38 +00:00
Hartmut Brandt
1ba46a03b7 Make the midway driver use the new ATM phy driver. This allows one to
toggle several media options (sonet/sdh, for example) with ifconfig and
to see the carrier state in ifconfig's output. It gives also read/write
access (given the right privilegs) to the S/Uni registers to user space
programs.
2003-06-13 12:08:09 +00:00
Josef Karthauser
7ced6062bf Regen. 2003-06-13 11:24:45 +00:00
Josef Karthauser
62db9d4d27 Allow the EPSON USB scanner 1250 to be recognised as a uscanner device.
Submitted by:	Cristiano Deana <deana@bmm.it>
By way of:	n_hibma
MFC after:	3 days
2003-06-13 11:20:26 +00:00
David Schultz
177935c8d6 Plug a serious memory leak. The -STABLE equivalent of this patch has
been tested extensively, but -CURRENT testing has been hampered by a
number of panics that also occur without the patch.  Since the
destabilizing changes between 4.X and 5.X are external to unionfs,
I believe this patch applies equally well to both.

Thanks to scrappy for assistance testing these and other changes.

MFC after:	4 days
2003-06-13 08:59:37 +00:00
Dag-Erling Smørgrav
c2935410f6 Make the VFS cache use zones instead of malloc(9). This results in a
small but noticeable increase in performance for name lookup operations.

The code uses two zones, one for short names (less than 32 characters)
and one for long names (up to NAME_MAX).  Since most file names are
fairly short, this saves a considerable amount of space that would
otherwise be wasted if we always allocated NAME_MAX bytes.  The cutoff
value of 32 characters was picked arbitrarily and may benefit from some
tweaking; it could also be made into a tunable.

Submitted by:	hmp
2003-06-13 08:46:13 +00:00
Alan Cox
d7ae6bd221 Add vm object locking. 2003-06-13 08:11:14 +00:00
Don Lewis
b156281658 Clean up the fifo_open() implementation:
Restructure the error handling portion of the resource allocation
        code to eliminate duplicated code.

        Test for the O_NONBLOCK && fi_readers == 0 case before incrementing
        fi_writers and modifying the the socket flag to avoid having to
        undo these operations in this error case.

        Restructure and simplify the code that handles blocking opens.

There should be no change to functionality.
2003-06-13 06:58:11 +00:00
Alan Cox
33a609ece0 Extend the scope of the vm object lock in swp_pager_async_iodone() to cover
a vm_page_free().
2003-06-13 06:17:42 +00:00
Alan Cox
8630c1173e Add vm object locking to various pagers' "get pages" methods, i386 stack
management functions, and a u area management function.
2003-06-13 03:02:28 +00:00
Matthew N. Dodd
d7522df29c Conditionally attach the MCA bus device. 2003-06-13 00:43:57 +00:00
Warner Losh
9b1b4524e6 As a workaround for the latest problems, don't init hermes cards more
than once.  This appears to work around the hanging issues, at the
expense of warnings about bad RID allocations.  I'm not sure this is a
permanant workaround, but does appear to help in the tests that I've
done here.
2003-06-13 00:40:37 +00:00
Matthew N. Dodd
cba6ce369d Despite my best efforts the Linux way of doing this is the only
way that works correctly.

- Remove unused function.
- Move declaration of variables to .S file.
2003-06-13 00:36:03 +00:00
Greg Lehey
887cae2b70 Remove these files. They have successors in tools/debugscripts. 2003-06-12 23:30:57 +00:00
Poul-Henning Kamp
7652131bee Initialize struct vfsops C99-sparsely.
Submitted by:   hmp
Reviewed by:	phk
2003-06-12 20:48:38 +00:00
Dag-Erling Smørgrav
633f506489 Document some sysctl variables.
Submitted by:	hmp
2003-06-12 19:46:51 +00:00
Matt Jacob
132ba32ac2 Remove mpt from the nodevice list. This was tested by the submitter.
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
2003-06-12 17:11:01 +00:00
Matt Jacob
a96c0ef246 Add change that allows PAE to work.
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
2003-06-12 17:10:00 +00:00
Scott Long
30c6f34e00 Add support to sysctl_kern_proc to return all threads in a proc, not just the
first one.  The old behaviour can be switched by specifying KERN_PROC_PROC.

Submitted by: julian, tweaks and added functionality by myself
2003-06-12 16:41:50 +00:00
Scott Long
db6d73dfcf Add KERN_PROC_PROC for returning only processes, not threads. 2003-06-12 16:34:19 +00:00
Ian Dowse
df12c16630 When removing a sillyrename file, make sure that the directory vnode
has not been cleaned in the meantime, since this can happen during
a forced unmount. Also add a comment that nfs_removeit() should
really be locking the directory vnode before calling nfs_removerpc().

Reported by:	mbr
Tested by:	mbr
MFC after:	1 week
2003-06-12 15:41:20 +00:00
Thomas Moestl
504f8e7cb9 Remove the PSYCHO_STRAY option - it was never really useful. Adjust a
nearby comment. PSYCHO_DEBUG remains, as it is quite useful for
debugging interrupt routing problems.
2003-06-12 15:00:34 +00:00
Hartmut Brandt
591f4054cb This is a driver for the physical layer chips used in ATM interfaces.
It currently supports the PMC Sierra Lite, Ultra and 622 chips and
the IDT 77105. The driver handles media options and state in a consistent
manner for ATM drivers. The next commit to the midway driver will make
it use utopia.
2003-06-12 14:28:32 +00:00
Maxime Henrion
62c0d1bf0e Add a new device ID.
Submitted by:	Tom Alsberg <alsbergt@cs.huji.ac.il>
2003-06-12 11:21:06 +00:00
Greg Lehey
222aa33abc If we're building a debug kernel, add target to install the .gdbinit files
from tools/debugscripts.
2003-06-12 08:09:48 +00:00
Greg Lehey
ed0a525e09 Silence a warning. 2003-06-12 06:17:12 +00:00
Warner Losh
2b8c22f66c Unlock after ISR.
Noticed by: njr
Pointy hat to: the impable one.
2003-06-12 06:06:14 +00:00
Alan Cox
c10c537816 Finish the vm object locking in sendfile(2). More generally,
the vm locking in sendfile(2) is complete.
2003-06-12 05:52:09 +00:00
Greg Lehey
de52a6f7a6 Remove "raw" and "label" keywords. 2003-06-12 05:45:45 +00:00
Warner Losh
9b6df37a1a s/BURN_THE_BOATS/BURN_BRIDGES/g to adopt to new world order 2003-06-12 05:44:30 +00:00
Greg Lehey
bfe670eec4 vinum_bounds_check: Don't check the label sector if the architecture
doesn't have one.  The test was bogus on these architectures, but
recent changes broke it altogether.

Prompted by:  phk

This should fix the recent SPARC 64 build problems.
2003-06-12 05:34:42 +00:00
Greg Lehey
98142e711a Remove VINUM_LABEL ioctl. It has been deprecated since December 1998,
and recent changes broke it altogether.

Prompted by:  phk
2003-06-12 05:32:31 +00:00
Greg Lehey
00ee3bf535 Remove write_volume_label, the implementation of VINUM_LABEL ioctl.
It has been deprecated since December 1998, and recent changes broke
it altogether.

Prompted by:  phk
2003-06-12 05:32:00 +00:00
Warner Losh
078f2f3123 Enable bus mastering in the attach routine. This appears to fix the
USB 2.0 cardbus cards that have been floating around.

Submitted by: Craig Boston
2003-06-12 05:29:15 +00:00
Greg Lehey
295cb8611f Remove kw_raw. I've forgotten what it was intended for, and it was
probably obsoleted by some changes a couple of months ago.
2003-06-12 05:28:18 +00:00
Warner Losh
d2cd166745 OLDCARD is OBSOLETE_IN_6. Tag it as such. 2003-06-12 04:46:43 +00:00
Warner Losh
e7a945f389 If BURN_BRIDGES or _FreeBSD_version >= 6.0 and OBSOLETE_IN_6 is
defined, then #error out.  This is protected inside of #ifdef _KERNEL.
This allows one to tag code in the tree that will be deleted in 6.x
with the 'OBSOLETE_IN_6 #define at the top of the file.  This makes
for easy grepping, plus a mechanism that automatically fails the
compilation of those files that are so tagged after we do the cutover.
2003-06-12 04:44:15 +00:00
Warner Losh
7b22d083ff New global option: BURN_BRIDGES
Compile out code that will disappear in 6.0, per Peter Wemm's bridge
burning proposal.
2003-06-12 04:39:32 +00:00
Warner Losh
56738d1490 pc98 doesn't need COMPAT_OLDISA for any devices in the kernel.
However, GENERIC has wdc commented out, and COMPAT_OLDISA is required
for that.  Comment out COMPAT_OLDISA and sdd a comment to this effect
near wdc.

Reviewed by: nyan@
2003-06-12 04:19:10 +00:00
Warner Losh
de5059db1c Make cbb interrupts MPSAFE:
o Register ISR INTR_MPSAFE.
o Loop on KTHREAD_DONE == 0 in the thread.
o Safe the INTR_MPSAFE flag for client drivers (don't know if there are any
  CardBus/PCI drivers that are INTR_MPSAFE)
o Read status after acquiring mtx_lock(Giant) rather than before so that we
  catch state changes that happen while Giant is being acquired.
o Turn off the CD bit when we see a CD interrupt, and turn it back on after
  we've attached/detached the card.
o On suspend, actually set the CBB_SOCKET_MASK to zero rather than oring
  in '0' to turn it off on suspend.
o If the ISR that's registerd is MPSAFE, don't acquire Giant around call to
  client ISR.
o Fix comments to reflect these changes.
2003-06-12 03:37:28 +00:00
David Xu
8f8377109f Reorder P_* flags. 2003-06-12 01:19:42 +00:00
Marcel Moolenaar
58f2d986a6 Make sure pcpu->pc_pcb is pointing to a 16-byte aligned address. The
PCB contains FP registers, whose alignment must be 16 bytes at least.
Since the PCB pointed to by pc_pcb is immediately after the PCPU
itself, round-up the size of thge PCPU to a multiple of 16 bytes. The
PCPU is page aligned.

This fixes a misalignment trap caused by stopping a CPU in a SMP
kernel, such as been done when entering the debugger.

Reported by: Alan Robinson <alan.robinson@fujitsu-siemens.com>
2003-06-12 00:15:18 +00:00
David E. O'Brien
874651b13c Use __FBSDID(). 2003-06-11 23:50:51 +00:00
Jake Burkholder
2b0e2c4ae1 Fix LINT for now. 2003-06-11 23:42:41 +00:00
Alan Cox
2ab3670aad Lock the vm object when removing a page. 2003-06-11 21:23:04 +00:00
Thomas Moestl
ad9d5b934b Remove the psycho and sbus iommu function stubs, and put the pointer
to the iommu_state structure directly into dt_cookie. The stubs have
not been needed for a long time now.
2003-06-11 20:30:52 +00:00
Thomas Moestl
bea59c91de Deallocate major 177; the openfirm device does not use a fixed major
any more.
2003-06-11 18:34:50 +00:00
Thomas Moestl
933c9a14ed - Add an OFIOCGETPROPLEN ioctl() to get the length of a property.
- Do not use a fixed major.
- Minor cleanups.
2003-06-11 18:33:03 +00:00
Warner Losh
c88a674b8d ARtem ONAIR card
Submitted by: Ben Gras
2003-06-11 16:56:02 +00:00
Warner Losh
cb8af9e613 regen for 1.52 2003-06-11 16:53:47 +00:00
Warner Losh
e8abadefcc Add ARtem ONAIR wi card.
Submitted by: Ben Gras
Forgotten by: imp
2003-06-11 16:53:26 +00:00
Warner Losh
7988ce93e8 Minor tweaks that are effectively all style tweaks. 2003-06-11 16:51:27 +00:00
Warner Losh
729a248d63 Call wi_free() in all the relevant error cases. 2003-06-11 16:41:07 +00:00
Warner Losh
459caa871c Call wi_free on the failure cases of pccard.
Tested by: scottl
2003-06-11 16:39:20 +00:00
Alan Cox
f717a9d063 Lock the vm object when removing a page. 2003-06-11 16:37:33 +00:00
Dag-Erling Smørgrav
ffe92432e3 Whitespace cleanup. 2003-06-11 07:35:56 +00:00
David E. O'Brien
81a6b595de Use __FBSDID(). 2003-06-11 07:22:30 +00:00
David E. O'Brien
f25de95508 Use __FBSDID(). 2003-06-11 07:11:35 +00:00
David E. O'Brien
f98c8ea46c Use __FBSDID(). 2003-06-11 07:06:31 +00:00
David E. O'Brien
050ae80c6f Use __FBSDID(). 2003-06-11 07:00:30 +00:00
David E. O'Brien
50b1faef38 Use __FBSDID().
Approved by:	phk
2003-06-11 06:49:16 +00:00
Alan Cox
c40f7377a4 Add vm object locking. 2003-06-11 06:43:48 +00:00
David E. O'Brien
f4636c5959 Use __FBSDID(). 2003-06-11 06:34:30 +00:00
David E. O'Brien
2c44651495 Use __FBSDID(). 2003-06-11 05:57:50 +00:00
David E. O'Brien
ab0de15baf Use __FBSDID(). 2003-06-11 05:37:42 +00:00
Peter Wemm
77e2a274d0 GC unused cpu_wait() function 2003-06-11 05:20:33 +00:00
Paul Saab
1795d0cdec Don't overflow when calculating vm_kmem_size. This fixes kmem_map
too small panics on PAE machines which have odd > 4GB sizes (4.5 gig
would render a 20MB of KVA for kmem_map instead of 200MB).

Submitted by:	John Cagle <john.cagle@hp.com>, jeff
Reviewed by:	jeff, peter, scottl, lots of USENIX folks
2003-06-11 05:18:59 +00:00
Greg Lehey
4b33b53279 Remove all files. They're now in tools/debugscripts. 2003-06-11 04:54:58 +00:00
Robert Watson
13b7350a5b Add the comment I meant to add about not passing in PCATCH to the
tsleep().  Note the XXX.
2003-06-11 03:32:42 +00:00
David Xu
7677ce18b8 Fix error in my last commit. Correctly maintain p_maxthrwaits and unlock
sched_lock.
2003-06-11 01:08:33 +00:00
David E. O'Brien
677b542ea2 Use __FBSDID(). 2003-06-11 00:56:59 +00:00
David E. O'Brien
8c9bbf484a Use __FBSDID(). 2003-06-11 00:34:37 +00:00
David E. O'Brien
be07195a60 Use __FBSDID(). 2003-06-11 00:01:05 +00:00
David E. O'Brien
3b16f7d7fe Use __FBSDID(). 2003-06-10 23:48:55 +00:00
David E. O'Brien
d7a26ce64c Use __FBSDID(). 2003-06-10 23:39:45 +00:00
David E. O'Brien
a75fe74844 Use __FBSDID(). 2003-06-10 23:23:33 +00:00
David E. O'Brien
753960f7c4 Use __FBSDID(). 2003-06-10 22:09:23 +00:00
Scott Long
af2aaddd7a Don't start the beastie menu if the 'beastie_disable' variable is set to
'YES'.

If the user selects to escape to the loader prompt, set 'autoboot_delay'
to 'NO' so that the prompt timer doesn't run.
2003-06-10 22:04:09 +00:00
David E. O'Brien
ad39da7821 Use __FBSDID(). 2003-06-10 21:44:29 +00:00
David E. O'Brien
16dbc7f228 Use __FBSDID(). 2003-06-10 21:29:12 +00:00
Alan Cox
2a8f9ab57f - Finish vm object and page locking in vnode_pager_setsize().
- Make some small style changes to vnode_pager_setsize(); most notably,
   move two comments to a more logical place.
2003-06-10 20:28:41 +00:00
David E. O'Brien
ee709e7024 Use __FBSDID(). 2003-06-10 18:14:05 +00:00
David E. O'Brien
9c963d873e Use __FBSDID(). 2003-06-10 17:50:20 +00:00
David E. O'Brien
61334e3b42 Use __FBSDID(). 2003-06-10 17:31:31 +00:00
David E. O'Brien
a880eba3cf Use __FBSDID(). 2003-06-10 17:10:18 +00:00
David E. O'Brien
f59584cd7f Use __FBSDID(). 2003-06-10 17:02:51 +00:00
David E. O'Brien
fa58a9089f Use __FBSDID(). 2003-06-10 16:50:43 +00:00
Hidetoshi Shimokawa
0b1739465d Fix typo in the previous revision. 2003-06-10 12:08:58 +00:00
David E. O'Brien
e9f0aa0360 Use __FBSDID(). 2003-06-10 05:05:54 +00:00
Justin T. Gibbs
a9fe95487e Sync perforce IDs. 2003-06-10 03:25:24 +00:00
Hidetoshi Shimokawa
97aad8deb4 Fix struct bus_info on big-endian machines. 2003-06-10 02:29:10 +00:00
Hidetoshi Shimokawa
efd4a0c1ec Add tx_speed sysctl variable. 2003-06-10 02:27:39 +00:00
David Xu
36407bec4f If there are signals delivered to current thread, breaks out of loop,
userret() will be called again by ast() and thread_userret() will be
called again by userret().

Reported by: tegge
2003-06-10 02:21:32 +00:00
Poul-Henning Kamp
c1f5a18201 Revert last commit, I have no idea what happened. 2003-06-09 22:51:36 +00:00
Stefan Eßer
fb9d7a4b40 Remove embededded ID string which was meant to provide information
about the driver version in case of an error report. It conflicts with
some other variable of the same name that has been added to the kernel
just recently and there haven't been any bug reports for quite some
time now, anyway ...
2003-06-09 22:16:00 +00:00
Maxime Henrion
0ca5dc1c3e style(9). 2003-06-09 21:57:48 +00:00
Poul-Henning Kamp
87eca0f99c Add new geom_ccd module 2003-06-09 21:49:54 +00:00
Poul-Henning Kamp
68bf8b56da remove old CCD module 2003-06-09 21:48:12 +00:00
John Baldwin
5499ea019d Wait for the real interval timer callout handler to finish executing if it
is currently executing when we try to remove it in exit1().  Without this,
it was possible for the callout to bogusly rearm itself and eventually
refire after the process had been free'd resulting in a panic.

PR:		kern/51964
Reported by:	Jilles Tjoelker <jilles@stack.nl>
Reviewed by:	tegge, bde
2003-06-09 21:46:22 +00:00
John Baldwin
8bccf7034e The issetugid() function is MPSAFE. 2003-06-09 21:34:19 +00:00
Scott Long
87947cad18 Track the resource id of the memory port instead of just assuming that
it is 0x0.  Cardbus-based sio/modem cards can now be ejected without
panic'ing.
2003-06-09 21:25:14 +00:00
Poul-Henning Kamp
47f94c12da A white-space nit I noticed. 2003-06-09 19:40:34 +00:00
Alan Cox
06fa71cdcc Update the vm object and page locking in exec_map_first_page(). Mark the
one still anticipated change with XXX.  Otherwise, this function is done.
2003-06-09 19:37:14 +00:00
Poul-Henning Kamp
df622d54f8 GEOMification of CCD.
You need your kernel and ccdconfig(8) to be in sync, particularly if your
source tree is on a ccd device.
2003-06-09 19:25:07 +00:00
Alan Cox
4412dc5468 - Add vm object locking to vm_pgmoveco().
- Add a comment to vm_pgmoveco() describing what remains to be done
   for vm locking.
2003-06-09 19:23:03 +00:00
Max Khon
3ba993a100 Merge NetBSD bktr_core.c rev. 1.26:
Fix broken programming of VSCALE_HI registers in yuv422_prog().

PR:		46521
Obtained from:	NetBSD
MFC after:	3 days
2003-06-09 19:13:38 +00:00
Poul-Henning Kamp
ec421aec25 Fix error handling for ENOMEM style issues. 2003-06-09 19:12:19 +00:00