diff options
author | Steve Langasek <steve.langasek@canonical.com> | 2019-02-09 21:28:06 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@canonical.com> | 2019-02-09 21:32:44 -0800 |
commit | ab4c731c1dd379acd3e95971af57401fb0a650a1 (patch) | |
tree | 6a26fb8d0746cbbaa6c2d4b242c73442bcc1df06 /include/console.h | |
parent | 0d63079c7da8e86104ce4bbdae2f6cb8d2ea40c6 (diff) | |
parent | 9c12130f9cd2ae11a9336813dd1f1669c0b64ad0 (diff) | |
download | efi-boot-shim-debian/15+1533136590.3beb971-1.tar.gz efi-boot-shim-debian/15+1533136590.3beb971-1.zip |
* New upstream release.debian/15+1533136590.3beb971-1
- debian/patches/second-stage-path: dropped; the default loader path now
includes an arch suffix.
- debian/patches/sbsigntool-no-pesign: dropped; no longer needed.
* Drop remaining patches that were not being applied.
* Sync packaging from Ubuntu:
- debian/copyright: Update upstream source location.
- debian/control: add a Build-Depends on libelf-dev.
- Enable arm64 build.
- debian/patches/fixup_git.patch: don't run git in clean; we're not
really in a git tree.
- debian/rules, debian/shim.install: use the upstream install target as
intended, and move files to the target directory using dh_install.
- define RELEASE and COMMIT_ID for the snapshot.
- Set ENABLE_HTTPBOOT to enable the HTTP Boot feature.
- Update dh_auto_build/dh_auto_clean/dh_auto_install for new upstream
options: set MAKELEVEL.
- Define an EFI_ARCH variable, and use that for paths to shim. This
makes it possible to build a shim for other architectures than amd64.
- Set EFIDIR=$distro for dh_auto_install; that will let files be installed
in the "right" final directories, and makes boot.csv for us.
- Set ENABLE_SHIM_CERT, to keep using ephemeral self-signed certs built
at compile-time for MokManager and fallback.
- Set ENABLE_SBSIGN, to use sbsign instead of pesign for signing fallback
and MokManager.
Diffstat (limited to 'include/console.h')
-rw-r--r-- | include/console.h | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/include/console.h b/include/console.h index d59e3b4f..deb4fa3d 100644 --- a/include/console.h +++ b/include/console.h @@ -1,8 +1,18 @@ -#ifndef _SHIM_LIB_CONSOLE_H -#define _SHIM_LIB_CONSOLE_H 1 +#ifndef SHIM_CONSOLE_H +#define SHIM_CONSOLE_H + +#define Print(fmt, ...) \ + ({"Do not directly call Print() use console_print() instead" = 1;}); + +#define PrintAt(fmt, ...) \ + ({"Do not directly call PrintAt() use console_print_at() instead" = 1;}); EFI_STATUS console_get_keystroke(EFI_INPUT_KEY *key); +UINTN +console_print(const CHAR16 *fmt, ...); +UINTN +console_print_at(UINTN col, UINTN row, const CHAR16 *fmt, ...); void console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_row, @@ -26,9 +36,6 @@ void console_reset(void); #define NOSEL 0x7fffffff -#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ - { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } - typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; typedef enum { @@ -42,7 +49,7 @@ EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( IN EFI_CONSOLE_CONTROL_PROTOCOL *This, OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, - OUT BOOLEAN *GopUgaExists, OPTIONAL + OUT BOOLEAN *GopUgaExists, OPTIONAL OUT BOOLEAN *StdInLocked OPTIONAL ); @@ -66,26 +73,23 @@ struct _EFI_CONSOLE_CONTROL_PROTOCOL { EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; }; -extern VOID setup_console (int text); +extern VOID console_fini(VOID); extern VOID setup_verbosity(VOID); -extern UINT8 verbose; -#define dprint(fmt, ...) ({ \ - UINTN __dprint_ret = 0; \ - if (verbose) \ - __dprint_ret = Print((fmt), ##__VA_ARGS__); \ - __dprint_ret; \ - }) -#define dprinta(fmt, ...) ({ \ - UINTN __dprinta_ret = 0; \ - if (verbose) { \ - UINTN __dprinta_i; \ - CHAR16 *__dprinta_str = AllocateZeroPool((strlena(fmt) + 1) * 2); \ - for (__dprinta_i = 0; fmt[__dprinta_i] != '\0'; __dprinta_i++) \ - __dprinta_str[__dprinta_i] = fmt[__dprinta_i]; \ - __dprinta_ret = Print((__dprinta_str), ##__VA_ARGS__); \ - FreePool(__dprinta_str); \ - } \ - __dprinta_ret; \ +extern UINT32 verbose; +#define dprint(fmt, ...) ({ \ + UINTN __dprint_ret = 0; \ + if (verbose) \ + __dprint_ret = console_print((fmt), ##__VA_ARGS__); \ + __dprint_ret; \ }) -#endif /* _SHIM_LIB_CONSOLE_H */ +extern EFI_STATUS print_crypto_errors(EFI_STATUS rc, char *file, const char *func, int line); +#define crypterr(rc) print_crypto_errors((rc), __FILE__, __func__, __LINE__) + +extern VOID msleep(unsigned long msecs); + +/* This is used in various things to determine if we should print to the + * console */ +extern UINT8 in_protocol; + +#endif /* SHIM_CONSOLE_H */ |