Home | History | Annotate | Download | only in ppbus
History log of /src/sys/dev/ppbus/lpt.c
RevisionDateAuthorComments
 1.32  27-Dec-2019  msaitoh s/manaul/manual/ in comment.
 1.31  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.30  25-Jul-2014  dholland branches: 1.30.26; 1.30.28;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.29  16-Mar-2014  dholland branches: 1.29.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.28  16-Dec-2008  christos branches: 1.28.14; 1.28.24; 1.28.28;
replace bitmask_snprintf(9) with snprintb(3)
 1.27  16-Apr-2008  cegger branches: 1.27.4; 1.27.12;
device_t / softc split. From Hans Rosenfeld.
 1.26  15-Apr-2008  cegger Use %zu format specifier for size_t. Fixes build error on shark.
 1.25  15-Apr-2008  cegger Make this build without options LPT_VERBOSE and LPT_DEBUG. From Hans Rosenfeld.
 1.24  15-Apr-2008  cegger device_t / softc split. From Hans Rosenfeld
 1.23  08-Apr-2008  cegger use aprint_*_dev and device_xname
 1.22  27-Feb-2008  tsutsui struct lpt_softc doesn't have sc_dev in it. Use ppbus_dev.sc_dev.
 1.21  22-Feb-2008  dyoung Use device_t and accessors. Use &sc->sc_dev instead of cast to
device_t. Remove superfluous detach warning.
 1.20  19-Oct-2007  ad branches: 1.20.12; 1.20.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.19  04-Mar-2007  christos branches: 1.19.2; 1.19.14; 1.19.16; 1.19.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18  24-Oct-2006  drochner branches: 1.18.4;
add zero initializers to make that compile again
 1.17  29-Mar-2006  thorpej branches: 1.17.8; 1.17.10;
Use device_pprivate().
 1.16  25-Mar-2006  thorpej Use device_parent().
 1.15  25-Dec-2005  rpaulo branches: 1.15.4; 1.15.6; 1.15.8; 1.15.10; 1.15.12;
PR/32381: Paul Shupak. Convert to ktrace-lwp.
 1.14  11-Dec-2005  christos merge ktrace-lwp.
 1.13  27-Feb-2005  perry branches: 1.13.4;
nuke trailing whitespace
 1.12  03-Feb-2004  jdolecek branches: 1.12.4; 1.12.10; 1.12.12;
allow setting of interrupt usage, priming and auto LF behaviour
via ioctl; drop the traditional device minor mapping for those in favour
of setting via lptctl(8)

introduce notion of 'control' device (minor bit 0x100 set); ATM this
device always skips the priming, which allows device open even with
disconnected printer

this also changes the default for interrupt use - polling is used
by default now
 1.11  03-Feb-2004  jdolecek overhaul the ioctl interface to be better suited for extensions and to
reduce number of separate ioctls - have only 'get mode', 'set mode',
'get flags', 'set flags'
 1.10  03-Feb-2004  jdolecek g/c some unused/write-only/redundant lpt_softc stuff
some style changes in lptwrite() + some printfs adjusted
 1.9  30-Jan-2004  jdolecek whitespace fixes, make LPTIO_DISABLE_DMA 'succeed' if DMA is not supported
 1.8  28-Jan-2004  jdolecek make testbyte[] in lpt_detect() static const
 1.7  28-Jan-2004  jdolecek do not use enums in ioctl structure, use fixed width integers instead
g/c boolean_t enum, explicitly assign numbers for lpt_mode_t enum

Note: lptctl needs to be recompiled to print status properly withh new kernel
 1.6  25-Jan-2004  jdolecek say 'port mode = <foo>' in autoconf message, so that it would be more
clear it's port attribute, not driver attribute
 1.5  25-Jan-2004  bjh21 Remove dollar signs from foreign RCSIDs per doc/3RDPARTY.
Add __KERNEL_RCSID() to .c files.
 1.4  22-Jan-2004  bjh21 Don't use "int" when we mean "size_t". Fixes compile on ARM.
 1.3  21-Jan-2004  bjh21 Add RCSID comments.
 1.2  20-Jan-2004  jdolecek attach this with lpt_ppbus, just to make co-existence with dev/ic/lpt.c
easier
fix a printf() format string
 1.1  19-Jan-2004  jdolecek branches: 1.1.1;
Initial revision
 1.1.1.1  19-Jan-2004  jdolecek Import Gary Thorpe's netbsd-ppbus 1.3. This is NetBSD port
of FreeBSD Parallel Port Bus framework. Work in progress.
 1.12.12.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.10.1  29-Apr-2005  kent sync with -current
 1.12.4.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.12.4.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.4.3  18-Sep-2004  skrll Sync with HEAD.
 1.12.4.2  03-Aug-2004  skrll Sync with HEAD
 1.12.4.1  03-Feb-2004  skrll file lpt.c was added on branch ktrace-lwp on 2004-08-03 10:50:27 +0000
 1.13.4.6  17-Mar-2008  yamt sync with head.
 1.13.4.5  27-Feb-2008  yamt sync with head.
 1.13.4.4  27-Oct-2007  yamt sync with head.
 1.13.4.3  03-Sep-2007  yamt sync with head.
 1.13.4.2  30-Dec-2006  yamt sync with head.
 1.13.4.1  21-Jun-2006  yamt sync with head.
 1.15.12.2  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.15.12.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.15.10.1  19-Apr-2006  elad sync with head.
 1.15.8.1  01-Apr-2006  yamt sync with head.
 1.15.6.1  22-Apr-2006  simonb Sync with head.
 1.15.4.1  09-Sep-2006  rpaulo sync with head
 1.17.10.1  10-Dec-2006  yamt sync with head.
 1.17.8.1  18-Nov-2006  ad Sync with head.
 1.18.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.19.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.19.16.2  23-Mar-2008  matt sync with HEAD
 1.19.16.1  06-Nov-2007  matt sync with HEAD
 1.19.14.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.19.2.1  23-Oct-2007  ad Sync with head.
 1.20.16.4  17-Jan-2009  mjf Sync with HEAD.
 1.20.16.3  02-Jun-2008  mjf Sync with HEAD.
 1.20.16.2  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.20.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.20.12.1  24-Mar-2008  keiichi sync with head.
 1.27.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.27.4.1  04-May-2009  yamt sync with head.
 1.28.28.1  18-May-2014  rmind sync with head
 1.28.24.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.14.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.29.2.1  10-Aug-2014  tls Rebase.
 1.30.28.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.30.28.1  10-Jun-2019  christos Sync with HEAD
 1.30.26.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed