bde [Wed, 16 Dec 1998 19:04:54 +0000 (19:04 +0000)]
The previous commit was bogus. <stdlib.h> was never a prerequisite
for <kvm.h> or kvm_getloadavg(), and <sys/types.h> was only a
prerequisite for <kvm.h> when <kvm.h> was broken.
bde [Wed, 16 Dec 1998 18:59:47 +0000 (18:59 +0000)]
Declare size_t and ssize_t if they are not already declared, so that
<kvm.h> is self-sufficient again.
Moved typedefs and forward struct declarations out of __BEGIN_DECLS/
__END_DECLS.
Don't comment out the prototype for kvm_uread(). This was a 4 year
old kludge for previous breakage of self-sufficiency. The prototypwe
was broken instead.
Fixed bitrot (const poisoning) in the type of kvm_uread().
phk [Wed, 16 Dec 1998 18:42:38 +0000 (18:42 +0000)]
Straigthen out the use of the tls and tlf callbacks.
Not tested on the if_sr, if_cx and if_ar drivers, but
expected to work just the same as it used to.
Any users of these drivers (or even better: donors
of hardware for them) please contact phk@freebsd.org
so we can test the next batch of changes to if_sppp.
bde [Wed, 16 Dec 1998 18:31:51 +0000 (18:31 +0000)]
Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This
fixes a type mismatch in the call to kvm_uread(). The bug has gone
undetected for almost 3 years because kvm_uproc()'s protoype has been
disabled for almost 4 years.
Trust sysctlbyname() to work properly if it succeeds.
ken [Wed, 16 Dec 1998 18:00:39 +0000 (18:00 +0000)]
Probable fix for the "cdda2wav" panics that various people have been
reporting since this past summer. (I think Daniel O'Conner was the first.)
The problem appears to have been something like this:
- cdda2wav by default passes in a buffer that is close to the 128K MAXPHYS
limit.
- many times, the buffer is not page aligned
- vmapbuf() truncates the address, so that it is page aligned
- that causes the total size of the buffer to be greater than MAXPHYS,
which of course is a bad thing.
Here's a quote from the PR (kern/9067):
==================
In particular, note bp->b_bufsize = 0x0001f950 and bp->b_data = 0xf2219960
(which does not start on a page boundary). vunmapbuf() loops through all
the pages without any difficulty until addr reaches 0xf2239000, and then
the panic occurs. This seems to indicate that we are exceeding MAXPHYS
since we actually started from the middle of a page (the data is being
transfered to a non page aligned location).
To complete the description, note that the system call originates from
ReadCddaMMC12() (in scsi_cmds.c of cdda2wav) with a request to read 55
audio sectors of 2352 bytes (which is calculated to fall under MAXPHYS).
This in turn ends up calling scsi_send() (in scsi-bsd.c) which calls
cam_fill_csio() and cam_send_ccb(). This results in a CAMIOCOMMAND ioctl
with a ccb function code of XPT_SCSI_IO.
==================
The fix is to change the size check in cam_periph_mapmem() so that it is
like the one in minphys(). In particular, it is something like:
if ((buffer_length + (buf_ptr & PAGE_MASK)) > MAXPHYS)
buffer is too big
My fix is based on the one in the PR, but I cleaned up a fair number of
things in cam_periph_mapmem(). The checks for each buffer to be mapped
are now in a separate loop from the actual mapping operation. With the new
arrangement, we don't have to bother with unmapping any previously mapped
buffers if one of the checks fails.
Many thanks to James Liu for tracking this down. I'd appreciate it if some
vm-savvy folks would look this over. I believe this fix is correct, but I
could be wrong.
bde [Wed, 16 Dec 1998 17:34:05 +0000 (17:34 +0000)]
Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This is
an unimprovement here. I thought it would be an improvement, as in libkvm,
but here we can access the strings directly.
Use sysctlbyname() instead of sysctl() and trust it to give a nonzero
address if it succeeds.
bde [Wed, 16 Dec 1998 16:28:58 +0000 (16:28 +0000)]
Removed the cast to a pointer in the definition of PS_STRINGS and
adjusted related casts to match (only in the kernel in this commit).
The pointer was only wanted in one place in kern_exec.c. Applications
should use the kern.ps_strings sysctl instead of PS_STRINGS, so they
shouldn't notice this change.
bde [Wed, 16 Dec 1998 16:06:29 +0000 (16:06 +0000)]
Removed all traces of SYSCTL_INTPTR(). Pointers can't really be passed
across the kernel -> application interface, and for the one sysctl where
they were passed and actually used (kern.ps_strings), the applications
want addresses represented as u_longs anyway (the other sysctl that
passed them, kern.usrstack, has never been used).
ache [Wed, 16 Dec 1998 11:45:51 +0000 (11:45 +0000)]
Remove appending objformat to obj prefix for
backend targets. Old variant cause top level things build in
/usr/obj/elf while lower level things build in /usr/obj which cause
mismatch
des [Wed, 16 Dec 1998 10:24:55 +0000 (10:24 +0000)]
Add verbose flag, and support functions.
Brucify the Makefile.
Differentiate atime and mtime in fetch*Stat().
Fix a few pointer bugs.
Tweak some error messages.
Don't #include sys/param.h and stdio.h in fetch.h.
Document that sys/param.h and stdio.h must be #included before fetch.h.
peter [Wed, 16 Dec 1998 07:20:45 +0000 (07:20 +0000)]
As previously threatened, clean up the rshd -a option and make it default
on rshd and rlogind. However, note that:
1: rshd used to drop a connection with -a if the hostname != ip address.
This is unneeded, because iruserok() does it's own checking.
It was also wrong if .rhosts had an explicit IP address in it,
connections would be dropped from that host solely because the DNS was
mismatched even though it was explicitly intended to work by IP address.
2: rlogind and rshd check the hostname mappings by default now because that
is what goes into the utmp/wtmp and logs. If the hostname != ip address,
then it uses the IP address for logging/utmp/wtmp purposes. There isn't
much point logging ficticious hostnames.
3: rshd -a is now accepted (but ignored) for compatability. If you really
want to make life miserable for people with bad reverse DNS, use tcpd in
paranoid mode (which is questionable anyway, given DNS ttl tweaking).
peter [Wed, 16 Dec 1998 06:04:29 +0000 (06:04 +0000)]
Old stuff laying around: Don't use a function called getstr(), that has
nasty consequences when the system curses is ncurses as this conflicts
with a ncurses funciton and causes recursion.
msmith [Tue, 15 Dec 1998 14:32:17 +0000 (14:32 +0000)]
Reformat help to improve subtopic display appearance, other minor
cleaning. The 'help' command in the loader should now be usable and
hopefully informative.
bde [Tue, 15 Dec 1998 09:16:57 +0000 (09:16 +0000)]
Fixed misformatted error messages. wderror() was broken way back
in rev.1.30 (just before FreeBSD-1.1R) to almost match corresponding
breakage in FreeBSD-1.x's diskerr(). FreeBSD-2.x's diskerr() never
had the breakage.
gibbs [Tue, 15 Dec 1998 08:22:42 +0000 (08:22 +0000)]
Perform a save data pointers operation if a data transfer was performed
in target mode, but we are not completing the command.
Use a template of allowed bus arbitration phases to selectively and
dynamically enable/disable initiator or target (re)selection.
Properly handle timeouts for target role transactions - just go to the
bus free state and report the error to the peripheral driver.
Checkpoint support for the XPT_ABORT_CCB function code. This currently
handles the accept tio and immediate notify ccb types, but does not
handle the continue target I/O or SCSI I/O ccb types. This is enough
to handle dynamic target enable/disable events.
Clean up the SCSI reset code so that we perform at most 1 SCSI bus
reset at initialization, the reset requested by the XPT layer.
gibbs [Tue, 15 Dec 1998 08:15:15 +0000 (08:15 +0000)]
Enable/Disable our lun on open/close. Track resources kept at the controller
level so they can be reclaimed before attempting to disable our lun.
Correctly free descriptors. Add periph locking and spl protection
around open and close.
imp [Tue, 15 Dec 1998 02:51:54 +0000 (02:51 +0000)]
o Convert length of hccb to integer from the array. Eivind Eklund
pointed this out, but I've not seen a manifestation of this.
o Check against 0x00 as well as 0xff for geometry register, as some clone
cards don't return 0xff. Vadim Mikhailov pointed this out in PR
8743 for his Dell SCSI Array controller working in AHA-1540
emulation mode. Note that this test is likely to go away in the
future in favor of a better one Justin has recommended.
imp [Tue, 15 Dec 1998 00:24:32 +0000 (00:24 +0000)]
This file contains minimal instructions for the moderately clueful to
update their systems from prior versions of FreeBSD. It is only for
November 18, 1998 and newer systems. If you have an older system, you
are on your own.
I'll update this from time to time, and if it shows signs of bitrot
I'll kill it.
dillon [Mon, 14 Dec 1998 21:34:55 +0000 (21:34 +0000)]
Remove hardwired alignment, align to sizeof(long) which should be more
portable (though the hardwired alignment of 16 would also have worked just
fine and perhaps even resulted in better L1 cache operation).
julian [Mon, 14 Dec 1998 21:14:11 +0000 (21:14 +0000)]
The OHCI interfaces I have access to map their control regs etc. into
memory address space rather than IO space.. reflect this when looking for the
interface revision register.
If this is not true for them all then we probably need some smarter code.
brian [Mon, 14 Dec 1998 19:24:30 +0000 (19:24 +0000)]
Rather than interrupting 10 times per second then checking
to see if there's anything to do, schedule the next alarm
based on the next required timeout.
This decreases the load when there are lots of relatively
idle ppp processes.
While I'm in there, handle the possibility that a timeout
makes the timer element go out of scope by grabbing the
enext pointer before executing the timer function.
bde [Mon, 14 Dec 1998 16:29:58 +0000 (16:29 +0000)]
Fixed LINT breakage in previous commit. Option FDC_YE enabled a
syntax error. Options FDC_YE and DEVFS together enabled references
to a nonexistent variable and calls of a nonexistent function.
mckay [Mon, 14 Dec 1998 13:27:48 +0000 (13:27 +0000)]
Restore traditional behaviour by allowing tabs in strings. In deference
to the new age of internationalisation, I used isblank() instead of a
literal '\t'.