Commit Graph

25792 Commits

Author SHA1 Message Date
Warner Losh
bccfae2270 Add some additional register definitions for some work I have in progress. 2001-05-08 02:06:03 +00:00
Brian Somers
3db1f8d59a sys/mutex.h requires sys/lock.h for LINT
Re-spotted by: phk
2001-05-07 23:52:08 +00:00
Warner Losh
bc5797c7de Set the slot pointer in the pc98 case. Correct the name of the bridge
chip to the one that the Japanese use.  Now we get insert/remove
events on my PC-9821Ne.  More work in bus space is needed to make
drivers work.

MFC after: 3 days
2001-05-07 22:28:05 +00:00
Mike Smith
282070b3e8 Minor updates:
- Rework of twe_report_request to use the command status value rather
   than the flags register. (Joel Jacobson @ 3ware)
 - Update to match some changes in -current vs. stable.

MFC in: 1 week
2001-05-07 21:46:44 +00:00
Akinori MUSHA
3b26be6ae1 Properly copy the P_ALTSTACK flag in struct proc::p_flag to the child
process on fork(2).

It is the supposed behavior stated in the manpage of sigaction(2), and
Solaris, NetBSD and FreeBSD 3-STABLE correctly do so.

The previous fix against libc_r/uthread/uthread_fork.c fixed the
problem only for the programs linked with libc_r, so back it out and
fix fork(2) itself to help those not linked with libc_r as well.

PR:		kern/26705
Submitted by:	KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
Tested by:	knu, GOTOU Yuuzou <gotoyuzo@notwork.org>,
		and some other people
Not objected by:	hackers
MFC in:		3 days
2001-05-07 18:07:29 +00:00
Warner Losh
a66173abd2 Disable the card after sending the removed event up to the pccard
layer.  This fixes an ordering problem that would cause the ISR for
the device to run with now power applied to the device.  Most cards
failed to deal with this gracefully, and thus would hang on card
eject.

The power down event, for those keeping score, is what causes the
interrupt for the card.

Many folks in the Japanese nomads list have reported this, so I'll be
MFCing quickly for their benefit.

Submitted by: Masayuki FUKUI
MFC after: 2 days
2001-05-07 16:50:34 +00:00
Duncan Barclay
9dc1f83dc8 Remove if_ray_oldcard.h because pccard support multiple windows now.
Setup attribute memory resource in ray_probe so that it is added to
the print out of the resource list on card insertion.
2001-05-07 13:11:08 +00:00
Brian Somers
cf8f8229d0 Change COM_LOCK/COM_UNLOCK to a regular mutex - still conditional on
SMP being defined.
2001-05-07 11:13:11 +00:00
Poul-Henning Kamp
079f2df393 Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.
2001-05-06 21:55:22 +00:00
Brian Somers
87406f5cb4 Make LINT compile again.
Spotted by:	phk
2001-05-06 21:03:37 +00:00
Poul-Henning Kamp
a468031ce8 Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.
2001-05-06 20:00:03 +00:00
Poul-Henning Kamp
18ee6cea78 Introduce bioerror(struct bio*, int err, int complete); 2001-05-06 18:57:08 +00:00
Poul-Henning Kamp
6bd2ea83ef Remove unneeded devfs_badop()
Noticed by:	rwatson
2001-05-06 17:40:34 +00:00
Poul-Henning Kamp
b966319db7 Fix return type of vop_stdputpages()
Noticed by:	rwatson
2001-05-06 17:40:22 +00:00
Poul-Henning Kamp
1f4ee1aac4 Fix a panic if MD devices were left half-created.
XXX: the real bug is that devstat isn't part of the disk minilayer.

PR:		27158
Submitted by:	Anders Nordby <anders@fix.no>
2001-05-06 17:17:23 +00:00
Robert Watson
29b2efeb6b o First step in cleaning up authorization code for the posix4
implementation.  Move from direct uid 0 comparision to using suser_xxx()
  call with the same semantics.  Simplify CAN_AFFECT() macro as passed
  pcred was redundant.  The checks here still aren't "right", but they
  are probably "better".

Obtained from:	TrustedBSD Project
2001-05-06 16:15:42 +00:00
Poul-Henning Kamp
8a9d06dcfb Update the DiskOnChip firmware to OSAK version 4.1.
Sponsored by:	Redfern Broadband Networks (www.RedFernNetworks.com)
2001-05-06 12:37:42 +00:00
Yoshihiro Takahashi
2f8a98e27b Restore I/O port resources to the condition before adv_isa_probe() is
called.

Submitted by:	yokota
2001-05-06 09:28:18 +00:00
KATO Takenori
3c4848ae4a Merged from sys/i386/i386/machdep.c revision 1.448. 2001-05-06 09:18:32 +00:00
Yoshihiro Takahashi
29986716bc Use correct resource id for bus_release_resource(). 2001-05-06 08:33:29 +00:00
Yoshihiro Takahashi
684ac05ae8 Move unused functions into #if 0 ... #endif. 2001-05-06 08:07:10 +00:00
Yoshihiro Takahashi
382157f377 Merged from sys/i386/conf/GENERIC revision 1.304. 2001-05-06 05:57:46 +00:00
Yoshihiro Takahashi
df55282812 Merged from sys/isa/fd.c revision 1.193. 2001-05-06 05:49:11 +00:00
Daniel Eischen
46022f276b When setting up the frame to invoke a signal handler, preserve the
%fs and %gs registers instead of setting them to known sane values.
%fs is going to be used for thread/KSE specific data by the new
threads library; we'll want it to be valid inside of signal handlers.

According to bde, Linux preserves the state of %fs and %gs when setting
up signal handlers, so there is precedent for doing this.

The same changes should be made in the Linux emulator, but when made,
they seem to break (at least one version of) the IBM JDK for Linux
(reported by drew).

Approved by:	bde
2001-05-06 02:13:12 +00:00
Joerg Wunsch
66d98ff938 Add q quirk for the old SONY SMO drive i've been sitting upon in my
private tree for too long now.  This (pre SCSI-2) drive returns a
mystic code when the medium is inserted but not spun up.
2001-05-05 14:42:06 +00:00
Cameron Grant
799c04bad3 this file has been unused for some time now 2001-05-05 05:32:22 +00:00
Matthew Dillon
1766b2e5fa Raise the SysV shared memory defaults to more reasonable values.
Mainly increases the shared memory limit from 4M to 32M (approx).
Many more programs these days use SysV shared memory, especially X-related
programs.
2001-05-04 18:43:19 +00:00
John Baldwin
6c49a8e295 Fix a bug in the pfind() changes due to confusing the process returned by
pfind() ('pp') with the process being detached from ptrace.

Reported by:	bde
2001-05-04 18:13:11 +00:00
John Baldwin
2d96f0b145 - Move state about lock objects out of struct lock_object and into a new
struct lock_instance that is stored in the per-process and per-CPU lock
  lists.  Previously, the lock lists just kept a pointer to each lock held.
  That pointer is now replaced by a lock instance which contains a pointer
  to the lock object, the file and line of the last acquisition of a lock,
  and various flags about a lock including its recursion count.
- If we sleep while holding a sleepable lock, then mark that lock instance
  as having slept and ignore any lock order violations that occur while
  acquiring Giant when we wake up with slept locks.  This is ok because of
  Giant's special nature.
- Allow witness to differentiate between shared and exclusive locks and
  unlocks of a lock.  Witness will now detect the case when a lock is
  acquired first in one mode and then in another.  Mutexes are always
  locked and unlocked exclusively.  Witness will also now detect the case
  where a process attempts to unlock a shared lock while holding an
  exclusive lock and vice versa.
- Fix a bug in the lock list implementation where we used the wrong
  constant to detect the case where a lock list entry was full.
2001-05-04 17:15:16 +00:00
John Baldwin
ac07d659c3 Don't hold the process mutex across calls to FREE() since the vm system
uses lockmgr locks and this leads to a lock order reversal.  At this point
in wait1() the process is not on any process lists or in the process tree,
so no other process should be able to find it or have a reference to it
anyways, so the locking is not needed.
2001-05-04 16:13:28 +00:00
Kirk McKusick
23371b2f22 Refinement to revision 1.16 of ufs/ffs/ffs_snapshot.c to reduce
the amount of time that the filesystem must be suspended. The
current snapshot is elided as well as the earlier snapshots.
2001-05-04 05:49:28 +00:00
Jonathan Lemon
5b3721af37 Fix the problem of some directory entries going missing when
read by the linux version of 'ls'.

Spotted by: rwatson
2001-05-04 05:19:22 +00:00
Mark Murray
559034b748 Putting sys/lockmgr.h in here allows us to depollute userland includes
a bit.
OK'ed by:	bde
2001-05-03 11:33:51 +00:00
Boris Popov
d759827bd9 Convert vnode_pager_freepage() to vm_free_page().
Forgotten by:	alfred
2001-05-03 09:00:54 +00:00
Boris Popov
3bdcb68d16 Wrap around MALLOC_DECLARE() invocation with #ifdef. 2001-05-03 08:57:26 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Bill Fenner
26e3096360 Get IP multicast working on VLAN devices:
- Allocate zeroed memory in ether_resolvemulti() to prevent equal() from
  comparing garbage and determining that two otherwise-equal sockaddr_dls
  are different.
- Fill in all required fields of the sockaddr_dl
- Actually copy the multicast address into the sockaddr_dl when calling
  if_addmulti()
- Don't claim that we don't have a way to resolve layer 3 addresses into
  layer 2 addresses; use the ethernet way.
2001-05-02 16:12:58 +00:00
KATO Takenori
4cb0ebe811 Merged from sys/isa/sio.c revision 1.330. 2001-05-02 14:02:16 +00:00
KATO Takenori
e5b4cbf1a9 Merged from sys/isa/fd.c revision 1.195. 2001-05-02 13:59:03 +00:00
KATO Takenori
92c90d5cd1 Merged from sys/i386/isa/npx.c revisions 1.96 and 1.97. 2001-05-02 13:56:50 +00:00
KATO Takenori
3520a2a0e2 Merged from sys/i386/isa/clock.c revisions 1.172 and 1.173. 2001-05-02 13:51:49 +00:00
KATO Takenori
281238b184 Merged the rest of changes in sys/i386/i386/machdep.c revision 1.447. 2001-05-02 13:48:39 +00:00
Bruce Evans
79d4e25bea Fixed panics in npx exception handling. When using IRQ13 exception
handling, SMPng always switches the npx context away from curproc
before calling the handler, so the handler always paniced.  When using
exception 16 exception handling, SMPng sometimes switches the npx
context away from curproc before calling the handler, so the handler
sometimes paniced.  Also, we didn't lock the context while using it,
so we sometimes didn't detect the switch and then paniced in a less
controlled way.

Just lock the context while using it, and return without doing anything
except clearing the busy latch if the context is not for curproc.  This
fixes the exception 16 case and makes the IRQ13 case harmless.  In both
cases, the instruction that caused the exception is restarted and the
exception repeats.  In the exception 16 case, we soon get an exception
that can be handled without doing anything special.  In the IRQ13 case,
we get an easy to kill hung process.
2001-05-02 13:06:58 +00:00
Brian Somers
de85e722d1 Only define DEBUG if it's undefined. This should eventually go, but
can stay for now in case of problems.
2001-05-02 01:47:34 +00:00
Brian Somers
ad01e0c856 Add a ``digi'' driver.
This driver supports PCI Xr-based and ISA Xem Digiboard cards.
dgm will go away soon if there are no problems reported.  For now,
configuring dgm into your kernel warns that you should be using
digi.  This driver is probably close to supporting Xi, Xe and Xeve
cards, but I wouldn't expect them to work properly (hardware
donations welcome).

The digi_* pseudo-drivers are not drivers themselves but contain
the BIOS and FEP/OS binaries for various digiboard cards and are
auto-loaded and auto-unloaded by the digi driver at initialisation
time.  They *may* be configured into the kernel, but waste a lot
of space if they are.  They're intended to be left as modules.

The digictl program is (mainly) used to re-initialise cards that
have external port modules attached such as the PC/Xem.
2001-05-02 01:08:09 +00:00
Kenneth D. Merry
9c6a092060 Fix up unit attention and selection timeout handling in various peripheral
drivers.

- change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls
  cam_periph_runccb().
- change the pt(4) driver to ignore unit attentions
- change the targ(4) driver to retry selection timeouts
- clean up a few formatting glitches in the targ(4) driver

Reviewed by:	gibbs
2001-05-01 19:37:25 +00:00
Jens Schweikhardt
de79862524 pseudo-device -> device in kernel config.
Reviewed by:	joerg, dd
2001-05-01 11:26:14 +00:00
Poul-Henning Kamp
3858e5e797 Use ufs_bmaparray() rather than VOP_BMAP() on our own vnodes. 2001-05-01 09:12:39 +00:00
Poul-Henning Kamp
3c7a8027cb Remove blatantly pointless call to VOP_BMAP().
Use ufs_bmaparray() rather than VOP_BMAP() on our own vnodes.
2001-05-01 09:12:31 +00:00
Poul-Henning Kamp
cf94807d03 Remove blatantly pointless call to VOP_BMAP(). 2001-05-01 09:12:05 +00:00
Poul-Henning Kamp
a62615e59b Implement vop_std{get|put}pages() and add them to the default vop[].
Un-copy&paste all the VOP_{GET|PUT}PAGES() functions which do nothing but
the default.
2001-05-01 08:34:45 +00:00
Mark Murray
fb919e4d5a Undo part of the tangle of having sys/lock.h and sys/mutex.h included in
other "system" header files.

