Port vboot_reference to use new wrapper API utility functions

Third time's the charm.  Now that we've moved to u-boot-next, this
won't break the ARM build.

BUG=chromium-os:17006
TEST=make && make runtests; emerge vboot_reference; emerge-tegra2_seaboard chromeos-bootimage

Change-Id: Ib4fa26c7a23868dd2ffd2b321ee8dc08c66ea322
Original-Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Original-Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Original-Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3803
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Randall Spangler
2011-07-08 13:03:32 -07:00
parent 4ae77c50cd
commit e49e8af65f
16 changed files with 85 additions and 136 deletions

View File

@@ -14,7 +14,7 @@
/* Debug and error output */
#ifdef VBOOT_DEBUG
#define VBDEBUG(params) debug params
#define VBDEBUG(params) VbExDebug params
#else
#define VBDEBUG(params)
#endif
@@ -35,16 +35,10 @@
#define VBPERFEND(name)
#endif
/* Outputs an error message and quits. */
void error(const char* format, ...);
/* Outputs debug/warning messages. */
void debug(const char* format, ...);
#ifdef VBOOT_DEBUG
#define VbAssert(expr) do { if (!(expr)) { \
error("assert fail: %s at %s:%d\n", \
#expr, __FILE__, __LINE__); }} while(0)
VbExError("assert fail: %s at %s:%d\n", \
#expr, __FILE__, __LINE__); }} while(0)
#else
#define VbAssert(expr)
#endif
@@ -57,14 +51,6 @@ void debug(const char* format, ...);
/* Return the minimum of (a) or (b). */
#define Min(a, b) (((a) < (b)) ? (a) : (b))
/* Allocate [size] bytes and return a pointer to the allocated memory. Abort
* on error.
*/
void* Malloc(size_t size);
/* Free memory pointed by [ptr] previously allocated by Malloc(). */
void Free(void* ptr);
/* Compare [n] bytes in [src1] and [src2]
* Returns an integer less than, equal to, or greater than zero if the first [n]
* bytes of [src1] is found, respectively, to be less than, to match, or be
@@ -114,18 +100,4 @@ uint32_t Strncat(char *dest, const char *src, uint32_t destlen);
#define memset _do_not_use_standard_memset
#endif
/* Read a high-resolution timer. */
uint64_t VbGetTimer(void);
/* Return the maximum frequency for the high-resolution timer, in Hz.
*
* Note that this call MUST be fast; the implementation must not
* attempt to actually measure the frequency. This function need only
* return an upper bound for the timer frequency, so that minimum
* delays can be established. For example, if the same BIOS can run
* on CPUs where the timer frequency varies between 1.2GHz and 1.8GHz,
* return 1800000000 (or even 2000000000). */
uint64_t VbGetTimerMaxFreq(void);
#endif /* VBOOT_REFERENCE_UTILITY_H_ */