Silvan Calarco
7228158b62
added icons and default configuration file [release 0.14-2mamba;Wed Jul 11 2012]
78 lines
3.0 KiB
Diff
78 lines
3.0 KiB
Diff
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
## 41_gptsync_uefi_call_wrapper.dpatch by <jblache@debian.org>
|
|
##
|
|
## All lines beginning with `## DP:' are a description of the patch.
|
|
## DP: Wrap EFI API calls with uefi_call_wrapper(), mandatory for GNU EFI
|
|
## DP: especially on x86_64.
|
|
|
|
@DPATCH@
|
|
diff -urNad refit-src-0.11~/gptsync/os_efi.c refit-src-0.11/gptsync/os_efi.c
|
|
--- refit-src-0.11~/gptsync/os_efi.c 2006-05-12 21:00:09.000000000 +0200
|
|
+++ refit-src-0.11/gptsync/os_efi.c 2008-05-21 22:20:28.422831977 +0200
|
|
@@ -48,7 +48,7 @@
|
|
{
|
|
EFI_STATUS Status;
|
|
|
|
- Status = BlockIO->ReadBlocks(BlockIO, BlockIO->Media->MediaId, lba, 512, buffer);
|
|
+ Status = uefi_call_wrapper(BlockIO->ReadBlocks, 5, BlockIO, BlockIO->Media->MediaId, lba, 512, buffer);
|
|
if (EFI_ERROR(Status)) {
|
|
// TODO: report error
|
|
return 1;
|
|
@@ -60,7 +60,7 @@
|
|
{
|
|
EFI_STATUS Status;
|
|
|
|
- Status = BlockIO->WriteBlocks(BlockIO, BlockIO->Media->MediaId, lba, 512, buffer);
|
|
+ Status = uefi_call_wrapper(BlockIO->WriteBlocks, 5, BlockIO, BlockIO->Media->MediaId, lba, 512, buffer);
|
|
if (EFI_ERROR(Status)) {
|
|
// TODO: report error
|
|
return 1;
|
|
@@ -80,7 +80,7 @@
|
|
|
|
GotKeyStrokes = FALSE;
|
|
for (;;) {
|
|
- Status = ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);
|
|
+ Status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &Key);
|
|
if (Status == EFI_SUCCESS) {
|
|
GotKeyStrokes = TRUE;
|
|
continue;
|
|
@@ -97,11 +97,11 @@
|
|
Print(L"\n* Hit any key to continue *");
|
|
|
|
if (ReadAllKeyStrokes()) { // remove buffered key strokes
|
|
- BS->Stall(5000000); // 5 seconds delay
|
|
+ uefi_call_wrapper(BS->Stall, 1, 5000000); // 5 seconds delay
|
|
ReadAllKeyStrokes(); // empty the buffer again
|
|
}
|
|
|
|
- BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &Index);
|
|
+ uefi_call_wrapper(BS->WaitForEvent, 3, 1, &ST->ConIn->WaitForKey, &Index);
|
|
ReadAllKeyStrokes(); // empty the buffer to protect the menu
|
|
|
|
Print(L"\n");
|
|
@@ -116,12 +116,12 @@
|
|
Print(prompt);
|
|
|
|
if (ReadAllKeyStrokes()) { // remove buffered key strokes
|
|
- BS->Stall(500000); // 0.5 seconds delay
|
|
+ uefi_call_wrapper(BS->Stall, 1, 500000); // 0.5 seconds delay
|
|
ReadAllKeyStrokes(); // empty the buffer again
|
|
}
|
|
|
|
- BS->WaitForEvent(1, &ST->ConIn->WaitForKey, &Index);
|
|
- Status = ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);
|
|
+ uefi_call_wrapper(BS->WaitForEvent, 3, 1, &ST->ConIn->WaitForKey, &Index);
|
|
+ Status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &Key);
|
|
if (EFI_ERROR(Status))
|
|
return 1;
|
|
|
|
@@ -188,7 +188,7 @@
|
|
if (!Usable)
|
|
continue;
|
|
|
|
- Status = BS->HandleProtocol(DeviceHandle, &BlockIoProtocol, (VOID **) &BlockIO);
|
|
+ Status = uefi_call_wrapper(BS->HandleProtocol, 3, DeviceHandle, &BlockIoProtocol, (VOID **) &BlockIO);
|
|
if (EFI_ERROR(Status)) {
|
|
// TODO: report error
|
|
BlockIO = NULL;
|