diff options
| author | Peter Jones <pjones@redhat.com> | 2017-10-19 15:57:32 -0400 |
|---|---|---|
| committer | Peter Jones <pmjones@gmail.com> | 2018-03-12 16:21:43 -0400 |
| commit | dd712378a7b2d83e0a2beb2e640cdee20eaca044 (patch) | |
| tree | 3e9795e20e76bb9713c4ca3ec12ac550908696ea | |
| parent | 568dc4944f851c493047ef372f4c7969bbf47431 (diff) | |
| download | efi-boot-shim-dd712378a7b2d83e0a2beb2e640cdee20eaca044.tar.gz efi-boot-shim-dd712378a7b2d83e0a2beb2e640cdee20eaca044.zip | |
shim: make everything use a common perror() call.
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | errlog.c | 6 | ||||
| -rw-r--r-- | httpboot.c | 7 | ||||
| -rw-r--r-- | shim.c | 8 | ||||
| -rw-r--r-- | shim.h | 18 | ||||
| -rw-r--r-- | tpm.c | 8 |
5 files changed, 17 insertions, 30 deletions
@@ -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; @@ -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) { @@ -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 */ @@ -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_ */ @@ -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; |
