libpayload: Provide atol(), malloc.h

Change-Id: I807ca061115146a6851eef481eb881b279fba8e1
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/86
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi 2011-05-27 15:31:52 +02:00 committed by Patrick Georgi
parent 163e220c5d
commit c3c827cf86
3 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1 @@
#include <stdlib.h>

View File

@ -120,6 +120,7 @@ void *memalign(size_t align, size_t size);
*/ */
long int strtol(const char *s, char **nptr, int base); long int strtol(const char *s, char **nptr, int base);
unsigned long int strtoul(const char *s, char **nptr, int base); unsigned long int strtoul(const char *s, char **nptr, int base);
long atol(const char *nptr);
/** @} */ /** @} */

View File

@ -473,6 +473,11 @@ long int strtol(const char *ptr, char **endptr, int base)
return ret * negative; return ret * negative;
} }
long atol(const char *nptr)
{
return strtol(nptr, NULL, 10);
}
/** /**
* Convert the initial portion of a string into an unsigned int * Convert the initial portion of a string into an unsigned int
* @param ptr A pointer to the string to convert * @param ptr A pointer to the string to convert