sleep command with armv6hf

Weiß, Jürgen weiss at uni-mainz.de
Sat Apr 5 16:25:11 UTC 2014


under armv6hf the sleep command gives

sleep: nanosleep: Invalid argument

Further investigations seem to indicate the following problem:

sleep calls the function __aeabi_d2lz

        vmov    r0, r1, d8
        bl      __aeabi_d2lz
        mov     r4, r0
        mov     r5, r1

with the argument in the r0/r1 registers. But the function
in libgcc.a expects the argument in d0 (seems to be
compiled with hardfloat as well).

__aeabi_d2lz:
   0:   e92d4010        push    {r4, lr}
   4:   ec52cb10        vmov    ip, r2, d0
   8:   e3a000ff        mov     r0, #255        ; 0xff
   c:   e59f10a8        ldr     r1, [pc, #168]  ; bc <__aeabi_d2lz+0xbc>
  10:   e3800c07        orr     r0, r0, #1792   ; 0x700
  14:   e0004a22        and     r4, r0, r2, lsr #20

Besides, when compiling sleep without optimization, the argument
for __aeabi_d2lz by chance is in d0 as well as r0/r1. So this
accidentally works.


Regards

Juergen



More information about the freebsd-arm mailing list