git: kernel: Provide __udivti3() for intermediate 128-bit calculations.
swildner at crater.dragonflybsd.org
Mon Sep 21 05:58:38 PDT 2020
Author: Sascha Wildner <saw at online.de>
Date: Mon Sep 21 14:58:31 2020 +0200
kernel: Provide __udivti3() for intermediate 128-bit calculations.
The recent refactoring of sysclock_t from 32 to 64 bits added -lgcc
to the kernel for this purpose but this approach has a number of
* It prevents the kernel from linking with clang that does these
* We don't generally want to link the kernel against any userspace
libraries. Even less if these are GPL licensed libraries.
So the best solution is to provide __udivti3() in the kernel, too.
The code of the __udivmodti4() function (of which __udivti3() is a
special case) was taken from an older LLVM/clang C runtime library
and is MIT licensed. I've added the (dual-)license and list of
The commit also adds kernel specific _uint128_t and _int128_t
types. The choice of names is deliberate, in order to avoid
conflicting with internal types provided by compilers.
Summary of changes:
sys/conf/kern.pre.mk | 4 +-
sys/cpu/x86_64/include/stdint.h | 6 +
sys/platform/pc64/conf/files | 1 +
sys/platform/pc64/x86_64/__udivti3.c | 318 +++++++++++++++++++++++++++++++++++
sys/sys/systm.h | 9 +-
5 files changed, 331 insertions(+), 7 deletions(-)
create mode 100644 sys/platform/pc64/x86_64/__udivti3.c
DragonFly BSD source repository
More information about the Commits