mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-05-29 17:18:22 +00:00
Make lib/ build right with the cflags it should be using...
... but isn't. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
0ea5b3e3b7
commit
1f23ecc300
@ -4,13 +4,16 @@
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
console_get_keystroke(EFI_INPUT_KEY *key);
|
console_get_keystroke(EFI_INPUT_KEY *key);
|
||||||
void
|
void
|
||||||
console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_row, int size_cols, int size_rows, int offset, int lines);
|
console_print_box_at(CHAR16 *str_arr[], unsigned int highlight,
|
||||||
|
unsigned int start_col, unsigned int start_row,
|
||||||
|
unsigned int size_cols, unsigned int size_rows,
|
||||||
|
int offset, unsigned int lines);
|
||||||
void
|
void
|
||||||
console_print_box(CHAR16 *str_arr[], int highlight);
|
console_print_box(CHAR16 *str_arr[], unsigned int highlight);
|
||||||
int
|
int
|
||||||
console_yes_no(CHAR16 *str_arr[]);
|
console_yes_no(CHAR16 *str_arr[]);
|
||||||
int
|
int
|
||||||
console_select(CHAR16 *title[], CHAR16* selectors[], int start);
|
console_select(CHAR16 *title[], CHAR16* selectors[], unsigned int start);
|
||||||
void
|
void
|
||||||
console_errorbox(CHAR16 *err);
|
console_errorbox(CHAR16 *err);
|
||||||
void
|
void
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
#include <efi.h>
|
#include <efi.h>
|
||||||
|
|
||||||
#ifndef BUILD_EFI
|
|
||||||
const char *guid_to_str(EFI_GUID *guid);
|
|
||||||
void str_to_guid(const char *str, EFI_GUID *guid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern EFI_GUID GV_GUID;
|
extern EFI_GUID GV_GUID;
|
||||||
extern EFI_GUID SIG_DB;
|
extern EFI_GUID SIG_DB;
|
||||||
extern EFI_GUID X509_GUID;
|
extern EFI_GUID X509_GUID;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
void *
|
void *
|
||||||
configtable_get_table(EFI_GUID *guid)
|
configtable_get_table(EFI_GUID *guid)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < ST->NumberOfTableEntries; i++) {
|
for (i = 0; i < ST->NumberOfTableEntries; i++) {
|
||||||
EFI_CONFIGURATION_TABLE *CT = &ST->ConfigurationTable[i];
|
EFI_CONFIGURATION_TABLE *CT = &ST->ConfigurationTable[i];
|
||||||
@ -82,7 +82,7 @@ configtable_find_image(const EFI_DEVICE_PATH *DevicePath)
|
|||||||
}
|
}
|
||||||
EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *)(e->Data + skip), *dpn = dp;
|
EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *)(e->Data + skip), *dpn = dp;
|
||||||
if (dp->Type == 0 || dp->Type > 6 || dp->SubType == 0
|
if (dp->Type == 0 || dp->Type > 6 || dp->SubType == 0
|
||||||
|| (((dp->Length[1] << 8) + dp->Length[0]) > e->InfoSize)) {
|
|| ((unsigned)((dp->Length[1] << 8) + dp->Length[0]) > e->InfoSize)) {
|
||||||
/* Parse error, table corrupt, bail */
|
/* Parse error, table corrupt, bail */
|
||||||
Print(L"Image Execution Information table corrupt\n");
|
Print(L"Image Execution Information table corrupt\n");
|
||||||
break;
|
break;
|
||||||
|
@ -33,7 +33,7 @@ count_lines(CHAR16 *str_arr[])
|
|||||||
static void
|
static void
|
||||||
SetMem16(CHAR16 *dst, UINT32 n, CHAR16 c)
|
SetMem16(CHAR16 *dst, UINT32 n, CHAR16 c)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < n/2; i++) {
|
for (i = 0; i < n/2; i++) {
|
||||||
dst[i] = c;
|
dst[i] = c;
|
||||||
@ -55,9 +55,12 @@ console_get_keystroke(EFI_INPUT_KEY *key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_row, int size_cols, int size_rows, int offset, int lines)
|
console_print_box_at(CHAR16 *str_arr[], unsigned int highlight,
|
||||||
|
unsigned int start_col, unsigned int start_row,
|
||||||
|
unsigned int size_cols, unsigned int size_rows,
|
||||||
|
int offset, unsigned int lines)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
||||||
UINTN rows, cols;
|
UINTN rows, cols;
|
||||||
CHAR16 *Line;
|
CHAR16 *Line;
|
||||||
@ -124,7 +127,7 @@ console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_
|
|||||||
|
|
||||||
|
|
||||||
for (i = start_row + 1; i < size_rows + start_row - 1; i++) {
|
for (i = start_row + 1; i < size_rows + start_row - 1; i++) {
|
||||||
int line = i - start;
|
unsigned int line = i - start;
|
||||||
|
|
||||||
SetMem16 (Line, size_cols*2, L' ');
|
SetMem16 (Line, size_cols*2, L' ');
|
||||||
Line[0] = BOXDRAW_VERTICAL;
|
Line[0] = BOXDRAW_VERTICAL;
|
||||||
@ -160,7 +163,7 @@ console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
console_print_box(CHAR16 *str_arr[], int highlight)
|
console_print_box(CHAR16 *str_arr[], unsigned int highlight)
|
||||||
{
|
{
|
||||||
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
|
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
|
||||||
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
||||||
@ -181,17 +184,17 @@ console_print_box(CHAR16 *str_arr[], int highlight)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
console_select(CHAR16 *title[], CHAR16* selectors[], int start)
|
console_select(CHAR16 *title[], CHAR16* selectors[], unsigned int start)
|
||||||
{
|
{
|
||||||
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
|
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
|
||||||
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
|
||||||
EFI_INPUT_KEY k;
|
EFI_INPUT_KEY k;
|
||||||
EFI_STATUS status;
|
EFI_STATUS status;
|
||||||
int selector;
|
unsigned int selector;
|
||||||
int selector_lines = count_lines(selectors);
|
unsigned int selector_lines = count_lines(selectors);
|
||||||
int selector_max_cols = 0;
|
int selector_max_cols = 0;
|
||||||
int i, offs_col, offs_row, size_cols, size_rows, lines;
|
unsigned int i, offs_col, offs_row, size_cols, size_rows, lines;
|
||||||
int selector_offset;
|
unsigned int selector_offset;
|
||||||
UINTN cols, rows;
|
UINTN cols, rows;
|
||||||
|
|
||||||
uefi_call_wrapper(co->QueryMode, 4, co, co->Mode->Mode, &cols, &rows);
|
uefi_call_wrapper(co->QueryMode, 4, co, co->Mode->Mode, &cols, &rows);
|
||||||
|
@ -51,7 +51,7 @@ generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16
|
|||||||
EFI_STATUS efi_status = EFI_SUCCESS;
|
EFI_STATUS efi_status = EFI_SUCCESS;
|
||||||
CHAR16 *devpathstr = DevicePathToStr(li->FilePath),
|
CHAR16 *devpathstr = DevicePathToStr(li->FilePath),
|
||||||
*found = NULL;
|
*found = NULL;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < StrLen(devpathstr); i++) {
|
for (i = 0; i < StrLen(devpathstr); i++) {
|
||||||
if (devpathstr[i] == '/')
|
if (devpathstr[i] == '/')
|
||||||
|
25
lib/guid.c
25
lib/guid.c
@ -6,31 +6,6 @@
|
|||||||
|
|
||||||
#include <guid.h>
|
#include <guid.h>
|
||||||
|
|
||||||
#ifndef BUILD_EFI
|
|
||||||
/* EFI has %g for this, so it's only needed in platform c */
|
|
||||||
const char *guid_to_str(EFI_GUID *guid)
|
|
||||||
{
|
|
||||||
static char str[256];
|
|
||||||
|
|
||||||
sprintf(str, "%08x-%04hx-%04hx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
|
|
||||||
guid->Data1, guid->Data2, guid->Data3,
|
|
||||||
guid->Data4[0], guid->Data4[1], guid->Data4[2],
|
|
||||||
guid->Data4[3], guid->Data4[4], guid->Data4[5],
|
|
||||||
guid->Data4[6], guid->Data4[7]);
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
void str_to_guid(const char *str, EFI_GUID *guid)
|
|
||||||
{
|
|
||||||
sscanf(str, "%8x-%4hx-%4hx-%2hhx%2hhx-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
|
|
||||||
&guid->Data1, &guid->Data2, &guid->Data3,
|
|
||||||
guid->Data4, guid->Data4 + 1, guid->Data4 + 2,
|
|
||||||
guid->Data4 + 3, guid->Data4 + 4, guid->Data4 + 5,
|
|
||||||
guid->Data4 + 6, guid->Data4 + 7);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* all the necessary guids */
|
/* all the necessary guids */
|
||||||
EFI_GUID GV_GUID = EFI_GLOBAL_VARIABLE;
|
EFI_GUID GV_GUID = EFI_GLOBAL_VARIABLE;
|
||||||
EFI_GUID SIG_DB = { 0xd719b2cb, 0x3d3a, 0x4596, {0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f }};
|
EFI_GUID SIG_DB = { 0xd719b2cb, 0x3d3a, 0x4596, {0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f }};
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
argsplit(EFI_HANDLE image, int *argc, CHAR16*** ARGV)
|
argsplit(EFI_HANDLE image, int *argc, CHAR16*** ARGV)
|
||||||
{
|
{
|
||||||
int i, count = 1;
|
unsigned int i, count = 1;
|
||||||
EFI_STATUS status;
|
EFI_STATUS status;
|
||||||
EFI_LOADED_IMAGE *info;
|
EFI_LOADED_IMAGE *info;
|
||||||
CHAR16 *start;
|
CHAR16 *start;
|
||||||
|
Loading…
Reference in New Issue
Block a user