e63990ef34
These functions are usually provided by gcc lib, which is not supposed to be included on embedded platforms. This patch adds a no thrills C implementation. Other than MIPS platforms are happy using the gcc library provided implementation, but in case of Chrome OS MIPS toolchain the libraries are compiled with the small GOT, such that the entire data segment does not fit. With this implementation mips, arm and x86 targets build fine. BRANCH=none BUG=chrome-os-partner:31438 TEST=checked the logic by incorporating this code into a C file and running a loop continuously comparing random inputs' division and left and right shift results. The test ran for extended periods of time without failure. Change-Id: I468acd2fdbcdd493a76758a394e79cad35f9535a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 2cc5f8668dd2609408af8da5a74c5a3d063fc0d3 Original-Change-Id: Ib46616d7eb0b2b497199270057514f730bb1cb0b Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/232232 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8742 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
47 lines
2.1 KiB
Makefile
47 lines
2.1 KiB
Makefile
##
|
|
## This file is part of the libpayload project.
|
|
##
|
|
## Copyright (C) 2008 Advanced Micro Devices, Inc.
|
|
## Copyright (C) 2008 coresystems GmbH
|
|
##
|
|
## Redistribution and use in source and binary forms, with or without
|
|
## modification, are permitted provided that the following conditions
|
|
## are met:
|
|
## 1. Redistributions of source code must retain the above copyright
|
|
## notice, this list of conditions and the following disclaimer.
|
|
## 2. Redistributions in binary form must reproduce the above copyright
|
|
## notice, this list of conditions and the following disclaimer in the
|
|
## documentation and/or other materials provided with the distribution.
|
|
## 3. The name of the author may not be used to endorse or promote products
|
|
## derived from this software without specific prior written permission.
|
|
##
|
|
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
## SUCH DAMAGE.
|
|
##
|
|
|
|
libc-$(CONFIG_LP_LIBC) += malloc.c printf.c console.c string.c
|
|
libc-$(CONFIG_LP_LIBC) += memory.c ctype.c ipchecksum.c lib.c
|
|
libc-$(CONFIG_LP_LIBC) += rand.c time.c exec.c
|
|
libc-$(CONFIG_LP_LIBC) += readline.c getopt_long.c sysinfo.c
|
|
libc-$(CONFIG_LP_LIBC) += args.c strings.c
|
|
libc-$(CONFIG_LP_LIBC) += strlcpy.c
|
|
libc-$(CONFIG_LP_LIBC) += qsort.c
|
|
libc-$(CONFIG_LP_LIBC) += hexdump.c
|
|
libc-$(CONFIG_LP_LIBC) += die.c
|
|
libc-$(CONFIG_LP_LIBC) += coreboot.c
|
|
|
|
# should be moved to coreboot directory
|
|
libc-$(CONFIG_LP_LAR) += lar.c
|
|
|
|
ifeq ($(CONFIG_LP_ARCH_MIPS),y)
|
|
libc-$(CONFIG_LP_LIBC) += 64bit_div.c
|
|
endif
|