Also help the deprecation of lockmgr.h by making it a sub-include of
sys/lock.h and removing sys/lockmgr.h form kernel .c files.

Sort sys/*.h includes where possible in affected files.

OK'ed by:	bde (with reservations)
2001-05-01 08:13:21 +00:00
John Baldwin
3908917969 Turn on preemption by default on the alpha arch. This also removes the
PREEMPTION kernel option.

Not objected to by:	-alpha
2001-05-01 00:19:24 +00:00
Kenneth D. Merry
7b1f8d8bd4 Add sense key table entries for DATA PROTECT and BLANK CHECK. This will
prevent scsi_sense_desc() from deferencing a NULL pointer when a drive
happens to return one of these sense keys.

Reported by:	Michael Samuel <michael@miknet.net>
2001-04-30 21:40:09 +00:00
John Baldwin
39c451331e Allow the size of the SSC memory disk used with the SKI emulator to be
overridden in the kernel config file via the SSC_NSECT option.
2001-04-30 21:26:43 +00:00
Poul-Henning Kamp
e9d19a117e Uncut&paste som bogus use of VOP_BMAP in cd9660::VOP_STRATEGY.
XXX mark some stuff which looks like further cut&paste junk.
2001-04-30 21:23:05 +00:00
Poul-Henning Kamp
c1acc01996 Uncut&paste som bogus use of VOP_BMAP in hpfs::VOP_STRATEGY.
At the same time, eliminate uninitialized use of a vnode
pointer.  Interesting GCC didn't spot this.
2001-04-30 21:21:53 +00:00
Kenneth D. Merry
00e54d14f6 In camperiphscsisenseerror(), don't return an error when the error action
is SS_NOP.

Submitted by:	joerg
2001-04-30 21:02:57 +00:00
Nick Hibma
d309bc7f71 Regen. 2001-04-30 17:38:57 +00:00
Nick Hibma
eb9c76a9f0 Add 4300C Id
Submitted by:	Ernst de Haan <ernst@heinz.jollem.com>
2001-04-30 17:37:11 +00:00
Kenneth D. Merry
6c3a3e1013 Fix an errant search and replace that broke SCSI start unit commands.
This should fix automatic spinups as well as 'camcontrol start'.
2001-04-30 16:07:38 +00:00
Bruce Evans
438abdb9c6 Backed out previous commit. It cause massive filesystem corruption,
not to mention a compile-time warning about the critical function
becoming unused, by replacing spec_bmap() with vop_stdbmap().

ntfs seems to have the same bug.

The factor for converting specfs block numbers to physical block
numbers is 1, but vop_stdbmap() uses the bogus factor
btodb(ap->a_vp->v_mount->mnt_stat.f_iosize), which is 16 for ffs with
the default block size of 8K.  This factor is bogus even for vop_stdbmap()
-- the correct factor is related to the filesystem blocksize which is not
necessarily the same to the optimal i/o size.  vop_stdbmap() was apparently
cloned from nfs where these sizes happen to be the same.

There may also be a problem with a_vp->v_mount being null.  spec_bmap()
still checks for this, but I think the checks in specfs are dead code
which used to support block devices.
2001-04-30 14:35:35 +00:00
Alfred Perlstein
aad7597ce0 When panic()'ing because of recursion on a non-recursive mutex, print
out the location it was initially locked.

Ok'd by: jake
2001-04-30 01:01:52 +00:00
Jake Burkholder
e6af1080c2 Make rtprio work again.
- add a missing break which caused RTP_SET to always return EINVAL
- break instead of returning if p_can fails so proc_lock is always
  dropped correctly
- only copyin data that is actually needed
- use break instead of goto
- make rtp_to_pri return EINVAL instead of -1 if the values are out
  or range so we don't have to translate
2001-04-29 22:09:26 +00:00
Robert Watson
46157a65d7 o As part of the move to not maintaining copies of the vnode owning uid
and gid in the ACL, vaccess_acl_posix1e() was changed to accept
  explicit file_uid and file_gid as arguments.  However, in making the
  change, I explicitly checked file_gid against cr->cr_groups[0], rather
  than using groupmember, resulting in ACL_GROUP_OBJ entries being
  compared to the caller's effective gid only, not the remainder of
  its groups.  This was recently corrected for the version of the
  group call without privilege, but the second test (when privilege is
  added) was missed.  This change replaces an additiona cr->cr_groups[0]
  check with groupmember().

Pointed out by:	jedgar
Reviewed by:	jedgar
Obtained from:	TrustedBSD Project
2001-04-29 19:53:50 +00:00
Poul-Henning Kamp
855aa097af VOP_BALLOC was never really a VOP in the first place, so convert it
to UFS_BALLOC like the other "between UFS and FFS function interfaces".
2001-04-29 12:36:52 +00:00
Poul-Henning Kamp
b7ebffbc08 Add a vop_stdbmap(), and make it part of the default vop vector.
Make 7 filesystems which don't really know about VOP_BMAP rely
on the default vector, rather than more or less complete local
vop_nopbmap() implementations.
2001-04-29 11:48:41 +00:00
Poul-Henning Kamp
bdb8855550 Make a panic less misleading. 2001-04-29 11:45:15 +00:00
Poul-Henning Kamp
f2ddd13ad2 Call ufs_bmaparray() directly instead of indirectly via VOP_BMAP(). 2001-04-29 10:25:30 +00:00
Poul-Henning Kamp
954a0e256e Remove two unused arguments from ufs_bmaparray(). 2001-04-29 10:24:58 +00:00
Poul-Henning Kamp
e955479077 Remove faint traces of blind copy&paste. 2001-04-29 10:23:50 +00:00
Poul-Henning Kamp
0c25dbeb17 Remove faint traces of non-existant ffs_bmap(). 2001-04-29 10:23:32 +00:00
Alfred Perlstein
f411fba5d3 Remove incorrect comment.
Submitted by: quinot@inf.enst.fr <quinot@inf.enst.fr>
PR: kern/26893
2001-04-29 03:10:24 +00:00
Greg Lehey
60fb0ce365 Revert consequences of changes to mount.h, part 2.
Requested by:	bde
2001-04-29 02:45:39 +00:00
Daniel C. Sobral
49acc8fe50 Bring in ficl 2.05.
This version has a step debugger, which now completely replaces the
old trace feature. Also, we moved all of the FreeBSD-specific MI
code to loader.c, reducing the diff between this and the official
FICL distribution.
2001-04-29 02:36:36 +00:00
Cameron Grant
cd94939222 don't unlock the channel in chn_read, msleep will do it for us.
PR:		kern/26430
2001-04-29 02:31:02 +00:00
David E. O'Brien
d856af0b1a Add back in the bits to remove any existing "schg" flags as we have
kernel's out in wild that still have these flags set.
2001-04-29 01:53:57 +00:00
Alfred Perlstein
6157b69f4a Instead of asserting that a mutex is not still locked after unlocking it,
assert that the mutex is owned and not recursed prior to unlocking it.

This should give a clearer diagnostic when a programming error is caught.
2001-04-28 12:11:01 +00:00
John Baldwin
4d4bc9acc6 Add in a missing call to forward_hardclock() in the SMP case.
Submitted by:	bde
2001-04-28 01:37:44 +00:00
Cameron Grant
680307ae14 be more specific in identifying the chip type 2001-04-27 22:26:36 +00:00
Alfred Perlstein
93c7ba9f09 Address a number of problems with sysctl_vm_zone().
The zone allocator's locks should be leaflocks, meaning that they
should never be held when entering into another subsystem, however
the sysctl grabs the zone global mutex and individual zone mutexes
while holding the lock it calls SYSCTL_OUT which recurses into the
VM subsystem in order to wire user memory to do a safe copy.  This
can block and cause lock order reversals.

To fix this:
  lock zone global.
  get a count of the number of zones.
  unlock global.
  allocate temporary storage.
  format and SYSCTL_OUT the banner.
  lock global.
  traverse list.
    make sure we haven't looped more than the initial count taken
      to avoid overflowing the allocated buffer.
    lock each nodes.
    read values and format into buffer.
    unlock individual node.
  unlock global.
  format and SYSCTL_OUT the rest of the data.
  free storage.
  return.

Other problems included not checking for errors when doing sysctl out
of the column header.  Fixed.

Inconsistant termination of the copied string. Fixed.

Objected to by: des (for not using sbuf)

Since the output is not variable length and I'm actually over
allocating signifigantly and I'd like to get this fixed now, I'll
work on the sbuf convertion at a later date.  I would not object
to someone else taking it upon themselves to convert it to sbuf.
I hold no MAINTIANER rights to this code (for now).
2001-04-27 22:24:45 +00:00
Bill Fenner
4f3c11a654 Better handling of ioctl(SIOCSIFFLAGS) failing in ifpromisc():
- Don't print the "promiscuous mode (enabled|disabled)" on failure
- Restore the reference count on failure
2001-04-27 22:20:22 +00:00
Søren Schmidt
ed27f87339 Move the disklabel construction to the attach function instead of
in open. This prevent panics when a the disklabel is accessed on
an ATA-RAID subdisk.
2001-04-27 19:47:33 +00:00
John Baldwin
6caa8a1501 Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made
to support Alpha SMP.

- It splits the per-process portions of hardclock() and statclock() off
  into hardclock_process() and statclock_process() respectively.  hardclock()
  and statclock() call the *_process() functions for the current process so
  that UP systems will run as before.  For SMP systems, it is simply necessary
  to ensure that all other processors execute the *_process() functions when the
  main clock functions are triggered on one CPU by an interrupt.  For the alpha
  4100, clock interrupts are delievered in a staggered broadcast fashion, so
  we simply call hardclock/statclock on the boot CPU and call the *_process()
  functions on the secondaries.  For x86, we call statclock and hardclock as
  usual and then call forward_hardclock/statclock in the MD code to send an IPI
  to cause the AP's to execute forwared_hardclock/statclock which then call the
  *_process() functions.
- forward_signal() and forward_roundrobin() have been reworked to be MI and to
  involve less hackery.  Now the cpu doing the forward sets any flags, etc. and
  sends a very simple IPI_AST to the other cpu(s).  AST IPIs now just basically
  return so that they can execute ast() and don't bother with setting the
  astpending or needresched flags themselves.  This also removes the loop in
  forward_signal() as sched_lock closes the race condition that the loop worked
  around.
- need_resched(), resched_wanted() and clear_resched() have been changed to take
  a process to act on rather than assuming curproc so that they can be used to
  implement forward_roundrobin() as described above.
- Various other SMP variables have been moved to a MI subr_smp.c and a new
  header sys/smp.h declares MI SMP variables and API's.   The IPI API's from
  machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h.
- The globaldata_register() and globaldata_find() functions as well as the
  SLIST of globaldata structures has become MI and moved into subr_smp.c.
  Also, the globaldata list is only available if SMP support is compiled in.

Reviewed by:	jake, peter
Looked over by:	eivind
2001-04-27 19:28:25 +00:00
Andrew Gallatin
e5878540ed Make stathz match reality on platforms like the 4100 where hz!=1024
It might be more correct to make stathz as close as possible to 128,
but that would involve adding complexity to the clock intr path, which
I don't want to do.
2001-04-27 18:21:25 +00:00
Alfred Perlstein
3abedb4e01 Actually show the values that tripped the assertion "receive 1" 2001-04-27 13:42:50 +00:00
Robert Watson
80c9c40df9 o Remove the disabled p_cansched() test cases that permitted users to
modify the scheduling properties of processes with a different real
  uid but the same effective uid (i.e., daemons, et al).  (note: these
  cases were previously commented out, so this does not change the
  compiled code at al)

Obtained from:	TrustedBSD Project
2001-04-27 01:56:32 +00:00
John Baldwin
23936bbf45 Initiate the deorbit burn sequence for sys/ipl.h by moving the software
interrupt priorities over to sys/interrupt.h next to the software interrupt
API.
2001-04-27 00:29:45 +00:00
John Baldwin
bf4c03d0e9 Initialize p_md.md_kernnest to 1 for newly fork'd processes since they
start off in the kernel.
2001-04-26 23:52:40 +00:00
Poul-Henning Kamp
8ee8b21b48 vfs_subr.c is getting rather fat. The underlying repocopy and this
commit moves the filesystem export handling code to vfs_export.c
2001-04-26 20:47:14 +00:00
Bill Paul
6263665f87 Fix the definitions for memory bank sizes, which I somehow got wrong.
The constant I was using was correct, but I mislabeled it as 256K when
it should have been 512K. This doesn't actually change the code, but
it clarifies things somewhat.

Submitted by:	Chuck Cranor <chuck@research.att.com>
2001-04-26 16:40:45 +00:00
Jake Burkholder
7a72decc2e Remove a leading underscore that prevented I386_CPU kernels from
compiling.

Submitted by:	Alexander N. Kabaev <ak03@gte.com>
PR:		kern/26858
2001-04-26 13:57:03 +00:00
Mike Smith
ed1c82f450 More new Dell PCI IDs.
Submitted by:	"Marty Moll" <martym@arbor.edu>
2001-04-26 01:14:37 +00:00
Kirk McKusick
c9509f5865 Rather than copying all the indirect blocks of the snapshot,
simply mark them as BLK_NOCOPY. This trick cuts the initial
size of the snapshot in half and cuts the time to take a
snapshot by a third.
2001-04-26 00:50:53 +00:00
Mike Smith
71665b0add The PERC 3/Di in the Dell PowerEdge 2250 has a new subdevice ID.
Submitted by:	Chris Csanady <cc@ameslab.gov>
2001-04-26 00:32:02 +00:00
Alfred Perlstein
06336fb26d Sendfile is documented to return 0 on success, however if when a
sf_hdtr is used to provide writev(2) style headers/trailers on the
sent data the return value is actually either the result of writev(2)
from the trailers or headers of no tailers are specified.

Fix sendfile to comply with the documentation, by returning 0 on
success.

Ok'd by: dg
2001-04-26 00:14:14 +00:00
Paul Richards
9ca3a84af2 A bogus check for a char device also matched symbolic links.
Replace it with a correct check using S_ISCHR()

Symbolic links will now work again in linux compatibility.
2001-04-25 22:07:16 +00:00
David E. O'Brien
ea87b3cb61 Don't install KO's with the "schg" flag.
We are way too inconsistent with our setting of the "schg" flag, and in
our default install, it doesn't really offer any additional security.

Reviewed by:	arch@
2001-04-25 20:56:15 +00:00
David E. O'Brien
58c9a20771 Fix SCM ID's and remove tailing blanks. 2001-04-25 20:40:57 +00:00
John Baldwin
bb61024d88 - Make the dumping of console messages from the secondary CPU's to the
kernel console be #ifdef DIAGNOSTIC.
- Don't set ktr_mask in release_aps().
2001-04-25 17:24:57 +00:00
Andrew Gallatin
7b6630700d alpha_fpstate_save is fairly expensive (critical enter/exit, possibly
saves 32 registers) to do on every context switch.  This is only required
for SMP, so only do it there.

We should also look at moving the critical enter/exit out to the callers
2001-04-25 13:57:33 +00:00
Bruce Evans
e8a28f87d8 MFffs ffs_balloc.c 1.5.
Long ago, bread() set b_blkno to the disk block number as a side effect
of doing physical i/o (or it just retained the setting from when the
i/o was done).  The setting is lost when buffers go away and then are
reconsituted from VM.  bread() originally compensated by doing a
VOP_BMAP() to recover b_blkno, but this was no good since it sometimes
caused extra i/o or even deadlock for bread()ing metadata to do the
bmap.  This was fixed in vfs_bio.c 1.33 (1995/03/03) and ffs_balloc.c
1.5, etc., by removing the VOP_BMAP() from bread() and breadn(), and
changing all (?) places that used b_blkno to set it if necessary.

ext2fs was not imported until later in 1995 and was still depending on
the old behaviour of bread() in at least ext2_balloc().  This caused
filesystem and file corruption by clobbering direct block numbers in
inodes.
2001-04-25 10:33:09 +00:00
Seigo Tanimura
ebdc3f1d2d Do not leave a process with no credential in zombproc.
Reviewed by:	jhb
2001-04-25 10:22:35 +00:00
Kirk McKusick
112f737245 When closing the last reference to an unlinked file, it is freed
by the inactive routine. Because the freeing causes the filesystem
to be modified, the close must be held up during periods when the
filesystem is suspended.

For snapshots to be consistent across crashes, they must write
blocks that they copy and claim those written blocks in their
on-disk block pointers before the old blocks that they referenced
can be allowed to be written.

Close a loophole that allowed unwritten blocks to be skipped when
doing ffs_sync with a request to wait for all I/O activity to be
completed.
2001-04-25 08:11:18 +00:00
Poul-Henning Kamp
a13234bb35 Move the netexport structure from the fs-specific mountstructure
to struct mount.

This makes the "struct netexport *" paramter to the vfs_export
and vfs_checkexport interface unneeded.

Consequently that all non-stacking filesystems can use
vfs_stdcheckexp().

At the same time, make it a pointer to a struct netexport
in struct mount, so that we can remove the bogus AF_MAX
and #include <net/radix.h> from <sys/mount.h>
2001-04-25 07:07:52 +00:00
Warner Losh
40afc1048e Ignore chflags errors. This makes installing to nfs mounted target
directories work.
2001-04-25 06:19:58 +00:00
Chris D. Faulhaber
0f6263079e o Separate acl_t into internal and external representations as
required by POSIX.1e.  This maintains the current 'struct acl'
  in the kernel while providing the generic external acl_t
  interface required to complete the ACL editing library.
o Add the acl_get_entry() function.
o Convert the existing ACL utilities, getfacl and setfacl, to
  fully make use of the ACL editing library.

Obtained from:	TrustedBSD Project
2001-04-24 22:45:41 +00:00
Cameron Grant
15418cf2bb get the parameters to pci_write_config the right way round. this may fix
some non-functional cards/machines
2001-04-24 22:35:11 +00:00
John Baldwin
9e438eb4f5 Add a new field 'md_kernnest' to the alpha machine dependent process
structure.  This field keeps track of how many levels deep we are nested
into the kernel.  The nesting level is bumped at the start of a trap,
interrupt, syscall, or exception and is decremented on return.  This is
used to detect the case when the kernel is returning back to a kernel
context in exception_return().  If we are returning to the kernel we need
to update the globaldata pointer register saved in the stack frame in case
we have switched CPU's between taking the initial interrupt that saved the
frame and returning.  If we don't do this fixup it is possible for a CPU to
use the wrong per-cpu data.  On UP systems this is not a problem, so the
code is conditional on SMP.

A count was used instead of simply checking the process status register in
the frame during exception_return() since there are critical sections at
the very start and end of a trap, exception, or interrupt from userland in
which we could trash the t7 register being used in userland.  The counter
is incremented after adn before these critical sections respectively so
that we will not overwrite the saved t7 register if we are interrupted
during one of these critical sections.
2001-04-24 21:06:53 +00:00
Thomas Moestl
83f3198b2b Change uipc_sockaddr so that a sockaddr_un without a path is returned
nam for an unbound socket instead of leaving nam untouched in that case.
This way, the getsockname() output can be used to determine the address
family of such sockets (AF_LOCAL).

Reviewed by:	iedowse
Approved by:	rwatson
2001-04-24 19:09:23 +00:00
Robert Watson
c7e1887023 o Change a suser() call to a suser_xxx(..., PRISON_ROOT) call in the
linuxulator so as to allow privileged processes within a jail() to
  invoke the Linux initgroups() system call.  This allows the Linux
  "su" to work properly (better) when running a complete Linux
  environment under jail().  This problem was reported by Attila
  Nagy <bra@fsn.hu>.

Reviewed by:	marcel
2001-04-24 19:08:53 +00:00
Doug Rabson
a78af1ccdb When switching backing store during signal delivery, do the switch before
creating the register frame for calling the handler. Also discard that
frame before switching back to the old backing store after the handler
returns.
2001-04-24 15:57:16 +00:00
Doug Rabson
2c7122ff0f Align stack pointer and backing store pointer to 16 byte boundary when
delivering signals.
2001-04-24 15:55:47 +00:00
Doug Rabson
1eaf877f2e Don't trash the user's pr on syscalls. 2001-04-24 15:54:23 +00:00
Sheldon Hearn
4721e8a849 Revert previous delta, which was completely bogus.
The perceived problem was the symptom of a local error.
2001-04-24 12:30:49 +00:00
Sheldon Hearn
da82ff05af Disconnect linux from the build. The buildkernel target has been
breaking on linux for more than two days because sys_exit_args
referenced in linux_sysent.c does not exist.
2001-04-24 08:56:42 +00:00
John Baldwin
33a9ed9d0e Change the pfind() and zpfind() functions to lock the process that they
find before releasing the allproc lock and returning.

Reviewed by:	-smp, dfr, jake
2001-04-24 00:51:53 +00:00
Ian Dowse
5d69bac493 Pre-dirpref versions of fsck may zero out the new superblock fields
fs_contigdirs, fs_avgfilesize and fs_avgfpdir. This could cause
panics if these fields were zeroed while a filesystem was mounted
read-only, and then remounted read-write.

Add code to ffs_reload() which copies the fs_contigdirs pointer
from the previous superblock, and reinitialises fs_avgf* if necessary.

Reviewed by:	mckusick
2001-04-24 00:37:16 +00:00
Greg Lehey
b186f62cbc Back out previous commit.
Requested by:	bde
2001-04-23 23:51:17 +00:00
Thomas Moestl
e15480f8dd Fix a bug introduced in the last commit: vaccess_acl_posix1 only checked
the file gid gainst the egid of the accessing process for the
ACL_GROUP_OBJ case, and ignored supplementary groups.

Approved by:	rwatson
2001-04-23 22:52:26 +00:00
Orion Hodson
3c43ddee02 Add als4000 subdir. 2001-04-23 21:58:23 +00:00
Orion Hodson
1f2b9fe67a Initial version of Avance Logic ALS4000 pcm driver. 2001-04-23 21:53:12 +00:00
Matt Jacob
2b4169610b fix it so it compiles again 2001-04-23 18:51:54 +00:00
Matt Jacob
140509ab5d fix it so it compiles again after twerpage elsewhere 2001-04-23 18:38:01 +00:00
Matt Jacob
3be6e0c249 add this ridiculous include foo so it will compile again 2001-04-23 18:14:41 +00:00
Matt Jacob
ac60aa4908 Fix includes so it compiles again. 2001-04-23 18:08:54 +00:00
Greg Lehey
d98dc34f52 Correct #includes to work with fixed sys/mount.h. 2001-04-23 09:05:15 +00:00
Greg Lehey
97d5f7bb3b Correct #includes to work with fixed sys/mount.h. 2001-04-23 08:28:44 +00:00
Greg Lehey
e84a5d8372 Remove bogus #include and duplicate definition of AF_MAX. These were
made necessary by breakage in usr.sbin/pstat and usr.bin/fstat, since
fixed.

Suggested by:	phk
Unearthed by:	John Hood <jhood@sitaranetworks.com>
2001-04-23 08:17:18 +00:00
Greg Lehey
4c68f41dda Add address families AF_SLOW and AF_SCLUSTER. These are used by the
Sitara QoSworks box.

Obtained from:	Sitara Networks Inc.
2001-04-23 05:13:18 +00:00
Joerg Wunsch
fc89704c57 Fix the `tape drive spinning indefinately upon mt stat' problem.
With the recent changes in the CAM error handling, some problems in
the error handling of sa(4) have been uncovered.  Basically, a number
of conditions that are not actually errors have been mistreated as
genuine errors.  In particular:

. Trying to read in variable length mode with a mismatched blocksize
  between the on-tape (virtual) blocks and the read(2) supplied buffer
  size, causing an ILI SCSI condition, have caused an attempt to retry
  the supposedly `errored' transfer, causing the tape to be read
  continuously until it eventually hit EOM.  Since by default any
  simple mt(1) operation does an initial test read, an `mt stat' was
  sufficient to trigger this bug.

  Note that it's Justin's opinion that treating a NO SENSE as an EIO
  is another bug in CAM.  I feel not authorized to fix cam_periph.c
  without another confirmation that i'm on the right track, however.

. Hitting a filemark caused the read(2) syscall to return EIO, instead
  of returning a `short read'.  Note that the current fix only solves
  this problem in variable length mode.  Fixed length mode uses a
  different code path, and since i didn't grok all the intentions behind
  that handling, i did not touch it (IOW: it's still broken, and you get
  an EIO upon hitting a filemark).

The solution is to keep track of those conditions inside saerror(),
and upon completion to not call cam_periph_error() in that case.  We
need to make sure that the device gets unfrozen if needed though (in
case of actual errors, cam_periph_error() does this on our behalf).

Not objected by:       mjacob (who currently doesn't have the time to
			      review the patch)
2001-04-22 20:13:28 +00:00
David E. O'Brien
1690d30589 Removed old version of vaccess_acl_posix1e() that snuck back in rev 1.146.
Submitted by (with good eye):	Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
2001-04-22 17:01:39 +00:00
David E. O'Brien
ea88c01d6e Style(9) fixes:
* get rid of space (0x20) before tab (^I)
* indent with ^I, not 0x20
* continuation line for prototypes is for 0x20's past function's name col.
* etc.
2001-04-22 01:56:09 +00:00
Matt Jacob
eab341ffa4 add MARVELL to the list of phys to go into miibus 2001-04-21 23:42:19 +00:00
Robert Watson
5ea6583e2d o Remove comment indicating policy permits loop-back debugging, but
semantics don't: in practice, both policy and semantics permit
  loop-back debugging operations, only it's just a subset of debugging
  operations (i.e., a proc can open its own /dev/mem), and that's at a
  higher layer.
2001-04-21 22:41:45 +00:00
Andrew Gallatin
62dbd2f29e Block out all interrupts, even machine checks, for critical_enter()
This is will be required to prevent lowering the ipl when a critical_enter()
is present in the interrupt path when handling a machine check.

reviewed by: jhb
2001-04-21 21:44:39 +00:00
Chris D. Faulhaber
d33d158eb5 Fix the cut'n'paste style bugs I introduced in rev 1.16
(spaces -> tab(s) in #define's)
2001-04-21 19:52:06 +00:00
Andrey A. Chernov
475693945d Upper limit of mousechar start is UCHAR_MAX - 3, not UCHAR_MAX - 4
Restore original characters when mousechar start changes, not always 0-3

PR:		24437
Submitted by:	Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
2001-04-21 14:11:48 +00:00
Warner Losh
4d98b7a61b My fix to NEWCARD for getting the function type broke oldcard due to
a name conflict.

Pointed out by: markm

# I had to login to freefall to make this commit, so something maybe up
2001-04-21 14:10:32 +00:00
Warner Losh
04a3a05381 Set the device name for NEC PC98 PCMCIA Controller on boot.
# We really need to allocate i/o ports for it, but I need to learn
# the pc98 bus space better before attempting that.
2001-04-21 07:08:03 +00:00
Warner Losh
dc8e185f93 Add accessor/ivar for the "function". This is so we can generically
match disks and serial ports and maybe others.
2001-04-21 04:08:39 +00:00
Mike Smith
b8ce799cc4 Avoid divide-by-zero for devices that the adapter has not negotiated a
transfer speed with.
2001-04-21 04:08:26 +00:00
Greg Lehey
ccd58ea72d Add entry for swdog, Sitara Networks' watchdog timer.
Submitted by: John Hood <jhood@sitaranetworks.com>
2001-04-21 03:09:42 +00:00
Warner Losh
19f1fe42e6 Only try to delete the resource if we actually got it. 2001-04-21 02:29:09 +00:00
John Baldwin
9d4f526475 Spelling nit: acquring -> acquiring.
Reported by:	T. William Wells <bill@twwells.com>
2001-04-21 01:50:32 +00:00
Alfred Perlstein
98689e1e70 Assert that when using an interlock mutex it is not recursed when lockmgr()
is called.

Ok'd by: jhb
2001-04-20 22:38:40 +00:00
Alfred Perlstein
38bb635d3d add a comment to note that a process's vmspace may change, but so far
only aiod does this and is also marked P_SYSTEM, the locations that
reference p->p_vmspace usually do it within the context of the caller,
the async access from the vm system is protected by the fact that it
will skip over P_SYSTEM processes.

Ok'd by: jhb
2001-04-20 22:34:48 +00:00
Jesper Skriver
d1745f454d Say goodbye to TCP_COMPAT_42
Reviewed by:	wollman
Requested by:	wollman
2001-04-20 11:58:56 +00:00
Hajimu UMEMOTO
d23d305519 Fix typo in previous commit.
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2001-04-20 08:43:20 +00:00
John Baldwin
242d02a13f Make the ap_boot_mtx mutex static. 2001-04-20 01:09:05 +00:00
John Baldwin
882796f8c2 Split up the db_printf's for 'show pcpu' so that we only output at most one
line for each db_printf().  Also, just use spaces to line the columns up
rather than trying to be fancy with tabs.
2001-04-20 01:08:27 +00:00
Andrew Gallatin
29b3d1c151 GC some debugging code that's been #if 0'ed since we got the file from
NetBSD
2001-04-20 00:55:21 +00:00
Hajimu UMEMOTO
8d64298407 - Fix to receive icmp6 echo reply within the host itself to ff02::1.
- Fix to receive icmp6 echo reply to link-local of itself.

Reported by:	Eriya Akasaka <eakasaka@rodfbs.org>
Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2001-04-19 23:51:20 +00:00
David E. O'Brien
c612c69dc7 style(9) edit.
Prompted by email from:	dfr
2001-04-19 23:15:06 +00:00
Chris D. Faulhaber
51be6918b5 o Document UFS_ACL option
o Add link to src/sys/ufs/ufs/README.extattr for UFS_EXTATTR* options

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-19 21:33:52 +00:00
John Baldwin
d8915a7f34 - Whoops, forgot to enable the clock lock in the spin order list on the
alpha.
- Change the Debugger() functions to pass in the real function name.
2001-04-19 15:49:54 +00:00
Orion Hodson
5090c9953c Add power on to start sequence for 4.x kernels.
PR:		kern/26255
Submitted by:	WATANABE Kiyoshi <aab10490@pop16.odn.ne.jp>
2001-04-19 13:23:50 +00:00
Doug Rabson
2322ee63c2 Don't unwrap the function descriptor used as the callout argument to
fork_exit(). The MI version of fork_exit() needs a real function
descriptor, not a simple function pointer.
2001-04-19 12:35:47 +00:00
Doug Rabson
eed829bca9 Don't take the Giant mutex for clock interrupts. 2001-04-19 12:34:23 +00:00
Alfred Perlstein
d8d5fa8805 vnode_pager_freepage() is really vm_page_free() in disguise,
nuke vnode_pager_freepage() and replace all calls to it with vm_page_free()
2001-04-19 06:18:23 +00:00
Warner Losh
3fb5ffd286 Indirect off cinfo rather than calling pcic_ functions directly. This
means that the pcic98 functionality might now work (I've tested it on
my pcic machine, but not the pcic98).  Since these functions are
rarely called, it is unlikely that this will have a measurable impact
on performance.
2001-04-19 05:45:51 +00:00
Warner Losh
7402675de4 First cut at bringing NEC PC98 original pccard bridge code back into
FreeBSD.  This code doesn't work just yet, but does compile.  We need
to start indirecting via the cinfo pointers, rather than directly
calling pcic_*.  There may be other issues as well, but you gotta
start somewhere.

Obtained from: PAO3
2001-04-19 00:04:08 +00:00
Bosko Milekic
d04d50d1f7 Fix inconsistency in setup of kernel_map: we need to make sure that
we also reserve _adequate_ space for the mb_map submap; i.e. we need
space for nmbclusters, nmbufs, _and_ nmbcnt. Furthermore, we need to
rounddown, and not roundup, so that we are consistent.

Pointed out by: bde
2001-04-18 23:54:13 +00:00
Alfred Perlstein
2f3cf91876 Check validity of signal callback requested via aio routines.
Also move the insertion of the request to after the request is validated,
there's still looks like there may be some problems if an invalid address
is passed to the aio routines, basically a possible leak or having a
not completely initialized structure on the queue may still be possible.

A new sig macro was made _SIG_VALID to check the validity of a signal,
it would be advisable to use it from now on (in kern/kern_sig.c) rather
than rolling your own.

PR: kern/17152
2001-04-18 22:18:39 +00:00
John Baldwin
08b0f4f908 Convert the protection of hte i8254 from critical_enter/exit like it is
on the x86.
2001-04-18 21:47:48 +00:00
Warner Losh
a5e25da40d Back out 1.103. It wasn't approved by the owner of the file and
introduced style bugs.

Submited by: bde
2001-04-18 20:57:43 +00:00
Alfred Perlstein
a9fa2c05fc Protect pager object creation with sx locks.
Protect pager object list manipulation with a mutex.

It doesn't look possible to combine them under a single sx lock because
creation may block and we can't have the object list manipulation block
on anything other than a mutex because of interrupt requests.
2001-04-18 20:24:16 +00:00
John Baldwin
e18935281b Back out the previous revision as it causes random sig 11's to userland
processes until a better fix is found.

Submitted by:	gallatin
2001-04-18 17:17:55 +00:00
Doug Rabson
ff37c2003c Don't panic when we try to modify the kernel pmap. 2001-04-18 15:08:37 +00:00
Doug Rabson
169915f56d Print an approximation of the function arguments in the stack trace. 2001-04-18 15:07:56 +00:00
Doug Rabson
072c3a5395 Implement a simple stack trace for DDB. This will have to be redone
if/when we change to a more modern toolchain.
2001-04-18 14:15:45 +00:00
Doug Rabson
dd85faa611 Record the right value for tf_ndirty for kernel interruptions so that
we can examine the interrupted register stack frame in DDB.
2001-04-18 14:10:43 +00:00
Ruslan Ermilov
701d4ac0c1 mdoc(7) police: fixed whatis(1) entry. 2001-04-18 12:56:15 +00:00
Seigo Tanimura
759cb26335 Reclaim directory vnodes held in namecache if few free vnodes are
available.

Only directory vnodes holding no child directory vnodes held in
v_cache_src are recycled, so that directory vnodes near the root of
the filesystem hierarchy remain in namecache and directory vnodes are
not reclaimed in cascade.

The period of vnode reclaiming attempt and the number of vnodes
attempted to reclaim can be tuned via sysctl(2).

Suggested by:	tegge
Approved by:	phk
2001-04-18 11:19:50 +00:00
Alfred Perlstein
4e2e455f2e NFS module now requires nfs_lock.c 2001-04-18 08:33:52 +00:00
Poul-Henning Kamp
793d6d5d57 bread() is a special case of breadn(), so don't replicate code. 2001-04-18 07:16:07 +00:00
Warner Losh
f4b5609430 Add some more O2Micro devices I gleened from the web site/linux pcmcia cs.
Add TI4451 as well.

These are untested since I don't have the hardware to test against.

Also, some O2Micro devices are #define w/o numbers as place holders so that
I can encourage people to submit them when they appear in the channels.
2001-04-18 05:45:15 +00:00
Alfred Perlstein
305dd591ee Fix the botched rev 1.59 where I made it such that without INVARIANTS
the map is never locked.

Submitted by: tegge
2001-04-18 05:30:24 +00:00
Warner Losh
029f7392a5 Add support for the OZ6832.
Submitted by: Martin Nilsson <martin@svenskabutiker.se>
2001-04-18 04:42:11 +00:00
Warner Losh
c18e19a64d Move setting of TI113X_PCI_CARD_CONTROL register sooner 2001-04-17 23:56:12 +00:00
Warner Losh
1f3da134c7 Minor comment that missed the last change 2001-04-17 23:50:24 +00:00
Warner Losh
82d3fe450d When booting, turn on the 3E0 compatibility address for ricoh cardbus
parts.  This is based on the newcard code that turns it off :-).  We
can now reboot after NEWCARD or Windows and have OLDCARD work.  Add
support for the RL5C466 while I'm at it.

Treat TI1031 the same as the CLPD6832.  It doesn't work yet, but sucks
less than it did before.

Also add a few #defines for other changes in the pipe.
2001-04-17 23:15:00 +00:00
Dima Dorfman
25c7870e5d Make this driver play ball with devfs(5).
Reviewed by:	brian
2001-04-17 20:53:11 +00:00
Alfred Perlstein
e04670b734 Add a sanity check on ucred refcount.
Submitted by: Terry Lambert <terry@lambert.org>
2001-04-17 20:50:43 +00:00
Alfred Perlstein
603c86672c Implement client side NFS locks.
Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
2001-04-17 20:45:23 +00:00
Poul-Henning Kamp
0dfba3cef1 Write a switch statement as less obscure if statements. 2001-04-17 20:22:07 +00:00
John Baldwin
5d52039847 Save are floating point state in cpu_switch() if needed instead of relying
completely on lazy floating point state saving.  This is needed for the
SMP case since processes can migrate to other CPUs.

Submitted by:	dfr
2001-04-17 18:27:55 +00:00
Kris Kennaway
f0a04f3f51 Randomize the TCP initial sequence numbers more thoroughly.
Obtained from:	OpenBSD
Reviewed by:	jesper, peter, -developers
2001-04-17 18:08:01 +00:00
John Baldwin
e3ee8974e3 Fix an old bug related to BETTER_CLOCK. Call forward_*clock if SMP
and __i386__ are defined rather than if SMP and BETTER_CLOCK are defined.
The removal of BETTER_CLOCK would have broken this except that kern_clock.c
doesn't include <machine/smptests.h>, so it doesn't see the definition of
BETTER_CLOCK, and forward_*clock aren't called, even on 4.x.  This seems to
fix the problem where a n-way SMP system would see 100 * n clk interrupts
and 128 * n rtc interrupts.
2001-04-17 17:53:36 +00:00
Nick Hibma
be971a7240 Regen. 2001-04-17 15:53:35 +00:00
Nick Hibma
177f46f166 Add the HP scanner 3400C 2001-04-17 15:53:20 +00:00
Nick Hibma
e47670c92d Regen. 2001-04-17 15:34:44 +00:00
Nick Hibma
dacb51ca16 Lexar jumpSHOT Id.
Submitted by:	gshapiro
2001-04-17 15:34:22 +00:00
Andrew Gallatin
73f446d078 set gd_other_cpus later, when we have a better idea what the other cpus
are.

submitted by: jhb
2001-04-17 14:59:05 +00:00
Andrew Gallatin
386eac30d9 Improved support for alpha SMP. The following commit gets dual AS2100s
and AS4100s into single user mode. This work was done jointly by jhb and
myself, and builds on dfr's earlier work.

smp_init_secondary() / smp_start_secondary()
- use the uniq val to pass the globalp (me)
- fancy footwork to take any pending machine checks (me)
- doing things the FreeBSD way and getting the per-cpu idleproc created
  correctly, and synchronizing the startup of secondaries (jhb)

mp_start()
- better recognition of available cpus (jhb)

smp_rendezvous()
- if smp hasn't started, only run the rendezvous function on the current
cpu.  Sleuthing and (prior) incorrect fix by me, correct fix by jhb

smp_handle_ipi()
- more verbose handling of console messages (jhb)
- grab sched lock around setting PS_ASTPENDING (jhb)

forward_*clock()
- commented out.  Joint decision by dfr, jhb and myself

 General synchronization improvements (more mb()s, etc) (jhb)

 Printf cleanups (joint)

 Whitespace cleanups (jhb)
2001-04-17 14:55:09 +00:00
Andrew Gallatin
3706fa1be6 Changes to support SMP:
- don't do the stack overflow sanity check on MP systems -- p->p_addr
will be malloc'ed memory (not K0SEG) and the check will fail.

- don't ignore clock interrupts on secondaries.  Alphas apparently
roundrobin clock interrupts to all cpus, so we're going to take clock
interrupts on all CPUS and not forward them.
2001-04-17 14:20:33 +00:00
Andrew Gallatin
ed4835b64d changes to smp_init_secondary_glue():
- use the unique value to save the per-cpu globalp struct like the
  comment says

- don't lower the ipl to ALPHA_PSL_IPL_HIGH: we may have a pending machine
  check to take and we're not prepared for that yet, as we haven't setup
  our interrupt entry points. (this may only happen on sable/lynx)

- indicate the fact that the working version of smp_init_secondary() doesn't
  return (this is tied up in other changes and hasn't yet been committed).
2001-04-17 14:15:12 +00:00
Brian Somers
395692dae2 Dont (ab)use drv2 to know if (si_flags & SI_NAMED) (pointed out by dd)
Call cdevsw_remove when we unload.
2001-04-17 09:59:34 +00:00
Poul-Henning Kamp
f84e29a06c This patch removes the VOP_BWRITE() vector.
VOP_BWRITE() was a hack which made it possible for NFS client
side to use struct buf with non-bio backing.

This patch takes a more general approach and adds a bp->b_op
vector where more methods can be added.

The success of this patch depends on bp->b_op being initialized
all relevant places for some value of "relevant" which is not
easy to determine.  For now the buffers have grown a b_magic
element which will make such issues a tiny bit easier to debug.
2001-04-17 08:56:39 +00:00
Kirk McKusick
5819ab3f12 Add debugging option to always read/write cylinder groups as full
sized blocks. To enable this option, use: `sysctl -w debug.bigcgs=1'.
Add debugging option to disable background writes of cylinder
groups. To enable this option, use: `sysctl -w debug.dobkgrdwrite=0'.
These debugging options should be tried on systems that are panicing
with corrupted cylinder group maps to see if it makes the problem
go away. The set of panics in question are:

	ffs_clusteralloc: map mismatch
	ffs_nodealloccg: map corrupted
	ffs_nodealloccg: block not in map
	ffs_alloccg: map corrupted
	ffs_alloccg: block not in map
	ffs_alloccgblk: cyl groups corrupted
	ffs_alloccgblk: can't find blk in cyl
	ffs_checkblk: partially free fragment

The following panics are less likely to be related to this problem,
but might be helped by these debugging options:

	ffs_valloc: dup alloc
	ffs_blkfree: freeing free block
	ffs_blkfree: freeing free frag
	ffs_vfree: freeing free inode

If you try these options, please report whether they helped reduce your
bitmap corruption panics to Kirk McKusick at <mckusick@mckusick.com>
and to Matt Dillon <dillon@earth.backplane.com>.
2001-04-17 05:37:51 +00:00
Kirk McKusick
f0f3f19f05 Background fsck sysctl operations must use vn_start_write and
vn_finished_write so that they do not attempt to modify a
suspended filesystem.
2001-04-17 05:06:37 +00:00
Robert Watson
b114e127e6 In my first reading of POSIX.1e, I misinterpreted handling of the
ACL_USER_OBJ and ACL_GROUP_OBJ fields, believing that modification of the
access ACL could be used by privileged processes to change file/directory
ownership.  In fact, this is incorrect; ACL_*_OBJ (+ ACL_MASK and
ACL_OTHER) should have undefined ae_id fields; this commit attempts
to correct that misunderstanding.

o Modify arguments to vaccess_acl_posix1e() to accept the uid and gid
  associated with the vnode, as those can no longer be extracted from
  the ACL passed as an argument.  Perform all comparisons against
  the passed arguments.  This actually has the effect of simplifying
  a number of components of this call, as well as reducing the indent
  level, but now seperates handling of ACL_GROUP_OBJ from ACL_GROUP.

o Modify acl_posix1e_check() to return EINVAL if the ae_id field of
  any of the ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} entries is a value
  other than ACL_UNDEFINED_ID.  As a temporary work-around to allow
  clean upgrades, set the ae_id field to ACL_UNDEFINED_ID before
  each check so that this cannot cause a failure in the short term
  (this work-around will be removed when the userland libraries and
  utilities are updated to take this change into account).

o Modify ufs_sync_acl_from_inode() so that it forces
  ACL_{USER_OBJ,GROUP_OBJ,MASK,OTHER} ae_id fields to ACL_UNDEFINED_ID
  when synchronizing the ACL from the inode.

o Modify ufs_sync_inode_from_acl to not propagate uid and gid
  information to the inode from the ACL during ACL update.  Also
  modify the masking of permission bits that may be set from
  ALLPERMS to (S_IRWXU|S_IRWXG|S_IRWXO), as ACLs currently do not
  carry none-ACCESSPERMS (S_ISUID, S_ISGID, S_ISTXT).

o Modify ufs_getacl() so that when it emulates an access ACL from
  the inode, it initializes the ae_id fields to ACL_UNDEFINED_ID.

o Clean up ufs_setacl() substantially since it is no longer possible
  to perform chown/chgrp operations using vop_setacl(), so all the
  access control for that can be eliminated.

o Modify ufs_access() so that it passes owner uid and gid information
  into vaccess_acl_posix1e().

Pointed out by:	jedger
Obtained from:	TrustedBSD Project
2001-04-17 04:33:34 +00:00
John Baldwin
abd9053ee4 Blow away the panic mutex in favor of using a single atomic_cmpset() on a
panic_cpu shared variable.  I used a simple atomic operation here instead
of a spin lock as it seemed to be excessive overhead.  Also, this can avoid
recursive panics if, for example, witness is broken.
2001-04-17 04:18:08 +00:00
John Baldwin
3c41f323c9 Check to see if enroll() returns NULL in the witness initialization. This
can happen if witness runs out of resources during initialization or if
witness_skipspin is enabled.

Sleuthing by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-04-17 03:35:38 +00:00
John Baldwin
7141f2ad46 Exit and re-enter the critical section while spinning for a spinlock so
that interrupts can come in while we are waiting for a lock.
2001-04-17 03:34:52 +00:00
John Baldwin
8c321ed95f - Add appropriate #ifndef/#define/#endif to protect against multiple
inclusions.
- Blow away all evidence of a static curpcb as curpcb is a per-CPU variable
  and this definition is now bogus.
2001-04-17 02:51:28 +00:00
John Baldwin
2bec909c3d - Fix memory barriers in atomic operations so that the barriers are always
"inside" of locked regions.  That is, an acquire atomic operation will
  always enforce a memory barrier after the atomic operation and a release
  operation will always enforce a memory barrier before the atomic
  operation.
- Explicitly use 'mb' instead of 'wmb' in release atomic operations.  The
  'wmb' memory barrier is not strong enough to guarantee coherence with
  other processors.  This is effectively a nop since alpha_wmb() actually
  performs a 'mb' and not a 'wmb', but I wanted the code to be more
  correct since at some point in the future alpha_wmb()'s implementation
  may switch to being a real 'wmb'.
2001-04-17 02:50:05 +00:00
John Baldwin
85eba1489b Add a cpu_throw() function that secondary CPU's can use for their first
context switch.
2001-04-17 02:46:13 +00:00
John Baldwin
0f98ef505a In exception_return(), test for usermode before testing the IPL to see if
we should call ast().  This allows us to branch to a separate Lkernelret
label so we can fixup the saved t7 register in the trapframe.  Otherwise
we can run into a problem on SMP systems where a process is interrupted by
a trap or interrupt on one CPU, migrates to another CPU, and then returns
with the t7 in the stack clobbering the CPU's t7.  As a result, two CPU's
would both point to the same per-CPU data and things would go downhill from
there.

Sleuthing help by:	gallatin
2001-04-17 02:44:35 +00:00
John Baldwin
1a72a97045 - Stop other CPU's in the SMP case when we enter ddb.
- Add a new ddb command: 'show pcpu' similar to the i386 command added
  recently.  By default it displays the current CPU's info, but an optional
  argument can specify the logical ID of a specific CPU to examine.
2001-04-17 02:41:41 +00:00
Søren Schmidt
b952dabaa1 Add support the the Intel ICH2 mobile
Tidy chip name printing a bit.
2001-04-16 21:22:34 +00:00
Mark Murray
573bc39917 Add missing sound module.
OK'ed by:	cg
2001-04-16 17:04:41 +00:00
Kenneth D. Merry
623db3603c Fix an off-by-2 error in periphdriver_register(). The read side of the
bcopy would go off the end of the array by two elements, which sometimes
causes a panic if it happens to cross into a page that isn't mapped.

Submitted by:	gibbs
Reviewed by:	peter
2001-04-16 15:53:54 +00:00
John Hay
0d1b4aef96 Move the isa parts to a separate file. 2001-04-16 13:20:39 +00:00
John Hay
24dbea46a9 Update to the 2001-04-02 version of the nanokernel code from Dave Mills. 2001-04-16 13:05:05 +00:00
KATO Takenori
1a476993b0 Merged from sys/i386/isa/npx.c revision 1.95. 2001-04-16 09:15:40 +00:00
KATO Takenori
0af2322303 Merged from sys/conf/options.i386 revision 1.148. 2001-04-16 09:13:51 +00:00
David E. O'Brien
c5e70d92ce Turn on kernel debugging support (DDB, INVARIANTS, INVARIANT_SUPPORT, WITNESS)
by default while SMPng is still being developed.

Submitted by:	jhb
2001-04-15 19:37:28 +00:00
Alfred Perlstein
cc64b484dd use TAILQ_FOREACH, fix a comment's location 2001-04-15 10:22:04 +00:00
Brian Somers
56700d4634 Call strlen() once instead of twice. 2001-04-14 21:33:58 +00:00
Mark Murray
b4edbce08c Back out wrapping the asm ... ; bits in #ifndef lint macros. There
are some good reasons for not doing this, even if the linting of
the code breaks.

1) If lint were ever to understand the stuff inside the macros,
   that would break the checks.

2) There are ways to use __GNUC__ to exclude overly specific
   code.

3) (Not yet practical) Lint(1) needs to properlyu understand
   all of te code we actually run.

Complained about by:	bde
Education by:		jake, jhb, eivind
2001-04-14 20:42:04 +00:00
Søren Schmidt
cffeef75e7 The VIA 586 chip does UDMA from rev 0x3 onwards.
MFC candidate!
2001-04-14 18:33:08 +00:00
Kirk McKusick
74046077a7 Update to describe use of mdconfig instead of deprecated vnconfig.
Submitted by:	Steve Ames <steve@virtual-voodoo.com>
2001-04-14 18:32:09 +00:00
Brian Somers
fa9a4c8a8d dgm now builds as a module 2001-04-14 15:36:45 +00:00
Brian Somers
b432115ffd New-busify and ansify.
I've cleaned up a bit of the formatting here, but it's still a long way
from style(9).
2001-04-14 15:32:16 +00:00
Kirk McKusick
1a6a661032 This checkin adds support in ufs/ffs for the FS_NEEDSFSCK flag.
It is described in ufs/ffs/fs.h as follows:

/*
 * Filesystem flags.
 *
 * Note that the FS_NEEDSFSCK flag is set and cleared only by the
 * fsck utility. It is set when background fsck finds an unexpected
 * inconsistency which requires a traditional foreground fsck to be
 * run. Such inconsistencies should only be found after an uncorrectable
 * disk error. A foreground fsck will clear the FS_NEEDSFSCK flag when
 * it has successfully cleaned up the filesystem. The kernel uses this
 * flag to enforce that inconsistent filesystems be mounted read-only.
 */
