The kernel code reads:
I am using do_div() as on x86/32 bits long-long division is supported by GCC via an external function (_udivdi3) which usually lives in libgcc but it is not provided by the kernel.#include <linux/kernel.h>
unsigned long long uSecSinceBoot()
volatile unsigned long long int cpu_ticks;
"mov %%edx, %%ecx\n\t"
unsigned long long div = cpu_ticks * 1000;
do_div(div, cpu_khz); // TRICK! div is modified, do_div() returns reminder
P.S. I did extract _udivdi3 from libgcc and then disassembled/reassembled it but it's a pain. do_div is the right thing to use in the kernel.