Consolidates the definitions of size_t in the minimal libc library.
This prevents code duplication.
Change-Id: I996990ad9093ebec1f9ba0045d14319e1a243e70
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Consolidates definitions of NULL in the minimal libc library.
This prevents code duplication.
Change-Id: Ia4a2bde1329d66e7c83afeab806a39b22704ab48
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.
Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Add a simple implementation of isprint() which is used to test for a
printable character.
Change-Id: I0ebca10ec0f8e43ee245f6508c5b82c6e207bd32
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Provides proper access to the per-thread errno variable, by using the
_get_errno() call.
Users can now do:
errno = EINVAL;
printk("errno: %d\n", errno);
Change-Id: I0ef365199656d002623b39b7f45f14f561501375
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The previous implementation mistakenly kept outputting the first
character of the string endlessly.
Change-Id: I299c627a52158218be8e88c952935edb87a636fe
Suggested-by: Tom Yeon <tom.yeon@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Change-Id: I34a54230bc4a63c8a4391d03ff530835910c3705
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change all the Intel and Wind River code license from BSD-3 to Apache 2.
Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Do not use local _isdigit function, use public isdigit
instead.
Change-Id: Ifc2721fc2def429de4934c9855f08dae30326694
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This option adds optional libc functions that are not directly
used by the kernel but can be used for testing purposes.
This option is experimental.
Change-Id: Ia4dba718359c4f381047a5b52ebddb26d87ea75a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add function for comparing two strings ignoring case.
Change-Id: I2fc78c0a0d0f53e23566ffacd8dca3b23e386c26
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Needed by CoAP implementation in net/ip/er-coap
Change-Id: I724bc7569a29c35f386bbc301d883a000882de78
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The way we build the libc files is not a real library that can be
used as a libc and makes managing the source files a bit
difficult, so lets revert back to building the c function files
like everything else in the system to avoid any confusion.
Change-Id: I4e998e37bc376522fe253c4aefefe7804597f0f2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove function name from comment and add @brief instead.
Also capitilize first letter.
Change-Id: Ib708b49bf02e5bc89b0066637a55874e659637e0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Previous comment style used RETRURNS:, use @return to comply
with javadoc style.
Change-Id: Ib1dffd92da1d97d60063ec5309b08049828f6661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The change replaces multiple asterisks to ** at
the beginning of comments and adds a space before
the asterisks at the beginning of lines.
Change-Id: I7656bde3bf4d9a31e38941e43b580520432dabc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a tolower implementation that may be used in various parts of the
operating system.
Change-Id: I5aa855b41e2a09fcb077860b4580dbe1e6d4a093
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Revises kernel so that it uses the standard boolean type library
defined for C99, rather than having its own custom boolean type.
Also revises sample projects that used the non-standard type.
Change-Id: Ib41b7f836da25352aa5ae9dfbbfdd29739017b6f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Builds upon the approach taken by the x86 version of k_memset()
and k_memcpy() APIs, which uses word-sized operations for greater
efficiency when manipulating large buffers. The algorithms used
here are architecture-independent.
Change-Id: I01ea8b22c8e6028f881e9b61ccc3a01e8ba4c02b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit changes the way libc is built.
Instead of building a hierarchy of objects linked into the
microkernel, libc minimal is built as a static library and
linked against the microkernel binary.
The location of the libc is configurable with the variable
KLIBC_DIR. This gives the flexibility to build against a
different libc other than minimal.
Change-Id: I9c0b6a684a9f3b407861aa387727c45eceb269c4
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit adds the Makefiles to create object-bundle for
libc minimal.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I9d15e0203664010ba4ef5cf3625b4075d7827ad7
The previous implementation would read one byte past both buffers if
the buffers were equal. Make sure the pointers are not incremented
past the last byte. Also ensure that comparing zero bytes always
returns 0.
Change-Id: I5ef25d6bd2f7417b60102dc1c2602d8b23c4c1bc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add a memcmp implementation that may be used in various parts of the
operating system.
Change-Id: I784bdcb26b924b2513ecd0b3ce1898195453f755
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Line's length should be shorten than 100 characters. This commit
fixes these lines separating them into two parts.
Change-Id: Ic68c9086866cd778187aa1465470acc0485e2271
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Spaces between the function name and the open parenthesis are not allowed.
This commit fixes the case where only one open parenthesis with leading
whitespaces is present in the line.
#!/bin/bash
checkpatch_script="$VXMICRO_BASE/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 "
for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*");
do
# fixing spaces between function name and open parenthesis
for line in $(eval $checkpatch_script $file | grep "WARNING:SPACING: space prohibited between function name and open parenthesis '('" | cut -d":" -f2)
do
echo "$file : $line"
sed -i ''$line' { /[ \t](.*[ \t](/ b skip_it s/[ \t]*(/(/ ; :skip_it }' $file;
done;
done;
Change-Id: I1e026eaee930e297374e5f2f725b78f29824dee3
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Enables the section garbage collection compiler flags regardless of the
state of the SECTION_GARBAGE_COLLECTION kconfig option.
Change-Id: Iad488b3ca4ee0a80898f83809e4c615efcdbd03f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
When the source string is shorter than the maximum number of bytes to copy
to the destination string, strncpy() must fill the remaining bytes in the
destination string with null bytes.
Change-Id: I419d11efd1dd33b1437d1891f1bf2ec7647826ee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit changes the pointer's location in order to comply with
the defined coding style.
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@linux.intel.com>
Change-Id: Ibcf1ef0e4fc53b0cb5286b36119e76d017f24cd9
Assignment in if condition should be avoided. The source code is
restructured to have the assignment outside the if condition.
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Change-Id: I9e3e1d069657d3ce9f54e1f4b4b74163c724a733
Signed-off-by: Anas Nashif <anas.nashif@intel.com>