Commit Graph

140 Commits

Author SHA1 Message Date
Ard Biesheuvel 11ad0847b7 StdLib: remove mention of ARMGCC
The ARMGCC toolchain will be removed, and so will the build rule family
by the same name. So remove the BuildOptions specific to ARMGCC.

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18207 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-12 05:25:12 +00:00
Harry Liebel 1bbb83b526 StdLib: Add support for AArch64
- Use some files from ARM version.
- Use NetBSD software floating point library to provide floating point
  operations not handled directly by hardware floating point enabled
  GCC compiler.

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 <edk2-lists@mc2research.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18118 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-30 09:51:04 +00:00
Harry Liebel d799c02832 StdLib/LibC: Provide missing ARM symbols
Provide missing functionality by using files from LLVM.

Changes made:
- Formatting changes (tabs to spaces, DOS line endings etc).
- Simplified 'int_endianness.h' to work for our case.
- Added LLVM licence to the individual files.

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 <edk2-lists@mc2research.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18117 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-30 09:50:58 +00:00
NetBSD project 3352b62beb StdLib/LibC: Add software floating point library from NetBSD
Floating point processing is not supported on ARM for UEFI. In order to
support UEFI applications in AppPkg we use this library to provide the
required functionality.

Changes as compared to the NetBSD version:
- Formatting changes (tabs to spaces, DOS line endings etc).
- Disable exceptions as described in the float_raise() function.
- Disable definition of 'Symbolic Boolean literals' in milieu.h.

Source originally from: NetBSD project
- Source: http://cvsweb.netbsd.org/bsdweb.cgi/?only_with_tag=MAIN
- Licensing and Copyright: http://www.netbsd.org/about/redistribution.html

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 <edk2-lists@mc2research.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18116 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-30 09:50:51 +00:00
Olivier Martin b393333538 StdLib: Added BaseStackLib for ARM architectures
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18115 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-30 09:50:43 +00:00
Scott Duplichan 88656abf1b StdLib: Do not define memcpy for AARCH64 builds
For AARCH64, do not define a memcpy function in stdlib because it is
already defined in CompilerIntrinsicsLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18063 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-26 08:07:20 +00:00
jiaxinwu c581e5037d StdLib: Remove EfiSocketLib and Ip4Config Protocol dependency.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jiaxinwu <jiaxin.wu@intel.com>
Reviewed-by: "Leahy, Leroy P" <leroy.p.leahy@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17875 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 03:12:58 +00:00
Jordan Justen 3f3c4895da */Contributions.txt: Update example email address
Use the example.com domain as recommended in RFC 2606.

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: Bruce Cran <bruce.cran@gmail.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16724 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-03 17:29:14 +00:00
Daryl McDaniel 6a013e50b3 StdLib: Move libraries from ShellPkg into MdeModulePkg and MdePkg.
The following libraries are being migrated out of ShellPkg in order to make
their functionality more widely available.
  • PathLib:        Incorporate into MdePkg/Library/BaseLib
  • FileHandleLib:  MdePkg/Library/UefiFileHandleLib
  • BaseSortLib:    MdeModulePkg/Library/BaseSortLib
  • UefiSortLib:    MdeModulePkg/Library/UefiSortLib

AppPkg.dsc:
StdLib.dsc:
StdLib.inc:
  Delete PathLib LibraryClass description.
  Update FileHandleLib LibraryClass description to reflect its new location.
  Update SortLib LibraryClass description to reflect its new location.

StdLib.inf:
  Delete PathLib from LibraryClasses.