#define FS_UNCLEAN    0x01	/* filesystem not clean at mount */
#define FS_DOSOFTDEP  0x02	/* filesystem using soft dependencies */
#define FS_NEEDSFSCK  0x04	/* filesystem needs sync fsck before mount */
2001-04-14 05:26:28 +00:00
Chris D. Faulhaber
9a227c5754 Add acl_get_perm_np(3), a non-portable function to check if a
permission is in a permission set, required for third-party
applications such as Samba.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:37:04 +00:00
Chris D. Faulhaber
94ef417e4b Add the remaining POSIX.1e ACL definitions:
ACL_UNDEFINED_TAG, ACL_UNDEFINED_ID, ACL_FIRST_ENTRY, ACL_NEXT_ENTRY

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:14:38 +00:00
John Baldwin
adccbaa77d People are still having problems with i586_* on UP machines and SMP
machines, so just hack it to disable them for now until it can be fixed.

Inspired by hair pulling of:	asmodai
2001-04-13 17:14:53 +00:00
Robert Watson
e9e7ff5b22 o Since uid checks in p_cansignal() are now identical between P_SUGID
and non-P_SUGID cases, simplify p_cansignal() logic so that the
  P_SUGID masking of possible signals is independent from uid checks,
  removing redundant code and generally improving readability.

