History log of /freebsd-current/usr.sbin/config/mkheaders.c
Revision Date Author Comments
# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 8a7b6120 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# bcaa6aa1 01-Feb-2021 John Baldwin <jhb@FreeBSD.org>

config: Fix typo in comment.


# ecc7fd09 15-Aug-2019 Warner Losh <imp@FreeBSD.org>

Catch mkheaders.c up to the removal of counted device support in 2005.

mkheaders.c hasn't made headers in ~15 years. Belatedly update the comments to
reflect that all it does these days is warn about 'device foo' lines in the
config where we don't know what a 'foo' is.

Remove extra includes too. These also haven't been needed for 15 years and
weren't removed at the time the comment wasn't updated...


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 61ede7ee 25-Nov-2005 Ruslan Ermilov <ru@FreeBSD.org>

Clean some code that became obfuscated over the years:
Don't keep duplicate files in the files list just to
mark the device as "known" later. XXX: Since the
device list isn't unique (there can be two "device foo"
directives, as this the case with LINT+DEFAULTS), we
have to traverse it all to mark all copies of the same
device as "used", but this is not worse than it was.


# f37a929c 30-Aug-2004 Peter Wemm <peter@FreeBSD.org>

Kill count device support from config. I've changed the last few
remaining consumers to have the count passed as an option. This is
i4b, pc98/wdc, and coda.

Bump configvers.h from 500013 to 600000.

Remove heuristics that tried to parse "device ed5" as 5 units of the ed
device. This broke things like the snd_emu10k1 device, which required
quotes to make it parse right. The no-longer-needed quotes have been
removed from NOTES, GENERIC etc. eg, I've removed the quotes from:
device snd_maestro
device "snd_maestro3"
device snd_mss

I believe everything will still compile and work after this.


# 23717fc4 06-Aug-2004 Warner Losh <imp@FreeBSD.org>

Per letter dated July 22, 1999, delete clause 3 from code directly
from Berkeley.


# e32e9a42 30-Jun-2004 Brooks Davis <brooks@FreeBSD.org>

Static device counts will not be supported in 6.x so place the generated
macros (N<driver>) under BURN_BRIDGES.

Discussed with: peter, imp, scottl, ...


# 76131e39 09-Mar-2003 Dag-Erling Smørgrav <des@FreeBSD.org>

Print FYI messages on stderr. Previously, they were printed on stdout,
and due to buffering they would sometimes come out after the actual
error message when mkheaders() failed due to an unknown device, so you'd
get an error messages followed by 20 or 30 lines of harmless warnings.

There are lots of other warning messages in config(8) that are printed
on stdout, but these were the most egregious (at least with LINT).


# 292dd8a8 14-Feb-2003 Ruslan Ermilov <ru@FreeBSD.org>

Convert to using <sys/queue.h> macros.


# 2f3bead0 21-Jul-2002 Peter Wemm <peter@FreeBSD.org>

Remove stray function prototype. I wrote and removed this function but
forgot the prototype.

Submitted by: dd


# 4f52fbb1 21-Jul-2002 Peter Wemm <peter@FreeBSD.org>

Check for missing static unit 'count' declarations as well.


# 775d6c0e 21-Jul-2002 Peter Wemm <peter@FreeBSD.org>

Check that we are not supplying 'device foo N' to devices that do not take
a statuc unit count.


# 3c36aab6 31-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Try and make it clearer that the static units thing is a FYI only.


# 246449f3 31-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Unwind a bit more cruft - we only have one type of device now.


# 62a4bb55 31-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Oops. An old version of a local change leaked in with the last commit.
Since it is here, clean it up a bit.


# ace85808 31-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Redo the stray header file cleanup code to not depend on timestamps
or access times or anything. Just bite the bullet and keep a list of
header files that we know about.


# b8e39fd1 22-Jan-2001 Peter Wemm <peter@FreeBSD.org>