realpath.c:
  Delete include of PathLib.h.

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: Lee Rosenbaum <lee.g.rosenbaum@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16608 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-13 23:35:33 +00:00
Bruce Cran 2aa580be65 StdLib/BsdSocketLib: Fix function declaration mismatch with definition.
Replace the existing old-style function declarations for Field, cvtbase and spectHex in BsdSocketLib with real prototypes.  This allows StdLib to build using the GCC48 toolchain.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bruce Cran <bruce.cran@gmail.com>
Reviewed-by: Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16467 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-02 21:30:41 +00:00
Daryl McDaniel 4b2cf923c0 StdLib/AppPkg: Add the NOOPT build target and fix a type conversion problem with VS2005.
AppPkg.dsc: Remove IPF support and add NOOPT build target.
StdLib.dsc: Add NOOPT build target.
daConsole.c: Cast a comparison to BOOLEAN before assigning it to a BOOLEAN.

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@16331 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-11 22:56:58 +00:00
Daryl McDaniel 2a7e98a8cc StdLib: Fix a "potentially uninitialized variable" error.
gdtoa/gdtoa.c:  Several "goto" paths allowed the initialization of a variable to be bypassed.  Initialized it at the top of the function in order to eliminate the error.

Updated the file header and copyright notices.

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@16324 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-10 23:05:45 +00:00
darylm503 16a5fed658 AppPkg: Add the Lua interpreter and library.
StdLib: Add support and include files for Lua.

The sources for the Lua standalone interpreter, as well as its library, have been added to AppPkg/Applications/Lua.  The Lua library, LuaLib, can be used to embed Lua into new applications.

The Lua header files, needed for both building and embedding, are located in StdLib/Include/Lua.  The original versions of these header files, in the source directory, have been converted into stubs that reference the include files in StdLib.  This allows us to keep the Lua sources as close to the distributed version as possible.

Documentation is contained in the Lua/doc directory.  Further information is available at www.lua.org.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed Off by:  Bruce Maynard <Bruce.Maynard@Emulex.Com>
Reviewed by:    Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16313 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-07 20:18:01 +00:00
Jordan Justen 26830e8579 EDK II Contributions.txt: Update patch format information
Update to show what the patch looks like in email form.

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: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16297 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 22:05:50 +00:00
Olivier Martin b81cc7d624 StdLib: Fix more GCC warnings/errors caused by variables being set but not used.
Removed variables that had no effect on code behavior.
Normalized comment formatting.

Contributed-under: TianoCore Contribution Agreement 1.0
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@16286 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 20:32:02 +00:00
Olivier Martin beaaa3b715 StdLib: Fix more GCC warnings/errors caused by variables being set but not used.
Removed variables that had no effect on code behavior.
Normalized comment formatting.

Contributed-under: TianoCore Contribution Agreement 1.0
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@16284 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-31 17:50:33 +00:00
Olivier Martin 0e565888ee StdLib: Fix GCC warnings/errors caused by variables being set but not used.
Removed variables that had no effect on code behavior.

Fifo.c::FIFO_Dequeue: Replaced instances of "Self->ElementSize" with preexisting variable "SizeOfElement".

IIOutilities.c::IIO_GetInChar: Fixed variable of wrong, but compatible, type and made updating of housekeeping variables dependent upon successful completion of reading from the buffer.

Contributed-under: TianoCore Contribution Agreement 1.0
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@16276 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-30 01:05:22 +00:00
Daryl McDaniel 24903bc48a StdLib: Some deployed versions of the Simple Text Input Protocol randomly return either NUL characters or Scan Codes when just typing normal text. These changes filter out NUL characters and make Scan Code and error handling more robust.
StdLibPrivateInternalFiles/Include/Device/Console.h: Change UnGetKey, in the ConInstance structure, from an EFI_INPUT_KEY structure to a CHAR16 variable.

Include/sys/termios.h: Add CHAR_SUB and CHAR_ESC for translation of '^Z' and the Escape Scan Code into the EOF and ESC characters, respectively.

LibC/Uefi/Devices/Console/daConsole.c:  Add da_ConRawRead() function to simplify the read logic. Discard NUL characters from the input stream.  In Blocking mode, retry until a non-NUL character is received.  In NonBlocking mode, a NUL causes an EAGAIN error to be returned.  Translate the Escape Scan Code into an ESC character.  If Scan Codes are ignored, retry if in Blocking mode else return an EAGAIN error.  UnGetKey becomes a single wide character instead of a structure.
    Change da_Poll() to use da_ConRawRead().

