rockbox/firmware/asm/SOURCES
Aidan MacDonald 2f2b90535a firmware: use C versions of memcpy and memmove for ARM Cortex-M
The ARM assembly versions of memcpy and memmove try to
directly modify the PC based on the number of bytes to
be copied as an "optimization"; but this only works if
instructions are guaranteed to be 4 bytes wide.

This trick is completely broken on Cortex-M, since an
instruction can be 2-4 bytes wide: for example a memcpy
of 4 bytes ends up storing 32 bytes worth of garbage to
the target address!

Use the C memcpy/memmove implementations for Cortex-M
instead; fixing the ASM version is more trouble than
it's worth.

Change-Id: I695587fd585ec25ef276f2dbc61e2290b7015e13
2026-01-08 16:41:59 +00:00

68 lines
1.4 KiB
Text

#if defined(CPU_ARM)
#if defined(CPU_ARM_CLASSIC)
arm/ffs.S
#endif
arm/memset16.S
#elif defined(CPU_MIPS)
mips/ffs.S
memset16.c
#elif defined(CPU_COLDFIRE)
m68k/ffs.S
m68k/memset16.S
#else
ffs.c
memset16.c
#endif
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(HAVE_ROCKBOX_C_LIBRARY)
#if defined(CPU_ARM_CLASSIC)
arm/memcpy.S
arm/memmove.S
arm/memset.S
strlen.c
#elif defined(CPU_ARM_MICRO)
memcpy.c
mempcpy.c
memmove.c
arm/memset.S
strlen.c
#elif defined(CPU_MIPS)
mips/memcpy.S
memmove.c
mips/memset.S
strlen.c
#elif defined(CPU_COLDFIRE)
m68k/memcpy.S
m68k/memmove.S
m68k/memset.S
m68k/strlen.S
#else
memcpy.c
mempcpy.c
memmove.c
memset.c
strlen.c
#endif
#endif
#if defined(WIN32) || defined(APPLICATION)
mempcpy.c
#endif
#if (defined(SANSA_E200) || defined(GIGABEAT_F) || defined(GIGABEAT_S) || \
defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \
defined(COWON_D2) || defined(MINI2440) || defined(SAMSUNG_YPR0) || \
defined(SAMSUNG_YPR1) || defined(DX50) || defined(DX90) || (defined(MROBE_500) && !defined(LCD_USE_DMA)) || \
defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || \
defined(FIIO_M3K_LINUX)) && \
!defined(SIMULATOR)
#if LCD_DEPTH >= 24
lcd-as-memframe-24bit.c
#else
#if defined(CPU_ARM)
arm/lcd-as-memframe.S
#else
lcd-as-memframe.c
#endif /* CPU_ARM */
#endif /* LCD_DEPTH */
#endif