From: <enl...@li...> - 2004-03-25 04:48:49
|
Enlightenment CVS committal Author : raster Project : e17 Module : libs/embryo Dir : e17/libs/embryo/src/lib Modified Files: embryo_amx.c Log Message: swap all code bytes! =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/lib/embryo_amx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- embryo_amx.c 25 Mar 2004 03:59:18 -0000 1.4 +++ embryo_amx.c 25 Mar 2004 04:38:07 -0000 1.5 @@ -153,6 +153,7 @@ if (hdr->stp <= 0) return 0; if ((hdr->flags & EMBRYO_FLAG_COMPACT)) return 0; +#ifdef WORDS_BIGENDIAN /* also align all addresses in the public function, public variable and */ /* public tag tables */ fs = GETENTRY(hdr, publics, 0); @@ -178,8 +179,19 @@ embryo_swap_32(&(fs->address)); fs = (Embryo_Func_Stub *)((unsigned char *)fs + hdr->defsize); } +#endif ep->flags = EMBRYO_FLAG_RELOC; - + +#ifdef WORDS_BIGENDIAN + { + Embryo_Cell cip, code_size; + Embryo_Cell *code; + + code_size = hdr->dat - hdr->cod; + code = ep->code + (int)hdr->code; + for (cip = 0; cip < code_size; ) embryo_swap_32(&(code[cip])); + } +#endif /* init native api for handling floating point - default in embryo */ _embryo_fp_init(ep); return 1; @@ -620,7 +632,7 @@ Embryo_Cell reset_stk, reset_hea, *cip; Embryo_UCell codesize; int i; - Embryo_Opcode op; + unsigned int op; Embryo_Cell offs; int num; |