Commit Graph

25938 Commits

Author SHA1 Message Date
David E. O'Brien
dfbe5c12ae One needs to introduce things with a `.file' directive before trying to
do a .loc on it.  BTW, the .loc needs to be in a .text section.
gas 2.11.0 catches these oversights where previous versions did not.
2001-05-28 09:52:21 +00:00
David E. O'Brien
6baccdc4da grep -v offending lines from loader.4th until the master version of it
is fixed.
2001-05-28 05:18:13 +00:00
David E. O'Brien
b4cb7636c9 Add the generated help files to CLEANDIRS.
Found by:	rm -rf /usr/obj/usr/src/sys/boot ; make ; make clean ; cvs -q up
2001-05-28 05:12:13 +00:00
Warner Losh
f83a4e8171 Turns out that one bit isn't enough. Introduce two new fields
csc_route and func_route to hold the way that each interrupt is
routed.  csc is Card Status Change in the datasheets and standard, but
is called "Management Interrupt" in FreeBSDese.  There are three types
of interrupt routing:  ISA parallel, PCI parallel and ISA serial (some
chipsets support other types as well, but I don't plan on supporting
them).

When we try to allocate an interrupt, and the type for that interrupt
is pci_parallel, allow it to be shared by oring in RF_SHAREABLE to the
flags argument.  Introduce pcic_alloc_resource to allow this to
happen.
2001-05-28 02:53:02 +00:00
Brian Somers
04bd20e31d Handle NULL struct device *s 2001-05-28 01:00:03 +00:00
Jesper Skriver
961c53b8e4 In sys/boot/common/module.c, near line 105 a request for a raw
file is processed by passing its name in argv[1]:
        return(mod_loadobj(typestr, argv[1]));
however, it is not tested to see if argv[1] actually is defined.

At best, mod_loadobj() near line 244 returns an error like
"can't find 'garbage'" but if the "filename" entered is sufficiently
long, some buffer gets overrun. Of course, "load -t filename" is
actually a typo because we meant to type "load -t mfs_root filename";
nevertheless, a hung machine seems like too harsh a punishment for
such a small typo...

PR:			i386/27693
Submitted by:	Adrian Steinmann <ast@marabu.ch>
MFC after:	1 week
2001-05-27 23:26:11 +00:00
Andrew Gallatin
d6a516cf80 finally fix intr routing on alphas such as the as500 after months of
breakage:

- call PCIB_ROUTE_INTERRUPT() regardless of how valid the intline looks.
  Some alphas leave garbage in the intline and leave the intr mapping
  to OS platform support routines that map slots/buses to intlines
- Down in the alpha pci code, first try platform.pci_intr_route() and
  if it doesn't exist or returns garbage, just read the intline out of
  config space.

tested on AS500 (garbage in intline) and UP1000 (PC-like, intline is valid)

Note that a nice little hack like the APIC_IO section of pci_cfgregread()
is not workable.  This is because the calling interface for
alpha_pci_route_interrupt() requires us to figure out the bus/slot/etc
from a device_t.  At pci_read_device() time, we don't have a device_t
for the bus/slot/func in question.
2001-05-27 22:22:03 +00:00
Robert Watson
823c224e95 o uifree() the cr_ruidinfo in crfree() as well as cr_uidinfo now that the real uid
info is in the credential also.

Submitted by:	egge
2001-05-27 21:43:46 +00:00
Scott Long
6d45b2bf31 Close the opening comment line on these two files that mysteriouly vanished. 2001-05-27 21:07:39 +00:00
Robert Nordier
9dfe98e24e Fix reboot buglet when BOOT_BTX_NOHANG is defined.
Submitted by: Umesh Krishnaswamy <umesh@juniper.net>
2001-05-27 20:15:10 +00:00
Cameron Grant
285648f9d2 beginnings of virtual playback channel support
instead of using two malloced arrays for storing channel lists, use an
slist.  convert the sndstat device to use sbufs and optionally provide more
detail about channel state.

vchans are software mixed playback channels.  they are not enabled by this
commit.  they use the feeder infrastructure to emulate normal playback
channels in a manner transparent to applications, whilst providing as many
channels are desired, especially suitable for devices with only one hardware
playback channel.  in the future they will provide additional features.

those wishing to test this functionality will need to add vchan.c to
sys/conf/files and use 'sysctl -w hw.snd.pcm0.vchans' to enable it.

blocksize and auto-rate selection are not yet supported.
2001-05-27 17:22:00 +00:00
Daniel C. Sobral
66bd171e5f As in with ":", check dictionary space and increase it if necessary before
"create".
2001-05-27 16:30:10 +00:00
Cameron Grant
4dce85407c add a new method for retrieving feeder parameters 2001-05-27 14:49:14 +00:00
Cameron Grant
fc60109d91 don't erase info in sndbuf_setup()
set free'd pointers to NULL in sndbuf_free()
add a new function
2001-05-27 14:39:34 +00:00
Warner Losh
92d08a4dcf Allow a shareable interrupts. Note, the bridge must set this flag or
the irq will be unshareable, as things are now.

More work likely is needed, but this is a good checkpoint.

# pcic_pci.c is getting closer :-)
2001-05-27 05:53:37 +00:00
Kenneth D. Merry
cb429a255a Print out the asc/ascq and description even when both the asc and ascq
are zero.  This is so that users will see the "no addtional sense" printout
and know that they have the full sense information.
2001-05-27 03:22:51 +00:00
Dima Dorfman
83d94cdf69 In the VIRTUAL_TTY macro, add a check to make sure that the result of
SC_DEV isn't NULL; if it is, evaluate to NULL and don't dereference
NULL.  Callers of VIRTUAL_TTY must already check for the result being
NULL since si_tty can be NULL, so this should be safe.

This fixes a panic when trying to switch to a different vty in an
environment such as userconfig (-c option to the kernel).

PR:		26508
2001-05-27 00:57:25 +00:00
Dima Dorfman
b3c2cf17ee Add a CONS_CLRHIST ioctl which instructs syscons to clear the history
(scroll-back) buffer.

PR:		27616
Reviewed by:	ru
2001-05-27 00:45:59 +00:00
Dima Dorfman
5a025167e7 Acquire vm_mtx before calling vm_pager_deallocate.
Reviewed by:	phk
2001-05-27 00:42:46 +00:00
Poul-Henning Kamp
e33457d7eb Don't copy the trailing zero in readlink, it confuses namei().
PR:		27656
2001-05-26 20:07:57 +00:00
Robert Watson
7cb8e4d277 o pcred-removal changes included modifications to optimize the setting of
the saved uid and gid during execve().  Unfortunately, the optimizations
  were incorrect in the case where the credential was updated, skipping
  the setting of the saved uid and gid when new credentials were generated.
  This change corrects that problem by handling the newcred!=NULL case
  correctly.

Reported/tested by:	David Malone <dwmalone@maths.tcd.ie>

Obtained from:	TrustedBSD Project
2001-05-26 19:59:44 +00:00
Robert Watson
a892504995 o Include file to provide prototypes for regression testing-specific
system calls/et al.  Not much in there just yet, but will most likely
  grow.

Obtained from:	TrustedBSD Project
2001-05-26 15:37:25 +00:00
Ruslan Ermilov
8a8402d3a5 - sys/n[tw]fs moved to sys/fs/n[tw]fs
- /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs
2001-05-26 11:57:45 +00:00
MIHIRA Sanpei Yoshiro
882f2b2b40 add Dualmode Zoom/FaxModem 56K (internal) Model 2919
PR:		kern/27476
Submitted by:	Eric Beyer <lnxfrk@earthlink.net>
2001-05-26 11:17:57 +00:00
Poul-Henning Kamp
a1f0ac133e Dang, I lost the sign in that brucification. DTRT with PCATCH.
Cut Out In Cardboard by:	bde
2001-05-26 09:37:42 +00:00
Poul-Henning Kamp
419d8080a4 Currently, each wireless networking driver has it's own control program
despite the fact that most people want to set exactly the same settings
regardless of which card they have.  It has been repeatidly suggested
that this configuration should be done via ifconfig.  This patch
implements the required functionality in ifconfig and add support to the
wi and an drivers.  It also provides partial, untested support for the
awi driver.

PR:		25577
Submitted by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-05-26 09:27:08 +00:00
Poul-Henning Kamp
3344c5a17e Create a general facility for making dev_t's depend on another
dev_t.  The dev_depends(dev_t, dev_t) function is for tying them
to each other.

When destroy_dev() is called on a dev_t, all dev_t's depending
on it will also be destroyed (depth first order).

Rewrite the make_dev_alias() to use this dependency facility.

kern/subr_disk.c:
Make the disk mini-layer use dependencies to make sure all
relevant dev_t's are removed when the disk disappears.

Make the disk mini-layer precreate some magic sub devices
which the disk/slice/label code expects to be there.

kern/subr_disklabel.c:
Remove some now unneeded variables.

kern/subr_diskmbr.c:
Remove some ancient, commented out code.

kern/subr_diskslice.c:
Minor cleanup.  Use name from dev_t instead of dsname()
2001-05-26 08:27:58 +00:00
Jordan K. Hubbard
caff01c276 Remove pcm hints here now that it's gone from GENERIC.
Reminded-by:	bde
2001-05-26 08:04:34 +00:00
Doug Barton
ffd41c9876 Update reality in the strings comment 2001-05-26 06:01:43 +00:00
Andrew Gallatin
9c201d7ba1 catch up to i386: Don't acquire Giant just to print the trap and panic 2001-05-25 21:03:40 +00:00
Andrew Gallatin
9a6832a398 make this compile. 2001-05-25 20:56:28 +00:00
Matt Jacob
fe95b46491 track the One True Architecture (i386) 2001-05-25 20:33:06 +00:00
Warner Losh
e0e5247337 Fix a minor formatting nit 2001-05-25 19:24:58 +00:00
John Baldwin
9d127f9ffb Add vm locking to sendfile(2) and sf_buf_free().
Reported by:	Tamiji Homma <thomma@BayNetworks.com>
Tested by:	Tamiji Homma <thomma@BayNetworks.com>
2001-05-25 19:23:04 +00:00
Warner Losh
ee327e92e1 Move to using the common device list.
Move to table driven probing of these devices since we have such a long list.
2001-05-25 19:22:36 +00:00
Warner Losh
db0d08ca8f Separate out pci cardbus bridge definitions to a common file for use
by both OLDCARD and NEWCARD.

# didn't make the tables the same because oldcard supports more devices than
# newcard and newcard's 16-bit stuff needs some work.
2001-05-25 19:12:58 +00:00
David E. O'Brien
3355915e54 JHB would prefer the KTR examples not be in here. 2001-05-25 18:49:08 +00:00
Warner Losh
995823e999 Migrate from unit based to dev base. Don't save unit number, but do save
dev.  Convert all uses of unit to dev as appropriate.  Minor comment fixes
to pcic_softc definition.
2001-05-25 18:28:49 +00:00
Thomas Moestl
3c436f07b7 Add a check to determine whether extended attributes have been
initialized on the file system before trying to grab the lock of the
per-mount extattr structure, as this lock is unitialized in that case.
This is needed because ufs_extattr_vnode_inactive is called from
ufs_inactive, which is also used by EA-unaware file systems such as
ext2fs.

Reviewed by:	rwatson
2001-05-25 18:24:52 +00:00
Warner Losh
acf5760400 Update copyright info 2001-05-25 18:03:07 +00:00
Jordan K. Hubbard
62d1937cec Take pcm (audio) back out of GENERIC; there appears to be some
concensus, most notably among the maintainers, that it's better
loaded as a module.

Finally-pushed-over-the-edge-by-the-anguished-cries-of:	rwatson
2001-05-25 17:55:39 +00:00
Robert Watson
b1fc0ec1a7 o Merge contents of struct pcred into struct ucred. Specifically, add the
real uid, saved uid, real gid, and saved gid to ucred, as well as the
  pcred->pc_uidinfo, which was associated with the real uid, only rename
  it to cr_ruidinfo so as not to conflict with cr_uidinfo, which
  corresponds to the effective uid.
o Remove p_cred from struct proc; add p_ucred to struct proc, replacing
  original macro that pointed.
  p->p_ucred to p->p_cred->pc_ucred.
o Universally update code so that it makes use of ucred instead of pcred,
  p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo,
  cr_{r,sv}{u,g}id instead of p_*, etc.
o Remove pcred0 and its initialization from init_main.c; initialize
  cr_ruidinfo there.
o Restruction many credential modification chunks to always crdup while
  we figure out locking and optimizations; generally speaking, this
  means moving to a structure like this:
        newcred = crdup(oldcred);
        ...
        p->p_ucred = newcred;
        crfree(oldcred);
  It's not race-free, but better than nothing.  There are also races
  in sys_process.c, all inter-process authorization, fork, exec, and
  exit.
o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid;
  remove comments indicating that the old arrangement was a problem.
o Restructure exec1() a little to use newcred/oldcred arrangement, and
  use improved uid management primitives.
o Clean up exit1() so as to do less work in credential cleanup due to
  pcred removal.
o Clean up fork1() so as to do less work in credential cleanup and
  allocation.
o Clean up ktrcanset() to take into account changes, and move to using
  suser_xxx() instead of performing a direct uid==0 comparision.
o Improve commenting in various kern_prot.c credential modification
  calls to better document current behavior.  In a couple of places,
  current behavior is a little questionable and we need to check
  POSIX.1 to make sure it's "right".  More commenting work still
  remains to be done.
o Update credential management calls, such as crfree(), to take into
  account new ruidinfo reference.
o Modify or add the following uid and gid helper routines:
      change_euid()
      change_egid()
      change_ruid()
      change_rgid()
      change_svuid()
      change_svgid()
  In each case, the call now acts on a credential not a process, and as
  such no longer requires more complicated process locking/etc.  They
  now assume the caller will do any necessary allocation of an
  exclusive credential reference.  Each is commented to document its
  reference requirements.
o CANSIGIO() is simplified to require only credentials, not processes
  and pcreds.
o Remove lots of (p_pcred==NULL) checks.
o Add an XXX to authorization code in nfs_lock.c, since it's
  questionable, and needs to be considered carefully.
o Simplify posix4 authorization code to require only credentials, not
  processes and pcreds.  Note that this authorization, as well as
  CANSIGIO(), needs to be updated to use the p_cansignal() and
  p_cansched() centralized authorization routines, as they currently
  do not take into account some desirable restrictions that are handled
  by the centralized routines, as well as being inconsistent with other
  similar authorization instances.
o Update libkvm to take these changes into account.

Obtained from:	TrustedBSD Project
Reviewed by:	green, bde, jhb, freebsd-arch, freebsd-audit
2001-05-25 16:59:11 +00:00
Scott Long
7edce08ac4 Fix DMA on machines with more than 128MB.
Obtained from:	cg
MFC after:	5 days
2001-05-25 16:05:22 +00:00
Poul-Henning Kamp
d951f85b28 Make if_tun's clone create SI_CHEAPCLONE devices. 2001-05-25 13:32:53 +00:00
Poul-Henning Kamp
5696db457d Make the PTY drivers cloning algorithm create "CHEAPCLONE" dev_t,
so that some twit cannot allocate all 256 PTY's with "ls -l".
2001-05-25 13:23:42 +00:00
David E. O'Brien
0ec59619a5 + Turn on SMP support by default (yes an Alpha SMP kernel works on
uniprocessor systems, aren't Alpha's neat :-))
+ Add example KTR (debugging) options.
2001-05-25 10:36:46 +00:00
Poul-Henning Kamp
48c35f87be Don't lie to diskerr() now that it listens to us. 2001-05-25 09:07:23 +00:00
Poul-Henning Kamp
2613d3fec9 Use the name given to the dev_t, rather than creating our own.
This makes it possible to give sensible information for /dev/fd.720
and similar "special" devices.
2001-05-25 09:06:52 +00:00
Hellmuth Michaelis
6b244dc54b Submitted by: Juha-Matti Liukkonen (Cubical Solutions Ltd) (jml@cubical.fi)
Add a CAPI (hardware independent) driver i4bcapi(4) and hardware driver
iavc (4) to support active CAPI-based BRI and PRI cards (currently AVM
B1 and T1 cards) to isdn4bsd.
2001-05-25 08:43:30 +00:00
Ruslan Ermilov
1166fb516b - sys/msdosfs moved to sys/fs/msdosfs
- msdos.ko renamed to msdosfs.ko
- /usr/include/msdosfs moved to /usr/include/fs/msdosfs
2001-05-25 08:14:14 +00:00
Warner Losh
f7d83eb183 Add intrack field to each slot. This can be used to acknowledge
interrupts on other buses.  Right now it isn't used, but will be for
the pci attachment.

# Add copyright by me for this year since I've changed so much.
2001-05-25 05:25:43 +00:00
Warner Losh
5da1cb2e2f Minor name space issues. 2001-05-25 05:22:00 +00:00
Poul-Henning Kamp
25e0288d07 Don't rely on cdevsw_add() when we hack about with dev_t's. 2001-05-24 20:28:06 +00:00
Poul-Henning Kamp
8576c652b4 Don't take the detour around devsw() to find out if the proto-cdevsw
is already initialized.
2001-05-24 20:27:16 +00:00
Bruce Evans
03c0300c01 Oops. Unremove vestiges of the old, broken sound drivers. They are now
used in new drivers.
2001-05-24 18:19:00 +00:00
Alfred Perlstein
0cea693084 whitespace/style 2001-05-24 18:06:22 +00:00
John Baldwin
190609dd48 Stick VM syscalls back under Giant if the BLEED option is not defined. 2001-05-24 18:04:29 +00:00
John Baldwin
ba83773edc Add a new kernel option 'BLEED' to be used for code that is still under
development but is being developed in the tree for whatever reason.

Not objected to by:     peter, jlemon
2001-05-24 17:01:51 +00:00
Bruce Evans
dd015692a7 Remove vestiges of the old, broken sound drivers. 2001-05-24 16:52:13 +00:00
Ruslan Ermilov
c7b23e0fb4 Actually rename FDESC, PORTAL, UMAP and UNION file systems.
OK'ed by:	bp
2001-05-24 15:20:11 +00:00
Ruslan Ermilov
c99d12581a mount_umap(8) -> mount_umapfs(8). 2001-05-24 13:20:41 +00:00
Ruslan Ermilov
57a523ae6b mount_null(8) -> mount_nullfs(8). 2001-05-24 13:17:47 +00:00
Yoshihiro Takahashi
d8b08f1591 (Re-)enabled boot2. 2001-05-24 11:19:43 +00:00
Yoshihiro Takahashi
f040ac4cec Update boot[12] program to compile ELF binary.
Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> and
		kawanobe@st.rim.or.jp (Kawanobe Koh)
2001-05-24 11:18:32 +00:00
Poul-Henning Kamp
9d9bdb3dc5 Restrict even further what parts of <sys/conf.h> can be seen from
userland.
2001-05-24 09:33:08 +00:00
David E. O'Brien
5864b79cd2 Make the rcsid and FreeBSD IDs more sane in the wcs* and wmem* files.
Do the same for the non-wcs*/wmem* files while I'm here.
2001-05-24 08:47:42 +00:00
Matthew Dillon
ac8f990bde This patch implements O_DIRECT about 80% of the way. It takes a patchset
Tor created a while ago, removes the raw I/O piece (that has cache coherency
problems), and adds a buffer cache / VM freeing piece.

Essentially this patch causes O_DIRECT I/O to not be left in the cache, but
does not prevent it from going through the cache, hence the 80%.  For
the last 20% we need a method by which the I/O can be issued directly to
buffer supplied by the user process and bypass the buffer cache entirely,
but still maintain cache coherency.

I also have the code working under -stable but the changes made to sys/file.h
may not be MFCable, so an MFC is not on the table yet.

Submitted by:	tegge, dillon
2001-05-24 07:22:27 +00:00
Warner Losh
8cad38176d Use bus_space functions rather than inb/outb.
Add defines for PCIC_INDEX and PCIC_DATA offsets.
Change PCIC_INDEX_0 to PCIC_PORT_0
Add define for PCIC_NPORT.
Document why the vadem probe works.
2001-05-24 06:54:48 +00:00
Peter Wemm
a4b82094bc Produce a config-time warning about EXT2FS and GPL_MATH_EMULATE 2001-05-24 06:26:18 +00:00
Peter Wemm
6aa0a2e57a Remove DEV_SNP -> opt_snp.h
Forgotten by:  dd
2001-05-24 06:24:06 +00:00
Warner Losh
4d5a4ec15f Do what we should have done a long time ago:
o If the class is PCIC_BRIDGE, subclass is PCIS_BRIDGE_PCMCIA and
  programming interface is 0, assume that it is a generic PCMCIA PCI
  chip we can program.  I don't think there are any of these that
  we don't know about, but you never know.
o If the class is PCIC_BRIDGE, subclass is PCIS_BRIDGE_CARDBUS and
  programming interface is 0, assume that it is a YENTA cardbus bridge
  that we know how to cope with.  There are likely some cardbus bridges
  that haven't it made it in here yet.
2001-05-24 04:24:22 +00:00
Warner Losh
99efcc2bb9 Move getb1 and putb1 from pcic_isa.c to pcic.c. Rename them to
pcic_{get,put}b_io.  There are some pci bridges (the CL-PD6729 and
maybe others) that do not have memory mapped registers, so we'll need
these in both places.  Declare them in pcicvar.h.
2001-05-24 04:03:28 +00:00
Dima Dorfman
2f799208a5 Add snp_olddisc member to struct snoop; the linedisc'ized snp(4) uses this.
Pointy hat to:	dd
2001-05-24 00:43:44 +00:00
Dima Dorfman
028f979d1d Correct style bugs with regards to long lines and comments.
Reviewed by:	bde
2001-05-23 23:38:05 +00:00
Dima Dorfman
636b9e70d2 Build snp(4) as a module. 2001-05-23 23:33:08 +00:00
Greg Lehey
7b4bf18baa Change #if VINUMDEBUG to #ifdef VINUMDEBUG. This is a flag, not a variable. 2001-05-23 23:24:05 +00:00
John Baldwin
0dfefe6829 Don't acquire Giant just to call trap_fatal(), we are about to panic
anyway so we'd rather see the printf's then block if the system is
hosed.
2001-05-23 22:58:09 +00:00
John Baldwin
bdc60f5bd3 Don't release Giant around vm_oject_page_clean() in fsync() as the pager
putpages called will need Giant.
2001-05-23 22:55:13 +00:00
John Baldwin
e6b961ffbd - Assert Giant is held in the vnode pager methods.
- Lock the VM while walking down a vm_object's backing_object list in
  vnode_pager_lock().
2001-05-23 22:51:23 +00:00
John Baldwin
3614c6fcbb - Add in several asserts of vm_mtx.
- Assert Giant in vm_pageout_scan() for the vnode hacking that it does.
- Don't hold vm_mtx around vget() or vput().
- Lock Giant when calling vm_pageout_scan() from the pagedaemon.  Also,
  lock curproc while setting the P_BUFEXHAUST flag.
- For now we still hold Giant for all of the vm_daemon.  When process
  limits are locked we will be only need Giant for swapout_procs().
2001-05-23 22:48:28 +00:00
John Baldwin
60517fd1f7 - Assert that the vm lock is held for all of _vm_object_allocate().
- Restore the previous order of setting up a new vm_object.  The previous
  had a small bug where we zero'd out the flags after we set the
  OBJ_ONEMAPPING flag.
- Add several asserts of vm_mtx.
- Assert Giant is held rather than locking and unlocking it in a few
  places.
- Add in some #ifdef objlocks code to lock individual vm objects when
  vm objects each have their own lock someday.
- Don't bother acquiring the allproc lock for a ddb command.  If DDB
  blocked on the lock, that would be worse than having an inconsistent
  allproc list.
2001-05-23 22:42:10 +00:00
John Baldwin
21c641b2a9 - Add lots of vm_mtx assertions.
- Add a few KTR tracepoints to track the addition and removal of
  vm_map_entry's and the creation adn free'ing of vmspace's.
- Adjust a few portions of code so that we update the process' vmspace
  pointer to its new vmspace before freeing the old vmspace.
2001-05-23 22:38:00 +00:00
John Baldwin
3a2189d451 - Lock the VM around the pmap_swapin_proc() call in faultin().
- Don't lock Giant in the scheduler() function except for when calling
  faultin().
- In swapout_procs(), lock the VM before the proccess to avoid a lock order
  violation.
- In swapout_procs(), release the allproc lock before calling swapout().
  We restart the process scan after swapping out a process.
- In swapout_procs(), un #if 0 the code to bump the vmspace reference count
  and lock the process' vm structures.  This bug was introduced by me and
  could result in the vmspace being free'd out from under a running
  process.
- Fix an old bug where the vmspace reference count was not free'd if we
  failed the swap_idle_threshold2 test.
2001-05-23 22:35:45 +00:00
John Baldwin
b608320d4a - Fix the sw_alloc_interlock to actually lock itself when the lock is
acquired.
- Assert Giant is held in the strategy, getpages, and putpages methods and
  the getchainbuf, flushchainbuf, and waitchainbuf functions.
- Always call flushchainbuf() w/o the VM lock.
2001-05-23 22:31:15 +00:00
John Baldwin
6d556da5c2 Assert Giant is held for the device pager alloc and getpages methods since
we call the mmap method of the cdevsw of the device we are mmap'ing.
2001-05-23 22:27:52 +00:00
John Baldwin
ce70e0a964 Assert Giant is held by the caller rather than getting it and releasing
it in getpages/putpages.
2001-05-23 22:26:05 +00:00
John Baldwin
8aa66068ed - Always call bfreekva() w/o vm_mtx held.
- Always call vfs_setdirty() with vm_mtx held.
- Fix an old comment: vm_hold_unload_pages is called vm_hold_free_pages()
  nowadays.
- Always call vm_hold_free_pages() w/o vm_mtx held.
2001-05-23 22:24:49 +00:00
John Baldwin
c7f52620e0 Don't acquire/release Giant around some of the places that need it in
spec_getpages().  Instead, assert that Giant is held by the caller.
2001-05-23 22:20:29 +00:00
John Baldwin
e4ca250d4b - Obtain Giant in mmap() syscall while messing with file descriptors and
vnodes.
- Fix an old bug that would leak a reference to a fd if the vnode being
  mmap'd wasn't of type VREG or VCHR.
- Lock Giant in vm_mmap() around calls into the VM that can call into
  pager routines that need Giant or into other VM routines that need
  Giant.
- Replace code that used a goto to jump around the else branch of a test
  to use an else branch instead.
2001-05-23 22:17:43 +00:00
Alfred Perlstein
1f50e112b6 pmap_mapdev needs the vm_mtx, aquire it if not already locked 2001-05-23 22:17:28 +00:00
Alfred Perlstein
b99c886a7f lock vm while playing with pmap 2001-05-23 22:13:58 +00:00
John Baldwin
bb10bb4978 Acquire Giant around vm_map_remove() inside of the obreak() syscall for
vm_object_terminate().
2001-05-23 22:13:10 +00:00
Bill Paul
95f27dc639 Regenerate 2001-05-23 22:11:25 +00:00
Bill Paul
134c58d3c0 Tweak the xmphy driver a little bit based on something I learned about
the built-in 1000baseX interface in the Level 1 LXT1001 chip. The Level 1
PHY comes up with the isolate bit in the control register set by default,
but it also has the autonegotiate bit set. When you tell the xmphy driver
to select IFM_AUTO mode, it sees that the autoneg bit is already on, and
thus doesn't bother updating the control register. However this means that
the isolate bit is never turned off (unless you manually select 1000baseSX
full or half duplex mode, which does result in the control register being
modified and the ISO bit being turned off).

This subtle and unusual behavioral difference stopped me from being able
to receive packets on the SMC9462TX card for several days, since isolating
the PHY disconnects it from the MAC's data interface. The fix is to omit
the 'is the autoneg big set?' test, since it doesn't really provide much
of an optimization anyway.

This commit also updates the xmphy driver to support the Jato/Level 1
internal PHY. (I'm not sure how Jato Technologies is related to Level 1:
all I know is the OUI from the PHY ID registers maps to Jato in the OUI
database.) This will be used once I add the if_lge driver to support
the LXT10010 chip.
2001-05-23 22:10:55 +00:00
John Baldwin
576f0c5fa4 Take a more conservative approach and still lock Giant around VM faults
for now.
2001-05-23 22:09:18 +00:00
John Baldwin
1b2555b243 - Lock the VM when initializing the vmspace for proc0.
- Don't bother releasing Giant while doing a lookup on the vm_map of
  initproc while starting up init.  We have to grab it again right after
  the lookup anyways.
2001-05-23 22:06:47 +00:00
John Baldwin
613c83cbf1 Lock the VM while twiddling the vmspace. 2001-05-23 22:05:08 +00:00
Bosko Milekic
629db60492 Increment mbstat.m_mpfail, not mbstat.m_mcfail, when m_pullup() fails.
This slipped in accidently a few commits back.
2001-05-23 20:44:54 +00:00
Hajimu UMEMOTO
12ae55c6f2 Fix memory leak.
Submitted by:	itojun
2001-05-23 20:41:17 +00:00
Poul-Henning Kamp
4638caddb7 Polish getnano{up}*time() prototypes.
PR:		15908
Submitted by:	Kelly Yancey kbyanc@posi.net
2001-05-23 20:33:54 +00:00
John Baldwin
c52f090cfb Set the phys_pager_alloc_lock to 1 when it is acquired so that it is
actually locked.
2001-05-23 19:52:23 +00:00
John Baldwin
5bd57bc8b7 Don't release the vm lock just to turn around and grab it again. 2001-05-23 19:51:12 +00:00
Doug Rabson
a0e512b219 Make sure that all resource allocation is handled in the pcib device, not
the chipset. This is already how the multi-hose systems handle resource
allocation and it fixes a bug where dense and bwx memory allocations were
not handled properly.

Reviewed by: gallatin
2001-05-23 19:44:17 +00:00
John Baldwin
b516d2f5e1 Add in assertions to ensure that we always call msleep or mawait with
either a timeout or a held mutex to detect unprotected infinite sleeps
that can easily lead to deadlock.

Submitted by:	alfred
2001-05-23 19:38:26 +00:00
Poul-Henning Kamp
f73cf22ade Vlan tags are 12 bits, mask off anything above since the chip doesn't
seem to do so for us.

PR:		27567
Submitted by:	Koji HINO hino@ccm.cl.nec.co.jp
MFC after:	1 week
2001-05-23 19:25:14 +00:00
Poul-Henning Kamp
4787f91d6b syslogd gets kernel log messages only once every 30 seconds or
at the top of the minute, whichever comes first.  It seems
logtimeout() is only called once after the kernel log is opened
and then never again after that.  So I guess syslogd only gets
kernel log messages by virtue of syncer(4)'s flushes ...?

PR:		27361
Submitted by:	pkern@utcc.utoronto.ca
MFC after:	1 week
2001-05-23 19:02:50 +00:00
Poul-Henning Kamp
840d4a82e4 Use '+' not '|' to add PCATCH to tsleep. 2001-05-23 17:54:58 +00:00
Poul-Henning Kamp
840e78b879 Use the correct enums in struct sysinit. 2001-05-23 17:53:24 +00:00
Poul-Henning Kamp
3b6c05fa7f Remove the empty uscannerioctl() and use noioctl() instead. 2001-05-23 17:51:43 +00:00
Poul-Henning Kamp
5a9300c451 Change the way deletes are managed in DEVFS.
This fixes a number of warnings relating to removed cloned devices.

It also makes it possible to recreate deleted devices with
mknod(2).  The major/minor arguments are ignored.
2001-05-23 17:48:20 +00:00
Andrew Gallatin
42fcdcb3e9 catch up to i386:
- remove Giant for vm related traps
- don't hold Giant for MP safe syscalls

Reviewed-by: jhb
2001-05-23 16:34:07 +00:00
Alfred Perlstein
1752ee59ba ufs_bmaparray() may block on IO, drop vm mutex and aquire Giant when
calling it from the pager routine
2001-05-23 10:30:25 +00:00
Alfred Perlstein
c5e62505ad aquire Giant when playing with the buffercache and doing IO.
use msleep against the vm mutex while waiting for a page IO to complete.
2001-05-23 10:28:11 +00:00
Alfred Perlstein
53240603ee aquire vm_mutex a little bit earlier to protect a pmap call. 2001-05-23 10:26:36 +00:00
Ruslan Ermilov
2c4645034f The following modules were renamed:
fdesc -> fdescfs
portal -> portalfs
umap -> umapfs
union -> unionfs
2001-05-23 10:06:48 +00:00
Ruslan Ermilov
801060df34 Name this module `umapfs'. 2001-05-23 10:02:22 +00:00
Ruslan Ermilov
99d300a1ec - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
systems were repo-copied from sys/miscfs to sys/fs.

