mpool/mpool_get.c: Avoid clobbering 'errno' when handling 'pread' errors
POSIX.1-2024 states that the 'free' function "shall not modify errno if
ptr is a null pointer or a pointer previously returned as if by malloc()
and not yet deallocated". However this is a fairly recent addition
and non-compliant allocators might still clobber 'errno', causing
'mpool_get' to return the wrong error code. Fix this by saving
and restoring 'errno' after calling 'free'.
Sponsored by: Klara, Inc.
Reviewed by: obiwac
Differential Revision: https://reviews.freebsd.org/D55463
MFC after: 1 week
asmc: introduce the concept of generic models
Having to enter in each of the models for Apple hardware, recompiling,
etc, is tedious. Provide generic models so end-users can leverage some
of the capabilities provided by the driver, i.e., common features like
minimal fans and lights (if present on the generic model) support.
The generic models are as follows:
- Macmini
- MacBookAir
- MacBookPro
- MacPro
This sort of follows the pattern established by the `applesmc` driver in
Linux.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55395
asmc: add Wake-on-LAN control via sysctl
Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.
This change adds a convenience sysctl, `dev.asmc.0.wol`. This can be
disabled if set to 0 and enabled if set to 1.
The AUPO key is volatile and resets to 0x00 on every boot, so WoL must
be manually enabled before each shutdown to work from powered-off state.
Users need to run: `sysctl dev.asmc.0.wol=1` before shutting down the
system. The sysctl is best set to persist in `/etc/sysctl.conf`.
MFC after: 1 week
Reviewed By: markj, ngie
Differential Revision: https://reviews.freebsd.org/D54439
chore: replace {0, 0} with {DEV,KOBJ}METHOD_END
Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.
Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END`
and `KOBJMETHOD_END` as appropriate. This helps ensure that
future adaptations to drivers following patterns documented
in driver(9) can be made more easily/without issue.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55414
syscall_timing: add Makefile.depend
This was part of review D44761. It was separated into another commit for
better clarity.
Obtained from: Hewlett Packard Enterprise
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44761
Use NO_SHARED instead of explicitly using -static flag
NO_SHARED is the proper way to declare linking a program without
shared libraries.
Obtained from: Hewlett Packard Enterprise
MFC after: 1 week
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D44761