tail: Allow repetitive or contraditory options
Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation. There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.
MFC after: 1 week
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D58192
(cherry picked from commit 9fc14dbe4897c4541113b9ba98236fbd7eb75380)
tail: Allow repetitive or contraditory options
Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation. There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.
MFC after: 1 week
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D58192
(cherry picked from commit 9fc14dbe4897c4541113b9ba98236fbd7eb75380)
[test] libatexit: leverage __{BEGIN,END}_DECLS
This change converts the longhand form of `extern "C" {` and its
corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.
The new form is much easier to grep for and is a best practice to use in
the FreeBSD tree.
This is meant to be a non-functional change.
MFC after: 1 week
libc: tests: add static to resolve -Wmissing-prototypes
The function create_staticobj() is only used inside this translation unit.
Clang produces a -Wmissing-prototypes warning during standard buildworld.
This warning will become a fatal compile error if MK_WERROR is enabled for hardened builds.
PR: 285870
Fixes: ee9ce1078 ("libc: tests: add some tests for __cxa_atexit...")
Signed-off-by: Zhang Qiyue <peter-open-source.probing805 at aleeas.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2321
stand: Fix build failure due to old EDK2 interface
In 43b8edb320519, we change EFI_GRAPHICS_OUTPUT_PROTOCOL from
EFI_GRAPHICS_OUTPUT. However, this patch is not MFC to stable/15. As a
result, we need to use the old interface to prevent compile failure.
Fixes: 1802f2ca7215
Sponsored by: The FreeBSD Foundation
hwpstate_intel: Minimize ifdef for i386 build
Reported by: jrtc27
Fixes: bdc0f7678257
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 02c440e204041e92da403a64b70c2e1fdf3a4f73)
kvm: Support non-default CPUID leaf
KVM does not always use 0x40000000 as its CPUID base. For example, QEMU
adds a 0x100 offset when nested virtualization is detected and the host
exposes Hyper-V enlightenment hints. To accommodate this behavior,
switch the detection logic to use the CPUID leaf returned by do_cpuid(),
making the implementation more flexible.
See:
https://github.com/qemu/qemu/blob/master/target/i386/kvm/kvm.c#L2300
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58146
(cherry picked from commit 86691d52a6d3796ad36ba474cf0a9493f6d99202)
stand: Bulk operations on each gfxfb_blt if shadow buffer enabled
Previously, gfxfb_blt flushed the framebuffer on every call. Since a
single drawing operation may invoke gfxfb_blt multiple times, this can
result in unnecessary flushes.
Instead, write updates to the shadow buffer (when present) and mark the
affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls
can be coalesced into a single update. As before, only the dirty region
is flushed.
This fixes the slow bootloader problem in some platforms.
Reviewed by: imp, adrian, obiwac
Tested by: obiwac, jrm
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57373
(cherry picked from commit 32da2f23ae4d18888d34682b0ddb49ec80c0bb26)
stand: Fix shadow buffer offset handling
The shadow buffer is addressed relative to `tg_origin`, which includes
the padding offset, whereas `gfxfb_blt` operates on coordinates without
that offset. To make `gfx_fb_copy_area` emulate the behavior of
`gfxfb_blt`, the source coordinates must include the padding offset,
while the destination coordinates must not. The original implementation
omitted the offset from the source coordinates; this change corrects
that.
Additionally, `gfx_fb_cons_display` already applies the padding offset,
so the redundant adjustment is removed.
PR: 296246
Reported by: 2khramtsov at gmail.com
Reviewed by: imp
Tested by: 2khramtsov at gmail.com, junchoon at dec.sakura.ne.jp,
naito.yuichiro_ at gmail.com
Fixes: 32da2f23ae4d
[5 lines not shown]