diff -r 02f19e28d12e -r 38a7352e23d3 kernel/eka/common/arm/cmem.cia --- a/kernel/eka/common/arm/cmem.cia Tue Jun 29 13:21:36 2010 +0100 +++ b/kernel/eka/common/arm/cmem.cia Wed Jun 30 18:53:50 2010 +0100 @@ -181,19 +181,46 @@ asm("small_fill_end: "); __JUMP(,lr); + } + #ifdef __EABI__ - // The AEABI switched the order of arg2 and arg3 to save an intruction when - // calling 'memset' from 'memclr' - asm(".global __aeabi_memset8 "); - asm("__aeabi_memset8: "); - asm(".global __aeabi_memset4 "); - asm("__aeabi_memset4: "); - asm(".global __aeabi_memset "); - asm("__aeabi_memset: "); - asm(" and r2, r2, #255"); - asm(" b fill "); -#endif - } +//mikek N.B. These __aeabi_mem functions are also defined in rvct/compsupp/aeabimem.cpp +// and should be implemented in the compsupp library, not here, when we build one for gcce. + +#define EXPORT_EABI_MEMSET_VENEER(name) \ +extern "C" EXPORT_C __NAKED__ TAny* (name)(TAny* /*aTrg*/, unsigned int /*aLength*/, TInt /*aValue*/ ) \ +{ \ + asm(" and r2, r2, #255"); \ + asm(" b fill "); \ +} + +EXPORT_EABI_MEMSET_VENEER(__aeabi_memset8) +EXPORT_EABI_MEMSET_VENEER(__aeabi_memset4) +EXPORT_EABI_MEMSET_VENEER(__aeabi_memset) + +#define EXPORT_EABI_MEMCLR_ALIAS(alias) \ +extern "C" EXPORT_C __NAKED__ TAny* (alias)(TAny* /*aTrg*/, unsigned int /*aLength*/ ) \ +{ \ + asm(" b memclr "); \ +} + +EXPORT_EABI_MEMCLR_ALIAS(__aeabi_memclr8) +EXPORT_EABI_MEMCLR_ALIAS(__aeabi_memclr4) +EXPORT_EABI_MEMCLR_ALIAS(__aeabi_memclr) + +#define EXPORT_EABI_MEMMOVE_ALIAS(alias,func) \ +extern "C" EXPORT_C __NAKED__ TAny* (alias)(TAny* /*aTrg*/, const TAny* /*aSrc*/, unsigned int /*aLength*/) \ +{ \ + asm(" b " #func ); \ +} + +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memcpy8,memcpy) +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memcpy4,memcpy) +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memcpy,memcpy) +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memmove8,memmove) +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memmove4,memmove) +EXPORT_EABI_MEMMOVE_ALIAS(__aeabi_memmove,memmove) +#endif // __EABI__ #endif // USE_REPLACEMENT_MEMSET