Reviewed by:	tmm
Obtained from:	TrustedBSD Project
2001-04-13 14:33:45 +00:00
Boris Popov
e59572b595 Add smbfs module. Currently it includes smbfs, netsmb and DES parts.
Kernel should be compiled with options LIBMCHAIN and LIBICONV.
2001-04-13 12:11:19 +00:00
Boris Popov
0fdabd3a45 Move VT_SMBFS definition to the proper place. Undefine VI_LOCK/VI_UNLOCK. 2001-04-13 11:26:54 +00:00
Alfred Perlstein
971dd34298 if/panic -> KASSERT 2001-04-13 11:15:40 +00:00
Boris Popov
de847dd07c All NETSMB* options should use opt_netsmb.h file (the joy of multiple repos). 2001-04-13 10:53:56 +00:00
Boris Popov
34ae6c7541 This file also depends on sys/types.h and sys/ioccom.h.
Remove some old junk.

Submitted by:	bde
2001-04-13 10:50:48 +00:00
Alfred Perlstein
2a758ebe58 protect pbufs and associated counts with a mutex 2001-04-13 10:23:32 +00:00
Alfred Perlstein
493607117e use %p for pointer printf, include sys/systm.h for printf proto 2001-04-13 10:22:14 +00:00
Alfred Perlstein
1375ed7eb7 convert if/panic -> KASSERT, explain what triggered the assertion 2001-04-13 10:15:53 +00:00
Mark Murray
c13d191de3 Make this more lint-friendly. This file seems to be invoked in just
about any .c file that includes a .h, and lint produces copious
whining because of the asm ...; stuff.
2001-04-13 09:46:54 +00:00
Murray Stokely
a4e6da691f Generate useful error messages. 2001-04-13 09:37:25 +00:00
Mark Murray
f0b60d7560 Handle a rare but fatal race invoked sometimes when SIGSTOP is
invoked.
2001-04-13 09:29:34 +00:00
John Baldwin
7a9aa5d372 - Add a comment at the start of the spin locks list.
- The alpha SMP code uses an "ap boot" spinlock as well.
2001-04-13 08:31:38 +00:00
Alfred Perlstein
7d26b6a450 Use a macro wrapper over printf along with KASSERT to reduce the amount
of code here.
2001-04-13 08:07:37 +00:00
Alfred Perlstein
7bbd138e2f Make SOMAXCONN a kernel option.
Submitted by: Terry Lambert <terry@lambert.org>
2001-04-13 03:50:37 +00:00
Robert Watson
44c3e09cdc o Disallow two "allow this" exceptions in p_cansignal() restricting
the ability of unprivileged processes to deliver arbitrary signals
  to daemons temporarily taking on unprivileged effective credentials
  when P_SUGID is not set on the target process:
  Removed:
     (p1->p_cred->cr_ruid != ps->p_cred->cr_uid)
     (p1->p_ucred->cr_uid != ps->p_cred->cr_uid)
