Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/clmpcc.c
RevisionDateAuthorComments
 1.54  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.53  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.52  28-Oct-2017  riastradh branches: 1.52.2; 1.52.4;
Kill some more extern struct cfdriver declarations.

Down with externs in .c!
 1.51  15-Nov-2014  christos centralize the dialout/call unit macros.
 1.50  18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.49  25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.48  25-Mar-2014  christos branches: 1.48.2;
fix unused/uninitialized
 1.47  16-Mar-2014  dholland 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.46  27-Oct-2012  chs branches: 1.46.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.45  01-Oct-2011  chs branches: 1.45.2; 1.45.12;
fix build errors with gcc 4.5.
 1.44  24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.43  23-Nov-2009  rmind branches: 1.43.4; 1.43.6;
Remove some unecessary includes sys/user.h header.
 1.42  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.41  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.40  17-Jun-2008  he branches: 1.40.4; 1.40.10;
Typo correction to restore buildability.
 1.39  11-Jun-2008  cegger - use device_lookup_private to get softc
- ansify
 1.38  28-Apr-2008  martin branches: 1.38.2; 1.38.4;
Remove clause 3 and 4 from TNF licenses
 1.37  08-Apr-2008  cegger branches: 1.37.2; 1.37.4;
use aprint_*_dev and device_xname
 1.36  19-Nov-2007  ad branches: 1.36.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.35  19-Oct-2007  ad branches: 1.35.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.34  08-Oct-2007  ad branches: 1.34.2;
Use the softint API.
 1.33  14-Jul-2007  ad branches: 1.33.6; 1.33.8; 1.33.10;
Generic soft interrupts are mandatory.
 1.32  04-Mar-2007  christos branches: 1.32.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.31  01-Oct-2006  elad branches: 1.31.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.30  01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.29  21-Jul-2006  ad branches: 1.29.4; 1.29.6;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.28  14-May-2006  elad integrate kauth.
 1.27  07-Mar-2006  he branches: 1.27.2; 1.27.4;
Remove another instance of the SET/CLR/ISSET macro tripelet, now
found in <sys/types.h>.
 1.26  11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8;
merge ktrace-lwp.
 1.25  06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.

Also, dispose of a redundant (and unreachable) instance of that check.
 1.24  27-Feb-2005  perry branches: 1.24.4;
nuke trailing whitespace
 1.23  04-Feb-2005  perry de-__P
 1.22  23-Oct-2002  jdolecek branches: 1.22.6; 1.22.14; 1.22.16;
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.21  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.20  17-Mar-2002  atatat branches: 1.20.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.19  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.18  13-Nov-2001  lukem add/cleanup RCSID
 1.17  12-Jul-2001  scw branches: 1.17.2;
Call clmpcc_init() when setting up the console to get the chip into
a known state.

