vboot2: Allow platform dependent debug logging

TEST=Built with VBOOT_DEBUG on/off. Booted Nyan Blaze. Verified debut output.
BUG=None
BRANCH=none
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>

Change-Id: Id189231f16ca8719dfff0ef3c9a8d4982b741d5f
Reviewed-on: https://chromium-review.googlesource.com/205157
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Daisuke Nojiri
2014-06-21 18:02:13 -07:00
committed by chrome-internal-fetch
parent 5b63803f6c
commit dd5883dee6
2 changed files with 10 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
#ifndef VBOOT_REFERENCE_VBOOT_2COMMON_H_
#define VBOOT_REFERENCE_VBOOT_2COMMON_H_
#include "2api.h"
#include "2return_codes.h"
#include "2sha.h"
#include "2struct.h"
@@ -23,13 +24,16 @@ struct vb2_public_key;
#endif
/*
* Debug output. Defaults to printf(), but can be overridden on a per-platform
* basis.
* Debug output. printf() for tests. otherwise, it's platform-dependent.
*/
#if defined(VBOOT_DEBUG) && !defined(VB2_DEBUG)
#define VB2_DEBUG(format, args...) printf(format, ## args)
#if defined(VBOOT_DEBUG)
# if defined(FOR_TEST)
# define VB2_DEBUG(format, args...) printf(format, ## args)
# else
# define VB2_DEBUG(format, args...) vb2ex_printf(__func__, format, ## args)
# endif
#else
#define VB2_DEBUG(format, args...)
# define VB2_DEBUG(format, args...)
#endif
/* Alignment for work buffer pointers/allocations */