summaryrefslogtreecommitdiff
path: root/shim.h
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2017-09-13 12:09:40 -0700
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2017-09-13 12:09:40 -0700
commitb6f94dbeacfc6f0a507413096189304c58dbe66c (patch)
treebce8c7db22209078618294c51d95a0c033aec7d9 /shim.h
parent25f7fd1fb389a5f6356f353d16c5ead80dac6bbc (diff)
downloadefi-boot-shim-upstream/13_git1505328970.9c1c35c5.tar.gz
efi-boot-shim-upstream/13_git1505328970.9c1c35c5.zip
New upstream version 13~git1505328970.9c1c35c5upstream/13_git1505328970.9c1c35c5
Diffstat (limited to 'shim.h')
-rw-r--r--shim.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/shim.h b/shim.h
index 52cbfeb9..9126253b 100644
--- a/shim.h
+++ b/shim.h
@@ -1,3 +1,9 @@
+#ifndef SHIM_H_
+#define SHIM_H_
+
+#include <efi.h>
+#include <efilib.h>
+
#include "PeImage.h"
extern EFI_GUID SHIM_LOCK_GUID;
@@ -37,3 +43,88 @@ 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 VLogError(const char *file, int line, const char *func, CHAR16 *fmt, va_list args);
+extern VOID PrintErrors(VOID);
+extern VOID ClearErrors(VOID);
+
+#ifdef __x86_64__
+#ifndef DEFAULT_LOADER
+#define DEFAULT_LOADER L"\\grubx64.efi"
+#endif
+#ifndef DEFAULT_LOADER_CHAR
+#define DEFAULT_LOADER_CHAR "\\grubx64.efi"
+#endif
+#ifndef EFI_ARCH
+#define EFI_ARCH L"x64"
+#endif
+#ifndef DEBUGDIR
+#define DEBUGDIR L"/usr/lub/debug/usr/share/shim/x64/"
+#endif
+#endif
+
+#if defined(__i686__) || defined(__i386__)
+#ifndef DEFAULT_LOADER
+#define DEFAULT_LOADER L"\\grubia32.efi"
+#endif
+#ifndef DEFAULT_LOADER_CHAR
+#define DEFAULT_LOADER_CHAR "\\grubia32.efi"
+#endif
+#ifndef EFI_ARCH
+#define EFI_ARCH L"ia32"
+#endif
+#ifndef DEBUGDIR
+#define DEBUGDIR L"/usr/lub/debug/usr/share/shim/ia32/"
+#endif
+#endif
+
+#if defined(__aarch64__)
+#ifndef DEFAULT_LOADER
+#define DEFAULT_LOADER L"\\grubaa64.efi"
+#endif
+#ifndef DEFAULT_LOADER_CHAR
+#define DEFAULT_LOADER_CHAR "\\grubaa64.efi"
+#endif
+#ifndef EFI_ARCH
+#define EFI_ARCH L"aa64"
+#endif
+#ifndef DEBUGDIR
+#define DEBUGDIR L"/usr/lub/debug/usr/share/shim/aa64/"
+#endif
+#endif
+
+#if defined(__arm__)
+#ifndef DEFAULT_LOADER
+#define DEFAULT_LOADER L"\\grubarm.efi"
+#endif
+#ifndef DEFAULT_LOADER_CHAR
+#define DEFAULT_LOADER_CHAR "\\grubarm.efi"
+#endif
+#ifndef EFI_ARCH
+#define EFI_ARCH L"arm"
+#endif
+#ifndef DEBUGDIR
+#define DEBUGDIR L"/usr/lub/debug/usr/share/shim/arm/"
+#endif
+#endif
+
+#include "netboot.h"
+#include "httpboot.h"
+#include "replacements.h"
+#include "tpm.h"
+#include "ucs2.h"
+
+#include "guid.h"
+#include "variables.h"
+#include "efiauthenticated.h"
+#include "security_policy.h"
+#include "console.h"
+#include "version.h"
+
+#ifdef ENABLE_SHIM_CERT
+#include "shim_cert.h"
+#endif
+
+#define LogError(fmt, ...) LogError(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
+
+#endif /* SHIM_H_ */