o Replace two "allow this" exceptions in p_cansignal() restricting
  the ability of unprivileged processes to deliver arbitrary signals
  to daemons temporarily taking on unprivileged effective credentials
  when P_SUGID is set on the target process:
  Replaced:
     (p1->p_cred->p_ruid != p2->p_ucred->cr_uid)
     (p1->p_cred->cr_uid != p2->p_ucred->cr_uid)
  With:
     (p1->p_cred->p_ruid != p2->p_ucred->p_svuid)
     (p1->p_ucred->cr_uid != p2->p_ucred->p_svuid)
o These changes have the effect of making the uid-based handling of
  both P_SUGID and non-P_SUGID signal delivery consistent, following
  these four general cases:
     p1's ruid equals p2's ruid
     p1's euid equals p2's ruid
     p1's ruid equals p2's svuid
     p1's euid equals p2's svuid
  The P_SUGID and non-P_SUGID cases can now be largely collapsed,
  and I'll commit this in a few days if no immediate problems are
  encountered with this set of changes.
o These changes remove a number of warning cases identified by the
  proc_to_proc inter-process authorization regression test.
o As these are new restrictions, we'll have to watch out carefully for
  possible side effects on running code: they seem reasonable to me,
  but it's possible this change might have to be backed out if problems
  are experienced.

