mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-03 22:53:55 +00:00
Verified boot wrapper - replace utility functions
This is part 3 of the vboot wrapper API refactoring. It replaces the function calls to utility.c functions with new API calls. (It also fixes up some integer type mismatches in cryptolib that were causing warnings on the H2C build; those had been fixed a while ago in H2C but hadn't been propagated across.) BUG=chromium-os:17006 TEST=make && make runtests Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f Reviewed-on: http://gerrit.chromium.org/gerrit/3263 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
@@ -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
|
||||
@@ -96,18 +82,4 @@ int SafeMemcmp(const void* s1, const void* s2, size_t n);
|
||||
#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_ */
|
||||
|
||||
Reference in New Issue
Block a user