Note on multi-architecture kernels: most architecture dependent traps are
forked off directly by having a separate trap table for each (sun4,sun4c,sun4m)
This reduces the number of tests on `cputyp' significantly, and it's easier
on the mind. There are still some entry points that need to test `cputyp',
most notably microtime().. yuck.
Note: multi-architecture kernels use function pointers for several PMAP
entry points.
Cut down the `#if defined(SUN4*)' mess severely by using CPU_ISSUN4*
macros (see machine/param.h) wherever possible.
- getcontext() fills the stack_t portion of the context with an 8k size
stack, 0 flags, and below our current stack pointer. I am not sure where
to set the pointer. Thanks pk [2-2] for noticing that.
Now netscape and java work...
- split softc size and match/attach out from cfdriver into
a new struct cfattach.
- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
- softclock was called with extra argument.
- missing %x formats in printf's
- kgdb_copy called with only two arguments.
Fix conf.c so that it used the _conf.h files from other places instead of
rolling its own.
[these bugs apply to the xy as well as the xd driver]
[1] check return value from malloc() for NULL before trying to bzero it.
[2] use "=" rather than "|=" when writing to CSR (otherwise you may
ACK something you don't mean to!).
[1] check return value from malloc() for NULL before trying to bzero it.
[2] use "=" rather than "|=" when writing to CSR (otherwise you may
ACK something you don't mean to!).
execpt without quotes. meant to be __CONCAT()ted for easy #includes
of machine-dependent headers for MI code (e.g. for the MI ISA/EISA/PCI/TC
bus code).
of bwtwo, cgfour, cgsix, and cgeight. Includes support for attaching
the overlay plane of the cgfour and cgeight as a bwtwo instance (a'la
SunOS).
P4 register descriptions, cgfour driver, and cgeight driver partially
derived from OpenBSD.
This code may still need polishing.
Apparently, some early 4/100 DMA controllers do illegal memory access on
large ( >= NBPG ) transfers at the end of the transfer. This appears
as SI_CSR_DMA_BUS_ERR in the csr. To work around this, we simply
transfer the (up to 3) missing bytes from the bpr. We were doing this
anyway, so the work-around is to ignore the bus error.
BUT! I goofed when I implemented the "left-over byte" code for the sw!
It *should* be correct now. Keep metrics (acceeible via DDB) on the number
of 1, 2, and 3 byte clean-ups, as well as the number of "clean" transfers,
just so we can get a clearer picture.
Thanks to Andrew Gillham <gillham@whirlpool.com> for noticing this!
only get these during autoconfiguration and during crash dumps. During
autoconfiguration, the transfers are small enough that DVMA won't be used
anyway. However, using DVMA during a crash dump can be dangerous,
depending on the nature of the panic, so we avoid it.
Correct the DMA transfer count when the target disconnects before
the whole transfer is completed. (Affects VME writes)
Reselect now works on the VME si board!
obio framebuffer. Noticed when my 4/260 dropped into DDB and the screen
didn't unblank. Pull all of the video enable/disable into functions so
this mishap doesn't happen again.
rather than SEEKCOMPLETE before retrying the operation. If implied seeks
are being used, the state is set to DOIO (no change). This is why I
couldn't reproduce the disk_unbusy() panic on my SS2; it uses implied
seeks. Patch from John F. Woods <jfw@jfwhome.funhouse.com>
[prevents disk_unbusy panic when disk is loaded (if no
free IOPBs, xdstrategy() would queue the buffer for pickup
by xdcintr() but xdcintr() would never call disk_busy().
xdc_startbuf() is a better place since all bufs are routed
through here] problem detected by girish@dworkin.wustl.edu,
diagnosed and corrected by me.
- move disk_unbusy() call in xdc_remove_iorq() before the call to
XDC_FREE() [don't want to access a data structure that was just put
on a free list]
- Better disklabel handling. While a disklabel isn't used
in the driver, some versions of the OpenPROM insist on
one being present in order to boot from floppy. These
changes provide a default label (in a way similar to how
the SCSI disk driver provides a default) so that a user
can more easily place the label on the disk.
- Fix semi-bug in bootpath handling. It appears as if the
bootpath can appear in a couple of formats: "/fd@0,0", which
is what bootpath_fake() creates on v0 proms and may be
passed by some v2 proms, and "/fd0" which is what the
v2 prom on my SS2 passes. We now handle both formats.
- Use a mountroot hook to eject the floppy and wait for
the user to insert a filesystem floppy if we're the boot/root
device.
zero since xycmatch no longer sets it). [if you call mapiodev()
with a zero size it will reuse the KVA it returns, swiping the device
out from under you!]
- make xyc->iopbase point in the kernels DVMA space rather than at the
normal malloc'd KVA. this isn't compatable with sun4m [doesn't
have a kernel DVMA space] and will need to be changed later (XXX).
- move disk_attach() to before reading the disk label as per Jason.
otherwise we are reading into an unallocated buffer (oops!)
zero since xdcmatch no longer sets it). [if you call mapiodev()
with a zero size it will reuse the KVA it returns, swiping the device
out from under you!]
- make xdc->iopbase point in the kernels DVMA space rather than at the
normal malloc'd KVA. this isn't compatable with sun4m [doesn't
have a kernel DVMA space] and will need to be changed later (XXX).
- move disk_attach() to before reading the disk label as per Jason.
otherwise we are reading into an unallocated buffer (oops!)
device address (bus_tmp, bus_map, and mapiodev now do this for us).
also, we handle all our mappings, so don't have obio.c do any for us
(i.e. don't set ra->ra_len in xycmatch).
device address (bus_tmp, bus_map, and mapiodev now do this for us).
also, we handle all our mappings, so don't have obio.c do any for us
(i.e. don't set ra->ra_len in xdcmatch).
and thus probed the wrong address on the 4/300 (but it worked because
it was probing the esp0 registers!).
now that bus_tmp() adds the offset in for us [as of obio 1.19] i
discoved that a byte access to the dma registers is not allowed.
so, i've change probeget to use a word access.
page boundaries:
- change bus_tmp() to include the offset from the start of page in the
returned KVA [rather than forcing each driver to add it back in
individually]
- changed bus_map() to include the offset from the start of page in the
the returned value if a mapping is found in the PROM's KVA area
- clarified a few comments
- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.
- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.
- Several new functions for attaching and detaching disks, and
handling metrics calculation.
Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.
For usage and architectural details, see the forthcoming disk(9) manual
page.
utilizing David Jones' new MI NCR 5380 code. Ported from the sun3 ncr_si.c
and "sw" DMA code written by me.
This driver contains user-configurable "options", which can be set via the
"flags" directive in the kernel configuration file. By default, only
DMA is enabled. DMA completion interrupts and reselection may be enabled
by setting the appropriate bits with "flags". See si.c for details.
Note that DMA completion interrupts and reselection don't yet work on the
4/100 controller. I don't know why, and it's unlikely that I'll have
the opportunity to find out any time soon. DMA does work, and results
in a considerable performance increase.
DMA, DMA completion interrupts, and reslection all work on my 4/260 (VME)
system with modern SCSI-II disks.