Clean up some obsolete stuff. config -r has not been needed since around
FreeBSD 3.x or so when the 'make depend' picked up the opt_foo.h files.
Convert warnings into actual errors in the hope that buildkernel users
will pay more attention. :-(


# faa913d7 21-Nov-2000 Warner Losh <imp@FreeBSD.org>

Fix buffer overflows in filenames. If you had a path > 80 characters
for your /usr/obj/path/to/my/files path to the kernel, then weird
things happened. make buildkernel would fail because config was
dumping core or generating bad file names (depending on the lenght of
the path).

While I was here, also use strlcpy, strlcat and snprintf (or asprintf)
as necessary. Minor format policing for the snprintf calls as well.


# f71c01cc 13-Jun-2000 Peter Wemm <peter@FreeBSD.org>

Borrow phk's axe and apply the next stage of config(8)'s evolution.

Use Warner Losh's "hint" driver to decode ascii strings to fill the
resource table at boot time.

config(8) no longer generates an ioconf.c table - ie: the configuration
no longer has to be compiled into the kernel. You can reconfigure your
isa devices with the likes of this at loader(8) time:
set hint.ed.0.port=0x320

userconfig will be rewritten to use this style interface one day and will
move to /boot/userconfig.4th or something like that.

It is still possible to statically compile in a set of hints into a kernel
if you do not wish to use loader(8). See the "hints" directive in GENERIC
as an example.

All device wiring has been moved out of config(8). There is a set of
helper scripts (see i386/conf/gethints.pl, and the same for alpha and pc98)
that extract the 'at isa? port foo irq bar' from the old files and produces
a hints file. If you install this file as /boot/device.hints (and update
/boot/defaults/loader.conf - You can do a build/install in sys/boot) then
loader will load it automatically for you. You can also compile in the
hints directly with: hints "device.hints" as well.

There are a few things that I'm not too happy with yet. Under this scheme,
things like LINT would no longer be useful as "documentation" of settings.
I have renamed this file to 'NOTES' and stored the example hints strings
in it. However... this is not something that config(8) understands, so
there is a script that extracts the build-specific data from the
documentation file (NOTES) to produce a LINT that can be config'ed and
built. A stack of man4 pages will need updating. :-/

Also, since there is no longer a difference between 'device' and
'pseudo-device' I collapsed the two together, and the resulting 'device'
takes a 'number of units' for devices that still have it statically
allocated. eg: 'device fe 4' will compile the fe driver with NFE set
to 4. You can then set hints for 4 units (0 - 3). Also note that
'device fe0' will be interpreted as "zero units of 'fe'" which would be
bad, so there is a config warning for this. This is only needed for
old drivers that still have static limits on numbers of units.
All the statically limited drivers that I could find were marked.

Please exercise EXTREME CAUTION when transitioning!

Moral support by: phk, msmith, dfr, asmodai, imp, and others


# 3f664fc6 10-Jun-2000 Peter Wemm <peter@FreeBSD.org>

A checkpoint of a part of a work-in-progress. Some more cleanups for
config(8). This commit allows control of the creation of the
#include "foo.h" files. We now only create them explicitly when needed.
BTW; these are mostly bad because they usually imply static limits on
numbers of units for devices. eg: struct mysoftc sc[NFOO];
These static limits have Got To Go.


# 94142695 08-Jan-2000 Peter Wemm <peter@FreeBSD.org>

Apply the axe to some more cruft in config(8). In particular:
- redo the "at" configuration system so that it just syntax checks
to make sure the device you're configuring something "at" appears to
exist. Nuke a bunch of complexity that was responsible for creating
"clones" of wildcard devices and some wierd stuff in a few places
including the scbus config tables etc.
- merge "controller" and "device" - there is no difference as far as
the kernel is concernend, it's just something there to make life
difficult for config file writers. "controller" is now an alias for
"device".
- emit full scsi config into the resource tables. We could trivially
change cam to use that rather than it's own "special" table for wiring
and static configuration. ATA could use this too for static wiring.
- try and emulate some of the quirks of the old system where it made
sense. Some were too strange though and I'd be very suprised if they
were features and not outright bugs. nexus handling is still strange.
One thing in particular is that some of the wierd entries in the
newbus devtables is now gone as it was a quirk side effect of the
wildcard/question-mark cloning above.

GENERIC and LINT still build etc.


# 952017be 06-Dec-1999 Peter Wemm <peter@FreeBSD.org>

Fix another quirk in the unknown device detection, and also deal with
unknown 'controller' lines.


# 1c56dc36 10-Oct-1999 Peter Wemm <peter@FreeBSD.org>

Further cleanup. Also remove the following unused or defunct tokens:
and, bio, cam, master, minor, net, priority, sequential, size, slave, trace


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# ed7e72e6 03-Jun-1999 Peter Wemm <peter@FreeBSD.org>

Check and warn about unknown devices in the config file along the same
lines as the pseudo-device checking. Previously 'device xyz0' would have
been silently accepted without comment.


# 188334f6 17-Apr-1999 Peter Wemm <peter@FreeBSD.org>

Get out the blow torch and hack away all the unused stuff. Note that
I zapped the MACHINE_MIPS stuff, it isn't likely to be useful apart from
recognition of the machine name. It would be reasonable to expect new
ports would look something like the alpha/i386 from a config perspective.


# 8518c081 06-Nov-1997 Joerg Wunsch <joerg@FreeBSD.org>

Fix some breakage from my last set of changes.

PR: bin/4892
Submitted by: Vasim Valejev <vasim@uddias.diaspro.com>


# cea24a2b 28-Oct-1997 Joerg Wunsch <joerg@FreeBSD.org>

Allow for a keyword in the "files" file named "mandatory". The first
candidate for this is "npx0", more are likely to follow.

Check for pseudo-devices that are being configured, but don't appear
in any "files" file. The ``pseudo-device bpf 2'' already hit me too
often.


# d5831691 15-Sep-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3), add usage(). -Wall clean.


# 5bd7b809 14-Dec-1996 Joerg Wunsch <joerg@FreeBSD.org>

Part #2 of the config cleanup. More aggressive, replaced an NIH
version of strdup() by a macro, killed many calls to strdup(), thus
potentially wasting less malloc'ed space (their args were never be
free()ed desptie despite of being malloc'ed). Probably still a huge
memory leak at all... Also killed two totally useless variables.

I've tested it as i could, but wouldn't be surprised if unexpected
problems showed up. So watch out this space!


# 1d95dc91 02-Jun-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Backout yacc changes.


# 829bde8e 30-May-1996 Poul-Henning Kamp <phk@FreeBSD.org>

yacc rule changes.


# 6d41b96f 11-Dec-1995 Peter Wemm <peter@FreeBSD.org>

Implement support for conf/options and i386/conf/options.i386
Note that this code is dormant unless the options files exist.
Also, parsing of quoted options in the config files is improved.

What this allows, is all the options in LINT to be specified to be
configured as #defines in a file rather than on the CC command line at
kernel build time. This means that 'make depend' will catch dependencies
on actual *options*, meaning that you can run 'config' and 'make depend'
in complete safety WITHOUT removing the compile directory each time.

Unfortunately, this requires a pass over the source to get the individual
files to #include the new .h files that would be generated by config.
This has a small compile time penalty (appears up to about 2% slower)
from a "fresh" build. Of course, you should not be needing to do complete
rebuilds very often once this was completed, so it would be an overall
win for most people.

Since this code is dormant and we've got a lot of other things happening
on the kernel tree at the moment (prototypes, devfs, static declarations
etc) I am not planning on doing any changes to activate this feature just
yet.


# dea673e9 25-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite usr.sbin Sources