Home | History | Annotate | Download | only in vsa
History log of /src/sys/arch/vax/vsa/hdc9224.c
RevisionDateAuthorComments
 1.62  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.61  24-Apr-2021  thorpej branches: 1.61.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.60  03-Jun-2019  msaitoh branches: 1.60.12;
Fix typo in comment(s/similiar/similar/).
 1.59  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.58  22-May-2017  ragge branches: 1.58.8; 1.58.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.57  02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.56  31-Dec-2014  christos declare error
 1.55  31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.54  25-Jul-2014  dholland branches: 1.54.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.53  25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.52  25-Oct-2013  martin branches: 1.52.2;
Simplify (and remove now unused variable)
 1.51  14-Dec-2010  matt branches: 1.51.8; 1.51.18; 1.51.22;
Cleanup includes. Switch from <machine/XXX.h> to <sys/XXX.h> from
bus, cpu, and intr. Remove unneeded includes.
 1.50  21-Nov-2009  rmind branches: 1.50.4;
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
 1.49  26-Oct-2009  cegger kill extra whitespaces
reviewed by tsutsui@
 1.48  18-Mar-2009  cegger bcopy -> memcpy
 1.47  18-Mar-2009  cegger bzero -> memset
 1.46  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.45  13-Jan-2009  yamt branches: 1.45.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.44  15-Mar-2008  matt branches: 1.44.4; 1.44.12;
Switch to PRIVALLOC and device_* accessors
 1.43  11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.42  17-Oct-2007  garbled branches: 1.42.12; 1.42.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.41  08-Oct-2007  ad Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.40  29-Jul-2007  ad branches: 1.40.4; 1.40.6; 1.40.8;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.39  04-Mar-2007  christos branches: 1.39.2; 1.39.10; 1.39.12; 1.39.14;
Fix caddr_t fallout.
 1.38  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37  14-May-2006  elad branches: 1.37.14;
integrate kauth.
 1.36  28-Mar-2006  thorpej Use device_unit().
 1.35  23-Feb-2006  thorpej branches: 1.35.2; 1.35.4; 1.35.6;
Use device_parent().
 1.34  24-Dec-2005  perry branches: 1.34.2; 1.34.4; 1.34.6;
bare asm -> __asm
 1.33  11-Dec-2005  christos merge ktrace-lwp.
 1.32  15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.31  28-Oct-2004  yamt branches: 1.31.12;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.30  15-Jul-2003  lukem __KERNEL_RCSID()
 1.29  18-Jun-2003  drochner branches: 1.29.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.28  10-May-2003  thorpej Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.27  02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.26  02-Apr-2003  he Change SBSIZE -> SBLOCKSIZE, to track changes brought in with UFS2.
 1.25  01-Jan-2003  thorpej Use aprint_normal() for cfprint routines.
 1.24  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.23  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.21  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20  25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.19  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.18  22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.17  09-Nov-2001  matt branches: 1.17.2; 1.17.10;
Make this compile under ELF.
 1.16  26-Jul-2001  wiz branches: 1.16.2; 1.16.4;
Various typos in comments (neccessary, sceme, choise, ...).
 1.15  12-Apr-2001  thorpej branches: 1.15.2;
splimp -> splbio.
 1.14  04-Feb-2001  ragge branches: 1.14.2;
Giant update from Michael Kukat (michael@unixiron.org).
Fixes support for:
MicroVAX 3100m90
MicroVAX 3100m95
VAX 4000/100 (tested)
VAX 4000/105A (tested)
VAX 4000/108
VAX 4000/400 (tested)
VAX 4000/500 (tested)
VAX 4000/600
 1.13  29-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.12  27-Jun-2000  ragge Do 3 retries on a failing sector before giving up.
Clear pending interrupts before starting a DMA transfer. If an interrupt
occurs while the HDC9224 is doing DMA, the transfered data will be
scrambled (without giving any errors, quite bad).
 1.11  27-Jun-2000  mrg remove redundant vm includes.
 1.10  25-Jun-2000  ragge Make the HDC9224 MFM device driver up-to-date; has been not-working
since NetBSD 1.2 (!) It also uses interrupts instead of polling now.
Also fix the DMA area locking between SCSI and MFM disks.
Still missing - floppy support.
 1.9  13-Apr-1998  ragge branches: 1.9.14; 1.9.24;
