Re: 64-bit math in the kernel

H. Peter Anvin (
20 Nov 1996 02:56:28 GMT

Followup to: <>
By author: Albert Cahalan <>
In newsgroup:
> What is the best way to divide a __u64 by a __u32 in the kernel?
> The result will fit in a __u32.

There is no way to express that in C, but the x86 DIV instruction will
do exactly that. It sounds like adding some inline assembly functions
(which needs to go into include/asm-* and need equivalents for all
architectures) probably is in order.

Furthermore, it might be worthwhile to provide the equivalent of
libgcc in the kernel.


Not speaking for Transmeta in any way, shape or form.