summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--errlog.c6
-rw-r--r--httpboot.c7
-rw-r--r--shim.c8
-rw-r--r--shim.h18
-rw-r--r--tpm.c8
5 files changed, 17 insertions, 30 deletions
diff --git a/errlog.c b/errlog.c
index b67c23df..de0e7350 100644
--- a/errlog.c
+++ b/errlog.c
@@ -7,10 +7,6 @@
#include "shim.h"
-#ifdef LogError
-#undef LogError
-#endif
-
static CHAR16 **errs = NULL;
static UINTN nerrs = 0;
@@ -51,7 +47,7 @@ VLogError(const char *file, int line, const char *func, CHAR16 *fmt, va_list arg
}
EFI_STATUS
-LogError(const char *file, int line, const char *func, CHAR16 *fmt, ...)
+LogError_(const char *file, int line, const char *func, CHAR16 *fmt, ...)
{
va_list args;
EFI_STATUS efi_status;
diff --git a/httpboot.c b/httpboot.c
index 0fd4ae76..4cfa3aab 100644
--- a/httpboot.c
+++ b/httpboot.c
@@ -36,13 +36,6 @@
#include "shim.h"
-#define perror(fmt, ...) ({ \
- UINTN __perror_ret = 0; \
- if (!in_protocol) \
- __perror_ret = Print((fmt), ##__VA_ARGS__); \
- __perror_ret; \
- })
-
static UINTN
ascii_to_int (CONST CHAR8 *str)
{
diff --git a/shim.c b/shim.c
index e8401f80..2b263c27 100644
--- a/shim.c
+++ b/shim.c
@@ -65,14 +65,6 @@ static CHAR16 *second_stage;
static void *load_options;
static UINT32 load_options_size;
-#define perror(fmt, ...) ({ \
- UINTN __perror_ret = 0; \
- if (!in_protocol) \
- __perror_ret = Print((fmt), ##__VA_ARGS__); \
- LogError(fmt, ##__VA_ARGS__); \
- __perror_ret; \
- })
-
/*
* The vendor certificate used for validating the second stage loader
*/
diff --git a/shim.h b/shim.h
index 6cbc9e1b..ddc8d7f6 100644
--- a/shim.h
+++ b/shim.h
@@ -156,11 +156,25 @@ typedef struct _SHIM_LOCK {
extern EFI_STATUS shim_init(void);
extern void shim_fini(void);
-extern EFI_STATUS LogError(const char *file, int line, const char *func, CHAR16 *fmt, ...);
+extern EFI_STATUS LogError_(const char *file, int line, const char *func, CHAR16 *fmt, ...);
extern EFI_STATUS VLogError(const char *file, int line, const char *func, CHAR16 *fmt, va_list args);
extern VOID PrintErrors(VOID);
extern VOID ClearErrors(VOID);
-#define LogError(fmt, ...) LogError(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
+extern UINT32 vendor_cert_size;
+extern UINT32 vendor_dbx_size;
+extern UINT8 *vendor_cert;
+extern UINT8 *vendor_dbx;
+
+extern UINT8 in_protocol;
+#define perror_(file, line, func, fmt, ...) ({ \
+ UINTN __perror_ret = 0; \
+ if (!in_protocol) \
+ __perror_ret = Print((fmt), ##__VA_ARGS__); \
+ LogError_(file, line, func, fmt, ##__VA_ARGS__); \
+ __perror_ret; \
+ })
+#define perror(fmt, ...) perror_(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
+#define LogError(fmt, ...) LogError_(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
#endif /* SHIM_H_ */
diff --git a/tpm.c b/tpm.c
index cacfde7c..26050dd1 100644
--- a/tpm.c
+++ b/tpm.c
@@ -5,14 +5,6 @@
#include "shim.h"
-#define perror(fmt, ...) ({ \
- UINTN __perror_ret = 0; \
- if (!in_protocol) \
- __perror_ret = Print((fmt), ##__VA_ARGS__); \
- __perror_ret; \
- })
-
-
typedef struct {
CHAR16 *VariableName;
EFI_GUID *VendorGuid;