test: Integrate benchmark into cryptoapi_test util
Print execution times and add "-n REPETITIONS" option.
Take the benchmark results with a grain of salt when comparing the
cryptoapi results against the cryptodev results, as we do not use
the AESNI CPU instruction when crytoapi is used outside the kernel.
While there, parse CLI options using getopt(3) and add a few more
test fixtures.
cryptoapi: inline functions and s/blocklen/blocksize/
- Inline a few functions which previously were macros
- Consistently use "blocksize" instead of "blocklen"
- Use uint8_t for alpha instead of int
- Use memset() in proximity of memcpy()
- Non-functional change
libusb: Implement v1.0 libusb_get_version() API
It seems our USB stack was synced from FreeBSD in 2016, so I inherit the
'nano = 2016' version info from FreeBSD.
This function is at least used by 'sysutils/nut' to fill the
'driver.version.usb' metadata in 'usbhid-ups' driver. The return value
doesn't matter at all.
Obtained-from: FreeBSD (commit 14b896ce80daad378a70a125ca15c2e23cd8d34b)
libusb: Implement v1.0 libusb_get_port_number() API
This function is also used by 'sysutils/nut' to scan the USB devices.
However, nut uses dlopen() to determine the presence of this API and
allows it to be absent.
Obtained-from: FreeBSD (commit 0f2c706643ff211ce1e1eb0cfbc3c05bc67f2311)
hammer2 - Enhance "show" (debugging feature)
Enhance the hammer2 show command to allow a chainspec to be specified
to dump a specific chain. The output will also print the xxhash64
value for the buffer.
vi(1): Tweak and clean up Makefile
- Group -D__REGEX_PRIVATE with -I${SRCDIR}/regex
- Update config.h to define USE_WIDECHAR, which aligns with the vendor
generated one.
test: Use snapshot testing for cryptoapi/cryptodev
The tests I wrote for cryptoapi where based on comparing the results
against the results of cryptodev - if they match, the test succeeds. But
as I am planning to remove cryptodev, this test methodology no longer
works.
Instead, store the test input data in fixtures.csv and run the test case
for each input. The generated output should then match the
expected_output.md in order for the tests to pass. This simplifies
adding new test fixtures and allows for re-generating the
expected_output.md.
sys/conf: continue to build kernel despite removal of devices
Commit 980dc6f5ee469df858eb285322bf689882073b07 removed the hifn(4),
safe(4), ubsec(4) and padlock(4) drivers. With this change, every
KERNELCONF that still refers to any of those devices or related options
like for example "device hifn" or "options HIFN_RNDTEST" would no longer
build.
Obsolete these devices and emit a warning, but do not break the build.
Suggested-by: Aaron Li
arcmsr.h: Include sys/bus.h header
The "arcmsr.h" header file uses types like bus_space_handle_t defined in
"sys/bus.h", but it does not include the "sys/bus.h" header itself. This
can cause build breakage elsewhere.
The build of "usr.bin/kdump" depends on the auto-generated file
"ioctl.c" created by the "mkioctls" script. Within the generated
"ioctl.c" file, various header files are included. Some of these header
files (namely "arcmsr.h") might depend on the order in which the header
files are included or depend on other header files being included before
themselves.
In the process of removing cryptodev, I noticed build breakage of kdump
when "sys/cryptodev.h" is removed. This is because "sys/cryptodev.h"
includes "sys/bus.h" and is placed before the include of "arcmsr.h"
(within the auto-generated "ioctl.c"). So removing "sys/cryptodev.h"
would lead to type definitions from "arcmsr.h" refering to yet undefined
types from "sys/bus.h".
libexec/customcc: Fix a wrong variable name
Obviously, the variable for C++ compiler should be ${CUSTOM_CXXFLAGS}
instead of ${CUSTOM_CFLAGS}. This bug was introduced in commit
571f588a5c6622ead0ed757b2884a76bb45bdb56.
libexec/customcc: Fix bug with the `[ -n ${X} ]` conditional
Before this fix, command `CCVER=xxx cc --version` failed with a strange
error:
```
exec: --version: not found
```
which was given by this customcc wrapper script. The expected error
should be:
```
xxx_CC undefined, see compilers.conf(5)
```
It turned out this was caused by the `[ -n ${X} ]` conditional: `[ -n ]`
evaluates to *true*, while `[ -n "" ]` evaulates to *false*.
Interestingly, both `[ -z ]` and `[ -z "" ]` evaulates to *false*. The
original version of this wrapper used `[ -z ${X} ]` style and it worked
fine, but commit 571f588a5c6622ead0ed757b2884a76bb45bdb56 changed it to
`[ -n ${X} ]` style and thus broke it.
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.
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.
objformat.1: Document the fallback behavior to use external compilers
When objformat(1) cannot find any of /usr/libexec/<ccver>/prog, it will
fallback to use /usr/libexec/custom/prog to access external compilers
defined by compilers.conf(5).
mk/sys.mk: Explain a bit more about ${WORLD_ALTCOMPILER}
It was introduced in commit 8d7da4247e43eb2bbe924d08f6a40ef80d742515 for
supporting multiple alternative compilers.