This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: libffi for ARM
David Daney writes:
> Andrew Haley wrote:
>
> > + __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \
> > + : "=r" (_beg) \
> > + : "0" (_beg), "r" (_end), "r" (_flg)); \
> > + })
>
> Can that be correct? Both _end and _flg have the generic "r" register
> constraint. Shouldn't they be forced into specific registers?
Congratulations, you have found the first bug.
The kernel source he say:
/*
* Flush a region from virtual address 'r0' to virtual address 'r1'
* _inclusive_. There is no alignment requirement on either address;
* user space does not need to know the hardware cache layout.
*
* r2 contains flags. It should ALWAYS be passed as ZERO until it
* is defined to be something else. For now we ignore it, but may
* the fires of hell burn in your belly if you break this rule. ;)
*
* (at a later date, we may want to allow this call to not flush
* various aspects of the cache. Passing '0' will guarantee that
* everything necessary gets flushed to maintain consistency in
* the specified region).
*/
I will fix.
Andrew.