#
d1579b2d |
| 03-Sep-2018 |
riastradh <riastradh@NetBSD.org> |
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 n
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!)
show more ...
|
#
f9228f42 |
| 25-Jul-2014 |
dholland <dholland@NetBSD.org> |
Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
|
#
a68f9396 |
| 16-Mar-2014 |
dholland <dholland@NetBSD.org> |
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
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.
show more ...
|
#
cbab9cad |
| 27-Oct-2012 |
chs <chs@NetBSD.org> |
split device_t/softc for all remaining drivers. replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
|
#
b1d183bf |
| 31-May-2009 |
phx <phx@NetBSD.org> |
Fixed format string from %x to %llx for dev_t.
|
#
d974db0a |
| 17-Oct-2007 |
garbled <garbled@NetBSD.org> |
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 v
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.
show more ...
|
#
88ab7da9 |
| 09-Jul-2007 |
ad <ad@NetBSD.org> |
Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes - select()/poll() improvements - miscellaneous MT safety improvements
|
#
53524e44 |
| 04-Mar-2007 |
christos <christos@NetBSD.org> |
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
|
#
2d62904b |
| 16-Feb-2007 |
ad <ad@NetBSD.org> |
More spllowersoftclock() fallout.
|
#
21374641 |
| 26-Mar-2006 |
thorpej <thorpej@NetBSD.org> |
Use device_unit().
|
#
95e1ffb1 |
| 11-Dec-2005 |
christos <christos@NetBSD.org> |
merge ktrace-lwp.
|
#
aad01611 |
| 07-Aug-2003 |
agc <agc@NetBSD.org> |
Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
|
#
e0cc03a0 |
| 23-Oct-2002 |
jdolecek <jdolecek@NetBSD.org> |
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
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
show more ...
|
#
c5e91d44 |
| 02-Oct-2002 |
thorpej <thorpej@NetBSD.org> |
Use CFATTACH_DECL().
|
#
9a711d69 |
| 27-Sep-2002 |
thorpej <thorpej@NetBSD.org> |
Declare all cfattach structures const.
|
#
77a6b82b |
| 06-Sep-2002 |
gehenna <gehenna@NetBSD.org> |
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 st
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.
show more ...
|
#
1ea4df81 |
| 28-Jan-2002 |
aymeric <aymeric@NetBSD.org> |
add __KERNEL_RCSID as suggested by Luke Mewburn
|
#
9382c873 |
| 26-Jan-2002 |
aymeric <aymeric@NetBSD.org> |
- ANSIfy - remove some trailing spaces/tabs - minor style nits
|
#
115bd3b3 |
| 27-Aug-2000 |
is <is@NetBSD.org> |
Replace one callout handler by using a timeout in tsleep(). 1.4.x version of it submitted by Ingolf Koch; translated to 1.5-ish by myself.
|
#
437d090c |
| 23-Apr-2000 |
mhitch <mhitch@NetBSD.org> |
Long term bug finally reared its head: size of device softc was specified as sizeof(struct device) when amiga switched to new config, and recent additions of callout structures and a long missing st
Long term bug finally reared its head: size of device softc was specified as sizeof(struct device) when amiga switched to new config, and recent additions of callout structures and a long missing struct device to the soft structure resulted in kernel panics when attempting to open the builtin serial port. The callout structure initialization was clearing the serial port softc data! Fixed by using sizeof(struct par_softc).
show more ...
|
#
440814a0 |
| 26-Mar-2000 |
frueauf <frueauf@NetBSD.org> |
Add "struct device sc_dev;" to struct par_softc.
Reviewed by Ignatios Souvatzis.
|
#
b667a5a3 |
| 23-Mar-2000 |
thorpej <thorpej@NetBSD.org> |
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
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.
show more ...
|
#
8bc084e1 |
| 16-Mar-2000 |
kleink <kleink@NetBSD.org> |
Kill more broken cf_unit bogons.
|
#
eb20bbc7 |
| 05-Aug-1999 |
thorpej <thorpej@NetBSD.org> |
Change the semantics of splsoftclock() to be like other spl*() functions, that is priority is rasied. Add a new spllowersoftclock() to provide the atomic drop-to-softclock semantics that the old spl
Change the semantics of splsoftclock() to be like other spl*() functions, that is priority is rasied. Add a new spllowersoftclock() to provide the atomic drop-to-softclock semantics that the old splsoftclock() provided, and update calls accordingly.
This fixes a problem with using the "rnd" pseudo-device from within interrupt context to extract random data (e.g. from within the softnet interrupt) where doing so would incorrectly unblock interrupts (causing all sorts of lossage).
XXX 4 platforms do not have priority-raising capability: newsmips, sparc, XXX sparc64, and VAX. This platforms still have this bug until their XXX spl*() functions are fixed.
show more ...
|
#
0b6e56ec |
| 12-Jan-1998 |
thorpej <thorpej@NetBSD.org> |
Adjust for changes to config.
|