Commit graph

28 commits

Author SHA1 Message Date
Warner Losh fdafd315ad sys: 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
2023-11-26 22:24:00 -07:00
Warner Losh 685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh 95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Mateusz Guzik 9c0df1da91 cfe: clean up empty lines in .c and .h files 2020-09-01 22:10:24 +00:00
Kyle Evans 23d5326823 tty: convert tty_lock_assert to tty_assert_locked to hide lock type
A later change, currently being iterated on in D24459, will in-fact change
the lock type to an sx so that TTY drivers can sleep on it if they need to.
Committing this ahead of time to make the review in question a little more
palatable.

tty_lock_assert() is unfortunately still needed for now in two places to
make sure that the tty lock has not been recursed upon, for those scenarios
where it's supplied by the TTY driver and possibly a mutex that is allowed
to recurse.

Suggested by:	markj
2020-04-17 18:34:49 +00:00
Kyle Evans 85ccd84cb3 sys/dev/cfi: include sys/types.h as well
This will soon be a dependency for machine/atomic.h on mips with the
introduction of 64-bit atomics; the scope here is pretty narrow, so throw it
here in the header just before systm.h, which includes machine/atomic.h
2020-01-02 22:52:31 +00:00
Pedro F. Giffuni 718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.
2017-11-27 14:52:40 +00:00
Landon J. Fuller 3cbea0b15c Sync CFE interface with upstream cfe-1.4.2 release.
Approved by:	adrian (mentor)
Obtained from:	https://www.broadcom.com/support/communications-processors
Differential Revision:	https://reviews.freebsd.org/D7375
2016-08-01 16:26:08 +00:00
Davide Italiano d9ca757cea Convert remaining {g,s}etenv->kern_{g,s}etenv
left over from r273174.

Reported by:    bz
2014-10-17 17:34:05 +00:00
John Baldwin f1f7034d11 Use callout_*() rather than timeout()/untimeout().
Reviewed by:	imp
2014-05-30 15:46:10 +00:00
Nathan Whitehorn feeec74df7 More BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba)
resist easy conversion since they implement a great deal of their attach
logic inside probe(). Some of this could be fixed by moving it to attach(),
but some requires something more subtle than BUS_PROBE_NOWILDCARD.
2013-10-29 14:19:42 +00:00
Andriy Gapon 9976156f12 kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.

Current intended meaning of the calls is that the kernel takes control of
console input.  In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:08:43 +00:00
Robert Watson e5a0927394 Follow up to r225203 refining break-to-debugger run-time configuration
improvements:

(1) Implement new model in previously missed at91 UART driver
(2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h
    to opt_kdb.h (spotted by np)
(3) Garbage collect now-unused opt_comconsole.h

MFC after:	3 weeks
Approved by:	re (bz)
2011-08-27 14:24:27 +00:00
Robert Watson 4cf7545589 Attempt to make break-to-debugger and alternative break-to-debugger more
accessible:

(1) Always compile in support for breaking into the debugger if options
    KDB is present in the kernel.

(2) Disable both by default, but allow them to be enabled via tunables
    and sysctls debug.kdb.break_to_debugger and
    debug.kdb.alt_break_to_debugger.

(3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue
    to behave as before -- only now instead of compiling in
    break-to-debugger support, they change the default values of the
    above sysctls to enable those features by default.  Current kernel
    configurations should, therefore, continue to behave as expected.

(4) Migrate alternative break-to-debugger state machine logic out of
    individual device drivers into centralised KDB code.  This has a
    number of upsides, but also one downside: it's now tricky to release
    sio spin locks when entering the debugger, so we don't.  However,
    similar logic does not exist in other device drivers, including uart.

(5) dcons requires some special handling; unlike other console types, it
    allows overriding KDB's own debugger selection, so we need a new
    interface to KDB to allow that to work.

GENERIC kernels in -CURRENT will now support break-to-debugger as long as
appropriate boot/run-time options are set, which should improve the
debuggability of BETA kernels significantly.

MFC after:	3 weeks
Reviewed by:	kib, nwhitehorn
Approved by:	re (bz)
2011-08-26 21:46:36 +00:00
Neel Natu 5f7eb1ff54 Start using the 'init_static_kenv()' API provided by r198561 to initialize
CFE environment variables.
2010-08-11 02:13:50 +00:00
Neel Natu 61f7c762de Create the "cfecons" tty directly using tty_makedev(). It is not clear what
the intention of having two ttys pointing to the same cfe console device was.

Also we were not initializing the output[] array passed in as input to
tty_makedev() so one name of the ttys was garbage.

Fix the code that calls cfe_write() to deal with the case where only a partial
buffer is written out.

cfe_cngetc() needs to return if there is no character available as input.
If we don't do this then the cfe_timeout() function will spin forever
because cfe_cngetc() will only ever return if there is valid input.

Approved by: imp (mentor)
2010-01-26 03:42:34 +00:00
Warner Losh 3274f529db Fix bug in cfe_enumenv(). The CFE API to invoke is CFE_CMD_ENV_ENUM
and not CFE_CMD_ENV_SET.

Submitted by:	neel@
2010-01-11 17:16:06 +00:00
Warner Losh 05ace0e870 Merge from projects/mips to head by hand:
copy over cfe_env.c...
2010-01-11 03:43:18 +00:00
Warner Losh c72a141e81 Fix various conolse issues with cfe after MPSAFE tty.
Fix a bug with getting env on cfe...
2009-07-04 02:50:33 +00:00
Warner Losh 579c0614d5 Merge in new cfe environment passing of kenv for swarm/sibyte boards.
Submitted by:	Neelkanth Natu
2009-07-04 02:49:17 +00:00
Ed Schouten c5e30cc02b Last minute TTY API change: remove mutex argument from tty_alloc().
I don't want people to override the mutex when allocating a TTY. It has
to be there, to keep drivers like syscons happy. So I'm creating a
tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex()
should eventually be removed.

The advantage of this approach, is that we can just remove a function,
without breaking the regular API in the future.
2009-05-29 06:41:23 +00:00
Bjoern A. Zeeb 44a2eb509f Remove an unused variable to make the SENTRY5 mips kernel compile
(though with some asm warning).
2008-12-27 11:38:41 +00:00
Ed Schouten c8978106d0 Remove unused consdev structure fields.
The cn_unit and cn_tp fields don't seem to be used anywhere. Some
drivers set them, while others don't. Just remove them, in an attempt to
make our consdev code a little easier to understand.
2008-10-27 11:45:31 +00:00
Warner Losh 750595ef63 Change while (cond)\n\t\t; to while (cond)\n\t\tcontinue; since the
former more explicitly tells the compiler that you want an empty loop.
There are some lint programs that use this hint to avoid generating
warnings.

No functional change...
2008-09-28 03:33:01 +00:00
Warner Losh 6f079ba163 Catch up to latest tty, kdb and SYSINIT changes. Modeled after the
dev/ofw changes, since this driver appears to have used that as a
start years ago...
2008-09-26 05:37:54 +00:00
Warner Losh 8e8ee9aaba The Ultra2 never had a CFE console or CFE boot loader. Kill obvious
cut-n-paste leftover.
2008-09-26 05:10:57 +00:00
Warner Losh ae36cccd6e Support for CFE boot loaders. Initially the support is for MIPS, but
other processors will work too.

Submitted by:	bms@
Obtained from:	p4 mips2 branch
2008-09-26 03:53:10 +00:00