Home | History | Annotate | Download | only in isa
History log of /src/sys/dev/isa/mcd.c
RevisionDateAuthorComments
 1.121  09-Sep-2021  riastradh sys/dev: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).
 1.120  24-Feb-2020  rin 0x%p --> %p for non-external codes.
 1.119  12-Nov-2019  msaitoh branches: 1.119.2;
Add missing initialization of sc_dev.
 1.118  24-Feb-2019  kamil branches: 1.118.4;
Add missing FALLTHROUGH in isa/mcd.c

Requested by GCC in NetBSD/i386 kUBSan KCOV build.

Reviewed by <mgorny>
 1.117  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.116  14-Jul-2016  msaitoh branches: 1.116.2; 1.116.8; 1.116.10; 1.116.16; 1.116.18;
- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
 1.115  26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.114  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.113  25-Jul-2014  dholland branches: 1.113.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.112  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.111  16-Mar-2014  dholland branches: 1.111.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.110  27-Oct-2012  chs branches: 1.110.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.109  12-May-2009  cegger branches: 1.109.12; 1.109.22;
struct device * -> device_t, no functional changes intended.
 1.108  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.107  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.106  13-Jan-2009  yamt branches: 1.106.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.105  08-Jun-2008  tsutsui branches: 1.105.6;
Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.
 1.104  08-Apr-2008  cegger branches: 1.104.2; 1.104.4; 1.104.6;
use aprint_*_dev and device_xname
 1.103  05-Dec-2007  ad branches: 1.103.12;
lockmgr -> mutex
 1.102  19-Oct-2007  ad branches: 1.102.2; 1.102.4;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.101  08-Oct-2007  ad branches: 1.101.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.100  29-Jul-2007  ad branches: 1.100.4; 1.100.6; 1.100.8; 1.100.10;
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.99  09-Jul-2007  ad branches: 1.99.2;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.98  30-Jun-2007  dsl The cd ioctl definitions are not condusive to being called from within
the kernel (eg from withthe linux compat code).
Add CDIOCREADSUBCHANNEL_BUF and CDIOREADTOCENTRIES_BUF which are like the
existing ioctls withoutthe _BUF, except that the data area immediately
follows the control structure (and is fixed length).
Modify scsipi/cd.c so that it only ever has one 'struct cd_formatted_toc'
allocated on the stack (maybe this info ought to be in the softc)
structure since even one 800 byte on-stack buffer isn't overly friendly.
cdplay(1) still seems able to read the track-list of an ATAPI cd.
 1.97  04-Mar-2007  christos branches: 1.97.2; 1.97.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.96  16-Nov-2006  christos branches: 1.96.4;
__unused removal on arguments; approved by core.
 1.95  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.94  02-Sep-2006  christos branches: 1.94.2; 1.94.4;
add missing initializer
 1.93  13-Apr-2006  christos PR/29683: Sergey Svishchev: Make this compile again..
 1.92  11-Dec-2005  christos branches: 1.92.4; 1.92.6; 1.92.8; 1.92.10; 1.92.12;
merge ktrace-lwp.
 1.91  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.90  12-Mar-2005  christos branches: 1.90.4;
PR/29683: M. B. Buchanan: mcd driver has printf formatting compile issue
and sets the wrong field to the number of ports.
 1.89  27-Feb-2005  perry nuke trailing whitespace
 1.88  04-Feb-2005  perry de-__P
 1.87  28-Oct-2004  yamt branches: 1.87.4; 1.87.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.86  14-Sep-2004  drochner Separate the namespace for default (ie unspecified) locators used
by the isa.c bus driver and the "address/whatever not specified"
argument passed to leaf device drivers.
The former is "ISACF_XXX_DEFAULT" as generaterd by config(8), the latter
"ISA_UNKNOWN_XXX", defined in isavar.h.
This way we save a dependency of every ISA device driver on "locators.h".
 1.85  07-Nov-2003  mycroft Replace home-grown locks with lockmgr().
 1.84  29-Jun-2003  fvdl branches: 1.84.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.83  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.82  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.81  01-Nov-2002  mrg implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.80  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.79  02-Oct-2002  thorpej Fix sizeof and whitespace bug from the script I'm using to do the
