mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-02 19:37:38 +00:00
shim: make everything use a common perror() call.
Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
568dc4944f
commit
dd712378a7
6
errlog.c
6
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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
8
shim.c
8
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
|
||||
*/
|
||||
|
18
shim.h
18
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_ */
|
||||
|
Loading…
Reference in New Issue
Block a user