Submitted by:		src/tools/regression/security/proc_to_proc/testuid
Reviewed by:		tmm
Obtained from:	TrustedBSD Project
2001-04-13 03:06:22 +00:00
Robert Watson
0489082737 o Disable two "allow this" exceptions in p_cansched()m retricting the
ability of unprivileged processes to modify the scheduling properties
  of daemons temporarily taking on unprivileged effective credentials.
  These cases (p1->p_cred->p_ruid == p2->p_ucred->cr_uid) and
  (p1->p_ucred->cr_uid == p2->p_ucred->cr_uid), respectively permitting
  a subject process to influence the scheduling of a daemon if the subject
  process has the same real uid or effective uid as the daemon's effective
  uid.  This removes a number of the warning cases identified by the
  proc_to_proc iner-process authorization regression test.
o As these are new restrictions, we'll have to watch out carefully for
  possible side effects on running code: they seem reasonable to me,
  but it's possible this change might have to be backed out if problems
  are experienced.

Reported by:	src/tools/regression/security/proc_to_proc/testuid
Obtained from:	TrustedBSD Project
2001-04-12 22:46:07 +00:00
Alfred Perlstein
b28cb1ca07 remove truncated part from commment 2001-04-12 21:50:03 +00:00
Robert Watson
e386f9bda3 o Make kqueue's filt_procattach() function use the error value returned
by p_can(...P_CAN_SEE), rather than returning EACCES directly.  This
  brings the error code used here into line with similar arrangements
  elsewhere, and prevents the leakage of pid usage information.

Reviewed by:	jlemon
Obtained from:	TrustedBSD Project
2001-04-12 21:32:02 +00:00
Robert Watson
d34f8d3030 o Limit process information leakage by introducing a p_can(...P_CAN_SEE...)
in rtprio()'s RTP_LOOKIP implementation.

Obtained from:	TrustedBSD Project
2001-04-12 20:46:26 +00:00
Robert Watson
eb9e5c1d72 o Reduce information leakage into jails by adding invocations of
p_can(...P_CAN_SEE...) to getpgid(), getsid(), and setpgid(),
  blocking these operations on processes that should not be visible
  by the requesting process.  Required to reduce information leakage
  in MAC environments.

Obtained from:	TrustedBSD Project
2001-04-12 19:39:00 +00:00
KATO Takenori
4dfe1d3b64 Merged from options.i386 revision 1.147. 2001-04-12 12:28:42 +00:00
KATO Takenori
a3758914a0 Merged from files.i386 revisions 1.359 and 1.360. 2001-04-12 12:26:40 +00:00
Nick Hibma
1470e6aaeb Regen. 2001-04-12 11:08:59 +00:00
Nick Hibma
47a9ad6b89 TDK ids
Submitted by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
2001-04-12 11:04:08 +00:00
Nick Hibma
426128e90b From NetBSD 2001-04-12 10:59:30 +00:00
Robert Watson
4c5eb9c397 o Replace p_cankill() with p_cansignal(), remove wrappage of p_can()
from signal authorization checking.
o p_cansignal() takes three arguments: subject process, object process,
  and signal number, unlike p_cankill(), which only took into account
  the processes and not the signal number, improving the abstraction
  such that CANSIGNAL() from kern_sig.c can now also be eliminated;
  previously CANSIGNAL() special-cased the handling of SIGCONT based
  on process session.  privused is now deprecated.
o The new p_cansignal() further limits the set of signals that may
  be delivered to processes with P_SUGID set, and restructures the
  access control check to allow it to be extended more easily.
o These changes take into account work done by the OpenBSD Project,
  as well as by Robert Watson and Thomas Moestl on the TrustedBSD
  Project.

Obtained from:  TrustedBSD Project
2001-04-12 02:38:08 +00:00
Warner Losh
a9304a4eb5 Fix minor typo in comment. 112x -> 12xx 2001-04-11 22:49:00 +00:00
Archie Cobbs
422c727634 Don't reference a node after we dropped a reference to it
(same as in previous checkin, but in a different function).
2001-04-11 22:04:47 +00:00
Boris Popov
cdcb16abd2 Pull constants from netsmb/smb.h. 2001-04-11 21:35:51 +00:00
Warner Losh
a17e1baffd Add IBM3765 to newcard's pcic pnp device list 2001-04-11 20:22:16 +00:00
Robert Watson
40829dd2dc o Regenerated following introduction of __setugid() system call for
"options REGRESSION".

Obtained from:	TrustedBSD Project
2001-04-11 20:21:37 +00:00
Robert Watson
130d0157d1 o Introduce a new system call, __setsugid(), which allows a process to
toggle the P_SUGID bit explicitly, rather than relying on it being
  set implicitly by other protection and credential logic.  This feature
  is introduced to support inter-process authorization regression testing
  by simplifying userland credential management allowing the easy
  isolation and reproduction of authorization events with specific
  security contexts.  This feature is enabled only by "options REGRESSION"
  and is not intended to be used by applications.  While the feature is
  not known to introduce security vulnerabilities, it does allow
  processes to enter previously inaccessible parts of the credential
  state machine, and is therefore disabled by default.  It may not
  constitute a risk, and therefore in the future pending further analysis
  (and appropriate need) may become a published interface.

Obtained from:	TrustedBSD Project
2001-04-11 20:20:40 +00:00
Warner Losh
e5eac10b13 Add #define for IBM3765.
Fix SWAMPBOX.  It had actiontec's ID.
Reorder pnpids so they are in alphabetical order.
2001-04-11 20:18:29 +00:00
Robert Watson
0b5438c6d1 o Introduce "options REGRESSION", a kernel option which enables
interfaces and functionality intended for use during correctness and
  regression testing.  Features enabled by "options REGRESSION" may
  in and of themselves introduce security or correctness problems if
  used improperly, and so are not intended for use in production
  systems, only in testing environments.

Obtained from:	TrustedBSD Project
2001-04-11 19:29:24 +00:00
John Baldwin
7b531e6037 Stick proc0 in the PID hash table. 2001-04-11 18:50:50 +00:00
John Baldwin
2fea957dc5 Rename the IPI API from smp_ipi_* to ipi_* since the smp_ prefix is just
"redundant noise" and to match the IPI constant namespace (IPI_*).

Requested by:	bde
2001-04-11 17:06:02 +00:00
John Baldwin
45fdf62519 Parse the various argument registers in the printtrap() function so that
one doesn't have to go grab a reference manual to decode them by hand every
time the alpha kernel falls over.

Reviewed by:	drew, -alpha
2001-04-11 16:20:11 +00:00
Boris Popov
bc9243be52 Add forgotten files for NETSMBCRYPTO option (may be DES based encryption
should be enabled by default, not sure).
2001-04-11 09:20:33 +00:00
Warner Losh
80914f7e42 Add O2Micro's OZ6872 Cardbus bridge.
Submitted by: Robert Sexton <robert@kudra.com>
2001-04-11 06:40:35 +00:00
Chris D. Faulhaber
fb1af1f2bf Correct the following defines to match the POSIX.1e spec:
ACL_PERM_EXEC  -> ACL_EXECUTE
  ACL_PERM_READ  -> ACL_READ
  ACL_PERM_WRITE -> ACL_WRITE

Obtained from:	TrustedBSD
2001-04-11 02:19:01 +00:00
Peter Wemm
9d10eb0c0c Create debug.hashstat.[raw]nchash and debug.hashstat.[raw]nfsnode to
enable easy access to the hash chain stats.  The raw prefixed versions
dump an integer array to userland with the chain lengths.  This cheats
and calls it an array of 'struct int' rather than 'int' or sysctl -a
faithfully dumps out the 128K array on an average machine.  The non-raw
versions return 4 integers: count, number of chains used, maximum chain
length, and percentage utilization (fixed point, multiplied by 100).
The raw forms are more useful for analyzing the hash distribution, while
the other form can be read easily by humans and stats loggers.
2001-04-11 00:39:20 +00:00
John Baldwin
5f76d89870 Remove constants defining the bitmasks of the old giant kernel lock. 2001-04-10 22:22:01 +00:00
John Baldwin
8f3b4b873c Remove the old APIC I/O higher level IPI API in favor of the newer MI
API for IPI's that isn't tied to the Intel APIC.  MD code can still use
the apic_ipi() function or dink with the apic directly if needed to send
MD IPI's.
2001-04-10 22:18:21 +00:00
John Baldwin
ca7ef17c08 Remove the BETTER_CLOCK #ifdef's. The code is on by default and is here
to stay for the foreseeable future.

OK'd by:	peter (the idea)
2001-04-10 21:34:13 +00:00
John Baldwin
6a0fa9a023 Add an MI API for sending IPI's. I used the same API present on the alpha
because:
 - it used a better namespace (smp_ipi_* rather than *_ipi),
 - it used better constant names for the IPI's (IPI_* rather than
   X*_OFFSET), and
 - this API also somewhat exists for both alpha and ia64 already.