LibC/Uefi/InteractiveIO/IIOutilities.c:  BUG fix.  Return the processed input character instead of the raw character.  Allows EOF propagation.

LibC/Uefi/InteractiveIO/CanonRead.c:  Enable EOF propagation.

LibC/Uefi/InteractiveIO/IIOechoCtrl.h:  Use symbols defined in termios.h instead of hard-coded constant numbers.

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>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16254 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-28 19:20:48 +00:00
Daryl McDaniel efb419ea76 StdLib: Produce DevMedia as a library class alternative to DevShell.
AppPkg: Replace existing DevShell dependencies with DevMedia.
  
These patches will NOT cause existing code which uses DevShell to break.
During an interim period, either DevShell or DevMedia may be used.
In the future, DevShell will be removed from the code base.

During the interim, DevShell and DevMedia refer to the same library.

StdLib/LibC/Uefi/Devices/daShell.inf
  Make this library also satisfy the DevMedia library class.
StdLib/StdLib.inc
  Add a library class definition for DevMedia

AppPkg/Applications/OrderedCollectionTest/OrderedCollectionTest.inf
AppPkg/Applications/Python/PythonCore.inf
AppPkg/Applications/Sockets/GetAddrInfo/GetAddrInfo.inf
AppPkg/Applications/Sockets/GetHostByAddr/GetHostByAddr.inf
AppPkg/Applications/Sockets/GetHostByDns/GetHostByDns.inf
AppPkg/Applications/Sockets/GetHostByName/GetHostByName.inf
AppPkg/Applications/Sockets/GetNameInfo/GetNameInfo.inf
AppPkg/Applications/Sockets/GetNetByAddr/GetNetByAddr.inf
AppPkg/Applications/Sockets/GetNetByName/GetNetByName.inf
AppPkg/Applications/Sockets/GetServByName/GetServByName.inf
AppPkg/Applications/Sockets/GetServByPort/GetServByPort.inf
AppPkg/Applications/Sockets/RecvDgram/RecvDgram.inf
AppPkg/Applications/Sockets/SetHostName/SetHostName.inf
AppPkg/Applications/Sockets/SetSockOpt/SetSockOpt.inf
AppPkg/Applications/Sockets/TftpServer/TftpServer.inf
AppPkg/Applications/Sockets/WebServer/WebServer.inf
  Change LibraryClass dependency from DevShell to DevMedia
  
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@16142 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18 19:13:22 +00:00
Stefan Kaeser 9d66ee4d17 StdLib: Fix parameter type errors.
Fix casts of parameters to sprintf() so that they have the correct type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by:  Stefan Kaeser <stefankaeser@hotmail.com>
Reviewed-by:  daryl.mcdaniel@intel.com



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16125 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-17 20:58:16 +00:00
daryl.mcdaniel 0164fc8e76 StdLib: Fix some build problems and obscure bugs.
StdLib\
  BsdSocketLib\
    ns_print.c
      Use "%lu" format instead of "%Lu".  A capital 'L' specifies (long double) in print formats.
      Add a cast from char to (unsigned int) to match its sprintf format.
    res_debug.c
      Use "%lu" format instead of "%Lu".  A capital 'L' specifies (long double) in print formats.
  EfiSocketLib\
    Socket.c
      Update copyright & correct formatting
  Include\
    sys\
      EfiCdefs.h
        Update copyright date
        Change type of LONGN and ULONGN to INTN and UINTN, respectively.
      errno.h
        Update copyright date
        Add enum member '__ESUCCESS = 0'
      fcntl.h
        Update copyright date
        Improve comment for O_EXCL
      stat.h
        Update copyright date
        Reorder the S_* flags
        Put the S_* predicate macros in the same order as their flag definitions
        Add a function header comment to the stat() function declaration.
    errno.h
      Update copyright date
      Define new ESUCCESS error code
    wchar.h
      Update copyright date
      Correct the description of the Nptr parameter to the wcstol, wcstoll, wcstoul, and wcstoull functions.
    x86\float.h
      Update copyright date
      Define 'long double' limits for non-Microsoft compilers
  LibC\
    Containers\Queues\Fifo.c
      Rewrite to make more robust and secure (zeros out old data)
    StdLib\realpath.c
      Update copyright date
      Reformat descriptive comment for realpath()
      Add terminating CRLF

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by:  daryl.mcdaniel@intel.com
Reviewed-by:  Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by:  Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16096 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-11 21:42:26 +00:00
Andrew Fish c21e7a7832 StdLib: Changes needed to support XCODE5
I had to make the following changes to make this build work: >build -p AppPkg/AppPkg.dsc -a X64 -t XCODE5

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Andrew Fish <afish@apple.com>
Reviewed-by: Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16081 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-09 21:59:08 +00:00
Jordan Justen fad213a3db EDK II Contributions.txt: Note acceptable contribution licenses
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
2014-08-25 23:10:18 +00:00
Daryl McDaniel a0d367299f StdLib/LibC/gdtoa: Initialize variables before use, update the Kmax definition.
gdtoaimp.h: update the Kmax definition.
strtodg.c: initialize variables before use.

