are all the same, so eliminate the redundancy. also, use mrg's
"Version:" trick to find the version rather than using the RCS ID.
(I must have been having a ... bad day.) Also, bump boot and netboot
versions for all the changes that have been happening lately.
a data structure after it was freed. This wasn't actually a problem,
and the change caused the wrong pool_item_header to be freed
in the non-PR_PHINPAGE case.
in the air to deal with it.
Basically, following a kernel fault (eg. dereferencing a NULL pointer
in kernel mode) a DDB 'trace' did not show the function where the
fault occurred. For example:
db> trace
_Debugger()
_panic()
_trap()
faultstkadj()
_pool_drain()
_uvm_pageout()
_start_pagedaemon()
_proc_trampoline()
db>
The 'faultstkadj()' line here is bogus. It is shown because the return
address to 'trap()' happens to point there, and since faultstkadj() has
no stack frame, DDB assumes it was the faulting function. In this example,
the _real_ function was pool_reclaim(), but you would have to look at
the program counter at the time of the fault to figure that one out.
This fix makes the trace command do the dirty work for you by grubbing
around in 'trap()'s argument list to find the *real* PC value at the
time of the fault, replacing the 'faultstkadj()' line with the real
function's name.
* The MNT_UPDATE case had a null pointer dereference. (This is a good example
of why blindly adding bogus initializiers is a FUNDAMENTALLY BAD IDEA!)
* Make sure the whole ufsmount is zeroed, as the export code relies on this.
* If we decided to use the second/alternate superblock, make sure to copy the
in-core version from the right buffer.
Also, reenable NFS exporting.
board versions with no BIOS. Separate mailbox interrupts from
IOCB interrupts. Read OUTMAILBOX5 while RISC_INT is active- not
after you clear it (potential race condition). Clear out older broken
BIG_ENDIAN goop. Don't negotiate narrow/async for LVD busses at startup
if already in LVD mode. Note usage of presumptive 1040C revision. For
all the LIP, PDB Changed, Loop UP/DOWN async events, mark fw state
as unknown as well as marking the need to do a getpdb on targets- after
a LIP for certain the f/w has to do PRLI/PLOGI for all targets again
and marking f/w state as unknown gives us a fighting chance to (start
to) hold up for that to complete.
that will SBusify an isp header or the lun/target portions of a request IOCB-
and have these only valid iff __sparc__ (no non-sparc SBus machine that *I*
know about).
remote of the tunnel can be found.
XXX If you manually mark the interface as "UP" and set the MTU later
XXX sending a packet will still cause a kernel panic.
was deasserted and we wanted to change parameters to -crtscts
This effectively stalled the transmitter since with TS_BUSY set
we only change parameters during the Tx interrupt handler.
passing SIOCSIFADDR/SIOIFDSTADDR, but by passing the addresses in
the appropriate structs.
One of the mysteries of ifconfig IMHO...
Should fix kern/6899.
provides the correct functions for primary, secondary, and unified
boot blocks. actually behave correctly (e.g. expect correct arguments,
perform correct operations) depending on which you are. also
some minor cleanup.
guts were actually functionally equivalent to the current guts, but were
much larger, filled with bugs, and indeed poked around at the disklabel
when some of those bugs prevented them from ever using the disklabel!
had a few bugs fixed that let the problem slip in, and since bootxx's
Makefile now goes out of its way to satisfy installboot's undocumented
and totally unreasonable assumptions about the bootxx file it's operating
on. No point in fixing the assumptions, because sooner rather than later
this incarnation of installboot is going to die.
assuming that there's always going to be space for the whole boot
block info struct. (the assumption would cause a malloc'd region
to be overrun, if it proved false.)
are called from the interrupt or timeout handler, 0 otherwise.
- use this to know if we can busy-wait for wait_for_unbusy or wait_for_ready
This fixes a bug where CDs withot the DRQ_INTR capability would not busy-wait
for the CMDOUT phase.
While I'm there change 2 delay() to DELAY() for consistency, and
garbage-collect some old code from wdcintr() which has been ifdef'd out
for some time now.
TULIP_BUSMODE_BIGENDIAN does bswap packet buffers also, so we should use
TULIP_BUSMODE_DESC_BIGENDIAN on big-endian machines. (PR 7027)
XXX 21040 doesn't have this bit, but supporting only 21041+ is better than
nothing.
picking the bits we wanted explicitly, taking advantage of some of the
recent code-size trimming from cgd. There's now no duplication if libsa
code in sys/arch/pmax/stand.
As a bonus, we now have 416 bytes free in stage one (up from 80), and
will all of Chris' space saving options enabled (these are commented out
in scsiboot/Makefile), theres over a 1kB free.
Call configure() directly immediately after config_init().
This causes autoconfiguration to happen at the same time as before, but
creates some kernel submaps earlier, so that e.g. mbinit() can now
allocate memory.
- Protect userspace from unnecessary header inclusions (as noted on
current-users).
- Some const poisioning.
- GREATLY simplify the locking protocol, and fix potential deadlock
scenarios. In particular, assume that the back-end page allocator
provides its own locking mechanism (this is currently true for all
such allocators in the NetBSD kernel). Doing so allows us to simply
use one spin lock for serialized access to all r/w members of the pool
descriptor. The spin lock is released before calling the back-end
allocator, and re-acquired upon return from it.
- Fix a problem in pr_rmpage() where a data structure was referenced
after it was freed.
- Minor tweak to page manaement. Migrate both idle and empty pages
to the end of the page list. As soon as a page becomes un-empty
(by a pool_put()), place it at the head of the page list, and set
curpage to point to it. This reduces fragmentation as well as the
time required to find a non-empty page as soon as curpage becomes
empty again.
- Use mono_time throughout, and protect access to it w/ splclock().
- In pool_reclaim(), if freeing an idle page would reduce the number
of allocatable items to below the low water mark, don't.
- there are a couple of registers that are reset after the X server finishes,
which do not have the same values as they do when the machine is powered
on. If the two are mismatched you can't write to the video memory.
- video memory is mapped at offset 4MB to keep the X server happy
- there is now a VGA memory mapping
- DEBUG_ET4000 is now a bit more useful for debugging!
call to __main(), and therefore saves the size of the call and the
size of a stub implementation of __main().
in the primary boot block, don't bother saving/restoring the argument
passed in from the caller. There is no such argument (that we care
about, at least) to the primary. (for secondary, it's the firmware
FD being used.)
Clean up the "Region 1" related definitions, and define load addresses,
max load size, and max total size for as many boot block types as we can.
(types = unified, primary, secondary). We can't always define all
values for all boot blocks, though.
Make CPP flags selection less gross.
Use objcopy rather than headersize (yay, evil gets a stake to the heart!).
Use a little shell script to verify that the sizes of the boot blocks are OK.
Do not compile too much more of libsa than we actually have to.
size to be reduced substantially. (backward compatibility verified
by compiling one of the alpha boot blocks which uses all of the code
before and after, diffing the object files, and manually verifying that
the differences were 'correct'. some differences were "unavoidable,"
it wanting to avoid a double-commit, because e.g. local variables which
were previously used were no longer used.) a README which describes
supported options (or at least the ones mentioned below) is forthcoming.
add support for the preprocessor macro LIBSA_NO_TWIDDLE, which
causes calls to twiddle() to be omitted if it's defined.
add support for the preprocessor macros:
LIBSA_NO_FS_CLOSE
LIBSA_NO_FS_WRITE
LIBSA_NO_FS_SEEK
which, if defined, cause the corresponding file system operations
in the individual file system implementations to be omitted. (note
that all of those macros are not supported by all file systems at
this point. comments were added to individual file system files
to indicate lack of support, and should be cleaned up later. Backward
compatibility options e.g. UFS_NOCLOSE, etc., are supported.)
add support for the preprocessor macro LIBSA_NO_FS_SYMLINK, which
removes support for symbolic links from the file system support
functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_FS_SINGLECOMPONENT which
removes all subdirectory and symlink support from the file system
support functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_NO_FD_CHECKING, which
causes code relating to libsa file descriptor checks (e.g. range
checking and checking that a file descriptor is valid) to be
omitted if it's defined.
add support for the preprocessor macro LIBSA_NO_RAW_ACCESS, which
causes code relating to raw device access to be omitted if it's
defined.
change some structure copies to use bcopy() instead. that way
use of bcopy vs. memcpy() can easily be selected by
LIBSA_USE_MEMCPY. (without changes like these, you could end up
having both bcopy() and memcpy() included. eventually, all
calls to bcopy should be changed to calls to memcpy() or memmove()
as appropriate -- hopefully never the latter -- with an option to
use bcopy instead.)
add support for the preprocessor macro LIBSA_NO_DISKLABEL_MSGS, which
causes disklabel() to return '1' as msg rather than a string. Can
be used if the boot blocks don't care about the string, and need to
save the space.
add support for the preprocessor macro LIBSA_SINGLE_FILESYSTEM, which
if defined causes all of the file system switch code to be removed.
Its value should be the name of the file system supported by the
boot block, e.g. "ufs" for the FFS file system. calls to the
file system functions open, close, etc., which were previously
done through a function switch are then done via direct invocation
of <fs>_open, <fs>_close, etc. (e.g. ufs_open, ...).
add support for the preprocessor macro LIBSA_SINGLE_DEVICE, which
does the equivalent of LIBSA_SINGLE_FILESYSTEM but for the device
switch table. Device entry pointes are expected to be named
<dev>foo, e.g. the 'strategy' routine used when LIBSA_SINGLE_DEVICE
is set to 'disk' is diskstrategy.
make ufs.c f_nindir array be unsigned ints. the fact that it was signed
caused ufs.c to require signed division routines (which were otherwise
unnecessary for a small boot block).
a small implementation of memcpy(). libsa memcpy() wouldn't
do the right thing if LIBSA_USE_MEMCPY was defined, and the whole
point of that define is to get rid of either bcopy() or memcpy().
(cloned from the bcopy() code.)
NMBCLUSTERS for the mbuf cluster pool. On platforms which use direct-mapped
segments for pool pages (MIPS and Alpha), this makes NMBCLUSTERS actually
meaningful (such ports don't even allocate mb_map, as it is not used to
map mbuf cluster pages).
Improve the message logged at a maximum rate of once per second. The
new message: "WARNING: mclpool limit reached; increase NMBCLUSTERS".
In the back-end pool page allocator, remove the message about mb_map
being full. The message was not necessarily correct as the allocator
may have been starved for pages, rather than for space in the map. Also,
the hard limit on the mbuf cluster pool will be reached before the map
fills (the last cluster will always fit into the map), so the message
is redundant.
Add a comment in mbinit() about considering setting low water marks on
the mbuf and mbuf cluster pools.
- Add support for hard limits, with optional rate-limited logging of
a warning message when the pool limit is reached. (This will be used
to fix a bug in mbuf cluster allocation on the MIPS and Alpha ports.)
- Fix some locking protocol errors. This required splitting pr_flags
into pr_flags (which is protected by the spin lock) and pr_roflags (which
are `read only' flags, set when the pool is initialized, and never changed
again; these do not need to be protected by a mutex).
- Make the low water support actually mean something. When a low water
mark is set, add free items to the pool until the low water mark is
reached. When an item allocation causes the number of free items to
drop below the low water mark, make the pool catch up to it. This can
make the pool allocator more useful for several applications (e.g.
pmap `pv entry' management) and more robust for others (for e.g. mbuf
and mbuf cluster allocation, so that the pagedaemon can use NFS to clean
pages on diskless systems without completely running dry on buffers to
receive packets in during extreme memory shoratages).
- Add a comment where we sleep waiting for more pages for the back-end
page allocator. Specifically, instead of sleeping potentially forever,
perhaps we should just wake up once a second to try allocating a page
again. XXX Revisit this soon.
-read retries were botched, use the right sector count
-read-ahead buffer was effectively unused
-concentrate the handling of the weird BIOS geometry report at one place
-fallback for old floppies left cylinder count uninitialized
- ALIAS() is not needed, use XLEAF() or XNESTED() instead
- use AENT() instead of .aent
- _END_LABEL() is not needed (and was wrong)
- define ALEAF(), NLEAF(), NON_LEAF(), NNON_LEAF() by
XLEAF(), LEAF_NONPROFILE(), NESTED(), NESTED_NONPROFILE()
* We shouldn't truncate the file.
* We were leaving the vnode locked (unless the truncate happened to fail).
Solaris clients may cause this under some conditions.
Problem reported by chopps, analysis and fix by me.