Commit graph

12 commits

Author SHA1 Message Date
Warner Losh 4cddd20e1e loader/ofw: Style(9) pass over return statements
Make these consistent. Some files weren't even consistent with
themselves. Make them all either return <space> ( <value> ); or
return;

Sponsored by:		Netflix
2024-05-19 22:05:43 -06:00
Warner Losh 7c43148a97 stand: 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 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh f9ce8da864 stand/ofw: Refactor ofw parsedev
Both ofw_disk and ofw_net use the same parsedev routine, except for the
string passed in to match the ofw device node's type. Create a routine
to do that and connect these two users up to that.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D37560
2022-11-30 15:30:34 -07:00
Warner Losh b8ff248f65 stand/ofw: Subclass devnet to cope with ofw's unique needs
We need to match devices in a slightly special way: We have to look up
the path and see if the device is a 'network' device in order to use it.

Sponsored by:		Netflix
Tested by:		grehan@ (with tweaks to my original patch)
Differential Revision:	https://reviews.freebsd.org/D37557
2022-11-30 15:30:33 -07:00
Warner Losh 4c4563e32d ofw_net: Use c99 initializers
Update to use c99 initializers, although there's no plans to change
anything that this would make easier...

Sponsored by:		Netflix
Reviewed by:		zlei
Differential Revision:	https://reviews.freebsd.org/D37442
2022-11-29 14:49:06 -07:00
Warner Losh 9f71565609 ofw: Remove old K&R function declaration
We don't need to forward declar strchr anymore.

Sponsored by:		Netflix
2022-11-27 13:34:33 -07:00
Warner Losh 272a882b37 Redo r360540 to retain the ifndef sparc code, not delete it.
Also undo the BROKEN stuff, since it was based on the same misreading.

Noticed by: Jens Schweikhardt
2020-05-01 18:36:48 +00:00
Warner Losh 9053d5b70c Remove more stray sparc64 ifdefs.
Also, dmabuf appears to only be set for sparc64 case, but there was a
comment at its only use that says it was broken for some apple
adapters. #ifdef it all of that out now that nothing sets it.
2020-05-01 17:50:21 +00:00
Toomas Soome aaeffe5b70 Backout 356693. The libsa malloc does provide necessary alignment and
memalign by 4 will reduce alignment for some platforms. Thanks for Ian for
pointing this out.
2020-01-13 20:02:27 +00:00
Toomas Soome 659bf32dfc loader: allocate properly aligned buffer for network packet
Use memalign(4, size) to ensure we have properly aligned buffer.

MFC after:	2 weeks
2020-01-13 18:22:54 +00:00
Brandon Bergren 475008d6ca Move stand/ofw/libofw to stand/libofw.
Since rS330365, there has been no particular reason for libofw to be in a
subdirectory of ofw. Move libofw up a level to make it fit in better with
the other top level libraries.

Also add a LIBOFWSRC to stand/defs.mk to match what all the other
libraries are doing.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D23000
2020-01-02 04:34:22 +00:00
Renamed from stand/ofw/libofw/ofw_net.c (Browse further)