jamvm-1.5.0.patch.avr32 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. diff -urpN jamvm-1.5.0/configure jamvm-1.5.0-avr32/configure
  2. --- jamvm-1.5.0/configure 2007-10-29 06:37:06.000000000 +0100
  3. +++ jamvm-1.5.0-avr32/configure 2008-02-08 09:20:37.000000000 +0100
  4. @@ -2550,6 +2550,7 @@ i386-*-openbsd*) host_os=bsd libdl_neede
  5. i386-*-freebsd*) host_os=bsd libdl_needed=no ;;
  6. x86_64-*-linux*) host_os=linux ;;
  7. hppa*-*-linux*) host_cpu=parisc host_os=linux ;;
  8. +avr32*-*-linux*) host_cpu=avr32 host_os=linux ;;
  9. mipsel-*-linux*) host_cpu=mips host_os=linux ;;
  10. amd64-*-openbsd*) host_os=bsd libdl_needed=no ;;
  11. amd64-*-freebsd*) host_os=bsd libdl_needed=no ;;
  12. @@ -22839,7 +22840,7 @@ fi
  13. ac_config_links="$ac_config_links src/arch.h:src/arch/$arch.h"
  14. -ac_config_files="$ac_config_files Makefile src/Makefile src/interp/Makefile src/interp/engine/Makefile src/arch/Makefile src/os/Makefile src/os/linux/Makefile src/os/darwin/Makefile src/os/bsd/Makefile src/os/linux/powerpc/Makefile src/os/linux/arm/Makefile src/os/linux/i386/Makefile src/os/linux/x86_64/Makefile src/os/linux/parisc/Makefile src/os/linux/mips/Makefile src/os/darwin/i386/Makefile src/os/darwin/powerpc/Makefile src/os/bsd/powerpc/Makefile src/os/bsd/arm/Makefile src/os/bsd/i386/Makefile src/os/bsd/x86_64/Makefile lib/Makefile lib/java/Makefile lib/java/lang/Makefile lib/jamvm/Makefile lib/jamvm/java/Makefile lib/jamvm/java/lang/Makefile lib/java/lang/reflect/Makefile lib/java/security/Makefile lib/gnu/Makefile lib/sun/reflect/annotation/Makefile lib/sun/reflect//Makefile lib/sun/Makefile lib/gnu/classpath/Makefile"
  15. +ac_config_files="$ac_config_files Makefile src/Makefile src/interp/Makefile src/interp/engine/Makefile src/arch/Makefile src/os/Makefile src/os/linux/Makefile src/os/darwin/Makefile src/os/bsd/Makefile src/os/linux/powerpc/Makefile src/os/linux/arm/Makefile src/os/linux/i386/Makefile src/os/linux/x86_64/Makefile src/os/linux/avr32/Makefile src/os/linux/parisc/Makefile src/os/linux/mips/Makefile src/os/darwin/i386/Makefile src/os/darwin/powerpc/Makefile src/os/bsd/powerpc/Makefile src/os/bsd/arm/Makefile src/os/bsd/i386/Makefile src/os/bsd/x86_64/Makefile lib/Makefile lib/java/Makefile lib/java/lang/Makefile lib/jamvm/Makefile lib/jamvm/java/Makefile lib/jamvm/java/lang/Makefile lib/java/lang/reflect/Makefile lib/java/security/Makefile lib/gnu/Makefile lib/sun/reflect/annotation/Makefile lib/sun/reflect//Makefile lib/sun/Makefile lib/gnu/classpath/Makefile"
  16. cat >confcache <<\_ACEOF
  17. @@ -23475,6 +23476,7 @@ do
  18. "src/os/linux/i386/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/linux/i386/Makefile" ;;
  19. "src/os/linux/x86_64/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/linux/x86_64/Makefile" ;;
  20. "src/os/linux/parisc/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/linux/parisc/Makefile" ;;
  21. + "src/os/linux/avr32/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/linux/avr32/Makefile" ;;
  22. "src/os/linux/mips/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/linux/mips/Makefile" ;;
  23. "src/os/darwin/i386/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/darwin/i386/Makefile" ;;
  24. "src/os/darwin/powerpc/Makefile") CONFIG_FILES="$CONFIG_FILES src/os/darwin/powerpc/Makefile" ;;
  25. diff -urpN jamvm-1.5.0/src/alloc.c jamvm-1.5.0-avr32/src/alloc.c
  26. --- jamvm-1.5.0/src/alloc.c 2007-10-22 01:24:22.000000000 +0200
  27. +++ jamvm-1.5.0-avr32/src/alloc.c 2008-02-08 09:20:38.000000000 +0100
  28. @@ -274,6 +274,11 @@ void initialiseAlloc(InitArgs *args) {
  29. #else
  30. char *mem = (char*)mmap(0, args->max_heap, PROT_READ|PROT_WRITE,
  31. MAP_PRIVATE|MAP_ANON, -1, 0);
  32. +// char *mem = (char*)mmap(0, 8196, PROT_READ|PROT_WRITE,
  33. +// MAP_PRIVATE|MAP_ANON, -1, 0);
  34. +//TODO: lto
  35. +//jam_printf("trying to mmap max:%lo min:%lo heap\n",args->max_heap , args->max_heap);
  36. +//jam_printf("mem: %d %d\n",mem,MAP_FAILED);
  37. if(mem == MAP_FAILED) {
  38. #endif
  39. perror("Aborting the VM -- couldn't allocate the heap");
  40. @@ -2214,7 +2219,7 @@ void *sysMalloc(int size) {
  41. int n = size < sizeof(void*) ? sizeof(void*) : size;
  42. void *mem = malloc(n);
  43. - if(mem == NULL) {
  44. + if(mem == NULL && n != 0) {
  45. jam_fprintf(stderr, "Malloc failed - aborting VM...\n");
  46. exitVM(1);
  47. }
  48. diff -urpN jamvm-1.5.0/src/arch/avr32.h jamvm-1.5.0-avr32/src/arch/avr32.h
  49. --- jamvm-1.5.0/src/arch/avr32.h 1970-01-01 01:00:00.000000000 +0100
  50. +++ jamvm-1.5.0-avr32/src/arch/avr32.h 2008-02-08 09:20:41.000000000 +0100
  51. @@ -0,0 +1,109 @@
  52. +/*
  53. + * Copyright (C) 2003, 2004, 2005, 2006, 2007
  54. + * Robert Lougher <rob@lougher.org.uk>.
  55. + *
  56. + * This file is part of JamVM.
  57. + *
  58. + * This program is free software; you can redistribute it and/or
  59. + * modify it under the terms of the GNU General Public License
  60. + * as published by the Free Software Foundation; either version 2,
  61. + * or (at your option) any later version.
  62. + *
  63. + * This program is distributed in the hope that it will be useful,
  64. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  65. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  66. + * GNU General Public License for more details.
  67. + *
  68. + * You should have received a copy of the GNU General Public License
  69. + * along with this program; if not, write to the Free Software
  70. + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  71. + */
  72. +
  73. +#define OS_ARCH "avr32"
  74. +//#ifndef DEBUG
  75. +//#define DEBUG
  76. +//#endif
  77. +
  78. +/* Override default min and max heap sizes. AVR32 machines are
  79. + usually embedded, and the standard defaults are too large. */
  80. +#define DEFAULT_MAX_HEAP 8*MB
  81. +#define DEFAULT_MIN_HEAP 1*MB
  82. +
  83. +#define HANDLER_TABLE_T static const void
  84. +#define DOUBLE_1_BITS 0x3ff0000000000000LL
  85. +
  86. +#define READ_DBL(v,p,l) v = ((u8)p[0]<<56)|((u8)p[1]<<48)|((u8)p[2]<<40) \
  87. + |((u8)p[3]<<32)|((u8)p[4]<<24)|((u8)p[5]<<16) \
  88. + |((u8)p[6]<<8)|(u8)p[7]; p+=8
  89. +
  90. +//extern void setDoublePrecision();
  91. +#define FPU_HACK
  92. +
  93. +//#define COMPARE_AND_SWAP(addr, old_val, new_val) ({char result;result;})
  94. +//static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned int old,
  95. +// unsigned int new)
  96. +//{
  97. +// int ret;
  98. +// //printf("compare and swap %d %d %s:line%d\n",old,new,__FILE__,__LINE__);
  99. +// asm volatile(
  100. +// "1: ssrf 5\n"
  101. +// " ld.w %[ret], %[m]\n"
  102. +// " cp.w %[ret], %[old]\n"
  103. +// " brne 2f\n"
  104. +// " stcond %[m], %[new]\n"
  105. +// " brne 1b\n"
  106. +// "2:\n"
  107. +// : [ret] "=&r"(ret), [m] "=m"(*m)
  108. +// : "m"(*m), [new] "r"(new), [old] "r"(old)
  109. +// : "memory", "cc");
  110. +// return ret;
  111. +//}
  112. +
  113. +//see C:\Cygwin\usr\local\avr32-linux\include\bits\atomicity.h
  114. +//see http://www.avr32linux.org/twiki/bin/view/Main/AtomicOperations
  115. +//see http://www.mail-archive.com/uclibc@uclibc.org/msg00914.html
  116. +//http://www.avr32linux.org/twiki/pub/Main/MicroClibcPatches/uClibc-0.9.28-avr32-20060621.patch
  117. +//http://www.google.com/codesearch?hl=en&q=+cmpxchg+avr32+show:WwwDfOAAdbA:L2BlPHy6h_g:nY7RakaTOnE&sa=N&cd=1&ct=rc&cs_p=http://gobo.calica.com/packages/official/Linux--2.6.20.4-r1--i686.tar.bz2&cs_f=Linux/2.6.20.4/Resources/Unmanaged/Files/Compile/Sources/linux-2.6.20.4/include/asm-avr32/system.h#first
  118. +//#define COMPARE_AND_SWAP(p, oldval, newval)({ \
  119. +// printf("compare and swap %d %d %s:line%d\n",oldval,newval,__FILE__,__LINE__); \
  120. +// __cmpxchg_u32(p,oldval,newval);\
  121. +//})
  122. +
  123. +// printf("compare and swap %d %d %s:line %d\n",old_val,new_val,__FILE__,__LINE__);
  124. +#define COMPARE_AND_SWAP(addr, old_val, new_val) \
  125. +({ \
  126. + int result; \
  127. + __asm__ __volatile__ (" \
  128. + 1: ssrf 5; \
  129. + ld.w %[ret], %[m]; \
  130. + cp.w %[ret], %[old]; \
  131. + brne 2f; \
  132. + stcond %[m], %[new]; \
  133. + brne 1b; \
  134. + 2:" \
  135. + : [ret] "=&r" (result), [m] "=m" (*addr) \
  136. + : "m" (*addr), [old] "r" (old_val), [new] "r" (new_val) \
  137. + : "memory", "cc"); \
  138. + result; \
  139. +})
  140. +
  141. +//ssrf 5 :set lock bit
  142. +//stcond :store param2 when lock is set
  143. +//sreq :If equal set register to true or false
  144. +//brne :Branch when not equal
  145. +//brne 1b :When the lock wasn't set anymore, try again
  146. +//label 1b 2f :first label named 1/2 before/after
  147. +#define FLUSH_CACHE(addr, length)
  148. +
  149. +#define LOCKWORD_READ(addr) *addr
  150. +#define LOCKWORD_WRITE(addr, value) *addr = value
  151. +#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
  152. + COMPARE_AND_SWAP(addr, old_val, new_val)
  153. +
  154. +#define UNLOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
  155. +#define JMM_LOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
  156. +#define JMM_UNLOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
  157. +
  158. +//TODO: lto
  159. +#define MBARRIER() __asm__ __volatile__ ("" ::: "memory")
  160. +//#define MBARRIER() __asm__ __volatile__ ("lock; addl $0,0(%%esp)" ::: "memory")
  161. diff -urpN jamvm-1.5.0/src/arch/Makefile.am jamvm-1.5.0-avr32/src/arch/Makefile.am
  162. --- jamvm-1.5.0/src/arch/Makefile.am 2007-10-28 00:19:26.000000000 +0200
  163. +++ jamvm-1.5.0-avr32/src/arch/Makefile.am 2008-02-08 09:20:41.000000000 +0100
  164. @@ -19,4 +19,4 @@
  165. ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  166. ##
  167. -EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h
  168. +EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h avr32.h
  169. diff -urpN jamvm-1.5.0/src/arch/Makefile.in jamvm-1.5.0-avr32/src/arch/Makefile.in
  170. --- jamvm-1.5.0/src/arch/Makefile.in 2007-10-29 07:02:36.000000000 +0100
  171. +++ jamvm-1.5.0-avr32/src/arch/Makefile.in 2008-02-08 09:20:41.000000000 +0100
  172. @@ -162,7 +162,7 @@ top_srcdir = @top_srcdir@
  173. use_zip_no = @use_zip_no@
  174. use_zip_yes = @use_zip_yes@
  175. with_classpath_install_dir = @with_classpath_install_dir@
  176. -EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h
  177. +EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h avr32.h
  178. all: all-am
  179. .SUFFIXES:
  180. diff -urpN jamvm-1.5.0/src/class.c jamvm-1.5.0-avr32/src/class.c
  181. --- jamvm-1.5.0/src/class.c 2007-10-29 05:45:32.000000000 +0100
  182. +++ jamvm-1.5.0-avr32/src/class.c 2008-02-08 09:20:37.000000000 +0100
  183. @@ -40,6 +40,8 @@
  184. #define SCAVENGE(ptr) FALSE
  185. #define FOUND(ptr) ptr
  186. +#define TRACE(fmt, ...) jam_printf(fmt, ## __VA_ARGS__)
  187. +
  188. static int verbose;
  189. static char *bootpath;
  190. static char *classpath;
  191. @@ -1273,6 +1275,9 @@ Class *findSystemClass0(char *classname)
  192. }
  193. Class *findSystemClass(char *classname) {
  194. +#ifdef DEBUG
  195. + TRACE(">>>>>>finding class: %s\n", classname);
  196. +#endif
  197. Class *class = findSystemClass0(classname);
  198. if(!exceptionOccurred())
  199. @@ -1383,18 +1388,32 @@ Class *findClassFromClassLoader(char *cl
  200. }
  201. Object *getSystemClassLoader() {
  202. +#ifdef DEBUG
  203. + printf("%s: %d: trying to find ClassLoader\n",__FILE__,__LINE__);
  204. +#endif
  205. Class *class_loader = findSystemClass("java/lang/ClassLoader");
  206. if(!exceptionOccurred()) {
  207. +#ifdef DEBUG
  208. + printf("%s: %d: found ClassLoader\n",__FILE__,__LINE__);
  209. +#endif
  210. MethodBlock *mb;
  211. if((mb = findMethod(class_loader, "getSystemClassLoader",
  212. "()Ljava/lang/ClassLoader;")) != NULL) {
  213. +#ifdef DEBUG
  214. + printf("%s: %d: executing static SystemClassLoader",__FILE__,__LINE__);
  215. +#endif
  216. +
  217. Object *system_loader = *(Object**)executeStaticMethod(class_loader, mb);
  218. if(!exceptionOccurred())
  219. return system_loader;
  220. }
  221. +#ifdef DEBUG
  222. + }else{
  223. + printf("%s: %d: found ClassLoader WITH EXCEPTION\n",__FILE__,__LINE__);
  224. +#endif
  225. }
  226. return NULL;
  227. }
  228. diff -urpN jamvm-1.5.0/src/interp/direct.c jamvm-1.5.0-avr32/src/interp/direct.c
  229. --- jamvm-1.5.0/src/interp/direct.c 2007-10-26 05:10:47.000000000 +0200
  230. +++ jamvm-1.5.0-avr32/src/interp/direct.c 2008-02-08 09:20:40.000000000 +0100
  231. @@ -31,7 +31,7 @@
  232. #include "interp.h"
  233. #ifdef TRACEDIRECT
  234. -#define TRACE(fmt, ...) jam_printf(fmt, ## __VA_ARGS__)
  235. +#define TRACE(fmt, ...) printf(fmt, ## __VA_ARGS__)
  236. #else
  237. #define TRACE(fmt, ...)
  238. #endif
  239. Binary files jamvm-1.5.0/src/interp/engine/compute_relocatability and jamvm-1.5.0-avr32/src/interp/engine/compute_relocatability differ
  240. diff -urpN jamvm-1.5.0/src/os/linux/avr32/dll_md.c jamvm-1.5.0-avr32/src/os/linux/avr32/dll_md.c
  241. --- jamvm-1.5.0/src/os/linux/avr32/dll_md.c 1970-01-01 01:00:00.000000000 +0100
  242. +++ jamvm-1.5.0-avr32/src/os/linux/avr32/dll_md.c 2008-02-08 09:20:38.000000000 +0100
  243. @@ -0,0 +1,669 @@
  244. +/*
  245. + * Copyright (C) 2003, 2004, 2005, 2006, 2007
  246. + * Robert Lougher <rob@lougher.org.uk>.
  247. + *
  248. + * This file is part of JamVM.
  249. + *
  250. + * This program is free software; you can redistribute it and/or
  251. + * modify it under the terms of the GNU General Public License
  252. + * as published by the Free Software Foundation; either version 2,
  253. + * or (at your option) any later version.
  254. + *
  255. + * This program is distributed in the hope that it will be useful,
  256. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  257. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  258. + * GNU General Public License for more details.
  259. + *
  260. + * You should have received a copy of the GNU General Public License
  261. + * along with this program; if not, write to the Free Software
  262. + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  263. + */
  264. +
  265. +#include "../../../jam.h"
  266. +
  267. +#ifndef USE_FFI
  268. +#include <string.h>
  269. +#include "../../../sig.h"
  270. +
  271. +#define RET_VOID 0
  272. +#define RET_DOUBLE 1
  273. +#define RET_LONG 2
  274. +#define RET_FLOAT 3
  275. +#define RET_DFLT 4
  276. +
  277. +int nativeExtraArg(MethodBlock *mb) {
  278. + //printf("!!!!!!!!!!nativeExtraArg (name=%s) (type=%s)!!!!!!!\n",mb->name,mb->type);
  279. + int len = strlen(mb->type);
  280. + if(mb->type[len-2] == ')')
  281. + switch(mb->type[len-1]) {
  282. + case 'V':
  283. + return RET_VOID;
  284. + case 'D':
  285. + return RET_DOUBLE;
  286. + case 'J':
  287. + return RET_LONG;
  288. + case 'F':
  289. + return RET_FLOAT;
  290. + }
  291. +
  292. + return RET_DFLT;
  293. +}
  294. +
  295. +//calls the f function pointer and takes care of the return type
  296. +#define perform_f(label,...) \
  297. + switch(ret_type) { \
  298. + case RET_VOID: \
  299. + (*(void (*)())f)(__VA_ARGS__); \
  300. + goto label; \
  301. + case RET_DOUBLE: \
  302. + *(double*)ostack = (*(double (*)())f)(__VA_ARGS__); \
  303. + ostack += 2; \
  304. + goto label; \
  305. + case RET_LONG: \
  306. + *(long long*)ostack = (*(long long (*)())f)(__VA_ARGS__); \
  307. + ostack += 2; \
  308. + goto label; \
  309. + case RET_FLOAT: \
  310. + *(float*)ostack = (*(float (*)())f)(__VA_ARGS__); \
  311. + ostack++; \
  312. + goto label; \
  313. + default: \
  314. + *ostack++ = (*(u4 (*)())f)(__VA_ARGS__); \
  315. + goto label; \
  316. + }
  317. +
  318. +#define write_ops_to_stack(x) \
  319. + /*write x operands to the stack */ \
  320. + int i; \
  321. + for(i=0; i < x; i++){ \
  322. + __asm__ __volatile__( \
  323. + "ld.w r11,%0 \n\t" \
  324. + "st.w --sp,r11 " \
  325. + :: "m"(*--opntr) \
  326. + :"sp","r11"); \
  327. + }
  328. +
  329. +u4 *callJNIMethod(void *env, Class *class, char *sig, int ret_type, u4 *ostack, unsigned char *f, int args) {
  330. + u4 *opntr = ostack + args;
  331. + int nrofopsonstack = 0;
  332. + if(class && args > 3){
  333. + nrofopsonstack = args - 3;
  334. + }else if(class){
  335. + nrofopsonstack = 0;
  336. + }else if(args > 4){
  337. + nrofopsonstack = args -4;
  338. + }else{
  339. + nrofopsonstack = 0;
  340. + }
  341. +
  342. + if(args == 0){
  343. + if(class){
  344. + perform_f(done,env,class);
  345. + }else{
  346. + perform_f(done,env);
  347. + }
  348. + }else if(args == 1){
  349. + if(class){
  350. + perform_f(done,env,class,*--opntr);
  351. + }else{
  352. + perform_f(done,env,*--opntr);
  353. + }
  354. + }else if(args == 2){
  355. + if(class){
  356. + perform_f(done,env,class,*--opntr,*--opntr);
  357. + }else{
  358. + perform_f(done,env,*--opntr,*--opntr);
  359. + }
  360. + }else if(args == 3){
  361. + if(class){
  362. + perform_f(done,env,class,*--opntr,*--opntr,*--opntr);
  363. + }else{
  364. + perform_f(done,env,*--opntr,*--opntr,*--opntr);
  365. + }
  366. + }else{
  367. + write_ops_to_stack(nrofopsonstack)
  368. + if(class){
  369. + perform_f(empty_stack,env,class,*--opntr,*--opntr,*--opntr);
  370. + }else{
  371. + perform_f(empty_stack,env,*--opntr,*--opntr,*--opntr,*--opntr);
  372. + }
  373. + }
  374. +
  375. + empty_stack:
  376. + //Increment stack pointer to loose all operands we put there
  377. + if(nrofopsonstack > 0) {
  378. + __asm__ __volatile__("add sp,%0" ::"r"((nrofopsonstack) * sizeof(u4)): "sp");
  379. + }
  380. +
  381. + done:
  382. + return ostack;
  383. +}
  384. +
  385. +/*
  386. + int i;
  387. + int nrofopsonstack,nrofopsinregister;
  388. + u4 *opntr = ostack + args;
  389. + register int *r5 asm ("r5");
  390. + *r5 = *f;
  391. +
  392. +// register unsigned char *r6 asm ("r6");
  393. +// register int *r7 asm ("r7");
  394. +// register int *r8 asm ("r8");
  395. +// register int *r9 asm ("r9");
  396. +// register int *r10 asm ("r10");
  397. +// register int *r11 asm ("r11");
  398. +// register int *r12 asm ("r12");
  399. +
  400. + if(class && args > 3){
  401. + nrofopsonstack = args - 3;
  402. + nrofopsinregister = 3;
  403. + }else if(class){
  404. + nrofopsonstack = 0;
  405. + nrofopsinregister = args;
  406. + }else if(args > 4){
  407. + nrofopsonstack = args -4;
  408. + nrofopsinregister = 4;
  409. + }else{
  410. + nrofopsonstack = 0;
  411. + nrofopsinregister = args;
  412. + }
  413. +
  414. + //write all operands except 3 or 4 to the stack
  415. + for(i=0; i < nrofopsonstack; i++){
  416. + //printf("!!!!!writing arg %d to stack\n",i);
  417. + __asm__ __volatile__(
  418. + "ld.w r11,%0 \n\t"
  419. + "st.w --sp,r11 "
  420. + :: "m"(*--opntr)
  421. + :"sp","r11");
  422. + }
  423. +
  424. +
  425. + //TODO: make sure none of the registers above have been changed
  426. + switch(ret_type) {
  427. + case RET_VOID:
  428. + goto do_void_function;
  429. + case RET_DOUBLE:
  430. + goto do_double_function;
  431. + case RET_LONG:
  432. + goto do_longlong_function;
  433. + case RET_FLOAT:
  434. + goto do_float_function;
  435. + default:
  436. + goto do_default_function;
  437. + }
  438. +
  439. + do_void_function:
  440. + WRITE_PARAMS(label_void)
  441. + __asm__ __volatile__(
  442. + "icall r5"
  443. + ::"m"(f));
  444. + label_void:
  445. + (*(void (*)())f)();
  446. + //printf("!!!!!!!!!!!!! called void JNIMethod %s!!!!!!!!!!\n",sig);
  447. + goto empty_stack;
  448. +
  449. + do_double_function:
  450. + WRITE_PARAMS(label_double)
  451. + label_double:
  452. + *(double*)ostack = (*(double (*)())f)();
  453. + ostack += 2;
  454. + //printf("!!!!!!!!!!!!! called double JNIMethod %s %l!!!!!!!!!!\n",sig,*ostack);
  455. + goto empty_stack;
  456. +
  457. + do_longlong_function:
  458. + WRITE_PARAMS(label_longlong)
  459. + label_longlong:
  460. + *(long long*)ostack = (*(long long (*)())f)();
  461. + ostack += 2;
  462. + //printf("!!!!!!!!!!!!! called long JNIMethod %s %l!!!!!!!!!!\n",sig,*ostack);
  463. + goto empty_stack;
  464. +
  465. + do_float_function:
  466. + WRITE_PARAMS(label_float)
  467. + label_float:
  468. + *(float*)ostack = (*(float (*)())f)();
  469. + ostack++;
  470. + //printf("!!!!!!!!!!!!! called float JNIMethod %s %f!!!!!!!!!!\n",sig,*ostack);
  471. + goto empty_stack;
  472. +
  473. + do_default_function:
  474. + WRITE_PARAMS(label_default)
  475. + label_default:
  476. + *ostack++ = (*(u4 (*)())f)();
  477. + //printf("!!!!!!!!!!!!! called default JNIMethod %s!!!!!!!!!!\n",sig);
  478. + goto empty_stack;
  479. +
  480. + empty_stack:
  481. +
  482. + //Get rid of the items on the stack
  483. + if(nrofopsonstack > 0) {
  484. + __asm__ __volatile__("add sp,%0" ::"r"(nrofopsonstack): "sp");
  485. + }
  486. + return ostack;*/
  487. +
  488. +
  489. +// r8 = (u4*)(*--opntr);
  490. +// r9 = (u4*)(*--opntr);
  491. +// r10 = (u4*)(*--opntr);
  492. +// r11 = (u4*)(*--opntr);
  493. +// r12 = env;
  494. +
  495. +
  496. +
  497. +/*
  498. + //write all operands to register
  499. + if(!class){
  500. + switch(nrofopsinregister){
  501. + case 4:
  502. + __asm__ __volatile__(
  503. + "ld.w r8,%[r8] \n\t"
  504. + "ld.w r9,%[r9] \n\t"
  505. + "ld.w r10,%[r10] \n\t"
  506. + "ld.w r11,%[r11] \n\t"
  507. + "ld.w r12,%[env]"
  508. + :: [r8]"m"(*--opntr),[r9]"m"(*--opntr),[r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env)
  509. + :"r8","r9","r10","r11","r12"
  510. + );
  511. + goto select_function;
  512. + case 3:
  513. + __asm__ __volatile__(
  514. + "ld.w r9,%[r9] \n\t"
  515. + "ld.w r10,%[r10] \n\t"
  516. + "ld.w r11,%[r11] \n\t"
  517. + "ld.w r12,%[env]"
  518. + :: [r9]"m"(*--opntr),[r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env)
  519. + :"r9","r10","r11","r12"
  520. + );
  521. + goto select_function;
  522. + case 2:
  523. + __asm__ __volatile__(
  524. + "ld.w r10,%[r10] \n\t"
  525. + "ld.w r11,%[r11] \n\t"
  526. + "ld.w r12,%[env]"
  527. + :: [r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env)
  528. + :"r10","r11","r12"
  529. + );
  530. + goto select_function;
  531. + case 1:
  532. + __asm__ __volatile__(
  533. + "ld.w r11,%[r11] \n\t"
  534. + "ld.w r12,%[env]"
  535. + ::[r11]"m"(*--opntr),[env]"m"(env)
  536. + :"r11","r12"
  537. + );
  538. + goto select_function;
  539. + case 0:
  540. + __asm__ __volatile__(
  541. + "ld.w r12,%[env]"
  542. + ::[env]"m"(env)
  543. + :"r12"
  544. + );
  545. + goto select_function;
  546. + }
  547. + }else{//class needs to be written to r11
  548. + switch(nrofopsinregister){
  549. + case 3:
  550. + __asm__ __volatile__(
  551. + "ld.w r8,%[r8] \n\t"
  552. + "ld.w r9,%[r9] \n\t"
  553. + "ld.w r10,%[r10] \n\t"
  554. + "ld.w r11,%[class] \n\t"
  555. + "ld.w r12,%[env]"
  556. + :: [r8]"m"(*--opntr),[r9]"m"(*--opntr),[r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env)
  557. + :"r8","r9","r10","r11","r12"
  558. + );
  559. + goto select_function;
  560. + case 2:
  561. + __asm__ __volatile__(
  562. + "ld.w r9,%[r9] \n\t"
  563. + "ld.w r10,%[r10] \n\t"
  564. + "ld.w r11,%[class] \n\t"
  565. + "ld.w r12,%[env]"
  566. + :: [r9]"m"(*--opntr),[r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env)
  567. + :"r9","r10","r11","r12"
  568. + );
  569. + goto select_function;
  570. + case 1:
  571. + __asm__ __volatile__(
  572. + "ld.w r10,%[r10] \n\t"
  573. + "ld.w r11,%[class] \n\t"
  574. + "ld.w r12,%[env]"
  575. + :: [r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env)
  576. + :"r10","r11","r12"
  577. + );
  578. + goto select_function;
  579. + case 0:
  580. + __asm__ __volatile__(
  581. + "ld.w r11,%[class] \n\t"
  582. + "ld.w r12,%[env]"
  583. + :: [class]"m"(class),[env]"m"(env)
  584. + :"r10","r11","r12"
  585. + );
  586. + goto select_function;
  587. + }
  588. + }
  589. + select_function: //This label is put here to make some cleaner assembler jumps above
  590. + */
  591. +
  592. +// int isstatic;
  593. +// if(class){
  594. +// isstatic = 1;
  595. +// }else{
  596. +// isstatic = 0;
  597. +// }
  598. +// printf("!!!!!!!!!!!!! calling JNIMethod (sig:%s) (type:%d) (argcount:%d) (static:%d)!!!!!!!!!!\n",sig,ret_type,args,isstatic);
  599. +
  600. +//Dit werkt!!!
  601. +// if(args == 3 && isstatic == 0 && ret_type == RET_DFLT){
  602. +// printf("I am here..\n");
  603. +// *ostack++ = (*(u4 (*)())f)(env,*--opntr,*--opntr,*--opntr);
  604. +// return ostack;
  605. +// }
  606. +/*
  607. + u4 *opntr = ostack + args;
  608. + long long *result;
  609. + if(class){
  610. + //printf("I am static!!!!!!!\n");
  611. + if(args == 0){
  612. + //*ostack = (*(u4 (*)())f)(env,class);
  613. + *result = (*(long long (*)())f)(env,class);
  614. + }else if(args == 1){
  615. + *result = (*(long long (*)())f)(env,class,*--opntr);
  616. + }else if(args == 2){
  617. + *result = (*(long long (*)())f)(env,class,*--opntr,*--opntr);
  618. + }else if(args == 3){
  619. + *result = (*(long long (*)())f)(env,class,*--opntr,*--opntr,*--opntr);
  620. + }else if(args == 4){
  621. + *result = (*(long long (*)())f)(env,class,*--opntr,*--opntr,*--opntr,*--opntr);
  622. + }else if(args == 5){
  623. + *result = (*(long long (*)())f)(env,class,*--opntr,*--opntr,*--opntr,*--opntr,*--opntr);
  624. + }
  625. + }else{
  626. + //printf("I am not static!!!!!!!\n");
  627. + if(args == 0){
  628. + *result = (*(long long (*)())f)(env);
  629. + }else if(args == 1){
  630. + *result = (*(long long (*)())f)(env,*--opntr);
  631. + }else if(args == 2){
  632. + *result = (*(long long (*)())f)(env,*--opntr,*--opntr);
  633. + }else if(args == 3){
  634. + *result = (*(long long (*)())f)(env,*--opntr,*--opntr,*--opntr);
  635. + }else if(args == 4){
  636. + *result = (*(long long (*)())f)(env,*--opntr,*--opntr,*--opntr,*--opntr);
  637. + }else if(args == 5){
  638. + *result = (*(long long (*)())f)(env,*--opntr,*--opntr,*--opntr,*--opntr,*--opntr);
  639. + }
  640. + }
  641. +
  642. + switch(ret_type) {
  643. + case RET_VOID:
  644. + printf("-------->Performed void function %s\n",sig);
  645. + break;
  646. +
  647. + case RET_DOUBLE:
  648. + *(double*)ostack = *(double(*))result;
  649. + ostack += 2;
  650. + printf("-------->Performed double function %s,casting to %d\n",sig, ret_type);
  651. + //printf("returned a double %f\n",*ostack);
  652. + break;
  653. +
  654. + case RET_LONG:
  655. + *(long long*)ostack = *(long long(*))result;
  656. + ostack += 2;
  657. + printf("-------->Performed long function %s,casting to %d\n",sig, ret_type);
  658. + //printf("returned a long %l\n",*ostack);
  659. + break;
  660. +
  661. + case RET_FLOAT:
  662. + *(float*)ostack = *(float(*))result;
  663. + ostack++;
  664. + printf("-------->Performed float function %s,casting to %d\n",sig, ret_type);
  665. + //printf("returned a float %f\n",*ostack);
  666. + break;
  667. +
  668. + default:
  669. + *ostack++ = *(u4(*))result;
  670. + //ostack++;
  671. + printf("-------->Performed default function %s,casting to %d\n",sig, ret_type);
  672. + //printf("returned a default %d\n",*ostack);
  673. + break;
  674. + }
  675. + return ostack;
  676. + */
  677. +
  678. +
  679. +
  680. +
  681. +// if(args == 3 && isstatic == 0 && ret_type == RET_DFLT){
  682. +// printf("I am here!!!!!!!\n");
  683. +// u4 *result = (*(u4 (*)())f)(env,*--opntr,*--opntr,*--opntr);
  684. +// *ostack++ = result;
  685. +// //*ostack++ = (*(u4 (*)())f)(env,*--opntr,*--opntr,*--opntr);
  686. +// return ostack;
  687. +// }
  688. +// if(args == 2 && isstatic == 0 && ret_type == RET_DFLT){
  689. +// printf("I am here..\n");
  690. +// *ostack++ = (*(u4 (*)())f)(env,*--opntr,*--opntr);
  691. +// return ostack;
  692. +// }
  693. +// if(args == 1 && isstatic == 0 && ret_type == RET_DFLT){
  694. +// printf("I am here..\n");
  695. +// *ostack++ = (*(u4 (*)())f)(env,*--opntr);
  696. +// return ostack;
  697. +// }
  698. +//
  699. +// if(args == 6 && isstatic == 1 && ret_type == RET_DFLT){
  700. +// printf("I am here for 7 args..\n");
  701. +// *ostack++ = (*(u4 (*)())f)(env,class,*--opntr,*--opntr,*--opntr,*--opntr,*--opntr,*--opntr);
  702. +// return ostack;
  703. +// }
  704. +// if(args == 4 && isstatic == 1 && ret_type == RET_DFLT){
  705. +// printf("I am here for 5 args..\n");
  706. +// *ostack++ = (*(u4 (*)())f)(env,class,*--opntr,*--opntr,*--opntr,*--opntr);
  707. +// return ostack;
  708. +// }
  709. +// if(args == 3 && isstatic == 1 && ret_type == RET_DFLT){
  710. +// printf("I am here..\n");
  711. +// *ostack++ = (*(u4 (*)())f)(env,class,*--opntr,*--opntr,*--opntr);
  712. +// return ostack;
  713. +// }
  714. +// if(args == 2 && isstatic == 1 && ret_type == RET_DFLT){
  715. +// printf("I am here..\n");
  716. +// *ostack++ = (*(u4 (*)())f)(env,class,*--opntr,*--opntr);
  717. +// return ostack;
  718. +// }
  719. +// if(args == 1 && isstatic == 1 && ret_type == RET_DFLT){
  720. +// printf("I am here..\n");
  721. +// *ostack++ = (*(u4 (*)())f)(env,class,*--opntr);
  722. +// return ostack;
  723. +// }
  724. +
  725. + //int i;
  726. +
  727. + //for(i = 0; i < args; i++){
  728. + // printf("!!!!!should write arg %d\n",i);
  729. + //__asm__ __volatile__("ld.w r11,%0" :: "m"(*--opntr):"r11");
  730. + //__asm__ __volatile__("st.w --sp,r11" ::: "sp","r11");
  731. + //}
  732. +
  733. +// int i=args;
  734. +// if(class) {
  735. +// for(i=args;i>3;i--){
  736. +// __asm__ __volatile__("ld.w r8,%0" :: "m"(*--opntr):"r8");
  737. +// __asm__ __volatile__("st.w --sp,r8" ::: "sp","r8");
  738. +// }
  739. +// if(args >= 3){
  740. +// __asm__ __volatile__("ld.w r8,%0" :: "m"(*--opntr):"r8");
  741. +// }
  742. +// if(args >= 2){
  743. +// __asm__ __volatile__("ld.w r9,%0" :: "m"(*--opntr):"r9");
  744. +// }
  745. +// if(args >= 1){
  746. +// __asm__ __volatile__("ld.w r10,%0" :: "m"(*--opntr):"r10");
  747. +// }
  748. +// __asm__ __volatile__("ld.w r11,%0" :: "m"(class):"r11");
  749. +// __asm__ __volatile__("ld.w r12,%0" :: "m"(env):"r12");
  750. +// }else{//static, don't add class variable
  751. +// for(i=args;i>4;i--){
  752. +// //r8 will be reused by the last register argument
  753. +// __asm__ __volatile__("ld.w r8,%0" :: "m"(*--opntr):"r8");
  754. +// __asm__ __volatile__("st.w --sp,r8" ::: "sp","r8");
  755. +// }
  756. +// if(args >= 4){
  757. +// __asm__ __volatile__("ld.w r8,%0" :: "m"(*--opntr):"r8");
  758. +// }
  759. +// if(args >= 3){
  760. +// __asm__ __volatile__("ld.w r9,%0" :: "m"(*--opntr):"r9");
  761. +// }
  762. +// if(args >= 2){
  763. +// __asm__ __volatile__("ld.w r10,%0" :: "m"(*--opntr):"r10");
  764. +// }
  765. +// if(args >= 1){
  766. +// __asm__ __volatile__("ld.w r11,%0" :: "m"(*--opntr):"r11");
  767. +// }
  768. +// __asm__ __volatile__("ld.w r12,%0" :: "m"(env):"r12");
  769. +// }
  770. +
  771. +// printf("!!!!!pushing environment to r12\n");
  772. +
  773. + //printf("!!!!!!!!!!!!! switching ret_type %s %d ,nr of args: %d!!!!!!!!!!\n",sig, ret_type,args);
  774. +// switch(ret_type) {
  775. +// case RET_VOID:
  776. +// (*(void (*)())f)();
  777. +// //printf("!!!!!!!!!!!!! called void JNIMethod %s!!!!!!!!!!\n",sig);
  778. +// break;
  779. +//
  780. +// case RET_DOUBLE:
  781. +// *(double*)ostack = (*(double (*)())f)();
  782. +// ostack += 2;
  783. +// //printf("!!!!!!!!!!!!! called double JNIMethod %s %l!!!!!!!!!!\n",sig,*ostack);
  784. +// break;
  785. +//
  786. +// case RET_LONG:
  787. +// *(long long*)ostack = (*(long long (*)())f)();
  788. +// ostack += 2;
  789. +// //printf("!!!!!!!!!!!!! called long JNIMethod %s %l!!!!!!!!!!\n",sig,*ostack);
  790. +// break;
  791. +//
  792. +// case RET_FLOAT:
  793. +// *(float*)ostack = (*(float (*)())f)();
  794. +// ostack++;
  795. +// //printf("!!!!!!!!!!!!! called float JNIMethod %s %f!!!!!!!!!!\n",sig,*ostack);
  796. +// break;
  797. +//
  798. +// default:
  799. +// *ostack++ = (*(u4 (*)())f)();
  800. +// //printf("!!!!!!!!!!!!! called default JNIMethod %s!!!!!!!!!!\n",sig);
  801. +// break;
  802. +// }
  803. +//
  804. +// if(class && args > 3) {
  805. +// int to_add = args-3;
  806. +// __asm__ __volatile__("add sp,%0" ::"r"(to_add): "sp");
  807. +// }else if(!class && args > 4){
  808. +// int to_add = args-4;
  809. +// __asm__ __volatile__("add sp,%0" ::"r"(to_add): "sp");
  810. +// }
  811. +// //printf("!!!!!!!!!!!!! returning JNIMethod (sig:%s) (type:%d) (argcount:%d)!!!!!!!!!!\n",sig,ret_type,args);
  812. +// //printf("!!!!!!!!!!!!! returning %s %d ,nr of args: %d!!!!!!!!!!\n",sig, ret_type,args);
  813. +// //printf("!!!!!!!!!!!!! returning JNIMethod !!!!!!!!!!\n");
  814. +// //__asm__ __volatile__ ("addl %0,%%esp" :: "r" ((args + 1) * sizeof(u4)) : "cc", "sp");
  815. +//
  816. +// return ostack;
  817. +
  818. +
  819. +//write all operands, class and env to register
  820. +#define WRITE_PARAMS(label) \
  821. + if(!class){ \
  822. + switch(nrofopsinregister){ \
  823. + case 4: \
  824. + __asm__ __volatile__( \
  825. + "ld.w r8,%[r8] \n\t" \
  826. + "ld.w r9,%[r9] \n\t" \
  827. + "ld.w r10,%[r10] \n\t" \
  828. + "ld.w r11,%[r11] \n\t" \
  829. + "ld.w r12,%[env]" \
  830. + :: [r8]"m"(*--opntr),[r9]"m"(*--opntr),[r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env) \
  831. + :"r8","r9","r10","r11","r12" \
  832. + ); \
  833. + goto label; \
  834. + case 3: \
  835. + __asm__ __volatile__( \
  836. + "ld.w r9,%[r9] \n\t" \
  837. + "ld.w r10,%[r10] \n\t" \
  838. + "ld.w r11,%[r11] \n\t" \
  839. + "ld.w r12,%[env]" \
  840. + :: [r9]"m"(*--opntr),[r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env) \
  841. + :"r9","r10","r11","r12" \
  842. + ); \
  843. + goto label; \
  844. + case 2: \
  845. + __asm__ __volatile__( \
  846. + "ld.w r10,%[r10] \n\t" \
  847. + "ld.w r11,%[r11] \n\t" \
  848. + "ld.w r12,%[env]" \
  849. + :: [r10]"m"(*--opntr),[r11]"m"(*--opntr),[env]"m"(env) \
  850. + :"r10","r11","r12" \
  851. + ); \
  852. + goto label; \
  853. + case 1: \
  854. + __asm__ __volatile__( \
  855. + "ld.w r11,%[r11] \n\t" \
  856. + "ld.w r12,%[env]" \
  857. + ::[r11]"m"(*--opntr),[env]"m"(env) \
  858. + :"r11","r12" \
  859. + ); \
  860. + goto label; \
  861. + case 0: \
  862. + __asm__ __volatile__( \
  863. + "ld.w r12,%[env]" \
  864. + ::[env]"m"(env) \
  865. + :"r12" \
  866. + ); \
  867. + goto label; \
  868. + } \
  869. + }else{ \
  870. + switch(nrofopsinregister){ \
  871. + case 3: \
  872. + __asm__ __volatile__( \
  873. + "ld.w r8,%[r8] \n\t" \
  874. + "ld.w r9,%[r9] \n\t" \
  875. + "ld.w r10,%[r10] \n\t" \
  876. + "ld.w r11,%[class] \n\t" \
  877. + "ld.w r12,%[env]" \
  878. + :: [r8]"m"(*--opntr),[r9]"m"(*--opntr),[r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env) \
  879. + :"r8","r9","r10","r11","r12" \
  880. + ); \
  881. + goto label; \
  882. + case 2: \
  883. + __asm__ __volatile__( \
  884. + "ld.w r9,%[r9] \n\t" \
  885. + "ld.w r10,%[r10] \n\t" \
  886. + "ld.w r11,%[class] \n\t" \
  887. + "ld.w r12,%[env]" \
  888. + :: [r9]"m"(*--opntr),[r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env) \
  889. + :"r9","r10","r11","r12" \
  890. + ); \
  891. + goto label; \
  892. + case 1: \
  893. + __asm__ __volatile__( \
  894. + "ld.w r10,%[r10] \n\t" \
  895. + "ld.w r11,%[class] \n\t" \
  896. + "ld.w r12,%[env]" \
  897. + :: [r10]"m"(*--opntr),[class]"m"(class),[env]"m"(env) \
  898. + :"r10","r11","r12" \
  899. + ); \
  900. + goto label; \
  901. + case 0: \
  902. + __asm__ __volatile__( \
  903. + "ld.w r11,%[class] \n\t" \
  904. + "ld.w r12,%[env]" \
  905. + :: [class]"m"(class),[env]"m"(env) \
  906. + :"r10","r11","r12" \
  907. + ); \
  908. + goto label; \
  909. + } \
  910. + } \
  911. + //This label is put here to make some cleaner assembler jumps above
  912. +#endif
  913. diff -urpN jamvm-1.5.0/src/os/linux/avr32/init.c jamvm-1.5.0-avr32/src/os/linux/avr32/init.c
  914. --- jamvm-1.5.0/src/os/linux/avr32/init.c 1970-01-01 01:00:00.000000000 +0100
  915. +++ jamvm-1.5.0-avr32/src/os/linux/avr32/init.c 2008-02-08 09:20:38.000000000 +0100
  916. @@ -0,0 +1,39 @@
  917. +/*
  918. + * Copyright (C) 2003, 2004, 2006, 2007
  919. + * Robert Lougher <rob@lougher.org.uk>.
  920. + *
  921. + * This file is part of JamVM.
  922. + *
  923. + * This program is free software; you can redistribute it and/or
  924. + * modify it under the terms of the GNU General Public License
  925. + * as published by the Free Software Foundation; either version 2,
  926. + * or (at your option) any later version.
  927. + *
  928. + * This program is distributed in the hope that it will be useful,
  929. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  930. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  931. + * GNU General Public License for more details.
  932. + *
  933. + * You should have received a copy of the GNU General Public License
  934. + * along with this program; if not, write to the Free Software
  935. + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  936. + */
  937. +
  938. +//#include <fpu_control.h>
  939. +//#include <stdio.h>
  940. +
  941. +/* Change floating point precision to double (64-bit) from
  942. + * the extended (80-bit) Linux default. */
  943. +
  944. +//void setDoublePrecision() {
  945. +// fpu_control_t cw;
  946. +//
  947. +// _FPU_GETCW(cw);
  948. +// cw &= ~_FPU_EXTENDED;
  949. +// cw |= _FPU_DOUBLE;
  950. +// _FPU_SETCW(cw);
  951. +//}
  952. +
  953. +void initialisePlatform() {
  954. + //TODO: is this needed for avr32? setDoublePrecision();
  955. +}
  956. diff -urpN jamvm-1.5.0/src/os/linux/avr32/Makefile.am jamvm-1.5.0-avr32/src/os/linux/avr32/Makefile.am
  957. --- jamvm-1.5.0/src/os/linux/avr32/Makefile.am 1970-01-01 01:00:00.000000000 +0100
  958. +++ jamvm-1.5.0-avr32/src/os/linux/avr32/Makefile.am 2008-02-08 09:20:38.000000000 +0100
  959. @@ -0,0 +1,25 @@
  960. +##
  961. +## Copyright (C) 2003, 2004, 2005, 2006, 2007
  962. +## Robert Lougher <rob@lougher.org.uk>.
  963. +##
  964. +## This file is part of JamVM.
  965. +##
  966. +## This program is free software; you can redistribute it and/or
  967. +## modify it under the terms of the GNU General Public License
  968. +## as published by the Free Software Foundation; either version 2,
  969. +## or (at your option) any later version.
  970. +##
  971. +## This program is distributed in the hope that it will be useful,
  972. +## but WITHOUT ANY WARRANTY; without even the implied warranty of
  973. +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  974. +## GNU General Public License for more details.
  975. +##
  976. +## You should have received a copy of the GNU General Public License
  977. +## along with this program; if not, write to the Free Software
  978. +## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  979. +##
  980. +
  981. +noinst_LTLIBRARIES = libnative.la
  982. +libnative_la_SOURCES = init.c dll_md.c
  983. +
  984. +AM_CPPFLAGS = -I$(top_builddir)/src
  985. diff -urpN jamvm-1.5.0/src/os/linux/avr32/Makefile.in jamvm-1.5.0-avr32/src/os/linux/avr32/Makefile.in
  986. --- jamvm-1.5.0/src/os/linux/avr32/Makefile.in 1970-01-01 01:00:00.000000000 +0100
  987. +++ jamvm-1.5.0-avr32/src/os/linux/avr32/Makefile.in 2008-02-08 09:20:38.000000000 +0100
  988. @@ -0,0 +1,446 @@
  989. +# Makefile.in generated by automake 1.10 from Makefile.am.
  990. +# @configure_input@
  991. +
  992. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
  993. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
  994. +# This Makefile.in is free software; the Free Software Foundation
  995. +# gives unlimited permission to copy and/or distribute it,
  996. +# with or without modifications, as long as this notice is preserved.
  997. +
  998. +# This program is distributed in the hope that it will be useful,
  999. +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  1000. +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  1001. +# PARTICULAR PURPOSE.
  1002. +
  1003. +@SET_MAKE@
  1004. +
  1005. +VPATH = @srcdir@
  1006. +pkgdatadir = $(datadir)/@PACKAGE@
  1007. +pkglibdir = $(libdir)/@PACKAGE@
  1008. +pkgincludedir = $(includedir)/@PACKAGE@
  1009. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
  1010. +install_sh_DATA = $(install_sh) -c -m 644
  1011. +install_sh_PROGRAM = $(install_sh) -c
  1012. +install_sh_SCRIPT = $(install_sh) -c
  1013. +INSTALL_HEADER = $(INSTALL_DATA)
  1014. +transform = $(program_transform_name)
  1015. +NORMAL_INSTALL = :
  1016. +PRE_INSTALL = :
  1017. +POST_INSTALL = :
  1018. +NORMAL_UNINSTALL = :
  1019. +PRE_UNINSTALL = :
  1020. +POST_UNINSTALL = :
  1021. +build_triplet = @build@
  1022. +host_triplet = @host@
  1023. +subdir = src/os/linux/avr32
  1024. +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
  1025. +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  1026. +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
  1027. + $(top_srcdir)/configure.ac
  1028. +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  1029. + $(ACLOCAL_M4)
  1030. +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  1031. +CONFIG_HEADER = $(top_builddir)/src/config.h
  1032. +CONFIG_CLEAN_FILES =
  1033. +LTLIBRARIES = $(noinst_LTLIBRARIES)
  1034. +libnative_la_LIBADD =
  1035. +am_libnative_la_OBJECTS = init.lo dll_md.lo
  1036. +libnative_la_OBJECTS = $(am_libnative_la_OBJECTS)
  1037. +DEFAULT_INCLUDES = -I. -I$(top_builddir)/src@am__isrc@
  1038. +depcomp = $(SHELL) $(top_srcdir)/depcomp
  1039. +am__depfiles_maybe = depfiles
  1040. +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  1041. + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  1042. +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  1043. + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
  1044. + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  1045. +CCLD = $(CC)
  1046. +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  1047. + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
  1048. + $(LDFLAGS) -o $@
  1049. +SOURCES = $(libnative_la_SOURCES)
  1050. +DIST_SOURCES = $(libnative_la_SOURCES)
  1051. +ETAGS = etags
  1052. +CTAGS = ctags
  1053. +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  1054. +ACLOCAL = @ACLOCAL@
  1055. +ALLOCA = @ALLOCA@
  1056. +AMTAR = @AMTAR@
  1057. +AR = @AR@
  1058. +AUTOCONF = @AUTOCONF@
  1059. +AUTOHEADER = @AUTOHEADER@
  1060. +AUTOMAKE = @AUTOMAKE@
  1061. +AWK = @AWK@
  1062. +CC = @CC@
  1063. +CCAS = @CCAS@
  1064. +CCASDEPMODE = @CCASDEPMODE@
  1065. +CCASFLAGS = @CCASFLAGS@
  1066. +CCDEPMODE = @CCDEPMODE@
  1067. +CFLAGS = @CFLAGS@
  1068. +CPP = @CPP@
  1069. +CPPFLAGS = @CPPFLAGS@
  1070. +CXX = @CXX@
  1071. +CXXCPP = @CXXCPP@
  1072. +CXXDEPMODE = @CXXDEPMODE@
  1073. +CXXFLAGS = @CXXFLAGS@
  1074. +CYGPATH_W = @CYGPATH_W@
  1075. +DEFS = @DEFS@
  1076. +DEPDIR = @DEPDIR@
  1077. +ECHO = @ECHO@
  1078. +ECHO_C = @ECHO_C@
  1079. +ECHO_N = @ECHO_N@
  1080. +ECHO_T = @ECHO_T@
  1081. +EGREP = @EGREP@
  1082. +EXEEXT = @EXEEXT@
  1083. +F77 = @F77@
  1084. +FFLAGS = @FFLAGS@
  1085. +GREP = @GREP@
  1086. +INSTALL = @INSTALL@
  1087. +INSTALL_DATA = @INSTALL_DATA@
  1088. +INSTALL_PROGRAM = @INSTALL_PROGRAM@
  1089. +INSTALL_SCRIPT = @INSTALL_SCRIPT@
  1090. +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  1091. +JAVAC = @JAVAC@
  1092. +LDFLAGS = @LDFLAGS@
  1093. +LIBOBJS = @LIBOBJS@
  1094. +LIBS = @LIBS@
  1095. +LIBTOOL = @LIBTOOL@
  1096. +LN_S = @LN_S@
  1097. +LTLIBOBJS = @LTLIBOBJS@
  1098. +MAINT = @MAINT@
  1099. +MAKEINFO = @MAKEINFO@
  1100. +MKDIR_P = @MKDIR_P@
  1101. +OBJEXT = @OBJEXT@
  1102. +PACKAGE = @PACKAGE@
  1103. +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  1104. +PACKAGE_NAME = @PACKAGE_NAME@
  1105. +PACKAGE_STRING = @PACKAGE_STRING@
  1106. +PACKAGE_TARNAME = @PACKAGE_TARNAME@
  1107. +PACKAGE_VERSION = @PACKAGE_VERSION@
  1108. +PATH_SEPARATOR = @PATH_SEPARATOR@
  1109. +RANLIB = @RANLIB@
  1110. +SED = @SED@
  1111. +SET_MAKE = @SET_MAKE@
  1112. +SHELL = @SHELL@
  1113. +STRIP = @STRIP@
  1114. +VERSION = @VERSION@
  1115. +abs_builddir = @abs_builddir@
  1116. +abs_srcdir = @abs_srcdir@
  1117. +abs_top_builddir = @abs_top_builddir@
  1118. +abs_top_srcdir = @abs_top_srcdir@
  1119. +ac_ct_CC = @ac_ct_CC@
  1120. +ac_ct_CXX = @ac_ct_CXX@
  1121. +ac_ct_F77 = @ac_ct_F77@
  1122. +am__include = @am__include@
  1123. +am__leading_dot = @am__leading_dot@
  1124. +am__quote = @am__quote@
  1125. +am__tar = @am__tar@
  1126. +am__untar = @am__untar@
  1127. +arch = @arch@
  1128. +bindir = @bindir@
  1129. +build = @build@
  1130. +build_alias = @build_alias@
  1131. +build_cpu = @build_cpu@
  1132. +build_os = @build_os@
  1133. +build_vendor = @build_vendor@
  1134. +builddir = @builddir@
  1135. +datadir = @datadir@
  1136. +datarootdir = @datarootdir@
  1137. +docdir = @docdir@
  1138. +dvidir = @dvidir@
  1139. +exec_prefix = @exec_prefix@
  1140. +host = @host@
  1141. +host_alias = @host_alias@
  1142. +host_cpu = @host_cpu@
  1143. +host_os = @host_os@
  1144. +host_vendor = @host_vendor@
  1145. +htmldir = @htmldir@
  1146. +includedir = @includedir@
  1147. +infodir = @infodir@
  1148. +install_sh = @install_sh@
  1149. +interp_cflags = @interp_cflags@
  1150. +libdir = @libdir@
  1151. +libexecdir = @libexecdir@
  1152. +localedir = @localedir@
  1153. +localstatedir = @localstatedir@
  1154. +mandir = @mandir@
  1155. +mkdir_p = @mkdir_p@
  1156. +oldincludedir = @oldincludedir@
  1157. +os = @os@
  1158. +pdfdir = @pdfdir@
  1159. +prefix = @prefix@
  1160. +program_transform_name = @program_transform_name@
  1161. +psdir = @psdir@
  1162. +sbindir = @sbindir@
  1163. +sharedstatedir = @sharedstatedir@
  1164. +srcdir = @srcdir@
  1165. +sysconfdir = @sysconfdir@
  1166. +target_alias = @target_alias@
  1167. +top_builddir = @top_builddir@
  1168. +top_srcdir = @top_srcdir@
  1169. +use_zip_no = @use_zip_no@
  1170. +use_zip_yes = @use_zip_yes@
  1171. +with_classpath_install_dir = @with_classpath_install_dir@
  1172. +noinst_LTLIBRARIES = libnative.la
  1173. +libnative_la_SOURCES = init.c dll_md.c
  1174. +AM_CPPFLAGS = -I$(top_builddir)/src
  1175. +all: all-am
  1176. +
  1177. +.SUFFIXES:
  1178. +.SUFFIXES: .c .lo .o .obj
  1179. +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
  1180. + @for dep in $?; do \
  1181. + case '$(am__configure_deps)' in \
  1182. + *$$dep*) \
  1183. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
  1184. + && exit 0; \
  1185. + exit 1;; \
  1186. + esac; \
  1187. + done; \
  1188. + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/os/linux/avr32/Makefile'; \
  1189. + cd $(top_srcdir) && \
  1190. + $(AUTOMAKE) --gnu src/os/linux/avr32/Makefile
  1191. +.PRECIOUS: Makefile
  1192. +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  1193. + @case '$?' in \
  1194. + *config.status*) \
  1195. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
  1196. + *) \
  1197. + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
  1198. + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
  1199. + esac;
  1200. +
  1201. +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
  1202. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  1203. +
  1204. +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
  1205. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  1206. +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
  1207. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  1208. +
  1209. +clean-noinstLTLIBRARIES:
  1210. + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
  1211. + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
  1212. + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
  1213. + test "$$dir" != "$$p" || dir=.; \
  1214. + echo "rm -f \"$${dir}/so_locations\""; \
  1215. + rm -f "$${dir}/so_locations"; \
  1216. + done
  1217. +libnative.la: $(libnative_la_OBJECTS) $(libnative_la_DEPENDENCIES)
  1218. + $(LINK) $(libnative_la_OBJECTS) $(libnative_la_LIBADD) $(LIBS)
  1219. +
  1220. +mostlyclean-compile:
  1221. + -rm -f *.$(OBJEXT)
  1222. +
  1223. +distclean-compile:
  1224. + -rm -f *.tab.c
  1225. +
  1226. +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dll_md.Plo@am__quote@
  1227. +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Plo@am__quote@
  1228. +
  1229. +.c.o:
  1230. +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
  1231. +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
  1232. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  1233. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  1234. +@am__fastdepCC_FALSE@ $(COMPILE) -c $<
  1235. +
  1236. +.c.obj:
  1237. +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
  1238. +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
  1239. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  1240. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  1241. +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
  1242. +
  1243. +.c.lo:
  1244. +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
  1245. +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
  1246. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
  1247. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  1248. +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
  1249. +
  1250. +mostlyclean-libtool:
  1251. + -rm -f *.lo
  1252. +
  1253. +clean-libtool:
  1254. + -rm -rf .libs _libs
  1255. +
  1256. +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  1257. + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  1258. + unique=`for i in $$list; do \
  1259. + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  1260. + done | \
  1261. + $(AWK) ' { files[$$0] = 1; } \
  1262. + END { for (i in files) print i; }'`; \
  1263. + mkid -fID $$unique
  1264. +tags: TAGS
  1265. +
  1266. +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
  1267. + $(TAGS_FILES) $(LISP)
  1268. + tags=; \
  1269. + here=`pwd`; \
  1270. + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  1271. + unique=`for i in $$list; do \
  1272. + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  1273. + done | \
  1274. + $(AWK) ' { files[$$0] = 1; } \
  1275. + END { for (i in files) print i; }'`; \
  1276. + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
  1277. + test -n "$$unique" || unique=$$empty_fix; \
  1278. + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  1279. + $$tags $$unique; \
  1280. + fi
  1281. +ctags: CTAGS
  1282. +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
  1283. + $(TAGS_FILES) $(LISP)
  1284. + tags=; \
  1285. + here=`pwd`; \
  1286. + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  1287. + unique=`for i in $$list; do \
  1288. + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  1289. + done | \
  1290. + $(AWK) ' { files[$$0] = 1; } \
  1291. + END { for (i in files) print i; }'`; \
  1292. + test -z "$(CTAGS_ARGS)$$tags$$unique" \
  1293. + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  1294. + $$tags $$unique
  1295. +
  1296. +GTAGS:
  1297. + here=`$(am__cd) $(top_builddir) && pwd` \
  1298. + && cd $(top_srcdir) \
  1299. + && gtags -i $(GTAGS_ARGS) $$here
  1300. +
  1301. +distclean-tags:
  1302. + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  1303. +
  1304. +distdir: $(DISTFILES)
  1305. + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
  1306. + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
  1307. + list='$(DISTFILES)'; \
  1308. + dist_files=`for file in $$list; do echo $$file; done | \
  1309. + sed -e "s|^$$srcdirstrip/||;t" \
  1310. + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
  1311. + case $$dist_files in \
  1312. + */*) $(MKDIR_P) `echo "$$dist_files" | \
  1313. + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
  1314. + sort -u` ;; \
  1315. + esac; \
  1316. + for file in $$dist_files; do \
  1317. + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  1318. + if test -d $$d/$$file; then \
  1319. + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
  1320. + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  1321. + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  1322. + fi; \
  1323. + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  1324. + else \
  1325. + test -f $(distdir)/$$file \
  1326. + || cp -p $$d/$$file $(distdir)/$$file \
  1327. + || exit 1; \
  1328. + fi; \
  1329. + done
  1330. +check-am: all-am
  1331. +check: check-am
  1332. +all-am: Makefile $(LTLIBRARIES)
  1333. +installdirs:
  1334. +install: install-am
  1335. +install-exec: install-exec-am
  1336. +install-data: install-data-am
  1337. +uninstall: uninstall-am
  1338. +
  1339. +install-am: all-am
  1340. + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  1341. +
  1342. +installcheck: installcheck-am
  1343. +install-strip:
  1344. + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  1345. + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  1346. + `test -z '$(STRIP)' || \
  1347. + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  1348. +mostlyclean-generic:
  1349. +
  1350. +clean-generic:
  1351. +
  1352. +distclean-generic:
  1353. + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
  1354. +
  1355. +maintainer-clean-generic:
  1356. + @echo "This command is intended for maintainers to use"
  1357. + @echo "it deletes files that may require special tools to rebuild."
  1358. +clean: clean-am
  1359. +
  1360. +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
  1361. + mostlyclean-am
  1362. +
  1363. +distclean: distclean-am
  1364. + -rm -rf ./$(DEPDIR)
  1365. + -rm -f Makefile
  1366. +distclean-am: clean-am distclean-compile distclean-generic \
  1367. + distclean-tags
  1368. +
  1369. +dvi: dvi-am
  1370. +
  1371. +dvi-am:
  1372. +
  1373. +html: html-am
  1374. +
  1375. +info: info-am
  1376. +
  1377. +info-am:
  1378. +
  1379. +install-data-am:
  1380. +
  1381. +install-dvi: install-dvi-am
  1382. +
  1383. +install-exec-am:
  1384. +
  1385. +install-html: install-html-am
  1386. +
  1387. +install-info: install-info-am
  1388. +
  1389. +install-man:
  1390. +
  1391. +install-pdf: install-pdf-am
  1392. +
  1393. +install-ps: install-ps-am
  1394. +
  1395. +installcheck-am:
  1396. +
  1397. +maintainer-clean: maintainer-clean-am
  1398. + -rm -rf ./$(DEPDIR)
  1399. + -rm -f Makefile
  1400. +maintainer-clean-am: distclean-am maintainer-clean-generic
  1401. +
  1402. +mostlyclean: mostlyclean-am
  1403. +
  1404. +mostlyclean-am: mostlyclean-compile mostlyclean-generic \
  1405. + mostlyclean-libtool
  1406. +
  1407. +pdf: pdf-am
  1408. +
  1409. +pdf-am:
  1410. +
  1411. +ps: ps-am
  1412. +
  1413. +ps-am:
  1414. +
  1415. +uninstall-am:
  1416. +
  1417. +.MAKE: install-am install-strip
  1418. +
  1419. +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
  1420. + clean-libtool clean-noinstLTLIBRARIES ctags distclean \
  1421. + distclean-compile distclean-generic distclean-libtool \
  1422. + distclean-tags distdir dvi dvi-am html html-am info info-am \
  1423. + install install-am install-data install-data-am install-dvi \
  1424. + install-dvi-am install-exec install-exec-am install-html \
  1425. + install-html-am install-info install-info-am install-man \
  1426. + install-pdf install-pdf-am install-ps install-ps-am \
  1427. + install-strip installcheck installcheck-am installdirs \
  1428. + maintainer-clean maintainer-clean-generic mostlyclean \
  1429. + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
  1430. + pdf pdf-am ps ps-am tags uninstall uninstall-am
  1431. +
  1432. +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  1433. +# Otherwise a system limit (for SysV at least) may be exceeded.
  1434. +.NOEXPORT:
  1435. diff -urpN jamvm-1.5.0/src/os/linux/Makefile.am jamvm-1.5.0-avr32/src/os/linux/Makefile.am
  1436. --- jamvm-1.5.0/src/os/linux/Makefile.am 2007-10-28 00:19:26.000000000 +0200
  1437. +++ jamvm-1.5.0-avr32/src/os/linux/Makefile.am 2008-02-08 09:20:38.000000000 +0100
  1438. @@ -20,7 +20,7 @@
  1439. ##
  1440. SUBDIRS = @arch@
  1441. -DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
  1442. +DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips avr32
  1443. noinst_LTLIBRARIES = libos.la
  1444. libos_la_SOURCES = os.c
  1445. diff -urpN jamvm-1.5.0/src/os/linux/Makefile.in jamvm-1.5.0-avr32/src/os/linux/Makefile.in
  1446. --- jamvm-1.5.0/src/os/linux/Makefile.in 2007-10-29 07:02:37.000000000 +0100
  1447. +++ jamvm-1.5.0-avr32/src/os/linux/Makefile.in 2008-02-08 09:20:38.000000000 +0100
  1448. @@ -191,7 +191,7 @@ use_zip_no = @use_zip_no@
  1449. use_zip_yes = @use_zip_yes@
  1450. with_classpath_install_dir = @with_classpath_install_dir@
  1451. SUBDIRS = @arch@
  1452. -DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
  1453. +DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips avr32
  1454. noinst_LTLIBRARIES = libos.la
  1455. libos_la_SOURCES = os.c
  1456. AM_CPPFLAGS = -I$(top_builddir)/src