general: Remove conditional sections for VAX and IBM mainframe.  Remove conditional sections for pre-ANSI (K&R) function prototypes.

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>
Reviewed-by: Jaben carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15874 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-21 20:58:05 +00:00
Olivier Martin 0e398dc739 StdLib: reinstate the use of va_arg() to handle long double arguments in vfscanf.
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
2014-08-20 23:20:54 +00:00
Harry Liebel 1bc81f4009 StdLib/LibC: Fix ARM symbol problems
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
2014-08-20 21:55:45 +00:00
Olivier Martin 9792ff7c5d StdLib: reinstate the use of va_arg() to handle long double arguments in vfscanf.
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
2014-08-20 21:11:26 +00:00
Daryl McDaniel dfa8858555 StdLib: Add a runtime helper function for VC++ 64-bit right shift on Ia32 target architectures.
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
2014-08-20 20:38:43 +00:00
Laszlo Ersek 6f347d0f0a StdLib/LibC/Stdio: fix "missing braces around initializer"
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
2014-08-11 22:00:01 +00:00
Laszlo Ersek 599aa11f87 StdLib/LibC/gdtoa: fix "missing braces around initializer"
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
2014-08-11 21:59:53 +00:00
Daryl McDaniel b04aba1773 StdLib: The formatting for double float values, within the gdtoa library, is improper.
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
2014-08-06 18:29:02 +00:00
Daryl McDaniel 69c87efff4 StdLib/LibC/StdLib/Malloc.c: Revert cast removal to fix GCC build breakage.
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
2014-07-24 23:16:47 +00:00
Daryl McDaniel dfa51bb619 StdLib: Simple code cleanup
StdLib/LibC/Main/Main.c
  Change Print to Debug statements.
  Ensure errno is initialized to 0 before calling main().

StdLib/LibC/StdLib/Malloc.c
  Aesthetic Cleanup: remove unnecessary cast, fix two whitespace alignment problems.

StdLib/LibC/Uefi/InteractiveIO/NonCanonRead.c
  Change Include order.

StdLib/Include/paths.h
  Add definition _PATH_LIB for the path to the library directory: /Efi/StdLib/lib.

