Commit Graph

99186 Commits

Author SHA1 Message Date
John Baldwin
b4323d7729 - A lot of style and whitespace fixes.
- Update a few comments regarding locking notes.

Submitted by:	bde (1, mostly)
2004-02-05 20:53:25 +00:00
Ruslan Ermilov
fe670e467a Temporarily put STRIP back; bsd.port.mk still needs it. 2004-02-05 20:48:44 +00:00
Ruslan Ermilov
4c25ae5742 Don't define STRIP in bsd.own.mk. 2004-02-05 20:16:18 +00:00
Ruslan Ermilov
1154360eaa strip wasn't stripped since we stopped to include bsd.own.mk from sys.mk. 2004-02-05 19:54:56 +00:00
Ruslan Ermilov
86751859b5 style.Makefile(5).
OK'ed by:	nectar
2004-02-05 18:51:52 +00:00
Ruslan Ermilov
88a15798d4 Try harder to pick up the correct print_version.c. The old version
works before bsd.dep.mk,v 1.44, whether .depend file exists or not,
but the contents of .depend file is wrong.  With bsd.dep.mk,v 1.44,
the contents of .depend file is always broken, and build without a
.depend file is broken too.  With this change it works reliably in
all cases.  Ugh.
2004-02-05 18:49:35 +00:00
Jacques Vidrine
b00a3c85da Correct a reference counting bug in shmat(2). If vm_map_find(9)
failed, the reference count for the virtual memory object referenced
by the specified shared memory segment would have been erroneously
incremented.

Reported by:	Joost Pol <joost@pine.nl>
2004-02-05 18:00:35 +00:00
Alexander Kabaev
dec8868dcc Rename cn_unavailable to cnunavailable for little more consistency.
Garbage collect unused cndebug() function.

Suggested by:	bde
2004-02-05 17:35:28 +00:00
Bruce Evans
ae62d94069 Fixed operation of -f to match its documentation and fsck_ffs. It
has now has no effect except in combination with -p, and plain fsck
checks all file systems instead of skipping clean ones for msdosfs
only.

