nrelease: Simplify the setting of disklabel packid/label
The packid (i.e., label name) can be directly set upon the label
creation; no need to edit the disklabel dump file.
pc64: Remove duplicate defines *_SLICE
Code that requires these defines should include <sys/diskslice.h>. For
example, 'stand/boot/pc32/boot2/boot2.c' already did this.
kernel: Fix GPT partition start/end check in gptinit()
The GPT partition ending LBA is inclusive, so it's valid to have a GPT
partition with start == end, i.e., the partition size is 1 block. Fix
gptinit() to support this case. In addition, improve the kprintf()
debug message to show the value of start and ending LBAs.
<sys/diskslice.h>: Fix a comment in 'struct partinfo'
The 'GPT_ENT_TYPE_DRAGONFLY_DISKLABEL32' macro should be
'GPT_ENT_TYPE_DRAGONFLY_LABEL64', as defined in <sys/gpt.h>.
<sys/diskslice.h>: Improve comments for MAX_SLICES
While there, fix the comment for COMPATIBILITY_SLICE, which should be
'<disk>s0' on DragonFly (at least since many years ago).
bsd.kern.mk: Always set '-Wno-unused-but-set-variable'
The check was useful for GCC <4.7, which we no longer has, so just
remove the unnecessary check and always set
'-Wno-unused-but-set-variable'.
Discussed-with: swildner
bsd.{sys,kern}.mk: Fix syntax error in pattern 'gcc[5-]*'
If ${_WCCVER} doesn't match the 'gcc[5-]*' pattern, bmake would generate
this fatal error:
```
Unfinished character list in pattern 'gcc[5-]*' of modifier ':M'
while evaluating variable "_WCCVER" with value "gcc100"
make: Fatal errors encountered -- cannot continue
```
Interestingly, this pattern works as expected if there is match. This
is because bmake matches the pattern along the parsing; it doesn't
validate the pattern syntax before matching it. The bmake code requires
that both the range begin and end be specified. So this is actually a
bug in the bmake code. See also contrib/bmake/str.c:Str_Match().
Reported-by: sparlane (IRC)
Discussed-with: swildner
bsd.{sys,kern}.mk: Fix syntax error in pattern 'gcc[5-]*'
If ${_WCCVER} doesn't match the 'gcc[5-]*' pattern, bmake would generate
this fatal error:
```
Unfinished character list in pattern 'gcc[5-]*' of modifier ':M'
while evaluating variable "_WCCVER" with value "gcc100"
make: Fatal errors encountered -- cannot continue
```
Interestingly, this pattern works as expected if there is match. This
is because bmake matches the pattern along the parsing; it doesn't
validate the pattern syntax before matching it. The bmake code requires
that both the range begin and end be specified. So this is actually a
bug in the bmake code. See also contrib/bmake/str.c:Str_Match().
Reported-by: sparlane (IRC)
Discussed-with: swildner
acpica: Some cleanups to acpi_hpet.c
Similar to the cleanups to acpi_timer.c, simplify the if-else
conditional in *_get_timecount() functions, define the ACPI_HPET_MASK
and ACPI_HPET_HIBITS constants.
Meanwhile, adjust the return type of 'acpi_hpet_read()' to uint32_t for
consistency.
kern: Tweak hardclock() to print the number of missed seconds
It could be helpful in debugging some timer bugs, e.g., the recent ACPI
timer underflow bug.
acpica: Further clean up acpi_timer.c
- Simplify the if-else conditional in acpi_timer_get_timecount*()
functions.
- Define constants for the hardcoded 24/32-bit masks.
- Tweak whitespaces.
acpica: Fix unexpected underflow bug in acpi_cputimer.base
The acpi_timer_construct() might underflow timer->base, and this
underflow was unexpected and not handled by acpi_timer_get_timecount*()
functions. As a result, they might return an extremely huge time count
(e.g., 18446744073706228405) and thus lead to an utterly wrong uptime
(e.g., 42951days ...).
In order to fix the bug and not further complicate the code, introduce
a separate static variable 'acpi_global_offset' to store the offset
between the given 'oldclock' and the initial counter read from the
timer. This 'acpi_global_offset' is then kept intact, and later
_acpi_get_timer{,_safe}() calls would give the delta over the base
'oldclock'. Then we deal with the adjusted counter from
_acpi_get_timer{,_safe}() in the same way as the original counter and
check for wraparounds in acpi_timer_get_timecount*() functions.
In this way, we don't need to worry about the underflow of 'timer->base'
and achieve a time count monotonically increasing from the 'oldclock'
given to the acpi_timer_construct().
[5 lines not shown]
acpica: Fix the comment of acpi_timer_get_timecount*()
- Remove the obsolete comment about per-cpu tracking and clock_lock();
see commit: 8fbc264d2bc2add66aefe4f4a7966c4364da1211
- Update the comment about the return value to be 64 bit.
pc64: Improve startrtclock() to print more info about TSC
Improve the kprintf() message to explicitly show whether the TSC is
invariant or not. In addition, show whether the invariant is forced by
the "hw.tsc_cputimer_force=1" tunable.
x86_64/identcpu: Print detected VMM/hypervisor vendor/origin
Note that the <vmm_vendor> may be empty. For example, VirtualBox
doesn't advertise the vendor name when using the "Minimal"
paravirtualization interface.
Credit: FreeBSD
x86_64/initcpu: Improve VMM/hypervisor detection
Improve detect_vmm() to use a table of VMMs to detect the supported
VMMs/hypervisors, and then add the detection of Xen, bhyve, VirtualBox.
Credit: FreeBSD
syscons - add sysctl to disable console bell globally
Add sysctl `kern.syscons.enable_bell`, which globally disables the
system console bell ("sc_beep") when set to 0. By default the bell is
on.
To silence all beeps, add this to /etc/sysctl.conf:
kern.syscons.enable_bell=0
This has the same effect as tcsh's "set nobeep". But there is no such
setting to my knowledge for our "/bin/sh".