CFATTACH_DECL conversion. (Grumble.)
 1.78  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.77  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.76  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.75  24-Jul-2002  hannken Convert to new device buffer queue interface.
 1.74  07-Jan-2002  thorpej branches: 1.74.8;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.73  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.72  13-Nov-2001  lukem add RCSID
 1.71  18-Jul-2001  thorpej branches: 1.71.2;
bzero -> memset
 1.70  10-Feb-2001  taca branches: 1.70.2; 1.70.4;
Insert missing '#' for cpp(1). This should close PR/12167.
 1.69  08-Jan-2001  fvdl Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
 1.68  07-Jan-2001  fvdl Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
 1.67  06-Jul-2000  thorpej Use device_lookup().
 1.66  23-Mar-2000  thorpej branches: 1.66.4;
New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.65  07-Feb-2000  thorpej Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle. Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
 1.64  21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.63  08-Feb-1999  bouyer branches: 1.63.8;
Change DIOCEJECT to do what's needed to eject a device before the eject
command (unlock for sd and cd) if no other partitions are open, return
EBUSY otherwise. DIOCEJECT will have the old semantic if its argument is not
0. The old ioctl has been renamed to ODIOCEJECT for binary compatibility.
 1.62  23-Jun-1998  jonathan * Add defopt MCD_PROMISC for more conservative probes.
