We strongly prefer that contribtions be offered using the same license
as the project/module. But, we should document other acceptable
licenses for contributions.
This will allow package owners to more easily know if they can accept
a contribution under a different source license.
NOTE: This does not modify the wording of the "TianoCore Contribution
Agreement 1.0" section
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Mark Doran <mark.doran@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15892 6f19259b-4bc3-4df7-8a09-765794883524
NOTE: Replaces the previous version which was a file from the wrong project.
Applies the patch, submitted by Olivier Martin, to use va_arg for long double.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Includes some cosmetic changes to enhance readability.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15859 6f19259b-4bc3-4df7-8a09-765794883524
StdLibPrivateInternalFiles: Add AArch64 support
Disable 'memcpy' symbol for ARM in LibC. It is already provided by the ARM compiler intrinsics library.
Add missing 'strtold' symbol. Use the same fallback as IPF for now.
Use Include definitions as provided by ARM version.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
Reviewed-By: Daryl McDaniel <daryl.mcdaniel@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15858 6f19259b-4bc3-4df7-8a09-765794883524
Applies the patch, submitted by Olivier Martin, to use va_arg for long double.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Also initializes an array so that strings will be properly terminated.
Includes some cosmetic changes to enhance readability.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15856 6f19259b-4bc3-4df7-8a09-765794883524
Add new file StdLib/LibC/CRT/Ia32/llshr.c
Add references to the new file to StdLib/LibC/LibC.inf
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15855 6f19259b-4bc3-4df7-8a09-765794883524
The member "fext._ub" is a structure (of type "struct __sbuf"), and the
current initializer triggers
StdLib/LibC/Stdio/vswscanf.c: In function 'vswscanf':
StdLib/LibC/Stdio/vswscanf.c:75:10: error: missing braces around
initializer [-Werror=missing-braces]
StdLib/LibC/Stdio/vswscanf.c:75:10: error: (near initialization for
'fext._ub') [-Werror=missing-braces]
cc1: all warnings being treated as errors
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15786 6f19259b-4bc3-4df7-8a09-765794883524
The member "u.L" is an array, and the current initializer triggers
StdLib/LibC/gdtoa/strtof.c: In function '_strtof':
StdLib/LibC/gdtoa/strtof.c:53:9: error: missing braces around
initializer [-Werror=missing-braces]
StdLib/LibC/gdtoa/strtof.c:53:9: error: (near initialization for
'u.L') [-Werror=missing-braces]
cc1: all warnings being treated as errors
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15785 6f19259b-4bc3-4df7-8a09-765794883524
When running Enquire.efi, several errors similar to the following are produced:
Maximum exponent = 128
Maximum number = 3.40282347e+38
*** WARNING: Possibly bad output from printf above
expected value around 3.40282347e38, bit pattern:
11111111 11111111 01111111 01111111
sscanf gave -inf, bit pattern:
00000000 00000000 10000000 11111111
difference= inf
Overflow doesn’t seem to generate a trap
The memory allocation tests will also fail, sometimes leaving all available memory consumed.
The correct output in the above example is:
Maximum exponent = 128
Maximum number = 3.40282347e+38
Overflow doesn't seem to generate a trap
The root cause is that all operations on values of Long or ULong type, within the gdtoa library, must be 32-bit operations. A previous change replaced the Long and ULong definitions with INTN and UINTN, respectively. While this is correct for a lot of Linux and NetBSD code, it was not correct for this library.
This fix reverts the definitions of ULong and Long back to 32-bit types.
A descriptive comment has also been added to the U union.
Additional white-space has been added to tidy up the definitions of the word0 and word1 macros.
Verified with Enquire.efi and the ISO/IEC C Library compliance Validation Suite.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15765 6f19259b-4bc3-4df7-8a09-765794883524
The cast to (void**) is needed for the last parameter of the AllocatePool call in malloc(). This is because type CPOOL_HEAD** is not automatically promoted to void**, as required by AllocatePool().
This was originally addressed in SVN revision 15474 but removed again in 15664.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed by: Stefan Kaeser <stefankaeser@hotmail.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15677 6f19259b-4bc3-4df7-8a09-765794883524
StdLib/LibC/Uefi/GetPass.c
COPY to StdLib/PosixLib/GetPass/GetPass.c
DELETE
StdLib/PosixLib/GetPass/GetPass.c
NEW, COPIED from StdLib/LibC/Uefi/GetPass.c
StdLib/PosixLib/PosixLib.inf
Create a LibPosix library class to build all PosixLib functions into a single library.
Move GetPass from LibC/Uefi to PosixLib.inf
StdLib/LibC/Uefi/Uefi.inf
Remove GetPass.c from sources.
Remove IPF from VALID_ARCHITECTURES
Update VERSION_STRING
Align [Defines] on a two-character boundary
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15663 6f19259b-4bc3-4df7-8a09-765794883524
This patch fixes the following warning:
"expected ‘void **’ but argument is of type ‘struct CPOOL_HEAD **’"
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Reviewed by: Daryl McDaniel <daryl.mcdaniel@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15474 6f19259b-4bc3-4df7-8a09-765794883524
StdLib/LibC/StdLib/Malloc.c
Create a private data structure, CPOOL_HEAD, which contains housekeeping information for StdLib’s memory allocation functions. An instance of this structure is prepended to every chunk of allocated memory. The structure links the allocation into a doubly-linked list and keeps track of the size of each allocation unit. This information is then available for use by the realloc function.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Rosenbaum, Lee G <lee.g.rosenbaum@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15319 6f19259b-4bc3-4df7-8a09-765794883524
LibWchar is now a standalone library which can be used independent of the rest of StdLib.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed-by: Matthew Stanbro <Matthew.A.Stanbro@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14959 6f19259b-4bc3-4df7-8a09-765794883524
Support local bind by validating the IP address using the IP configuration protocol.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Ankit Singh3 <Ankit_Singh3@Dell.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14875 6f19259b-4bc3-4df7-8a09-765794883524
The original Linux code tried to be too fancy so the internal pointers got out of sync.
Rewrote the function to at least be more clear.
Regardless, it now works properly.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed by: matthew.stanbro@intel.com
Reviewed by: erik.c.bjorge@intel.com
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14664 6f19259b-4bc3-4df7-8a09-765794883524
Building with the Intel Compiler V11 produces the following error:
StdLib\LibC\Containers\Queues\Fifo.c(223): error #186: pointless comparison of unsigned integer with zero
assert(Count >= 0);
Deleted the assert.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>
Reviewed by: erik.c.bjorge@intel.com
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14648 6f19259b-4bc3-4df7-8a09-765794883524
Modifies StdLib/StdLib.inc to include the ARM CompilerIntrinsicsLib when building for Aarch64.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed by: Daryl McDaniel <daryl.mcdaniel@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14499 6f19259b-4bc3-4df7-8a09-765794883524
DecodeOneStateful: Properly handle combinations of Src, Dest, or Len being NULL or 0.
EncodeUtf8: Do not zero-terminate the result string in this worker function.
mbsrtowcs: Remove test for **src == '\0', as per ISO/IEC 9899:199409. Allows "".
wcsrtombs: The C Language standard, ISO/IEC 9899:199409, states that the wcsrtombs() function will stop before encountering the terminating NUL character only if Dest is NOT NULL. This implies that if Dest is NULL, the Limit parameter will be ignored. In order to avoid system hangs, if Dest is NULL a Limit value of ASCII_STRING_MAX is automatically used. Also fixed a typo in the function header comment.
With these changes, StdLib now passes all of the C Language Standards Compliance Tests for ISO/IEC 9899:199409 (C95).
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14358 6f19259b-4bc3-4df7-8a09-765794883524
ISSUES.txt: Added issue 11, updated status of issue 1.
gdtoa/gdtoaimp.h: Fix definition of union U.
Locale/_wcstod.h: Return 0.0 instead of 0 in the "no_convert" case.
Locale/multibyte_Utf8.c: In wcsrtombs(), if both the destination pointer is NULL and the size, Limit, is 0; return the estimated length of the converted string up to ASCII_STRING_MAX bytes.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: Aniruddha_Herekar@Dell.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14171 6f19259b-4bc3-4df7-8a09-765794883524
StdLib\Include\Containers\Fifo.h
Change return type of cFIFO_Truncate to size_t. Makes declaration match definition.
Update comment to describe what is returned.
StdLib\LibC\Uefi\InteractiveIO\IIOutilities.c
Change return type of IIO_CursorDelta to int. Makes declaration match definition.
Change other types from INT32 to int, for consistency.
Update comment for returned values.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14060 6f19259b-4bc3-4df7-8a09-765794883524
SysCalls.c: Add IGNSPEC to the "sane" termios settings so that, by default, function keys and other special keys are ignored.
fvwrite.c:
Line 109: Change test to less-than zero since zero is a valid value.
Line 113: Change test to greater-than zero since we only want to loop when there are characters available.
Line 114: Force uio_resid to zero since it might have become negative on line 113.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
Reviewed-by: lee.g.rosenbaum@intel.com
Reviewed-by: jaben.carsey@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14013 6f19259b-4bc3-4df7-8a09-765794883524
Adds a subset of the terminal I/O capabilities described in the Single Unix Specification, V4.
Supports:
Erase previous character. Default is Backspace or ^H
Erase line. Default is ^U
TAB characters are supported and, by default, are rendered as 8 spaces. They will still be read as a single TAB character.
Both Canonical and Non-Canonical modes are supported.
If a terminal device is opened with O_TTY_INIT in the mode, the device will be initialized to "sane" values for interactive use. It will be in Canonical mode, Enter will be translated to NewLine and on output, a NewLine is translated to CRLF. Echoing will be on, control characters are output as ^X, and TABs are expanded.
See the new <sys/termios.h> file for more information.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
Reviewed-by: leroy.p.leahy@intel.com
Reviewed-by: lee.g.rosenbaum@intel.com
Reviewed-by: jaben.carsey@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13989 6f19259b-4bc3-4df7-8a09-765794883524
Add utility functions for determining character length of strings.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: erik.c.bjorge@intel.com
Reviewed-by: lee.g.rosenbaum@intel.com
StdLib/LibC/
Locale/multibyte_Utf8.c
Improve comments.
Define implementation-specific MBCS utility functions, as declared in <stdlib.h>.
Enhance functionality of EncodeUtf8() and improve error handling.
Set correct conversion state in wcrtomb().
Bug fixes in wcsrtombs().
Make wctob() properly MBCS compliant.
Main/Main.c
Remove code obsoleted by new wcsrtombs() implementation.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13785 6f19259b-4bc3-4df7-8a09-765794883524
StdLib/Include/
stdlib.h
Update MB_CUR_MAX to 3, the max. size of a MBCS character.
Improve comments for wcstombs()
Declare implementation-specific MBCS utility functions:
OneWcToMcLen() Determine the number of bytes needed to represent
a Wide character as a MBCS character.
EstimateWtoM() Determine the number of bytes needed to represent
a Wide character string as a MBCS string.
CountMbcsChars() Determine the number of characters in a MBCS string.
wchar.h
Improve comments.
StdLib/Include/sys/
fcntl.h
Define new Open flags.
Remove obsolete and commented-out lines.
termios.h
Add Intel Copyright notice and Open-Source License.
Change c_cc index macros into enumerated values.
Clean up flag definitions for visual alignment as well as UEFI relevance.
Move c_ispeed and c_ospeed termios members to end for better alignment.
Comment out declarations for functions not yet implemented.
Add an enum defining values for the UEFI extended function keys.
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: erik.c.bjorge@intel.com
Reviewed-by: jaben.carsey@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13741 6f19259b-4bc3-4df7-8a09-765794883524
The C95 specification states: "The free function causes the space pointed to by ptr to be deallocated, that is, made available for further allocation. If ptr is a null pointer, no action occurs". The UEFI FreePool() function, which the StdLib implementation of free() uses, does not make this check. This fix adds a check for null to the free() function such that if the pointer argument is NULL, nothing is done.
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: erik.c.bjorge@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13739 6f19259b-4bc3-4df7-8a09-765794883524