StdLib/LibC/Stdio/vfwscanf.c
  Align declarations and initializations.
  Initialize the multipurpose pointer, p, to NULL.


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@15664 6f19259b-4bc3-4df7-8a09-765794883524
2014-07-17 20:54:49 +00:00
Daryl McDaniel caf89d64ff StdLib: Move GetPass.c out of Uefi and into PosixLib. Create LibPosix to contain all functions from PosixLib instead of individual libraries. Retains the ability to use the individual libraries, except GetPass, for backwards compatibility.
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
2014-07-17 01:55:23 +00:00
Paulo Alcantara 147113644f StdLib: StdLib/Malloc.c
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
2014-04-17 20:59:50 +00:00
leroy.p.leahy eb5b60155a Fix TCP4/TCP6 connections. Connections were transitioning into the connected state and the polling was returning an error. Fix the polling routine to return success in this case.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: leroy.p.leahy@intel.com
Reviewed-by: SREENIVASULA_REDDY@Dell.com



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15355 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-20 22:05:51 +00:00
Daryl McDaniel 7292c69b2a StdLib: Modify the memory allocation routines to not be dependent upon the internal structure of the EDK II memory pool.
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
2014-03-07 01:05:30 +00:00
lpleahy leroy.p.leahy ceecdc62ab Fix the non-blocking behavior for connect. The behavior was correct if the code polled the connect routine but was not correct when using select to complete the asynchronous request. This change fixes the select case by moving where some of the operations performed upon the connection completion.
Signed-off-by: lpleahy  leroy.p.leahy@intel.com
Reviewed-by: Daniel Moura  oxesoft@gmail.com


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14984 6f19259b-4bc3-4df7-8a09-765794883524
2013-12-13 19:22:39 +00:00
Daryl McDaniel 7476ad722c StdLib: Update Copyright Notices.
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@14960 6f19259b-4bc3-4df7-8a09-765794883524
2013-12-10 22:16:57 +00:00
Daryl McDaniel 6d16cca576 StdLib: Remove an unnecessary dependency from LibWchar.
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
2013-12-10 21:42:59 +00:00
Lee Leahy a93b0f4549 Fix GCC build errors
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14876 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-20 19:07:31 +00:00
Lee Leahy 2dc09dd50f Ignore transmit errors for UDPv4, UDPv6 and IPv4.
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
2013-11-20 18:31:01 +00:00
Lee Leahy 86e9f87ec8 Enable the build command override the .DSC file contents to enable debug output and specify which debug messages are displayed. An example:
build  -a IA32  -a X64  -t VS2008x86  -p AppPkg/AppPkg.dsc  -b DEBUG   -D DEBUG_ENABLE_OUTPUT=TRUE   -D DEBUG_PROPERTY_MASK=0x27   -D DEBUG_PRINT_ERROR_LEVEL=0xFCF00040

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14859 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-19 02:37:37 +00:00
Daryl McDaniel 9551b02721 EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Update ReadMe.txt in all packages.
StdLib: Update Issues.txt and add Fixes.txt files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <daryl.mcdaniel@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14801 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-24 23:14:10 +00:00
Daryl McDaniel 3a2f8f4216 StdLib: Fix pointer arithmetic issues in the strncasecmp function.
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
2013-09-13 00:46:19 +00:00
Daryl McDaniel 979ce27979 StdLib: Fix IA32 and X64 build issues.
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
2013-09-10 21:53:28 +00:00
Daryl McDaniel d02bc714cb StdLib: Fix IPF build issues.
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@14647 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-10 21:47:26 +00:00
Harry Liebel 6ba46a9209 StdLib: Add Aarch64 support.
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
2013-07-23 18:51:51 +00:00
darylm503 5a5221122b StdLib/LibC/Locale/multibyte_Utf8.c: Fix obscure corner cases in wide to multibyte and multibyte to wide character conversions. The majority of problems center around the interpretation of the Length or Limit parameter when the Destination parameter is NULL.
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
2013-05-15 01:59:11 +00:00
darylm503 05c7d5f615 StdLib: Fix printf issues with floating point and wide character strings. Also resolves a compilation issue with VS2010. See ISSUES.txt items 1, 11.
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
2013-03-11 18:00:30 +00:00