- Renamed the following file systems and their modules:
  fdesc -> fdescfs, portal -> portalfs, union -> unionfs.

- Renamed corresponding kernel options:
  FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS.

- Install header files for the above file systems.

- Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland
  Makefiles.
2001-05-23 09:42:29 +00:00
Greg Lehey
468f05c7f7 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.

Remove the gross debug device/non-debug device hack used to recognize
whether the kernel module was in sync with the userland module.
2001-05-23 05:27:40 +00:00
Greg Lehey
dd3dced8c4 Move objflags from vinumvar.h to vinumobj.h in preparation for
requiring fewer header files for userland programs.
2001-05-23 05:27:15 +00:00
Greg Lehey
4ec8f62211 Move external declaration to vinumhdr.h. 2001-05-23 05:26:40 +00:00
Greg Lehey
bc55b89e25 Set flag VF_HASDEBUG in vinum_conf to indicate that the module was
compiled with debug support.  This can be used by userland programs to
recognize which ioctls the module supports.

As a result, remove the gross debug device/non-debug device hack used
to recognize whether the kernel module was in sync with the userland
module.

Replace explicit references to major/minor numbers of vinum
superdevice with the VINUM_SUPERDEV macro written for that purpose.
2001-05-23 05:25:45 +00:00
Warner Losh
a8ed536b94 Add better support for the Ricoh 5C296 and 5C396 chips. These chips
have a slightly different 3.3V support than the other clones, so
compensate as best we can.  Note: 3.3V support is untested since I do
not have any 3.3V cards that I know of to test it with.
2001-05-23 05:06:04 +00:00
Warner Losh
e0e34f291e Add recognition for Toshiba ToPIC-100.
Submitted by: Shimodaira Toshio <tshimod1@ym.nsw.co.jp> in [bsd-nomads:15589]
2001-05-23 04:37:00 +00:00
Dima Dorfman
a61a2e8e90 Add a makefile for snp(4) since it can be compiled as a module now. 2001-05-22 22:56:47 +00:00
Greg Lehey
4b2ec3c529 New header file.
Missed by:	Szilveszter Adam <sziszi@petra.hos.u-szeged.hu>
		David Wolfskill <david@catwhisker.org>