For some reason, "Bug" on mvme68k can't be relied upon to leave it
in a good enough state for our console routines...
 1.16  02-May-2001  scw branches: 1.16.2;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.15  14-Jan-2001  thorpej branches: 1.15.2;
Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>. This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
 1.14  01-Nov-2000  eeh Adapt to the new line discipline scheme.
 1.13  20-Jul-2000  scw Take advantage of generic soft interrupts, if available.
 1.12  15-Jul-2000  scw Fix a typo in the `device_lookup()' changes.
 1.11  06-Jul-2000  thorpej Use device_lookup().
 1.10  19-Mar-2000  scw branches: 1.10.4;
The soft-interrupt handler now returns void.
 1.9  28-Nov-1999  scw Don't bother spinning in the console 'putc' routine for the transmitter
to become idle; it actually doesn't matter as the chip takes care of
this for us. It would also spin endlessly in certain circumstances
during shutdown.

While I'm here, (finally) add code to allow sending BREAK characters.
 1.8  11-Nov-1999  scw Zero is a valid value for ch_tcor and ch_rcor, so be a bit more conservative
when deciding if the baud-rate should be changed. (Spotted by Bruce Martin)
Also fix the mask used when setting the Rx FIFO threshold to zero. I don't
yet understand how the Rx side worked with the code as it was. ;-}
 1.7  18-Sep-1999  scw branches: 1.7.2; 1.7.4; 1.7.8;
Minor optimisation.
 1.6  01-Aug-1999  scw Re-work the Tx side to avoid calling into the tty layer at
interrupt time. This was the cause of the 'mmu fault' panics
seen by several people, as the Tx interrupt is at a higher
priority that spltty().
 1.5  03-Apr-1999  scw Fix a problem where no Tx Empty interrupt ever happened if CTS
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.
 1.4  21-Feb-1999  scw branches: 1.4.2;
Don't update the CORx registers unless they really have changed.
Also make console Tx handling wait until the Tx FIFO has drained and
the shift-register is empty before sending console characters.
 1.3  20-Feb-1999  scw That #define splserial() really didn't want to be there...
 1.2  20-Feb-1999  scw Delay serial port parameter changes until the Tx FIFO has emptied.
 1.1  13-Feb-1999  scw New MI front-end for the Cirrus Logic CD240[01] Multi-protocol
Communications Controller.

This is still a work in progress, but it is functional enough to
be usable.
 1.4.2.4  29-Nov-1999  he Pull up revisions 1.7 and 1.9 (requested by scw):
Fix a bug where the console 'putc' routine would spin endlessly
under certain circumstances during shutdown. In addition, the driver
is now able to generate BREAK.
 1.4.2.3  21-Nov-1999  he Pull up revision 1.8 (requested by scw):
Fix a problem with changing baud rate to > 9600, and a problem
with setting the Rx FIFO threshold register.
 1.4.2.2  10-Sep-1999  he Pull up revision 1.6:
Fix panics seen by some people during mvme167 installation. (scw)
 1.4.2.1  05-Apr-1999  scw branches: 1.4.2.1.2;
Pullup 1.5 from trunk.
 1.4.2.1.2.2  02-Aug-1999  thorpej Update from trunk.
 1.4.2.1.2.1  21-Jun-1999  thorpej Sync w/ -current.
 1.7.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.4.1  15-Nov-1999  fvdl Sync with -current
 1.7.2.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.7.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.7.2.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.10.4.2  29-Jul-2000  scw Fix the previous pullup; I botched the patch.
Approved by: thorpej and jhawk
 1.10.4.1  22-Jul-2000  scw Pullup from trunk: 1.13
Approved by: thorpej

Make use of generic soft interrupts, when available.
 1.15.2.7  11-Nov-2002  nathanw Catch up to -current
 1.15.2.6  17-Sep-2002  nathanw Catch up to -current.
 1.15.2.5  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.15.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.15.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.15.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.16.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.16.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.16.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.16.2.1  03-Aug-2001  lukem update to -current
 1.17.2.2  13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.17.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.20.4.1  16-May-2002  gehenna Add the character device switch.
 1.22.16.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.22.16.1  12-Feb-2005  yamt sync with head.
 1.22.14.1  29-Apr-2005  kent sync with -current
 1.22.6.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.22.6.3  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.22.6.2  04-Feb-2005  skrll Sync with HEAD.
 1.22.6.1  26-Jan-2005  skrll Adapt to branch.
 1.24.4.5  07-Dec-2007  yamt sync with head
 1.24.4.4  27-Oct-2007  yamt sync with head.
 1.24.4.3  03-Sep-2007  yamt sync with head.
 1.24.4.2  30-Dec-2006  yamt sync with head.
 1.24.4.1  21-Jun-2006  yamt sync with head.
 1.26.8.3  11-Aug-2006  yamt sync with head
 1.26.8.2  24-May-2006  yamt sync with head.
 1.26.8.1  13-Mar-2006  yamt sync with head.
 1.26.6.2  01-Jun-2006  kardel Sync with head.
 1.26.6.1  22-Apr-2006  simonb Sync with head.
 1.26.4.1  09-Sep-2006  rpaulo sync with head
 1.27.4.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.27.2.3  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.27.2.2  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.27.2.1  07-Mar-2006  elad file clmpcc.c was added on branch elad-kernelauth on 2006-03-08 01:44:48 +0000
 1.29.6.1  22-Oct-2006  yamt sync with head
 1.29.4.1  18-Nov-2006  ad Sync with head.
 1.31.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.32.2.2  23-Oct-2007  ad Sync with head.
 1.32.2.1  17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.33.10.1  14-Oct-2007  yamt sync with head.
 1.33.8.2  09-Jan-2008  matt sync with HEAD
 1.33.8.1  06-Nov-2007  matt sync with HEAD
 1.33.6.2  21-Nov-2007  joerg Sync with HEAD.
 1.33.6.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.34.2.2  21-Nov-2007  bouyer Sync with HEAD
 1.34.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.35.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.36.14.2  29-Jun-2008  mjf Sync with HEAD.
 1.36.14.1  02-Jun-2008  mjf Sync with HEAD.
 1.37.4.3  11-Mar-2010  yamt sync with head
 1.37.4.2  04-May-2009  yamt sync with head.
 1.37.4.1  16-May-2008  yamt sync with head.
 1.37.2.2  17-Jun-2008  yamt sync with head.
 1.37.2.1  18-May-2008  yamt sync with head.
 1.38.4.1  18-Jun-2008  simonb Sync with head.
 1.38.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.40.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.40.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.43.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.43.4.1  31-May-2011  rmind sync with head
 1.45.12.3  03-Dec-2017  jdolecek update from HEAD
 1.45.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.45.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.45.2.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.45.2.1  30-Oct-2012  yamt sync with head
 1.46.2.1  18-May-2014  rmind sync with head
 1.48.2.1  10-Aug-2014  tls Rebase.
 1.52.4.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.52.4.1  10-Jun-2019  christos Sync with HEAD
 1.52.2.1  06-Sep-2018  pgoyette Sync with HEAD

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

RSS XML Feed