Wall cleaning.
 1.8  24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.7  12-Jan-1998  thorpej Update for changes to config.
 1.6  15-Mar-1997  ragge Change the way boot device is figured out; now only using DEC numbers
and done when the device get attached.
 1.5  09-Mar-1997  ragge Fixed bug that caused d partition being treated as c.
RAW_PART is 2, not 3.
 1.4  13-Oct-1996  christos branches: 1.4.6;
backout previous kprintf change
 1.3  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2  27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.1  20-Jul-1996  ragge SCSI and ST506 support for the VAXstation architecture.
 1.4.6.1  12-Mar-1997  is Merge in changes from Trunk
 1.9.24.1  28-Jun-2000  ragge Pull up revision 1.10 + 1.12 (requested by ragge):
Fixes broken MFM support + DMA area queueing.
 1.9.14.3  21-Apr-2001  bouyer Sync with HEAD
 1.9.14.2  11-Feb-2001  bouyer Sync with HEAD.
 1.9.14.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.15.2.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.15.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.15.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1  03-Aug-2001  lukem update to -current
 1.16.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.16.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.17.10.2  31-Aug-2002  gehenna catch up with -current.
 1.17.10.1  19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.17.2.6  03-Jan-2003  thorpej Sync with HEAD.
 1.17.2.5  11-Nov-2002  nathanw Catch up to -current
 1.17.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.17.2.3  17-Sep-2002  nathanw Catch up to -current.
 1.17.2.2  01-Aug-2002  nathanw Catch up to -current.
 1.17.2.1  09-Nov-2001  nathanw file hdc9224.c was added on branch nathanw_sa on 2002-08-01 02:44:02 +0000
 1.29.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.29.2.5  02-Nov-2004  skrll Sync with HEAD.
 1.29.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.29.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.29.2.2  12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.29.2.1  03-Aug-2004  skrll Sync with HEAD
 1.31.12.4  17-Mar-2008  yamt sync with head.
 1.31.12.3  27-Oct-2007  yamt sync with head.
 1.31.12.2  03-Sep-2007  yamt sync with head.
 1.31.12.1  21-Jun-2006  yamt sync with head.
 1.34.6.1  22-Apr-2006  simonb Sync with head.
 1.34.4.1  09-Sep-2006  rpaulo sync with head
 1.34.2.1  01-Mar-2006  yamt sync with head.
 1.35.6.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.35.4.1  19-Apr-2006  elad sync with head - hopefully this will work
 1.35.2.1  01-Apr-2006  yamt sync with head.
 1.37.14.1  12-Mar-2007  rmind Sync with HEAD.
 1.39.14.1  15-Aug-2007  skrll Sync with HEAD.
 1.39.12.1  07-Aug-2007  matt Sync with HEAD.
 1.39.10.2  16-Oct-2007  garbled Sync with HEAD
 1.39.10.1  03-Oct-2007  garbled Sync with HEAD
 1.39.2.2  20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.39.2.1  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.40.8.1  14-Oct-2007  yamt sync with head.
 1.40.6.2  23-Mar-2008  matt sync with HEAD
 1.40.6.1  06-Nov-2007  matt sync with HEAD
 1.40.4.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.42.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.42.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.42.12.1  24-Mar-2008  keiichi sync with head.
 1.44.12.2  28-Apr-2009  skrll Sync with HEAD.
 1.44.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.44.4.2  11-Mar-2010  yamt sync with head
 1.44.4.1  04-May-2009  yamt sync with head.
 1.45.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.50.4.1  05-Mar-2011  rmind sync with head
 1.51.22.1  18-May-2014  rmind sync with head
 1.51.18.3  03-Dec-2017  jdolecek update from HEAD
 1.51.18.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.18.1  02-Dec-2012  tls Don't pass NULL struct dkdriver to disk_init. That's seriously bogus.
 1.51.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.52.2.1  10-Aug-2014  tls Rebase.
 1.54.4.2  28-Aug-2017  skrll Sync with HEAD
 1.54.4.1  06-Apr-2015  skrll Sync with HEAD
 1.58.10.1  10-Jun-2019  christos Sync with HEAD
 1.58.8.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.60.12.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.61.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed