[kaffe] ARM EABI fixed cache_flush but broken VMDouble.toString

Steven Newbury s_j_newbury at yahoo.co.uk
Sat Apr 28 06:11:10 PDT 2007


In this post:
http://www.kaffe.org/pipermail/kaffe/2007-April/104908.html

Dalibor Topic asked whether the INTERNAL_SYSCALL_ARM macros from glibc ports
would fix the ARM build in recent kernels:

Dalibor Topic wrote:
> OK. I've also dug around in glibc-ports-2.5,  but I don't have a 
> suitable cross-compiler toolchain atm.
> 
> here's what's in glibc-ports-2.5 (suitably cut and paste from two files):
<snip code>

It is sufficient for OABI, for compatibility with EABI too something like this
is needed (I've kept the comment from glibc for clarity):


#ifdef __ARM_EABI__
/* The ARM EABI user interface passes the syscall number in r7, instead
   of in the swi.  This is more efficient, because the kernel does not need 
   to fetch the swi from memory to find out the number; which can be painful
   with separate I-cache and D-cache.  Make sure to use 0 for the SWI
   argument; otherwise the (optional) compatibility code for APCS binaries
   may be invoked.  */

#undef INTERNAL_SYSCALL_RAW
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)            \
  ({                                                            \
       register int _a1 asm ("r0"), _nr asm ("r7");             \
       LOAD_ARGS_##nr (args)                                    \
       _nr = name;                                              \
       asm volatile ("swi       0x0     @ syscall " #name       \
                     : "=r" (_a1)                               \
                     : "r" (_nr) ASM_ARGS_##nr                  \
                     : "memory");                               \
       _a1; })
#else
#undef INTERNAL_SYSCALL_RAW
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)            \
  ({ unsigned int _sys_result;                                  \
     {                                                          \
       register int _a1 asm ("a1");                             \
       LOAD_ARGS_##nr (args)                                    \
       asm volatile ("swi       %1      @ syscall " #name       \
                     : "=r" (_a1)                               \
                     : "i" (name) ASM_ARGS_##nr                 \
                     : "memory");                               \
       _sys_result = _a1;                                       \
     }                                                          \
     (int) _sys_result; })
#endif

With this done I have a successful build with a working cache_flush function,
however attempting to run a java program results in:

zaurus java # java HelloWorldApp       
Internal error: caught an unexpected exception.
Please check your CLASSPATH and your installation.
java/lang/UnsatisfiedLinkError: Failed to locate native function:      
java/lang/VMDouble.toString(DZ)Ljava/lang/String;
   at java.lang.ClassLoader.getSystemClassLoader (ClassLoader.java:799)
Aborted

I'm working against a checkout of the current kaffe CVS.

My target machine is a PXA270 with a iwmmxt native gcc-4.3 toolchain (using
-ftree-vectorize), so softfloat only.  Disassembly of libkaffevm-1.1.8-pre.so
shows the functions handling doubles etc using 64bit iWMMXt registers which is
nice.

I'm going to do more digging and see if I can figure it out.

Steve


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 



More information about the kaffe mailing list