2001-04-10 21:04:32 +00:00
George C A Reid
e572fcd463 Add another card to the list of Neomagic 256AV's which don't have AC97
codecs. Also, add some additional code to check for future cards without
this feature - attempting to initialise them as AC97 cards will hang the
machine.

PR:		26427
Reviewed by:	cg
2001-04-10 14:28:21 +00:00
Cameron Grant
f72b6281c2 lock the mutex, not the softc pointer. 2001-04-10 13:52:26 +00:00
Kirk McKusick
a61ab64ac4 Directory layout preference improvements from Grigoriy Orlov <gluk@ptci.ru>.
His description of the problem and solution follow. My own tests show
speedups on typical filesystem intensive workloads of 5% to 12% which
is very impressive considering the small amount of code change involved.

------

  One day I noticed that some file operations run much faster on
small file systems then on big ones. I've looked at the ffs
algorithms, thought about them, and redesigned the dirpref algorithm.

  First I want to describe the results of my tests. These results are old
and I have improved the algorithm after these tests were done. Nevertheless
they show how big the perfomance speedup may be. I have done two file/directory
intensive tests on a two OpenBSD systems with old and new dirpref algorithm.
The first test is "tar -xzf ports.tar.gz", the second is "rm -rf ports".
The ports.tar.gz file is the ports collection from the OpenBSD 2.8 release.
It contains 6596 directories and 13868 files. The test systems are:

1. Celeron-450, 128Mb, two IDE drives, the system at wd0, file system for
   test is at wd1. Size of test file system is 8 Gb, number of cg=991,
   size of cg is 8m, block size = 8k, fragment size = 1k OpenBSD-current
   from Dec 2000 with BUFCACHEPERCENT=35

2. PIII-600, 128Mb, two IBM DTLA-307045 IDE drives at i815e, the system
   at wd0, file system for test is at wd1. Size of test file system is 40 Gb,
   number of cg=5324, size of cg is 8m, block size = 8k, fragment size = 1k
   OpenBSD-current from Dec 2000 with BUFCACHEPERCENT=50

You can get more info about the test systems and methods at:
http://www.ptci.ru/gluk/dirpref/old/dirpref.html

                              Test Results

             tar -xzf ports.tar.gz               rm -rf ports
  mode  old dirpref new dirpref speedup old dirprefnew dirpref speedup
                             First system
 normal     667         472      1.41       477        331       1.44
 async      285         144      1.98       130         14       9.29
 sync       768         616      1.25       477        334       1.43
 softdep    413         252      1.64       241         38       6.34
                             Second system
 normal     329         81       4.06       263.5       93.5     2.81
 async      302         25.7    11.75       112          2.26   49.56
 sync       281         57.0     4.93       263         90.5     2.9
 softdep    341         40.6     8.4        284          4.76   59.66

"old dirpref" and "new dirpref" columns give a test time in seconds.
speedup - speed increasement in times, ie. old dirpref / new dirpref.

------

Algorithm description

The old dirpref algorithm is described in comments:

/*
 * Find a cylinder to place a directory.
 *
 * The policy implemented by this algorithm is to select from
 * among those cylinder groups with above the average number of
 * free inodes, the one with the smallest number of directories.
 */

A new directory is allocated in a different cylinder groups than its
parent directory resulting in a directory tree that is spreaded across
all the cylinder groups. This spreading out results in a non-optimal
access to the directories and files. When we have a small filesystem
it is not a problem but when the filesystem is big then perfomance
degradation becomes very apparent.

What I mean by a big file system ?

  1. A big filesystem is a filesystem which occupy 20-30 or more percent
     of total drive space, i.e. first and last cylinder are physically
     located relatively far from each other.
  2. It has a relatively large number of cylinder groups, for example
     more cylinder groups than 50% of the buffers in the buffer cache.

The first results in long access times, while the second results in
many buffers being used by metadata operations. Such operations use
cylinder group blocks and on-disk inode blocks. The cylinder group
block (fs->fs_cblkno) contains struct cg, inode and block bit maps.
It is 2k in size for the default filesystem parameters. If new and
parent directories are located in different cylinder groups then the
system performs more input/output operations and uses more buffers.
On filesystems with many cylinder groups, lots of cache buffers are
used for metadata operations.

My solution for this problem is very simple. I allocate many directories
in one cylinder group. I also do some things, so that the new allocation
method does not cause excessive fragmentation and all directory inodes
will not be located at a location far from its file's inodes and data.
The algorithm is:
/*
 * Find a cylinder group to place a directory.
 *
 * The policy implemented by this algorithm is to allocate a
 * directory inode in the same cylinder group as its parent
 * directory, but also to reserve space for its files inodes
 * and data. Restrict the number of directories which may be
 * allocated one after another in the same cylinder group
 * without intervening allocation of files.
 *
 * If we allocate a first level directory then force allocation
 * in another cylinder group.
 */

  My early versions of dirpref give me a good results for a wide range of
file operations and different filesystem capacities except one case:
those applications that create their entire directory structure first
and only later fill this structure with files.

  My solution for such and similar cases is to limit a number of
directories which may be created one after another in the same cylinder
group without intervening file creations. For this purpose, I allocate
an array of counters at mount time. This array is linked to the superblock
fs->fs_contigdirs[cg]. Each time a directory is created the counter
increases and each time a file is created the counter decreases. A 60Gb
filesystem with 8mb/cg requires 10kb of memory for the counters array.

  The maxcontigdirs is a maximum number of directories which may be created
without an intervening file creation. I found in my tests that the best
performance occurs when I restrict the number of directories in one cylinder
group such that all its files may be located in the same cylinder group.
There may be some deterioration in performance if all the file inodes
are in the same cylinder group as its containing directory, but their
data partially resides in a different cylinder group. The maxcontigdirs
value is calculated to try to prevent this condition. Since there is
no way to know how many files and directories will be allocated later
I added two optimization parameters in superblock/tunefs. They are:

        int32_t  fs_avgfilesize;   /* expected average file size */
        int32_t  fs_avgfpdir;      /* expected # of files per directory */

These parameters have reasonable defaults but may be tweeked for special
uses of a filesystem. They are only necessary in rare cases like better
tuning a filesystem being used to store a squid cache.

I have been using this algorithm for about 3 months. I have done
a lot of testing on filesystems with different capacities, average
filesize, average number of files per directory, and so on. I think
this algorithm has no negative impact on filesystem perfomance. It
works better than the default one in all cases. The new dirpref
will greatly improve untarring/removing/coping of big directories,
decrease load on cvs servers and much more. The new dirpref doesn't
speedup a compilation process, but also doesn't slow it down.

Obtained from:	Grigoriy Orlov <gluk@ptci.ru>
2001-04-10 08:38:59 +00:00
Boris Popov
681a5bbef2 Import kernel part of SMB/CIFS requester.
Add smbfs(CIFS) filesystem.

Userland part will be in the ports tree for a while.

Obtained from:	smbfs-1.3.7-dev package.
2001-04-10 07:59:06 +00:00
Alfred Perlstein
43d97995d8 Add more diagnostic output for failure.
s/1518/ETHER_MAX_LEN

Some style changes, add some braces, mostly residual from having
a lot of debug hooks added while working on this driver.

Bring in a plethora of changes from NetBSD:

	revision 1.58
	date: 2001/03/08 11:07:08;  author: ichiro;  state: Exp;  lines: +17 -1
	it wait until busy flag disappears.
	it was able to prevent some cards with late initializing faling in wi_reset().

	revision 1.41
	date: 2000/10/13 19:15:08;  author: jonathan;  state: Exp;  lines: +4 -2
	Fix wi_intr() to avoid touching card registers during insert/remove  events,
	when sharing an interrupt with other devices:
	check sc->sc_enabled,  and drop the interrupt if its' off.

	revision 1.30
	date: 2000/08/18 04:11:48;  author: jhawk;  state: Exp;  lines: +4 -4
	Copy wi_{dst,src}_addr from struct wi_frame into faked-up ether_header
	instead of addr1 and addr2. THis means that tcpdump -e will show the
	correct MAC address for communications with access points instead of showing
	the BSSID.

	In the future there should be 802.11 support for bpf/libpcap/tcpdump,
	but that is aways down the road.
2001-04-10 05:29:26 +00:00
Boris Popov
16162e5789 Avoid endless recursion on panic.
Reviewed by:	jhb
2001-04-10 00:56:19 +00:00
John Baldwin
d53d22496f Maintain a reference count on the witness struct. When the reference
count drops to 0 in witness_destroy, set the w_name and w_file pointers
to point to the string "(dead)" and the w_line field to 0.  This way,
if a mutex of a given name is used only in a module, then as long as
all mutexes in the module are destroyed when the module is unloaded,
witness will not maintain stale references to the mutex's name in the
module's data section causing a panic later on when the w_name or w_file
field's are examined.
2001-04-09 22:34:05 +00:00
Matt Jacob
bab64fffde Several things:
1. Pick up MII/PHY support for Livengood copper part (10/100/1000) from
Parag Patel. It was a fairly complete but not quite platform independent
job.

2. Finish silly offset differences that LIVENGOOD vs. WISEMAN registers
have (so the !)$*!)$*!$ fiber LIVENGOOD now works too).

3. Ansify the source.

So- we now suppor tthe PRO1000F and PRO1000T adapters.
2001-04-09 21:54:15 +00:00
Matt Jacob
40be668926 Add in MII support for LICENGOOD copper part (10/100/1000). Add in some
more flags for verbose as well as debug printing.
2001-04-09 21:48:50 +00:00
Matt Jacob
91e6ce1b32 Pick up changes from Parag Patel and Kachun Lee, and self:
1. The offsets for some registers change in LIVENGOOD. Gratuitously.

2. Define LIVENGOOD and LIVENGOOD_CU part numbers. Add some more
specific LIVENGOOD defaults.

3. Add definitions for PHY support for the copper LIVENGOOD part
(10/100/1000).
2001-04-09 21:47:11 +00:00
John Baldwin
7d8e84e364 - One can now specify the decimal pid of a process to trace as a parameter.
Since pid's are not in the kernel address space, this doesn't conflict
  with the funcionality of specifying an arbitrary frame pointer to the
  trace command.
- If the first function of a backtrace maps to fork_trampoline, then this
  is a newly fork'd process that has not been executed yet, so just print
  out the first frame and then return for that case.
- Lower the default count from 65535 to 1024.  ddb doesn't trace into
  userland, and if the stack gets hosed and starts looping it's less
  annoying.
2001-04-09 21:43:45 +00:00
Matt Jacob
175fe04ac6 We now depend on miibus_if.h. 2001-04-09 21:34:52 +00:00
Cameron Grant
941431caa8 comment out a boot-time debug message 2001-04-09 21:33:47 +00:00
Matt Jacob
2a4339f78f Add Marvell PHY support for 10/100/1000 LIVENGOOD_CU Intel NIC.
Parag Patel did all of the grunt work, so he gets the credit.
Register definitions and actions inferred from a Linux driver,
so Intel also gets some 'credit'.
2001-04-09 21:29:44 +00:00
Nick Hibma
e796578c40 Rege. 2001-04-09 18:45:32 +00:00
Nick Hibma
053a2f773b Again an ID that has been reused. Update description. 2001-04-09 18:45:02 +00:00
Nick Hibma
6e4a2c5638 Add the Abocom URE 450 ethernet adapter.
Submitted by:   dima@bog.msu.su
2001-04-09 18:44:11 +00:00
Nick Hibma
d6bbfa7387 Regen. 2001-04-09 18:26:18 +00:00
Nick Hibma
5224ce264a Update the description for the EPSON PID 0x010a. It seems to be reused in
the 8700 series.
2001-04-09 18:22:20 +00:00
Nick Hibma
0ec85a1de5 Regen. 2001-04-09 18:19:41 +00:00
Nick Hibma
b0477600ef Add the Omni 56K Plus modem
Submitted by:	kazarov@izmiran.rssi.ru
2001-04-09 18:19:20 +00:00
Cameron Grant
3bf5344663 enable the rate conversion feeder.
the main benefit this gives for now is that via686 audio devices on
motherboards with ac97 codecs that do not support vra will be able to use
sample rates other than 48khz.
2001-04-09 12:04:44 +00:00
Nick Hibma
7032578aac Remove a stale file. 2001-04-09 10:28:33 +00:00
Boris Popov
6f2d8adb12 Add function prototypes and base module for kernel side iconv library.
Add simple "xlat" converter which performs 8to8 table based conversion.
Unicode converter will be added in the near future.

Reviewed by:			silence on arch@
Files placement reviewed by:	bde
Obtained from:			smbfs
2001-04-09 09:39:29 +00:00
Warner Losh
f8ef5bfb0d Two minor fixes:
o Change the number of init tries from 5 to a #define.
	o Allow up to 5s rather than 2s for commands to complete.  This
	  is still much less than 51 minutes, but makes my intel card init
	  with more reliability than before.
