From 0c47dbe92d1017ebedb089533cc8dfa0f3f2cc03 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 29 Jan 2015 06:36:53 -0600 Subject: [PATCH 1/2] ARM assembly language memcpy.S was not returning a value in R0 it is required to do. From David Sidrane --- arch/arm/src/armv7-a/arm_memcpy.S | 15 +++++++++++++++ arch/arm/src/armv7-m/up_memcpy.S | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/arm/src/armv7-a/arm_memcpy.S b/arch/arm/src/armv7-a/arm_memcpy.S index 84da4942b6..713359d09e 100644 --- a/arch/arm/src/armv7-a/arm_memcpy.S +++ b/arch/arm/src/armv7-a/arm_memcpy.S @@ -143,11 +143,26 @@ MEM_LongCopyTable: * Input Parameters: * r0 = destination, r1 = source, r2 = length * + * Returned Value: + * r0 = destination r1-r3 burned + * ************************************************************************************/ + .align 4 .thumb_func + memcpy: push {r14} + push {r0} + bl _do_memcpy + pop {r0} + pop {pc} + + .align 4 + + .thumb_func +_do_memcpy: + push {r14} /* This allows the inner workings to "assume" a minimum amount of bytes */ /* Quickly check for very short copies */ diff --git a/arch/arm/src/armv7-m/up_memcpy.S b/arch/arm/src/armv7-m/up_memcpy.S index ea267f78fc..84877b0400 100644 --- a/arch/arm/src/armv7-m/up_memcpy.S +++ b/arch/arm/src/armv7-m/up_memcpy.S @@ -142,11 +142,26 @@ MEM_LongCopyTable: * Input Parameters: * r0 = destination, r1 = source, r2 = length * + * Returned Value: + * r0 = destination r1-r3 burned + * ************************************************************************************/ + .align 4 .thumb_func + memcpy: push {r14} + push {r0} + bl _do_memcpy + pop {r0} + pop {pc} + + .align 4 + + .thumb_func +_do_memcpy: + push {r14} /* This allows the inner workings to "assume" a minimum amount of bytes */ /* Quickly check for very short copies */ From 447ec3cae775ede860e8d45db3d783b1b4c6b365 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 29 Jan 2015 06:38:45 -0600 Subject: [PATCH 2/2] Update ChangeLog --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index e79c3a46ea..e4c9abc62d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9556,3 +9556,6 @@ interrupts are automatically restored when the wait happens. But with CONFIG_NET_NOINTS=y, the wait blocks with the network locked -- bad style and also can lead to a deadlock condition (2015-01-28). + * arch/arm/src/armv7-a/arm_memcpy.S and arch/arm/src/armv7-m/up_memcpy.S: + ARM assembly language memcpy.S's were not returning a value in R0 they + are required to do. From David Sidrane (2015-01-29).