Skip to contentSkip to conversation

HOWTO do Linux kernel development - take 3

RFC James G. Sack (jim) 2 participants 2 messages Nov 24, 2005 – Nov 28, 2005

lore
Share & tools
lore
#0 lore raw

Pardon the technical question, but..

I wonder if you could either elaborate or give a reference to what is meant by

"Arbitrary long long divisions .. not allowed"

Thanks,
..jim

#1 lore raw
Quoted 6 lines · On Wed, 23 Nov 2005 22:16:40 -0800 James G. Sack (jim) wrote:

Pardon the technical question, but..

I wonder if you could either elaborate or give a reference to what is meant by

"Arbitrary long long divisions .. not allowed"

(if not already answered)

short answer: see include/asm-generic/div64.h

longer answer:

Not supported:

long long numerator, divisor, dividend;
/* init. numerator & divisor */
dividend = numerator / divisor;

Is supported:

uin64_t numerator, dividend;
uint32_t divisor, remainder;
/* init. numerator & divisor */
remainder = do_div(&numerator, divisor);

---
~Randy