Pointy hat to:	grog
2001-05-22 22:29:35 +00:00
Dima Dorfman
0150c6e83d Unifdef DEV_SNP; snp(4) no longer requires these ugly hacks.
Silence by:	-hackers, -audit
2001-05-22 22:16:18 +00:00
Dima Dorfman
47eaa5f542 Convert this driver to (ab?)use line disciplines to get the input it
needs instead of relying on idiosyncratic hacks in the tty subsystem.
Also add module code since this can now be compiled as a module.

Silence by:	-hackers, -audit
2001-05-22 22:13:14 +00:00
Bruce Evans
1c1771cb5b Convert npx interrupts into traps instead of vice versa. This is much
simpler for npx exceptions that start as traps (no assembly required...)
and works better for npx exceptions that start as interrupts (there is
no longer a problem for nested interrupts).

Submitted by:	original (pre-SMPng) version by luoqi
2001-05-22 21:20:49 +00:00
Alfred Perlstein
240e0fdd93 aquire vm mutex in swp_pager_async_iodone. Don't call swp_pager_async_iodone
with the mutex held.
2001-05-22 19:01:26 +00:00
Andrew Gallatin
3bd404a4e2 grab the vm mtx around exec_new_vmspace() 2001-05-22 18:45:12 +00:00
Brian Somers
6ce76643aa MALLOC -> malloc, FREE -> free 2001-05-22 18:10:57 +00:00
Hajimu UMEMOTO
8d67252492 M_COPY_PKTHDR has to be done before MCLGET.
Obtained from:	KAME
2001-05-22 17:32:02 +00:00
Ruslan Ermilov
0a13f04ebe Hide UNION in opt_dontuse.h (see vfs_syscalls.c,v 1.109). 2001-05-22 08:32:13 +00:00
John Baldwin
86e92ee7e1 Remove duplicate include and sort includes. 2001-05-22 07:21:46 +00:00
John Baldwin
7d4ad42de5 Sort includes. 2001-05-22 07:01:11 +00:00
Greg Lehey
3b0d9edc7b Add vinumobj.h to SRCS. 2001-05-22 06:12:47 +00:00
Greg Lehey
74f5bf080b Remove Malloc definitions (now in vinumext.h) 2001-05-22 06:08:52 +00:00
John Baldwin
12635f9c89 Unlock the VM lock at the end of munlock() instead of locking it again. 2001-05-22 06:07:36 +00:00
John Baldwin
874468957d Sort includes from previous commit. 2001-05-22 05:35:45 +00:00
Dima Dorfman
a8dbafbe87 Correct the vm_mtx handling; specifically, don't acquire it in
shm_deallocate_segment because shmexit_myhook calls it, and the latter
should always be called with it already held.