Renamed the force flag to skipclean and inverted its logic as in
fsck_ffs.
2004-02-05 15:47:46 +00:00
Bruce Evans
910da6c689 Fixed some bugs in checkdirty(). The check for the clean bit was
combined with the the signature check in a wrong way (basically
(dirty:= signature_recognised() && !clean) instead of
(mightbedirty:= !signature_recognized || !clean), so file systems
with unrecognized signatures were considered clean.  Many of the
don't-care and reserved bits were not ignored, so some file systems
with valid signatures were unrecognized.  One of my FAT32 file systems
has a signature of f8,ff,ff,ff,ff,ff,ff,f7 when dirty, but only
f8,ff,ff,0f,ff,ff,ff,07 was recognised as dirty for FAT32, so the
fail-unsafeness made my file system always considered clean.

Check the i/o non-error bit in checkdirty().  Its absence would give
an unrecognized signature in code that is unaware of it, but we now
mask it out of the signature so we have to check it explicitly.  This
combines naturally with the check of the clean bit.

Reviewed by:	rnordier (except for final details)
2004-02-05 15:18:18 +00:00
Roman Kurakin
6f97087e27 Updates cx driver information (Cronyx-Sigma)
Approved by:	imp (mentor)
2004-02-05 13:02:14 +00:00
Hajimu UMEMOTO
4ef2dc8b71 printed statistics about source address selection rules.
Obtained from:	KAME
2004-02-05 12:08:35 +00:00
Hajimu UMEMOTO
cb60a8de59 stops program if kvm_read fails.
Obtained from:	KAME
2004-02-05 12:05:35 +00:00
Hajimu UMEMOTO
22a4e20905 - support hmac-ripemd160.
- support AES XCBC MAC/AES counter mode.

Obtained from:	KAME
2004-02-05 12:02:37 +00:00
Hajimu UMEMOTO
3fde69b944 print stats on SPD cache lookups.
Obtained from:	KAME
2004-02-05 12:01:39 +00:00
Hajimu UMEMOTO
5d8a878a55 - %d is 12 chars, not 10. use NI_MAX* where appropriate.
- goodbye RC5.
- use %llu directly.
- KNF.

Obtained from:	KAME
2004-02-05 11:59:37 +00:00
Dag-Erling Smørgrav
d36f5b40f2 Use more generic directories (most prominently, s|/home/des|%%HOME%%|) 2004-02-05 11:08:36 +00:00
Dag-Erling Smørgrav
fef1e56d1e Don't create a template file if we're not going to let the user edit it. 2004-02-05 10:57:29 +00:00
Peter Pentchev
f7644f46f0 Fix a typo in kan's last commit: cnavaiable() -> cnavailable() 2004-02-05 10:02:20 +00:00
Pawel Jakub Dawidek
e493da7e6f Fix wrong check.
Approved by:	jake, scottl (mentor)
2004-02-05 09:50:57 +00:00
Ruslan Ermilov
f258f151cd make(1) can now handle spaces surrounding parenthesis correctly. 2004-02-05 08:44:43 +00:00
Pawel Jakub Dawidek
0cd7b33bf3 Fixed some non-critical memory leaks and one temporary file leak
(theoretical).

Approved by:	phk, scottl (mentor)
2004-02-05 08:39:38 +00:00
Mike Silbersack
b711d74eaf Style fixes: don't indent variable names.
Submitted by:	bde
2004-02-05 08:29:27 +00:00
Bruce Evans
8e9c564a11 Document the dirty flag and other bits in the first 2 FAT entries
better.  There is a related I/O error flag which we don't support in
the kernel but must support here.  (Support for bits that we don't
understand here is mostly automatic by fail-safeness, but checkdirty()
has fail-unsafeness.)  There are some reserved and don't-care bits
that weren't fully documented and aren't always masked properly.  The
comment about the bits in readfat() will be removed when the masking
is fixed.

Submitted by:	rnordier
2004-02-05 06:55:12 +00:00
Alan Cox
bfee999d6a - Locking for the per-process resource limits structure has eliminated
the need for Giant in vm_map_growstack().
 - Use the proc * that is passed to vm_map_growstack() rather than
   curthread->td_proc.
2004-02-05 06:33:18 +00:00
Bruce Evans
a270f31ebd Prepare to fix checkdirty() by moving it from check.c to fat.c. It is
identical to a subset of readfat(), so it belongs near readfat() if not
in it.
2004-02-05 06:32:16 +00:00
David Xu
cb10cbc878 libkse was renamed to libpthread. 2004-02-05 02:55:20 +00:00
Alexander Kabaev
e99c09e2dc Eliminate global cons_unavailable flag and replace it by the status
bit maintained on a per-device basis. Single variable is inadequate
on machines running with multiple consoles enabled.
2004-02-05 01:56:43 +00:00
Peter Wemm
668329e94b Compile on amd64. (pointer/int mismatches and printf int vs long ) 2004-02-05 01:35:33 +00:00
Peter Wemm
db41012cc3 Add crypto implemenation files (C versions (like alpha, unlike i386)) 2004-02-05 01:09:29 +00:00
Peter Wemm
0765d4d608 Don't cast a pointer to an int that isn't big enough. 2004-02-05 00:12:08 +00:00
Peter Wemm
46d9072b4a Fix long/int printf format problems exposed by PMAP_DIAGNOSTIC 2004-02-05 00:11:05 +00:00
Dag-Erling Smørgrav
5e3128401a GC port.mkversion. 2004-02-05 00:07:09 +00:00
Peter Wemm
b132d96ea6 Checkpoint a NOTES file I had as of Nov 23rd. It doesn't quite compile
due to triggering some printf breakage in some DIAGNOSTIC printfs.
2004-02-04 22:53:50 +00:00
Dag-Erling Smørgrav
eab0ab565c Remove Perl lines; it's better to let use.perl handle them. 2004-02-04 22:37:14 +00:00
Lukas Ertl
3a1ab63eb7 When creating raid5 or striped plexes, avoid falling out of bounds
when checking the given stripe size.

Also move the code a bit around to avoid duplication.

Approved by: joerg (mentor)
2004-02-04 22:29:52 +00:00
John Baldwin
0804ed5acc Regen. 2004-02-04 22:00:44 +00:00
Johan Karlsson
84d018e017 Fix typo, s/transmitts/transmits/
PR:		62346
Submitted by:	Gavin Atkinson (gavin at ury.york.ac.uk)
2004-02-04 21:59:29 +00:00
John Baldwin
c3b612d935 The following compat syscalls are now mpsafe: linux_getrlimit(),
linux_setrlimit(), linux_old_getrlimit(), osf1_getrlimit(),
osf1_setrlimit(), svr4_sys_ulimit(), svr4_sys_setrlimit(),
svr4_sys_getrlimit(), svr4_sys_setrlimit64(), svr4_sys_getrlimit64(),
ibcs2_sysconf(), and ibcs2_ulimit().
2004-02-04 21:57:00 +00:00
John Baldwin
91d5354a2c Locking for the per-process resource limits structure.
- struct plimit includes a mutex to protect a reference count.  The plimit
  structure is treated similarly to struct ucred in that is is always copy
  on write, so having a reference to a structure is sufficient to read from
  it without needing a further lock.
- The proc lock protects the p_limit pointer and must be held while reading
  limits from a process to keep the limit structure from changing out from
  under you while reading from it.
- Various global limits that are ints are not protected by a lock since
  int writes are atomic on all the archs we support and thus a lock
  wouldn't buy us anything.
- All accesses to individual resource limits from a process are abstracted
  behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return
  either an rlimit, or the current or max individual limit of the specified
  resource from a process.
- dosetrlimit() was renamed to kern_setrlimit() to match existing style of
  other similar syscall helper functions.
- The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit()
  (it didn't used the stackgap when it should have) but uses lim_rlimit()
  and kern_setrlimit() instead.
- The svr4 compat no longer uses the stackgap for resource limits calls,
  but uses lim_rlimit() and kern_setrlimit() instead.
- The ibcs2 compat no longer uses the stackgap for resource limits.  It
  also no longer uses the stackgap for accessing sysctl's for the
  ibcs2_sysconf() syscall but uses kernel_sysctl() instead.  As a result,
  ibcs2_sysconf() no longer needs Giant.
- The p_rlimit macro no longer exists.

Submitted by:	mtm (mostly, I only did a few cleanups and catchups)
Tested on:	i386
Compiled on:	alpha, amd64
2004-02-04 21:52:57 +00:00
John Baldwin
890cefab5b Expand the mask for the Avlab Technology, PCI IO 2S entry to cover the
2S-650 and 2S-850 variants.

PR:		kern/45285
Submitted by:	Andrey Zakharchenko <avz AT jscc.ru>
MFC after:	1 week
2004-02-04 18:01:02 +00:00
Bruce Evans
cff9b99a47 Fixed editing error in a comment in previous commit. 2004-02-04 17:08:46 +00:00
Bruce Evans
24d19140f2 Removed TIOCMODG and TIOCMODS. They were superseded by TIOCMGET and
TIOCMSET before FreeBSD existed and have never been implemented by any
FreeBSD serial driver (not even as aliases).

Moved the TIOCM bit definitions to be with TIOCMGET.

Added more comments gaps between ioctl numbers.  There are now a large
number of conflicts with ppp, slip, tap and tun ioctls (especially ppp
ones) from closing gaps that weren't there.  This mainly breaks decoding
of ioctl numbers in kdump, but there are some serious conflicts where
the interpretation of a tty ioctl depends on the line discipline.
2004-02-04 17:03:49 +00:00
Ruslan Ermilov
fc448d1579 Unbreak build with OpenLDAP.
Forgotten by:	mr
2004-02-04 16:42:36 +00:00
Justin T. Gibbs
d44d2bb948 aic7xxx.c:
Shorten a diagnostic printf to fit in 80 columns.

	In ahc_abort_scbs() remove an incorrect diagnostic test
	that printed a spurious warning.
2004-02-04 16:40:08 +00:00
Justin T. Gibbs
4164174aff aic79xx.c:
aic79xx.seq:
	Convert the COMPLETE_DMA_SCB list to an "stailq".  This allows us to
	safely keep the SCB that is currently being DMA'ed back the host on
	the head of the list while processing completions off of the bus.  The
	newly completed SCBs are appended to the tail of the queue.   In the
	past, we just dequeued the SCB that was in flight from the list, but
	this could result in a lost completion should the host perform certain
	types of error recovery that must cancel all in-flight SCB DMA operations.

	Switch from using a 16bit completion entry, holding just the tag and the
	completion valid bit, to a 64bit completion entry that also contains a
	"status packet valid" indicator.  This solves two problems:
	  o The SCB DMA engine on at least Rev B. silicon does not properly deal
	    with a PCI disconnect that occurs at a non-64bit aligned offset in the
	    chips "source buffer".  When the transfer is resumed, the DMA engine
	    continues at the correct offset, but may wrap to the head of the buffer
	    causing duplicate completions to be reported to the host.  By using a
	    completion buffer in host memory that is 64bit aligned and using 64bit
	    completion entries, such disconnects should only occur at aligned addresses.
	    This assumes that the host bridge will only disconnect on cache-line
	    boundaries and that cache-lines are multpiles of 64bits.

	  o By embedding the status information in the completion entry we can avoid
	    an extra memory reference to the HSCB for commands that complete without
	    error.

	Use the comparison of a "host freeze count" and a "sequencer freeze count"
	to allow the host to process most SCBs that complete with non-zero status
	without having to clear critical sections.  Instead the host can just pause the
	sequencer, performs any necessary cleanup in the waiting for selection list,
	increments its freeze count on the controller, and unpauses.  This is only
	possible because the sequencer defers completions of SCBs with bad status
	until after all pending selections have completed.  The sequencer then avoids
	referencing any data structures the host may touch during completion of the
	SCB until the freeze counts match.

aic79xx.c:
	Change the strategy for allocating our sentinal HSCB for the QINFIFO.  In
	the past, this allocation was tacked onto the QOUTFIFO allocation.  Now that
	the qoutfifo has grown to accomodate larger completion entries, the old
	approach will result in a 64byte allocation that costs an extra page of
	coherent memory.  We now do this extra allocation via ahd_alloc_scbs()
	where the "unused space" can be used to allocate "normal" HSCBs.

	In our packetized busfree handler, use the ENSELO bit to differentiate
	between packetized and non-packetized unexpected busfree events that
	occur just after selection, but before the sequencer has had the oportunity
	to service the selection.

	When cleaning out the waiting for selection list, use the SCSI mode
	instead of the command channel mode.  The SCB pointer in the command
	channel mode may be referenced by the SCB dma engine even while the
	sequencer is paused, whereas the SCSI mode SCB pointer is only accessed
	by the sequencer.

	Print the "complete on qfreeze" sequencer SCB completion list in
	ahd_dump_card_state().  This list holds all SCB completions that are deferred
	until a pending select-out qfreeze event has taken effect.

aic79xx.h:
	Add definitions and structures to handle the new SCB completion scheme.

	Add a controller flag that indicates if the controller is in HostRAID
	mode.

aic79xx.reg:
	Remove macros used for toggling from one data fifo mode to the other.
	They have not been in use for some time.

	Add scratch ram fields for our new qfreeze count scheme, converting
	the complete dma list into an "stailq", and providing for the "complete
	on qfreeze" SCB completion list.  Some other fields were moved to retain
	proper field alignment (alignment >= field size in bytes).

aic79xx.seq:
	Add code to our idle loop to:
	  o Process deferred completions once a qfreeze event has taken full
	    effect.
	  o Thaw the queue once the sequencer and host qfreeze counts match.

	Generate 64bit completion entries passing the SCB_SGPTR field as the
	"good status" indicator.  The first bit in this field is only set if
	we have a valid status packet to send to the host.

	Convert the COMPLETE_DMA_SCB list to an "stailq".

	When using "setjmp" to register an idle loop handler, do not combine
	the "ret" with the block move to pop the stack address in the same
	instruction.  At least on the A, this results in a return to the setjmp
	caller, not to the new address at the top of the stack.  Since we want
	the latter (we want the newly registered handler to only be invoked from
	the idle loop), we must use a separate ret instruction.

	Add a few missing critical sections.

	Close a race condition that can occur on Rev A. silicon.  If both FIFOs
	happen to be allocated before the sequencer has a chance to service the
	FIFO that was allocated first, we must take special care to service the
	FIFO that is not active on the SCSI bus first.  This guarantees that a
	FIFO will be freed to handle any snapshot requests for the FIFO that is
	still on the bus.  Chosing the incorrect FIFO will result in deadlock.

	Update comments.

aic79xx_inline.h
	Correct the offset calculation for the syncing of our qoutfifo.

	Update ahd_check_cmdcmpltqueues() for the larger completion entries.

aic79xx_pci.c:
	Attach to HostRAID controllers by default.  In the future I may add a
	sysctl to modify the behavior, but since FreeBSD does not have any
	HostRAID drivers, failing to attach just results in more email and
	bug reports for the author.

MFC After: 1week
2004-02-04 16:38:38 +00:00
Dag-Erling Smørgrav
df3ac04211 We don't really need a lockfile, and most likely can't create one at
this point.
2004-02-04 15:53:49 +00:00
Daniel Eischen
903f2e5041 Allow libc's version of sem_trywait() to work for non-pshared mutexes. 2004-02-04 15:37:48 +00:00
Bruce Evans
d17387acd4 Fixed breakage of POSIX support in rev.1.31. -pipe was added to
CFLAGS in all cases, but POSIX requires a default of -O.  Adding
-pipe unconditionally still is still broken for non-gcc compilers
in the non-POSIX case.
2004-02-04 14:40:44 +00:00
Bruce Evans
cf4a32a1cd Include <sys/queue.h> before <sys/_lock.h> instead of depending on
namespace pollution in other headers.  <sys/types.h> is now the only
prerequisite for <sys/sx.h>.

Fixed some style bugs:
- removed bogus LOCORE ifdef.  Including this C header in assembler
  sources is just nonsense.
- removed unused include of <sys/_mutex.h>.  It finished rotting when
  the mutex in struct sx became indirect in rev.1.15.
- removed most comments on #else and #endif's and cleaned up the others.
  All were misindented...
2004-02-04 14:18:21 +00:00