st_write_filemarks(). This means that it is possible to write a file
on the tape for which all the writes and the close return without
errors, but the all bits did not make it onto the tape.
PR: 741
Reviewed by: phk
Submitted by: Andrew Heybey <ath@niksun.com>
of some disk ioctls and uniformizes bounds checking in the strategy
routine. EOF handling got fixed as a side effect. The changes
are similar to old changes for SCSI disks, except slices and labels
are not searched for on the disk and the in-core label has a few
more details (mostly just for backwards compatibility). Bugs in
the in-core label had to be fixed to get dsopen() to accept it.
The slice interfaces had to support large sectors for all this to
work.
and DSO_NOLABELS flags prevent searching for slices and labels
respectively. Current drivers don't set these flags. When
DSO_NOLABELS is set, the in-core label for the whole disk is cloned
to create an in-core label for each slice. This gives the correct
result (a good in-core label for the compatibility slice) if
DSO_ONESLICE is set or only one slice is found, but usually gives
broken labels otherwise, so DSO_ONESLICE should be set if DSO_NOLABELS
is set.
`make world' to avoid problems with picking up (new) target or (stale)
host shared libraries.
Don't honor -static in LDFLAGS for linking LKMs. LDFLAGS is not
actually for ld, but we use it anyway, and must prevent -static being
misinterpreted as -s.
Don't hide any of the link steps.
- Call isa_dmadone() whenever necessary to stop DMA and/or free bounce
buffers. Undead DMA corrupted the malloc freelist fairly consistently
in the following configuration: SLICE kernel, 2 floppy drives, no disk
in fd0, disk in fd1.
- Don't call fdc_reset() from fd_timeout(). Doing so gave an "extra"
interrupt which was usually misinterpreted as being for completion
of the next FDC command; the interrupt for completion of the next
FDC command was then usually misinterpreted... There were further
complications for interrupts latched by the soft-spl mechanism so
that they were delivered after all the h/w interrupts went away.
This caused at least wrong head settle delays and may be why the
FreeBSD floppy driver seems to munch floppies more than most floppy
drivers. The reset was unnecessary anyway in cases that didn't have
the bug described next, since is was repeated a little later for
the IOTIMEDOUT state. The state machine has complications to handle
resets correctly, so just use it.
- Don't call retrier() from fd_timeout(). The IOTIMEDOUT state needs
to be processed next, and it isn't valid to set to that state if
retrier() has aborted the current transfer. Doing so caused null
pointer panics after the previous bug was fixed.
Improved error handling:
- If an i/o is aborted, arrange to reset in the state machine before
doing the next i/o. New fdc flag for this. This fixes spurious
warnings and lengthy busy-waiting for the next i/o.
- Split STARTRECAL into RESETCOMPLETE and STARTRECAL and only check
for the results from reset if we actually reset. This fixes spurious
warnings for other paths to STARTRECAL. [Oops, it may break reset
handling for motor-off resets.]
Cleanups in fd_timeout():
- Renamed to fd_iotimeout() to make it clearer that it is only used
for i/o.
- Don't handle the bp == 0 case. This case can't happen for i/o.
- Don't check for controller-busy. We know it must be.
- Don't print anything. retrier() already prints too much for normal
errors.
- Fudge the state differently so that the state machine advances
fdc->retry and the status is invalid (perhaps this should fudge a
valid state like the one for WP).
- Style fixes.
protection checks. Using the partition-relative blkno in some
parts broke the write protection for partitions at unusual
offsets (only for partitions at offset 1 on i386's).
several new features are added:
- support vc/vp shaping
- support pvc shadow interface
code cleanup:
- remove WMAYBE related code. ENI WMAYBE DMA doen't work.
- remove updating if_lastchange for every packet.
- BPF related code is moved to midway.c as it should be.
(bpfwrite should work if atm_pseudohdr and LLC/SNAP are
prepended.)
- BPF link type is changed to DLT_ATM_RFC1483.
BPF now understands only LLC/SNAP!! (because bpf can't
handle variable link header length.)
It is recommended to use LLC/SNAP instead of NULL
encapsulation for various reasons. (BPF, IPv6,
interoperability, etc.)
the code has been used for months in ALTQ and KAME IPv6.
OKed by phk long time ago.
best place to set it, and the wd and wfd strategy routines don't
set it (for failed transfers) because they expect dscheck() to
initialize everything necessary. dscheck() has always set B_ERROR,
but this is not quite sufficient, because b_resid is used by physio()
to decide how much of a B_ERROR'ed i/o was done.
formats and args to match. Fixed old printf format errors (all related;
most were hidden by calling printf indirectly).
This change somehow avoids compiler bugs for 64-bit longs on i386's,
although it increases the number of 64-bit calculations.
fork_trampoline() if switchtime is valid. This fixes not accounting
for the time between the previous context switch and and the current
time (when the forked child starts up here) in most cases - the time
is now counted in the child's runtime. I think it actually fixes
all cases, and switchtime is always valid here, since there must have
been a context switch just before the forked child starts up. Some
code should be removed if this is correct. The check that switchtime
is valid sometimes gives a false negative because the check isn't
correct until the after the first context switch after the system
has been up for >= 1 second.
The machine can not recognize this PD drive
as neither PD drive nor CD-ROM Drive.
So I can not use CD-ROMs and PDs from FreeBSD.
PR: 7423
Reviewed by: phk
Submitted by: Takura Koyama <takura@popweb.ne.jp>
timeslice of the exiting process was counted for both the exiting
process and the next process to run if the next process runs
immediately.
Broken in: mostly in kern_clock.c rev.1.70 (1998/05/28)
potentially re-use the stack page.
Cosmetic cleanup of the code to de-obfuscate it and make it easier
to follow. There should be no functional changes in this commit.
but isn't valid.
Reimplement pmap_remove() to be much more efficient at removing large
stretches of addresses.
As part of reimplementing pmap_remove() fix pmap_protect() so that it stands
a hope of working.
Change the port address argument to pci_map_port to pci_port_t* which is
defined as u_int on the alpha, u_short on i386. This is a stopgap with a
hopefully limited lifetime.
Discussed with: Stefan Esser <se@freebsd.org>
code still left in there. The macros it describes disapeared some-
time since 4.4BSD lite.
PR: 7246
Reviewed by: phk
Submitted by: Stefan Eggers <seggers@semyam.dinoco.de>
Callers only need to initialize d_secperunit now, but should
initialize d_type (to reduce the IDE/SCSI confusion), d_typename
(put the disk model in it) and geometry info (if it isn't completely
ficticious). Callers will soon need to initialize d_secsize.
normally only defined in opt_devfs.h, so testing it before including
anything is normally a no-op. Undef'ing DEVFS before including
opt_devfs.h is similarly useless. OTOH, DEVFS support for sliced
but not SLICEd (despite defined(SLICE)) devices is either harmless
(if there are no such devices, then nothing in this file is used)
or necessary (otherwise). It even seems to work for sliced cd
devices.
small part of a bug suite beginning in the SLICE probes but mostly in the
floppy driver. This is a quick fix: the auto case shouldn't be special;
DMA should also be stopped in isa_dma_release(); isa_dmastop() probably
shouldn't exist; common DMA registers should not be accessed without
locking.
controller reports a successful seek, it is very unlikely to report
seeking to a cylinder other than the one requested, but we check for
this, and botched the error handling for the requested_cylinder != 0
case. This error happened when the bug fixed in rev.1.52 of <sys/buf.h>
caused the head of buffer queue to change to one starting on a different
cylnder - the requested cylinder was found, but it wasn't what we
thought we requested. The fix is simply to arrange to reset the state
machine.
Corruption of the buffer queue seems to only have been a problem in the
floppy driver. Other drivers dequeue the head of the queue before doing
physical i/o on it, so the corruption at worse broke the elevator sort
order. Dequeueing breaks it anyway.
These asm statments are not quite as pessimal as when I complained
about them in rev.1.9 of audio.c. They seem to be only 40% slower
than the C version on P5's and the same speed on K6's.
to int32_t's and all unsigned longs to u_int32_t's. Fixed the one
printf format broken by this. The old math emulator now compiles
cleanly on i386's with 64-bit longs. It may even work, provided
suword() doesn't actually write a long.
nearly so many casts here. Casting an pointer that was an integer
back to an integer just to compare it with -1 is bad, and casting
it back just to compare it with NULL is just wrong.
Access the entry address as a uintfptr_t, not as a long, and not
necessarily as what modload(8) passes (it takes a u_long from the
exec header and passes a u_int).
Fixed bitrot in K&R support (suword() now takes a long word).
Didn't fix corresponding bitrot in store.9 and fetch.9.
The correct types for the store and fetch families are problematic.
The `word' functions are unfortunately named and need to be split
to handle ints/longs/object pointers/function pointers. Storing
argv[] as longs is quite broken when longs are longer than pointers,
but usually works because it clobbers variables that will soon be
reinitialized.
Hopefully caddr_t is large enough to hold function pointers.
Cast object pointers to uintptr_t before casting them to u_long.
Types are wronger than usual for the PT_READ_U case. ptrace() can
only return ints, but longs are accessed.
respectively. Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.
casting them to long, etc. Fixed some nearby printf bogons (sign
errors not warned about by gcc, and style bugs, but not truncation
of vm_ooffset_t's).
casting them to long, etc. Fixed some nearby printf bogons (sign
errors not warned about by gcc, and style bugs, but not truncation
of vm_ooffset_t's).
Use slightly less bogus casts for passing pointers to ddb command
functions.
to [u]intptr_t instead of to [u_]long.
Don't cast pointers to integers just to do ordinary pointer arithmetic
on them, especially when the casts use gcc's feature of casting lvalues.
suitable for holding object pointers (ptrint_t -> uintptr_t).
Added corresponding signed type (intptr_t). Changed/added
corresponding non-C9x types for function pointers to match. Don't
use nonstandard types to implement these types, and don't comment
on them in <machine/types.h>.
cure the problems I was having with interrupts not being acknowledged
on time. This fixes a problem I observed where starting two ping -f
processes at 10Mbps would cause an adapter check due to TX GO commands
being issued before TXEOC interrupts were being acked.
Also fix a small problem with tl_start(): the mechanism I was using
to queue new packets onto the TX chain was bogus.
Change adapter check handler so that it resets card state after
tl_softreset() is stored.
Moved all EEPROM-related macro definitions into if_tlreg.h.
Don't allow an autoneg session to start until after the TX queue has
been drained, and don't transmit anything until after the autoneg
session is complete.
Also add support for two more Compaq ThunderLAN-based cards, and three
cards from Olicom which also use the ThunderLAN chip. The only thing
different about the Olicom cards is that they store the station address
at a different location within the EEPROM.
`len = min(so->so_snd.sb_cc, win) - off;'. min() has type u_int
and `off' has type int, so when min() is 0 and `off' is 1, the RHS
overflows to 0U - 1 = UINT_MAX. `len' has type long, so when
sizeof(long) == sizeof(int), the LHS normally overflows to to the
correct value of -1, but when sizeof(long) > sizeof(int), the LHS
is UINT_MAX.
Fixed some u_long's that should have been fixed-sized types.
mismatches exposed by this (the prototype for tcp_respond() didn't
match the function definition lexically, and still depends on a
gcc feature to match if ints have more than 32 bits).
sizeof(struct bpf_hdr) > 20. 20 is normal on 32-bit systems with
32-bit alignment, but we still assume that the last 2 bytes of the
struct are unnecessary padding on such systems. On systems with
64-bit longs, struct timeval is bloated to 16 bytes, so bpf headers
certainly don't fit in 18 bytes.
interupt level events. This needs a lot of cleanup, but has been working
here for a month or two.. originally needed for CAM integration
but that hasn't happenned yet. The probing state machines for each
handler should be replaced by a more generic state-service. It's
still quite messy in there..
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family. err() isn't quite printf-like since its format arg can
legitimately be NULL. syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.
hidden). Now "ticks" are used, which are 4 byte, not 8 byte in size.
The size mismatch did not matter due to sufficient padding at the end
of the structure that holds time stamps (there is an unused member).
The fix suggested by Bruce Evans used "sizeof (ticks_t)", but I prefer
to use "sizeof ticks", and didn't seem to object in his last mail on
this topic.
Submitted by: bde
mostly for objects that have the fewest dependencies on `Makefile'
(since they were mostly for utilities and objects generated from *.s
and these don't depend on profiling flags).
Give an explicit rule for building vnode_if.o. This fixes building
it without ${PROF}.
Use .ORDER instead of a stamp file to avoid building vnode_if.[ch]
concurrently.
Removed explicit dependencies that will be generated by `make' (.c.o)
or will be generated by mkdep.
Added missing dependencies of special objects on opt_global.h.
Use ${NORMAL_C} instead of special rules for special objects where
possible.
FIxed dependencies of vers.o.
just to ensure 32-bit variables. Doing so broke and/or pessimized
i386's with 64-bit longs (unnecessary use of 64-bit variables
caused remarkably few problems in C code, but the inline asm here
tended to fail because there are no 64-bit registers). Since the
interfaces here are very machine-dependent and shouldn't be used
outside of the kernel, use a standard types of "known" width instead
of fixed-width types.
Changed all quad_t's to u_int64_t's. quad_t isn't standard, and
using signed types for 64-bit registers was bogus (but made no
difference).
to ensure 32-bit variables. Doing so broke i386's with 64-bit
longs. Use fixed-size integral types instead of plain ints, shorts,
chars and pointers since the bootinfo struct layout is a binary
interface. The boot blocks could reasonably be implemented using
16-bit code.