Submitted by:	dwmalone, dd
Approved by:	alfred
2001-05-22 03:56:26 +00:00
Greg Lehey
c6ef641d24 Add a field 'version' to vinum_conf. This field is a constant which
gets incremented every time the kernel-userland interface changes.
This enables vinum(8) to check for the correct kernel version and to
produce a useful message if it doesn't match.

Requested by:	Too many to count.

Move the definitions of struct drive, sd, plex and volume to
vinumobj.h.

Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
2001-05-22 02:37:28 +00:00
Greg Lehey
2e387f1bd3 vinumstart: If a write request is for a RAID-[45] plex or a volume
with more than one plex, the data will be accessed
            multiple times.  During this time, userland code could
            potentially modify the buffer, thus causing data
            corruption.  In the case of a multi-plexed volume this
            might be cosmetic, but in the case of a RAID-[45] plex it
            can cause severe data corruption which only becomes
            evident after a drive failure.  Avoid this situation by
            making a copy of the data buffer before using it.

	    Note that this solution does not guarantee any particular
	    content of the buffer, just that it remains unchanged for
	    the duration of the request.

Suggested by:	alfred
2001-05-22 02:36:47 +00:00
Greg Lehey
5be7546b83 tokenize: Take third parameter specifying the maximum number of
parameters to return.  This code is used both in userland and in the
kernel.
2001-05-22 02:35:57 +00:00
Greg Lehey
24ad5cd24b Cosmetics: wrap long lines to be < 80 characters. 2001-05-22 02:35:19 +00:00
Greg Lehey
c4d4f4147d Add a new debug flag, DEBUG_LOCKREQS, which logs only lock requests.
Use this instead of DEBUG_LASTREQS to decide whether to log lock
requests.

