• Alessandro Rubini's avatar
    arith.c: use __div64_32 from the library · 7e5fe21c
    Alessandro Rubini authored
    This change is needed to avoid requiring libgcc in freestanding
    environments.
    
    The div64 function I copied from the kernel only works with unsigned
    numbers, but arth.h had them signed. I'm not sure at this point
    whether PTP uses negative nanoseconds in this conversion, so I added a
    diagnostic message. If it triggers, I can look for a solution, but I
    suspect it doesn't happen.
    
    Please note that a 64-bit arch may define the function as an inline
    that does the calculation with C operators, but currently
    arch-gnu-linux is used for both 32-bit and 64-bit hosts.
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    7e5fe21c
arith.c 2.48 KB