diff --git a/ChangeLog b/ChangeLog index 82a4fd0926..44f38ee10a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3494,3 +3494,5 @@ * lib/strings/lib_memset.c: CONFIG_MEMSET_OPTSPEED will select a version of memset() optimized for speed. By default, memset() is optimized for size. + * lib/strings/lib_memset.c: CONFIG_MEMSET_64BIT will perform 64-bit + aligned memset() operations. diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index e43ca8a2fa..08c6534cb4 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -4457,7 +4457,7 @@ build
- And if CONFIG_MEMCPY_VIK
, the following tuning options are available:
+ And if CONFIG_MEMCPY_VIK
is selected, the following tuning options are available:
CONFIG_MEMCPY_PRE_INC_PTRS
:
@@ -4471,7 +4471,7 @@ build
CONFIG_MEMCPY_64BIT
:
- Compiles memcpy for 64 bit architectures
+ Compiles memcpy()
for 64 bit architectures
memset()
is optimized for size.
+ And if CONFIG_MEMSET_OPTSPEED
is selected, the following tuning option is available:
+
CONFIG_MEMSET_64BIT
:
+ Compiles memset()
for 64 bit architectures
+
The architecture may provide custom versions of certain standard header files:
diff --git a/configs/README.txt b/configs/README.txt
index 0bb531d67a..9714b0228c 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -628,7 +628,7 @@ defconfig -- This is a configuration file similar to the Linux
function by Daniel Vik. See licensing information in the top-level
COPYING file. Default: n
- And if CONFIG_MEMCPY_VIK, the following tuning options are available:
+ And if CONFIG_MEMCPY_VIK is selected, the following tuning options are available:
CONFIG_MEMCPY_PRE_INC_PTRS - Use pre-increment of pointers. Default is
post increment of pointers.
@@ -644,6 +644,11 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_MEMSET_OPTSPEED - Select this option to use a version of memcpy()
optimized for speed. Default: memcpy() is optimized for size.
+ And if CONFIG_MEMSET_OPTSPEED is selected, the following tuning option is
+ available:
+
+ CONFIG_MEMSET_64BIT - Compiles memset() for 64 bit architectures
+
The architecture may provide custom versions of certain standard header
files:
diff --git a/lib/Kconfig b/lib/Kconfig
index 0f25c89238..80c584ce92 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -219,6 +219,13 @@ config MEMSET_OPTSPEED
Select this option to use a version of memcpy() optimized for speed.
Default: memcpy() is optimized for size.
+config MEMSET_64BIT
+ bool "64-bit memset()"
+ default n
+ depends on MEMSET_OPTSPEED
+ ---help---
+ Compiles memset() for 64 bit architectures
+
config ARCH_STRCMP
bool "strcmp()"
default n
diff --git a/lib/string/lib_memmove.c b/lib/string/lib_memmove.c
index ecaeb54cf2..85cb79e174 100644
--- a/lib/string/lib_memmove.c
+++ b/lib/string/lib_memmove.c
@@ -56,17 +56,22 @@ void *memmove(void *dest, const void *src, size_t count)
if (dest <= src)
{
tmp = (char*) dest;
- s = (char*) src;
+ s = (char*) src;
while (count--)
- *tmp++ = *s++;
+ {
+ *tmp++ = *s++;
+ }
}
else
{
tmp = (char*) dest + count;
- s = (char*) src + count;
+ s = (char*) src + count;
while (count--)
- *--tmp = *--s;
+ {
+ *--tmp = *--s;
+ }
}
+
return dest;
}
#endif
diff --git a/lib/string/lib_memset.c b/lib/string/lib_memset.c
index c910d2ce04..2828f1ff86 100644
--- a/lib/string/lib_memset.c
+++ b/lib/string/lib_memset.c
@@ -1,4 +1,5 @@
-/************************************************************
+
+/****************************************************************************
* lib/string/lib_memset.c
*
* Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
@@ -31,15 +32,12 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
- * Compilation Switches
- ************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include