2001-04-09 06:33:36 +00:00
Matt Jacob
660fd20479 Correctly initialize free_ccbq so that if we fail to attach (as is
possible for some systems where the device is there, but the BIOS
hasn't allocated memory resources for it), we don't panic.

Submitted by:	 Gerard Roudier
2001-04-09 05:41:41 +00:00
George C A Reid
9de0de1dd4 Reinitialise the DSP and mixer after a resume from suspend
PR:		22372
Submitted by:	Hiroyuki Aizu <aizu@jaist.ac.jp>
Reviewed by:	cg
2001-04-08 23:02:06 +00:00
David E. O'Brien
d899d4083c Style fix. 2001-04-08 21:50:41 +00:00
Joerg Wunsch
9a82806973 Move the decision whether we want to request authentication from our
peer out from sppp_lcp_open() to sppp_lcp_up().  For one, this makes
things look more symmetrical to sppp_lcp_close(), and somehow it also
just occurred to me that an Up event following the open caused the
value of the authentication option to be clobbered.
2001-04-08 20:29:09 +00:00
Cameron Grant
60391e107d add a software sample rate conversion feeder. this uses linear
interpolation for reasonable quality whilst not using too much cpu time.
2001-04-08 20:26:22 +00:00
Cameron Grant
66a3addbf2 minor tweaks in speed and format setting routines.
don't stop exploring the feeders if a feeder fails to initialise.
2001-04-08 20:20:52 +00:00
Cameron Grant
7c3968cc32 fix feeder initialisation methods to return correct result codes. 2001-04-08 20:17:03 +00:00
Cameron Grant
2753645ced if the feeder chain returned no data, do not try to acquire the data. 2001-04-08 20:14:14 +00:00
Andrew Gallatin
ceca66bb01 insert a magical second memory barrier prior to calling draina() in
badaddr_read().  This fixes 'machine check in pal mode' halts on
ev5 2100As.

MFC candidate -- after spending 6 hours tracking this down, I checked and
discovered that it has been in NetBSD for over a year, so it should be safe
for MFC into 4.3-RELEASE
2001-04-08 16:43:59 +00:00
Jake Burkholder
1681b00a79 Fix a precedence bug. ! has higher precedence than &. 2001-04-08 04:15:26 +00:00
George C A Reid
46ae634c56 Add yet another chip revision of the ES1371 which requires initialisation
delays

PR:		26415
Submitted by:	Jose M. Alcaide <jose@we.lc.ehu.es>
Reviewed by:	cg
2001-04-08 00:07:53 +00:00
Andrew Gallatin
f814df3b04 no longer needed now that we are able to build cdboot from sources again 2001-04-08 00:01:54 +00:00
Andrew Gallatin
3d8ec0e11f build cdboot from sources now that the cd9660 fs support works
MFC candidate
2001-04-07 23:52:31 +00:00
Nick Hibma
6d0b13c1ba Use getopt instead of a home grown one
Submitted by:	DES
2001-04-07 20:51:24 +00:00
Nick Hibma
b9688f84b0 Add id for the IO Data ET/T
PR:		23877
Submitted by:	Makoto MATSUSHITA <matusita@jp.freebsd.org>
2001-04-07 20:47:29 +00:00
Dag-Erling Smørgrav
9733a80839 Let pseudofs into the warmth of the FreeBSD CVS repo.
It's not finished yet (I still have to find a way to implement process-
dependent nodes without consuming too much memory, and the permission
system needs tightening up), but it's becoming hard to work on without
a repo (I've accidentally almost nuked it once already), and it works
(except for the lack of process-dependent nodes, that is).

I was supposed to commit this a week ago, but timed out waiting for jkh
to reply to some questions I had. Pass him a spoonful of bad karma :)
2001-04-07 19:51:12 +00:00
Orion Hodson
7370c6a68a Quieten when re-triggering. 2001-04-07 14:12:53 +00:00
Alfred Perlstein
b9d311049e use correct contants (from net/ethernet.h)
ETHER_TYPE_LEN instead of sizeof(u_int16_t) when looking at an ethernet
  header

ETHERTYPE_IP instead of 0x800
2001-04-06 22:21:57 +00:00
Alfred Perlstein
85d6297f46 replace hardcoded 1518 with ETHER_MAX_LEN 2001-04-06 21:48:19 +00:00
John Baldwin
ed55a19f67 Add a new ddb command 'show pcpu' which lists some of the per-cpu data.
Specifically, the cpuid, curproc, curpcb, npxproc, and idleproc members.
Also, if witness is compiled into the kernel, then a list of all the spin
locks held by this CPU is displayed.  By default the information for the
current CPU is displayed, but a decimal cpu id may be specified as a
parameter to obtain information on a specific CPU.
2001-04-06 21:41:52 +00:00
John Baldwin
3dcb6789d7 - Split out the functionality of displaying the contents of a single lock
list into a public witness_list_locks() function.  Call this function
  twice in witness_list() instead of using an evil goto.
- Adjust the 'show locks' command to take an optional parameter which
  specifies the pid of a process to list the locks of.  By default the
  locks held by the current process are displayed.
2001-04-06 21:37:52 +00:00
Søren Schmidt
8018014f59 Add ATA66 and ATA100 mode support for Acer chipsets.
MFC candidate :)
2001-04-06 19:18:35 +00:00
Darren Reed
454a43c1f1 fix security hole created by fragment cache 2001-04-06 15:52:28 +00:00
John Baldwin
ae60f36f19 Axe the per-cpu variable witness_spin_check as it was replaced by the
per-cpu spinlocks list.
2001-04-06 07:20:27 +00:00
Bill Fumerola
0901f62e11 pipe/queue are the only consumers of flow_id, so only set it in those cases 2001-04-06 06:52:25 +00:00
Hajimu UMEMOTO
7b35f61ab7 - correct logic of per-address input packet counts for lo0
- reject packets to fe80::xxxx%lo0 (xxxx != 1)

Submitted by:	JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2001-04-05 19:45:02 +00:00
Warner Losh
aaad2b9793 Soften the dire warnings about this code. Things are kinda working
now and it does compile :-).  There are still some issues, but it is a
good time to soften the warning.
2001-04-05 17:00:46 +00:00
Søren Schmidt
5e083a4a31 More error handling cleanups. 2001-04-05 15:45:53 +00:00
Søren Schmidt
268f572fab On burners that return faulty ready on fixate, wait for the
expected fixate time before returning.

Dont print error messages to the console on READ_TOC on
a blank media.
2001-04-05 11:17:33 +00:00
Søren Schmidt
ae2e8ffad0 Add new flag ATPR_F_QUIET to atapi_request.
Cleanup error handling.
2001-04-05 11:15:24 +00:00
Søren Schmidt
e65e827e13 Correct the sysctl names to match the tuneables.
Proberly flush the tag queue on detach.
2001-04-05 11:13:07 +00:00
Doug Rabson
46b9a4ff52 Don't call prom_open() multiple times. This confuses some versions of SRM
and makes it impossible to boot from floppy and CD on some AlphaServer
platforms.

Detective work by: Michael Richards <michael@fastmail.ca>
2001-04-05 10:28:52 +00:00
Alfred Perlstein
6857ad1f30 test should be for == 0, not < 0 2001-04-05 09:47:07 +00:00
Alfred Perlstein
34702f7e67 WI_TIMEOUT is 65536
65536 * 10msec == 10 minutes 55 seconds == hung machine

Instead wait for the busy bits for a max of ~2 seconds (200 * 10msec)
2001-04-05 09:25:37 +00:00
Alfred Perlstein
8da738fd11 Don't leak resources:
Don't leak iospace when irq allocation fails.  (call wi_free())

Call bus_release_resource() with the correct "rid" obtained from
bus_alloc_resource() that's saved in the softc instead of a hardcoded
0.
2001-04-05 06:56:10 +00:00
Robert Watson
2955f0b360 o Rather than arbitrarily construct a credential in the nfs_statfs()
VFS operation, make use of the calling process's credential.  This
  solution may not be ideal (there are a number of other possible
  proposals, including making use of the proc0 credential, adding a
  credential argument to the VFSOP, and switching from a hard-coded
  ucred to a hard-coded nfscred), it is simple and appears to
  work.  The arguments against using simply crget() are fairly
  strong: it is the only place in the code (other than a nearly
  identical invocation in ncp) where crget() is invoked, other than
  in the process credential creation code; as ucred becomes extensible,
  this use of crget() without appropriate context results in less and
  less meaningful credential data.  The implementation here will
  probably be tweaked as a result of experimentation and further
  exploration of the requirements.  In the mean-time, it allows
  progress to be made in ucred expansion for new security models without
  causing a crash every time df is used on an NFS mounted file system.

  This code has been interop tested against FreeBSD and Solaris NFS
  servers.  While using the process credentials should not introduce
  interop problems, please let me know if any turn out to exist.

Reviewed by:	freebsd-arch
2001-04-05 06:12:38 +00:00
Bosko Milekic
406dd7d1d4 Change a couple of M_WAITOKs used in M_PREPEND() to M_TRYWAITs, which
is what they should be. As the returned mbuf is already checked for
failure of M_PREPEND even in the wait case, nothing more to be done
here.
2001-04-05 04:20:48 +00:00
Bosko Milekic
22a847c32e Various style fixes.
Also place the macros under #ifdef _KERNEL. Equally hide the internal
structures such as the freelist structs which include condition variables.

Reviewed by: bde
Mostly suggested by: bde
2001-04-05 03:55:27 +00:00
Garance A Drosehn
0832fc6494 Fix bpf devices so select() recognizes that they are always writable.
PR:		9355
Submitted by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Garrett Rooney <rooneg@electricjellyfish.net>  (see pr :-)
2001-04-04 23:27:35 +00:00
Kenneth D. Merry
4464fee503 Don't allow immediate values of 0 for operations that can take either an
immediate value or the accumulator.  0 is the chip's internal
representation for the accumulator, and so 0 is an invalid immediate value
when the accumulator can also be specified as an argument.

Submitted by:	gibbs
2001-04-04 22:50:57 +00:00
Matt Jacob
a1bc34c6b8 Redo a lot of the target mode infrastructure to be cognizant of Dual Bus
cards like the 1280 && the 12160. Cleanup isp_target_putback_atio.
Make sure bus and correct tag ids and firmware handles get propagated
as needed.
2001-04-04 21:58:29 +00:00
Alfred Perlstein
627d3c9285 call a watchdog timeout like it is. 2001-04-04 21:56:25 +00:00
Matt Jacob
1209134a70 Roll platform minor.
Change target mode state definitions to be aware of 'channel' (for the
dualbus 1280/12160 cards).
2001-04-04 21:56:15 +00:00
Matt Jacob
e9a2738ad1 Complete some Ansification. Check to make sure, in tdma_mk, that we won't
overflow the request queue. The reason we want to do this is that we
now push out completed CTIOs as we complete them- this gets the QLogic
working on them quicker. So we need to know whether we can put the entire
burrito out before we start.

We now support conjoint status with data for the last CTIO for both Fibre
Channel and SCSI. Leave the old code in place in case we need to go back
(minor 3 line ifdef).

Ultra-ultra important- *don't* set rq->req_seg_count for non-data
target mode requests in isp_pci_dmasetup. D'oh- this is actually
the tag value area for a CTIO. What *was* I thinking? Boy howdy
does both aic7xxx and sym get awfully unhappy when on reconnect
you give them a constant '1' for a tag value.
2001-04-04 21:53:59 +00:00
Matt Jacob
b25bcef87a Perform some more Ansification. Remove and then replace the isp_putback_atio
function- we did it a bit cleaner. We only use this if a CTIO completes with
!CT_OK state. We now have managed to get away without having to poke around
and trying to find the original ATIO- the csio we're using has the tag_id
and lun values with it which is mostly what we need when we do the putback.

Make sure we correctly propagate AT_TQAE->CT_TQAE for tags. Make sure
we call ISP_DMAFREE only if we had DATA to move.
2001-04-04 21:49:51 +00:00
Matt Jacob
b5da7b232e Amazing. The bits to enable tagged queing in target mode, grok that a
tag is active for an ATIO, and say that you want to reconnect with
a tag value in a CTIO have *never* been exercised until now. This lossage
derived from Solaris code where this stuff originally came from that is
about 7 years old. Amazing.

We now bundle the incoming tag (legal values are 0..256) as the low
16 bits of the ccb_accept_tio's at_tagid while we put the firmware
handle for this ATIO in the top 16 bits- define some macros to make
this cleaner.

Complete some Ansification.
2001-04-04 21:46:48 +00:00
Matt Jacob
8055acd82d Add some target mode definitions and firmware (FC only) attribute definitions. 2001-04-04 21:44:10 +00:00
Matt Jacob
56f7a63a7a Ansification of source. 2001-04-04 21:43:43 +00:00
Matt Jacob
534bd9fecb After loading f/w, for FC cards print out Firmware Attributes.
Redo establishment of default SCSI parameters whether or not
we've been compiled for target mode. Unfortunately, the Qlogic
f/w is confused so that if we set all targets to be 'safe' (i.e.,
narrow/async), it will also then report narrow, async if we're
contacted in target mode from that target (acting in initiator
role). D'oh!

Fix ISPCTL_TOGGLE_TMODE to correctly enable the right channel for
dual channel cards. Add some more opcodes. Fix a stupid NULL
pointer bug.
2001-04-04 21:42:59 +00:00
Matt Jacob
34707c9f37 If we have and error and are booting verbosely, don't be complaining
if this was a non-retryable selection timeout- wading through 256 targets
worth of Fibre Channel 'selection timeouts' is tedious at best.
2001-04-04 18:24:35 +00:00