Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      


__udivdi3 __umoddi3 - 64 bit division in linux

If you've encountered an error message like this
Unknown symbol __udivdi3
Unknown symbol __umoddi3
Unresolved symbol __udivdi3
Unresolved symbol __umoddi3
you most likely want to make a 64 bit division, which is not supported by default in linux kernel space.


To solve this problem, you need to use the do_div macro available in asm/div64.h:
#include <asm/div64.h>
unsigned long long x, y, result;
unsigned long mod;
mod = do_div(x, y);
result = x;
If you want to calculate x / y with do_div(x, y), the result of the division is in x, the remainder is returned from the do_div function.


Since do_div is just an asm (assembler) macro, it doesn't break real time determinism, so it's also suitable for use in RTAI classic, RTAI fusion and ADEOS/ADEOS-IPIPE applications.

Last-Modified: Sat, 04 Feb 2006 16:03:00 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top