Commit Graph

39 Commits

Author SHA1 Message Date
riastradh
d1579b2d70 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!)
2018-09-03 16:29:22 +00:00
chs
cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
uebayasi
b76221069a This actually uses only PAGE_SIZE, remove uvm/uvm_extern.h again. 2010-11-14 06:30:59 +00:00
uebayasi
4bbd14ce50 Yet another hidden uvmexp user. 2010-11-14 04:01:50 +00:00
uebayasi
8184d5dc03 Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.
2010-11-13 13:51:57 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui
78a1d236b6 Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
2008-04-13 04:55:52 +00:00
cegger
7088512994 use aprint_*_dev and device_xname 2008-04-08 12:07:25 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
christos
fffc9c66c9 fix fallout from caddr_t changes. 2007-03-04 07:54:07 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos
6b23a10118 avoid variable shadow. 2005-05-31 00:46:05 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
perry
18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
petrov
b5de398a25 Adjust residual counter for wide transfers. 2002-10-01 07:07:03 +00:00
chs
cc28b18bbb don't print anything when attaching as part of a FAS.
it doesn't add any information and it messes up the autoconf output.
2002-09-23 04:57:59 +00:00
lukem
2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem
a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
mrg
46762d3560 fix lint exposed by GCC 3.0 20010604 (prerelease). 2001-06-04 20:56:51 +00:00
tsutsui
c65417c92f Make sure to print "\n" at the end of the attach line on non-DEBUG case. 2001-04-08 11:45:45 +00:00
tsutsui
2f9f69455f Fix some bus_dma(9) usage:
- bus_dmamap_sync() takes offset into the dmamap, not VA.
- Use BUS_DMA_STREAMING for the data dmamap, not BUS_DMA_COHERENT.
2001-04-07 10:50:13 +00:00
petrov
b0605f71d5 fas support added 2001-03-29 02:58:38 +00:00
thorpej
275539f03c NBPG -> PAGE_SIZE 2000-11-14 18:21:00 +00:00
eeh
f9a51c7b15 Clean up a #define that doesn't belong. Oops. That's what I get for
working this late.
2000-10-31 08:06:14 +00:00
eeh
37486bb837 Get the bpp driver to work properly. 2000-10-31 06:32:06 +00:00
pk
e7adcbdb13 enet dma: claim interrupt as appropriate. 2000-07-04 14:58:36 +00:00
mrg
b9140fbc0c KNF a line. 2000-06-12 05:25:48 +00:00
mrg
dfe176302c add some casts to (u_long) to shut up gcc 2000-04-14 08:22:49 +00:00
pk
9db217428b Cast size_t to long for printf purposes. 1999-06-05 08:35:45 +00:00
pk
d93e27676e Remove splbio()/splserial(), which should not try to protect bus_dma*(9)
internals.
1999-04-20 20:21:04 +00:00
pk
cd6eaa20b1 Print register contents before we modify it. 1999-04-16 13:35:41 +00:00
pk
c3eb74e089 Check for Sbus slave access errors.
Call bus_dma_load() with elevated priority.
1999-03-23 00:32:27 +00:00
pk
0b10e1ddab Parallel port support routines. 1998-09-21 21:26:51 +00:00
pk
b871ab5f2c Use the new "%b" format for the various control register bits. 1998-09-06 21:39:33 +00:00
pk
fec2fa9e43 Typo in device Id mask. 1998-09-01 21:04:43 +00:00
pk
73b946e04e LSI64854 DMA engine driver.
Currently used by Lance Ethernet and NCR SCSI front-ends on sparc/sparc64.
1998-08-29 21:42:03 +00:00