Commit graph

22 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
John Baldwin ce4ca2edc6 pbio: Remove unused devclass argument to DRIVER_MODULE. 2022-05-09 14:26:44 -07:00
John Baldwin 51f481235c pbio: Add locking and remove D_NEEDGIANT.
Use a sx lock to permit uiomove directly into/out of the the per-port
buffers.  In addition, the sx lock provides a stronger guarantee that
I think this driver wants which is to single-thread read and write
calls even while paused.  Finally, replace tsleep with dummy wait
channels with calls to pause_sig to more clearly communicate the
intent.

Differential Revision:	https://reviews.freebsd.org/D35081
2022-05-05 16:40:04 -07:00
John Baldwin 4942e8df47 pbio: Return BUS_PROBE_DEFAULT from probe instead of 0.
0 should only be returned from probe in legacy drivers that need to
preserve softc state between probe and attach.

Differential Revision:	https://reviews.freebsd.org/D35080
2022-05-05 16:39:19 -07:00
John Baldwin bb81a138c3 pbio: Axe bus_space tag/handle using bus_read/write_1 instead.
Differential Revision:	https://reviews.freebsd.org/D35079
2022-05-05 16:38:51 -07:00
John Baldwin 0db65574bb pbio: Store softc in si_drv1 for character devices.
The port number is still stored in the unit (si_drv0) but is the
entire unit value now.

While here, removed checks for NULL softc since those can never happen
from cdevsw routines.  This also resulted in the close method becoming
a no-op, so it has been removed.

Differential Revision:	https://reviews.freebsd.org/D35078
2022-05-05 16:38:25 -07:00
Mateusz Guzik 0f9f3568cd pbio: clean up empty lines in .c and .h files 2020-09-01 22:01:17 +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
Justin Hibbits c47476d7e6 Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given
count.  Migrate these to use the new bus_alloc_resource_anywhere() API.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D5370
2016-02-27 03:38:01 +00:00
Ed Schouten 6bfa9a2d66 Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by:	kib
2008-09-27 08:51:18 +00:00
Poul-Henning Kamp c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Yoshihiro Takahashi d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Warner Losh 8d50b6af00 Skip PNP probes. If there are isapnp or pnpbios instances of this driver,
then we can support them later.  This keeps the pbio probe from claiming
lots of otherwise unused pnpbios devices on my laptop.
2005-02-11 03:56:13 +00:00
Warner Losh 098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
David E. O'Brien 154eb44539 Catch up with the header repo copy. 2004-11-11 19:14:09 +00:00
Warner Losh 905454c86c Fix conflicts I didn't fix before I committed my busspace changes.
Noticed by: ru@ (and likely tinderbox, I haven't checked)
2004-10-11 00:58:24 +00:00
Warner Losh ac00fac23a Convert to newbus. (chances are we could now move this to dev/pbio
since I believe it is now MI, but that hasn't been done yet).

Reviewed by: dds
2004-10-10 03:26:20 +00:00
David E. O'Brien 3b33d41dc2 style(9) 2004-10-09 08:31:21 +00:00
Warner Losh bacb482d94 Port pbio to HEAD.
OK'd by: dds
2004-10-07 16:21:03 +00:00