MFS:

vinumlock: Catch a potential race condition where one process is
           waiting for a lock, and between the time it is woken and
           it retries the lock, another process gets it and places it
           in the first entry in the table.

           This problem has not been observed, but it's possible, and
           it's easy enough to fix.

Submitted by:   tegge

vinumunlock: Catch a real bug capable of hanging a system.  When
             releasing a lock, vinumunlock() called wakeup_one.  This
             caused wakeups to sometimes get lost.  After due
             consideration, we think that this is due to the fact that
             you can't guarantee that some other process is also
             waiting on the same address.  This makes wakeup_one a
             very dangerous function to use.
2001-05-22 02:34:30 +00:00
Greg Lehey
cf65a3dc63 Change ioctls to use the expurgated userland version of the Vinum
structures.
2001-05-22 02:33:32 +00:00
Greg Lehey
acac8659d7 format_config: Replace long format lines.
Requested by:  bde

Add retryerrors keyword.

vinum_scandisk: Print a different message if an inadvertent start
command did not find any additional drives.  The previous message "no
drives found" confused and worried many people.

MFS:

vinum_open: Recognize Mylex devices as storage devices.
2001-05-22 02:32:22 +00:00
Greg Lehey
ab15c118bf complete_rqe:
In case of error, check the VF_RETRYERRORS flag in the subdisk and
  don't take the subdisk down if it's set, just retry the I/O.

  Requested by:	peter

  If the buffer has been copied (XFR_COPYBUF), release the copied
  buffer when the I/O completes.

  Suggested by:	alfred
2001-05-22 02:31:08 +00:00
Greg Lehey
0e414969e0 Remove unnecessary declarations of userland functions.
Desired by:	   bde

This commit is the first of a general cleanup of the header files..
It won't be enough to make bde happy.

Move debug definitions from vinumhdr.h.
2001-05-22 02:30:44 +00:00
Greg Lehey
177bb9657f config_sd: Add code to recognize "retryerrors" keyword.
config_plex: Don't create the device until we're finished.

parse_config: check for corrupted configuration, thus avoiding a
potential panic.

remove_sd_entry: Restore structure.
2001-05-22 02:29:54 +00:00