Before, the probe routine (mcd_find() would succeed even if the probe
code thought it had a response, but didn't recognize the ID-code byte.
Now, only do the promiscuous match if MCD_PROMISC is configured.
 1.61  09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.60  14-Jan-1998  drochner make it compile without BROKEN_INDIRECT_CONFIG
 1.59  12-Jan-1998  thorpej Update for config changes.
 1.58  11-Nov-1997  fvdl Add missing ;
 1.57  20-Oct-1997  thorpej branches: 1.57.2;
Don't panic if we fail to remap i/o or mem space in the attach function.
Instead, print a diagnostic and return. (Some drivers do this already.)

Also, normalize the diagnostic message, and fix some places where the
printfs were getting ugly.
 1.56  19-Oct-1997  thorpej Make sure the i/o and/or mem addresses aren't wildcarded (i.e. -1) before
using the address in a bus_space_map() call.
 1.55  08-Oct-1997  thorpej Implement DIOCGDEFLABEL.
 1.54  14-Jun-1997  thorpej branches: 1.54.4;
Make this compile again in light of recent changes to cdio.h
 1.53  04-Apr-1997  christos Busify the driver (from perry).
 1.52  05-Nov-1996  mikel Eliminate unsolicited spewage; PR #2108.
 1.51  13-Oct-1996  christos backout kprintf changes
 1.50  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.49  12-May-1996  mycroft Use intr.h.
 1.48  29-Apr-1996  christos Fix gcc -Wall warnings.
 1.47  11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.46  17-Mar-1996  thorpej New device attachment scheme:

- 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.
 1.45  30-Jan-1996  thorpej Accept DIOCEJECT as a synonym for CDIOCEJECT. Implement DIOCLOCK
separately from CDIOCALLOW and CDIOCPREVENT, even though they perform
basically the same function (with a different interface XXX).
 1.44  07-Jan-1996  thorpej New generic disk framework. Highlights:

- 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.
 1.43  24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.42  05-Aug-1995  mycroft Use an intermediate variable to shorten label initialization code.
 1.41  10-Jul-1995  cgd fix from Onno van der Linden for large-file read timeouts on double-speed
drives. A different read command must be used on double-speed drives.
It boggles my mind that people could design hardware this stupid.
 1.40  05-Jul-1995  mycroft Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely. Remove d_strategy from cdevsw to
force the abstraction barrier.
 1.39  26-Jun-1995  cgd make dump stubs consistent
 1.38  27-Apr-1995  mycroft Turn off some debugging code by default.
 1.37  17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.36  15-Apr-1995  mycroft Don't boundary check I/O to the `raw' partition.
 1.35  01-Apr-1995  mycroft Insert a missing unlock.
 1.34  01-Apr-1995  mycroft Change the locking protocol to match other drivers.
 1.33  01-Apr-1995  mycroft Always load the TOC. Turn off the TOC bit in the mode register so the busy
light goes off.
 1.32  27-Mar-1995  mycroft Remove unused variable.
 1.31  27-Mar-1995  mycroft Remove a tiny bit of redundant code.
 1.30  27-Mar-1995  mycroft It's not necessary to do a GETSTAT before each read.
 1.29  27-Mar-1995  mycroft Small garbage collection, and turn off debugging info by default.
 1.28  27-Mar-1995  mycroft Largely rewritten by me, with some input from Dave Burgess. Implement most of
the CDIOC* calls correctly, improve performance by 10x when interrupts work,
and implement the same generic disk framework as other drivers.
Needs some more work.
 1.27  29-Jan-1995  cgd lip service to making ISA support machine-independent. This is the first
round: moving the drivers into a machine-independent directory.
Some drivers (e.g. fd.c) not moved because they use other pc features (e.g.
CMOS settings), and none of the non-driver files moved, because they're
still pretty much PC specific. eventually (when other ports with ISA
busses really start using this code), more 'high-level' ISA support will
live here.
 1.26  03-Jan-1995  mycroft Add interrupt sharing types.
 1.25  14-Dec-1994  mycroft Remove dkbad.h.
 1.24  18-Nov-1994  mycroft Convert port, IRQ, and DRQ numbers to ints.
 1.23  03-Nov-1994  mycroft Use indirect config for subdevices, and add dkdrivers where missing.
 1.22  30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.21  28-Oct-1994  mycroft Various:
* Forget all cached info when opening a new disc.
* If the disc is removed, flush the buffer queue rather than stalling it.
* Set the default label after getting the disc size, and fill in the info
for RAW_PART also.
* Change another use of the unit number to a softc pointer.
* Use a dkdevice to hold the label and open partition masks.
* Force the partition offset to 0 for RAW_PART, regardless of the label.
* Nuke MCDPHYS() and MCDREADRAW; they had a silly bug that caused the code
to not work, and they aren't useful anyway.
Some other minor cleanup.
 1.20  27-Oct-1994  cgd new RCS ID format.
 1.19  14-Oct-1994  cgd move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS.
 1.18  05-Aug-1994  mycroft Fix spelling of `STEREO'.
 1.17  03-Aug-1994  mycroft Add a missing splx() and increase the reset delay during probe, as suggested
by Juergen Keil. Add a diagnostic message if the controller info is not what
we expect.
 1.16  16-Jun-1994  mycroft branches: 1.16.2;
b_un.b_addr -> b_data
 1.15  11-May-1994  mycroft Add dummy *dump() routines.
 1.14  05-May-1994  mycroft Retool the state machine is a sane way.
 1.13  05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.12  22-Apr-1994  mycroft Don't need isa.h.
 1.11  08-Apr-1994  mycroft Small fix to attach message.
 1.10  08-Apr-1994  mycroft Fix return values from some interrupt routines.
 1.9  07-Apr-1994  mycroft Implement dynamic IRQ configuration and IRQ sharing. Inline spl*() calls.
Reorganize and clean up the relevant code.
 1.8  29-Mar-1994  mycroft Updates for new autoconfig.
 1.7  06-Mar-1994  mycroft DELAY() --> delay(). This is not a macro.
 1.6  21-Feb-1994  mycroft Fixed probe routine from Holger Veit; lots of other cleanup by me.
 1.5  09-Feb-1994  mycroft All ioctl routines take a struct proc * now.
 1.4  06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.3  20-Dec-1993  mycroft Canonicalize all #includes, and add pio.h where appropriate.
 1.2  17-Nov-1993  cgd added two copyright strings at the request of Gary Clark II
<gclarkii@freefall.cdrom.com>, because he hacked and is in the process
of hacking the code significantly.
 1.1  04-Nov-1993  cgd branches: 1.1.2;
add mcd: Mitsumi CD driver by Holger Veit and Brian Moore
 1.1.2.7  06-Feb-1994  mycroft Use b_actf, not av_forw.
 1.1.2.6  02-Feb-1994  mycroft Various cleanup.
 1.1.2.5  02-Feb-1994  mycroft Change second arg of probe to self, in preparation of changing subr_autoconf.
 1.1.2.4  02-Feb-1994  mycroft Updates from Gary Clark II; may need more work.
 1.1.2.3  01-Feb-1994  mycroft Updates from main branch.
 1.1.2.2  29-Nov-1993  mycroft Forgot to #include pio.h and cpu.h.
 1.1.2.1  29-Nov-1993  mycroft Converted. Needs testing.
 1.16.2.2  05-Aug-1994  mycroft update from trunk
 1.16.2.1  03-Aug-1994  cgd from trunk
 1.54.4.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.57.2.1  12-Nov-1997  mellon Pull rev 1.58 up from trunk (fvdl)
 1.63.8.3  11-Feb-2001  bouyer Sync with HEAD.
 1.63.8.2  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.63.8.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.66.4.2  26-May-2001  he Apply patch (requested by wiz):
Correct typo related to __HAVE_OLD_DISKLABEL changes.
 1.66.4.1  01-May-2001  he Pull up revisions 1.68-1.69 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
 1.70.4.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.70.4.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.70.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.70.4.1  03-Aug-2001  lukem update to -current
 1.70.2.9  11-Nov-2002  nathanw Catch up to -current
 1.70.2.8  18-Oct-2002  nathanw Catch up to -current.
 1.70.2.7  17-Sep-2002  nathanw Catch up to -current.
 1.70.2.6  01-Aug-2002  nathanw Catch up to -current.
 1.70.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.70.2.4  11-Jan-2002  nathanw More catchup.
 1.70.2.3  08-Jan-2002  nathanw Catch up to -current.
 1.70.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.70.2.1  24-Aug-2001  nathanw Catch up with -current.
 1.71.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.74.8.2  29-Aug-2002  gehenna catch up with -current.
 1.74.8.1  16-May-2002  gehenna Add the block/character device switches.
 1.84.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.84.2.8  01-Apr-2005  skrll Sync with HEAD.
 1.84.2.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.84.2.6  04-Feb-2005  skrll Sync with HEAD.
 1.84.2.5  02-Nov-2004  skrll Sync with HEAD.
 1.84.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.84.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.84.2.2  03-Aug-2004  skrll Sync with HEAD
 1.84.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.87.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.87.6.1  12-Feb-2005  yamt sync with head.
 1.87.4.1  29-Apr-2005  kent sync with -current
 1.90.4.5  07-Dec-2007  yamt sync with head
 1.90.4.4  27-Oct-2007  yamt sync with head.
 1.90.4.3  03-Sep-2007  yamt sync with head.
 1.90.4.2  30-Dec-2006  yamt sync with head.
 1.90.4.1  21-Jun-2006  yamt sync with head.
 1.92.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.92.10.1  19-Apr-2006  elad sync with head.
 1.92.8.2  03-Sep-2006  yamt sync with head.
 1.92.8.1  24-May-2006  yamt sync with head.
 1.92.6.1  22-Apr-2006  simonb Sync with head.
 1.92.4.1  09-Sep-2006  rpaulo sync with head
 1.94.4.2  10-Dec-2006  yamt sync with head.
 1.94.4.1  22-Oct-2006  yamt sync with head
 1.94.2.1  18-Nov-2006  ad Sync with head.
 1.96.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.97.4.1  11-Jul-2007  mjf Sync with head.
 1.97.2.7  23-Oct-2007  ad Sync with head.
 1.97.2.6  20-Aug-2007  ad Sync with head.
 1.97.2.5  20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.97.2.4  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.97.2.3  15-Jul-2007  ad Sync with head.
 1.97.2.2  01-Jul-2007  ad Adapt to callout API change.
 1.97.2.1  09-Jun-2007  ad Sync with head.
 1.99.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.100.10.2  29-Jul-2007  ad 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.100.10.1  29-Jul-2007  ad file mcd.c was added on branch matt-mips64 on 2007-07-29 12:50:22 +0000
 1.100.8.1  14-Oct-2007  yamt sync with head.
 1.100.6.2  09-Jan-2008  matt sync with HEAD
 1.100.6.1  06-Nov-2007  matt sync with HEAD
 1.100.4.2  09-Dec-2007  jmcneill Sync with HEAD.
 1.100.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.101.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.102.4.1  08-Dec-2007  ad Sync with head.
 1.102.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.103.12.4  17-Jan-2009  mjf Sync with HEAD.
 1.103.12.3  29-Jun-2008  mjf Sync with HEAD.
 1.103.12.2  02-Jun-2008  mjf Sync with HEAD.
 1.103.12.1  05-Apr-2008  mjf - add "file-system DEVFS" and "pseudo-device devfsctl" to conf/std seeing
as these are always needed.

- convert many, many drivers over to the New Devfs World Order. For a
list of device drivers yet to be converted see,
http://www.netbsd.org/~mjf/devfs-todo.html.

- add a new device_unregister_all(device_t) function to remove all device
names associated with a device_t, which saves us having to construct
device names when the driver is detached.

- add a DEV_AUDIO type for devices.
 1.104.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.104.4.2  16-May-2009  yamt sync with head
 1.104.4.1  04-May-2009  yamt sync with head.
 1.104.2.1  17-Jun-2008  yamt sync with head.
 1.105.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.105.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.106.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.109.22.3  03-Dec-2017  jdolecek update from HEAD
 1.109.22.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.109.22.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.109.12.2  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.109.12.1  30-Oct-2012  yamt sync with head
 1.110.2.1  18-May-2014  rmind sync with head
 1.111.2.1  10-Aug-2014  tls Rebase.
 1.113.4.3  05-Oct-2016  skrll Sync with HEAD
 1.113.4.2  06-Jun-2015  skrll Sync with HEAD
 1.113.4.1  06-Apr-2015  skrll Sync with HEAD
 1.116.18.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.116.18.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.116.18.1  10-Jun-2019  christos Sync with HEAD
 1.116.16.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.116.10.2  21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1835):

sys/dev/pci/if_iwi.c: revision 1.117
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401
sys/dev/scsipi/ses.c: revision 1.52
sys/dev/isa/mcd.c: revision 1.121
(all via patch)

sys/dev: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).
 1.116.10.1  14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1439):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.


Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.


Add missing initialization of sc_dev.
 1.116.8.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.116.2.2  25-Jul-2016  pgoyette Redo previous
 1.116.2.1  25-Jul-2016  pgoyette Update a few drivers for localcount(9)
 1.118.4.2  03-Aug-2022  martin Pull up following revision(s) (requested by riastradh in ticket #1485):

sys/dev/pci/if_iwi.c: revision 1.117
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401
sys/dev/scsipi/ses.c: revision 1.52
sys/dev/isa/mcd.c: revision 1.121

sys/dev: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).
 1.118.4.1  14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #425):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.

Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.

Add missing initialization of sc_dev.
 1.119.2.1  29-Feb-2020  ad Sync with head.

RSS XML Feed