Skip to content

Commit

Permalink
fix windows compilation, fix setmem usage
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Isakov <[email protected]>
  • Loading branch information
SergeySlice committed Oct 16, 2019
1 parent da51723 commit 902c497
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
15 changes: 13 additions & 2 deletions Include/Protocol/AptioMemoryFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@

#define APTIOMEMORYFIX_PROTOCOL_REVISION 27

#include <Library/UefiLib.h>

//#ifndef EFIAPI
//#if _MSC_EXTENSIONS
///
/// Define the standard calling convention regardless of optimization level.
/// __cdecl is Microsoft* specific C extension.
///
//#define EFIAPI __cdecl
//#endif
//#endif

//
// APTIOMEMORYFIX_PROTOCOL_GUID
// C7CBA84E-CC77-461D-9E3C-6BE0CB79A7C1
Expand All @@ -26,8 +38,7 @@
//
typedef
BOOLEAN
EFIAPI
(*AMF_SET_NVRAM_REDIRECT) (
(EFIAPI *AMF_SET_NVRAM_REDIRECT) (
IN BOOLEAN NewValue
);

Expand Down
13 changes: 10 additions & 3 deletions cbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set DEFAULT_CYGWIN_HOME=c:\cygwin
set DEFAULT_PYTHONHOME=
rem d:\Program File\Python37"
set DEFAULT_PYTHON_FREEZER_PATH=%PYTHON_HOME%\Scripts
rem set PYTHON3_ENABLE=TRUE
set PYTHON3_ENABLE=FALSE
set DEFAULT_NASM_PREFIX=
rem C:\Program Files (x86)\NASM"
rem # %DEFAULT_CYGWIN_HOME%\bin
Expand All @@ -53,10 +53,17 @@ if errorlevel 1 (
rem # get the current revision number
:getrevision
rem get svn revision number
set F_VER_TXT=vers.txt
rem set F_VER_TXT=vers.txt
rem # svnversion -n>%F_VER_TXT%
set /P s=<%F_VER_TXT%
rem set /P s=<%F_VER_TXT%
rem # del %F_VER_TXT%
git rev-list --tags --max-count=1 > revs.txt
set /p c=< revs.txt
del revs.txt
git describe --tags %c% > vers.txt
set /P s=< vers.txt
del vers.txt

set SVNREVISION=

rem # get the current revision number
Expand Down
6 changes: 3 additions & 3 deletions rEFIt_UEFI/Platform/Settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->KextPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->KextPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->KextPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->KextPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->KextPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);
Expand Down Expand Up @@ -1318,7 +1318,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->KernelPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->KernelPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);
Expand Down Expand Up @@ -1443,7 +1443,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->BootPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->BootPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->BootPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->BootPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->BootPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);
Expand Down

0 comments on commit 902c497

Please sign in to comment.