opnsense-src/sys
Warner Losh 68f57679d6 Ensure that all values of ns, us and ms work for {n,u,m}stosbt
Integer overflows and wrong constants limited the accuracy of these
functions and created situatiosn where sbttoXs(Xstosbt(Y)) != Y. This
was especailly true in the ns case where we had millions of values
that were wrong.

Instead, used fixed constants because there's no way to say ceil(X)
for integer math. Document what these crazy constants are.

Also, use a shift one fewer left to avoid integer overflow causing
incorrect results, and adjust the equasion accordingly. Document this.

Allow times >= 1s to be well defined for these conversion functions
(at least the Xstosbt). There's too many users in the tree that they
work for >= 1s.

This fixes a failure on boot to program firmware on the mlx4
NIC. There was a msleep(1000) in the code. Prior to my recent rounding
changes, msleep(1000) worked, but msleep(1001) did not because the old
code rounded to just below 2^64 and the new code rounds to just above
it (overflowing, causing the msleep(1000) to really sleep 1ms).

A test program to test all cases will be committed shortly. The test
exaustively tries every value (thanks to bde for the test).

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D18051
2018-11-20 07:11:23 +00:00
..
amd64 Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. 2018-11-16 21:27:11 +00:00
arm acpica: rework INTRNG interrupts 2018-11-19 03:02:47 +00:00
arm64 gitv3_its: fixes for multiple GIC ITS blocks 2018-11-19 03:52:56 +00:00
bsm
cam Add cam_iosched_set_latfcn to set a latency callback for high latency. 2018-11-15 16:02:45 +00:00
cddl Add d_off support for multiple filesystems. 2018-11-14 14:18:35 +00:00
compat Do proper copyin of control message data in the Linux sendmsg syscall. 2018-11-19 15:31:54 +00:00
conf cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. 2018-11-19 21:59:07 +00:00
contrib Ensure that libnv can be used when kern.trap_enotcap=1. 2018-11-13 20:07:55 +00:00
crypto rijndael (AES): Avoid leaking sensitive data on kernel stack 2018-10-26 20:53:01 +00:00
ddb ddb: Enable 'thread <address>' 2018-10-20 20:45:49 +00:00
dev For consistency within the front-end, prefer SDHCI_{READ,WRITE}_{2,4}() 2018-11-19 23:56:33 +00:00
dts Fix test-dts{,o} targets 2018-11-12 22:18:11 +00:00
fs Improve sanity checking for the dircount hint argument to 2018-11-20 01:59:57 +00:00
gdb
geom Revert r340187, it breaks EOD (end-of-device) detection logic. Turns out, 2018-11-07 16:28:09 +00:00
gnu Update our devicetree to 4.19 for arm and arm64 2018-11-10 21:02:32 +00:00
i386 Add evdev support to amd64 and i386 kernels 2018-11-12 21:01:28 +00:00
isa Reapply, with minor tweaks, r338025, from the original commit: 2018-09-26 17:12:14 +00:00
kern acpi: fix acpi_ec_probe to only check EC devices 2018-11-19 18:29:03 +00:00
kgssapi OpenCrypto: Convert sessions to opaque handles instead of integers 2018-07-18 00:56:25 +00:00
libkern mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
mips Fix access to cpu_model[] in mtk_soc_set_cpu_model() 2018-11-19 06:48:48 +00:00
modules cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. 2018-11-19 21:59:07 +00:00
net Allow configuration of several ipsec interfaces with the same tunnel 2018-11-16 14:21:57 +00:00
net80211 Fix misspellings of transmitter/transmitted 2018-08-10 20:37:32 +00:00
netgraph Unbreak ng_source(4) for 64-bit platforms including amd64. 2018-11-19 07:27:50 +00:00
netinet Improve the comment for arpresolve_full() in if_ether.c. 2018-11-17 16:13:09 +00:00
netinet6 Add ability to use dynamic external prefix in ipfw_nptv6 module. 2018-11-12 11:20:59 +00:00
netipsec Add sadb_x_sa2 extension to SADB_ACQUIRE requests. 2018-10-21 14:19:16 +00:00
netpfil Add ability to use dynamic external prefix in ipfw_nptv6 module. 2018-11-12 11:20:59 +00:00
netsmb Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
nfs Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
nfsclient
nfsserver
nlm
ofed Introduce and use sgid_index in CM requests in ibcore. 2018-09-09 07:20:15 +00:00
opencrypto Add sha224 to the authctx union. 2018-10-23 18:07:37 +00:00
powerpc powerpc: Sync icache on SIGILL, in case of cache issues 2018-11-19 23:54:49 +00:00
riscv RISC-V: Implement get_cyclecount(9). 2018-11-13 18:20:27 +00:00
rpc Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done. 2018-07-20 12:03:16 +00:00
security Add const to input-only char * arguments. 2018-11-02 20:50:22 +00:00
sparc64 Given that the idea of D15374 was to "make memmove a first class citizen", 2018-11-20 00:08:33 +00:00
sys Ensure that all values of ns, us and ms work for {n,u,m}stosbt 2018-11-20 07:11:23 +00:00
teken Implement ECMA-48 "REP", some Linuxen have started emitting them recently. 2018-10-21 08:29:36 +00:00
tests epoch_test: fix compile 2018-07-15 00:31:17 +00:00
tools Use ${ECHO} in dtb/dtbo build, pass in from dtb.mk for -s 2018-11-09 18:56:40 +00:00
ufs Add d_off support for multiple filesystems. 2018-11-14 14:18:35 +00:00
vm Use swp_pager_isondev() throughout. Submitted by: ota@j.email.ne.jp 2018-11-19 17:17:23 +00:00
x86 Axe MINIMUM_MSI_INT. 2018-11-16 23:39:39 +00:00
xdr
xen xen: legacy PVH fixes for the new interrupt count 2018-09-13 07:14:11 +00:00
Makefile