Added support for ARM64 (AARCH64) platform in rEFInd, drivers, and
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 28 Nov 2015 05:10:55 +0000 (00:10 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 28 Nov 2015 05:10:55 +0000 (00:10 -0500)
gptsync.

14 files changed:
Make.common
Make.tiano
filesystems/Make.gnuefi
filesystems/Make.tiano
gptsync/Make.gnuefi
gptsync/Make.tiano
gptsync/gptsync.h
include/refit_call_wrapper.h
libeg/image.c
libeg/lodepng.h
refind/Make.tiano
refind/Makefile
refind/apple.c
refind/main.c

index af47ccc..2804559 100644 (file)
@@ -22,9 +22,10 @@ CPPFLAGS        = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../incl
 OPTIMFLAGS      = -O2 -fno-strict-aliasing
 DEBUGFLAGS      = -Wall
 #CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
-CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fno-stack-protector -fpic -fshort-wchar -mno-red-zone $(DEBUGFLAGS)
+CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fno-stack-protector -fpic -fshort-wchar $(DEBUGFLAGS)
 ASFLAGS         = $(ARCH3264)
-LDFLAGS         = -nostdlib -znocombreloc -zdefs
+export LDFLAGS  = -nostdlib
+export DRV_LDFLAGS = 
 
 prefix          = /usr/bin/
 CC              = $(prefix)gcc
@@ -39,9 +40,13 @@ ifeq ($(ARCH),ia64)
   CFLAGS       += -frename-registers -mfixed-range=f32-f127
 endif
 
+FORMAT          = --target=efi-app-$(ARCH)
+FORMAT_DRIVER   = --target=efi-bsdrv-$(ARCH)
+
 ifeq ($(ARCH),x86_64)
-  CFLAGS += -DEFI_FUNCTION_WRAPPER
+  CFLAGS += -DEFI_FUNCTION_WRAPPER -mno-red-zone 
   CPPFLAGS += -DEFIX64
+  LDFLAGS += -znocombreloc -zdefs
 
   ifeq ($(HOSTARCH),ia32)
     ARCH3264 = -m64
@@ -54,6 +59,7 @@ endif
 
 ifeq ($(ARCH),ia32)
   CPPFLAGS += -DEFI32 -malign-double
+  LDFLAGS += -znocombreloc -zdefs
 
   ifeq ($(HOSTARCH),x86_64)
     ARCH3264 = -m32
@@ -64,6 +70,14 @@ ifeq ($(ARCH),ia32)
   endif
 endif
 
+ifeq ($(ARCH), aarch64)
+  CFLAGS += -fno-stack-check -g -fno-merge-constants -ffreestanding -fno-stack-check 
+  CPPFLAGS += -DEFIAARCH64
+  FORMAT          = -O binary
+  FORMAT_DRIVER   = -O binary
+  LDFLAGS         += --defsym=EFI_SUBSYSTEM=0xa --warn-common --no-undefined --fatal-warnings
+  DRV_LDFLAGS     += --defsym=EFI_SUBSYSTEM=0xb --warn-common --no-undefined --fatal-warnings
+endif
 
 CRTOBJS         = $(EFICRT0)/crt0-efi-$(ARCH).o
 
@@ -78,9 +92,8 @@ else
 endif
 
 LDFLAGS        += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
+DRV_LDFLAGS    += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
 LIBS            = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
-FORMAT          = efi-app-$(ARCH)
-FORMAT_DRIVER   = efi-bsdrv-$(ARCH)
 
 
 # general rules
@@ -94,13 +107,6 @@ ifneq (,$(filter %.efi,$(TARGET)))
 
 SHLIB_TARGET = $(subst .efi,.so,$(TARGET))
 
-$(SHLIB_TARGET): $(OBJS)
-       $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
-
-#$(TARGET): $(SHLIB_TARGET)
-#      $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-#                 -j .rela -j .reloc --target=$(FORMAT) $< $@
-
 endif
 
 # rules for libraries
index 546df73..6823583 100644 (file)
@@ -22,13 +22,21 @@ ifeq ($(ARCH),ia32)
 endif
 
 ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -DEFIX64 -mcmodel=large -m64
+  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -DEFIX64 -mcmodel=large -m64 -mno-red-zone 
   ARCHDIR = X64
   UC_ARCH = X64
   FILENAME_CODE = x64
   LD_CODE = elf_x86_64
 endif
 
+ifeq ($(ARCH),aarch64)
+  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
+  ARCHDIR = AArch64
+  UC_ARCH = AARCH64
+  FILENAME_CODE = aa64
+  LD_CODE = aarch64elf
+endif
+
 EDK2BASE = /usr/local/UDK2014/MyWorkSpace
 #EDK2BASE = /usr/local/EDK2/tianocore-edk2
 #ENTRYPOINT=_ModuleEntryPoint
@@ -49,7 +57,7 @@ INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
                  -I ../include \
                  -I ../mok
 
-OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -Os
+OPTIMFLAGS      += -fno-strict-aliasing -Wno-address -Os
 DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
 CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c
 
index 3b99878..9fb1676 100644 (file)
@@ -31,6 +31,14 @@ ifeq ($(ARCH),x86_64)
   LD_CODE = elf_x86_64
 endif
 
+ifeq ($(ARCH),aarch64)
+  LIBEG = build64
+  ARCH_C_FLAGS = 
+  FILENAME_CODE = aa64
+  LD_CODE = elf_aarch64
+  FORMAT_DRIVER = -O binary
+endif
+
 LOCAL_CPPFLAGS   = -DFSTYPE=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg
 
 OBJS            = fsw_core.o fsw_efi.o fsw_efi_lib.o fsw_lib.o fsw_$(DRIVERNAME).o
@@ -40,9 +48,13 @@ all: $(TARGET)
 
 include $(SRCDIR)/../Make.common
 
+$(SHLIB_TARGET): $(OBJS)
+       $(LD) $(LOCAL_LDFLAGS) $(DRV_LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-                  -j .rela -j .reloc --target=$(FORMAT_DRIVER)  $< $@
+                  -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
+                  -j .reloc $(FORMAT_DRIVER) $< $@
        chmod a-x $(TARGET)
        mkdir -p ../drivers_$(FILENAME_CODE)
        cp $(TARGET) ../drivers_$(FILENAME_CODE)
index 39cdfa5..7b914eb 100644 (file)
@@ -22,13 +22,21 @@ ifeq ($(ARCH),ia32)
 endif
 
 ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64
+  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone
   ARCHDIR = X64
   UC_ARCH = X64
   FILENAME_CODE = x64
   LD_CODE = elf_x86_64
 endif
 
+ifeq ($(ARCH),aarch64)
+  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
+  ARCHDIR = AArch64
+  UC_ARCH = AARCH64
+  FILENAME_CODE = aa64
+  LD_CODE = aarch64elf
+endif
+
 EDK2BASE = /usr/local/UDK2014/MyWorkSpace
 #EDK2BASE = /usr/local/edk2
 
@@ -49,6 +57,10 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
                  $(EFILIB)/UefiLib/UefiLib/OUTPUT/UefiLib.lib \
                  $(EFILIB)/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib
 
+ifeq ($(ARCH),aarch64)
+  ALL_EFILIBS +=  $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
+endif
+
 INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
                   -I $(EDK2BASE)/MdePkg/Include \
                   -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
@@ -60,7 +72,7 @@ OBJS            = $(FSW_NAMES:=.obj)
 #DRIVERNAME      = ext2
 BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
-OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -Os
+OPTIMFLAGS      = -fno-strict-aliasing -Wno-address -Os
 DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
 CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2
 
index a38aa84..ad92564 100644 (file)
@@ -20,16 +20,21 @@ ifeq ($(ARCH),x86_64)
   ARCHNAME = gptsync_x64.efi
 endif
 
+ifeq ($(ARCH),aarch64)
+  ARCHNAME = gptsync_aa64.efi
+endif
+
 all: $(TARGET)
 
 #SHLIB_TARGET = $(subst .efi,.so,$(TARGET))
 
-#$(SHLIB_TARGET): $(OBJS)
-#      $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+$(SHLIB_TARGET): $(OBJS)
+       $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
 
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-                  -j .rela -j .reloc --target=$(FORMAT) $< $@
+                  -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
+                  -j .reloc $(FORMAT) $< $@
        chmod a-x $(TARGET)
        mv $(TARGET) $(ARCHNAME)
 
index 85823ee..e047136 100644 (file)
@@ -22,13 +22,21 @@ ifeq ($(ARCH),ia32)
 endif
 
 ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -DEFIX64
+  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone -DEFIX64
   ARCHDIR = X64
   UC_ARCH = X64
   FILENAME_CODE = x64
   LD_CODE = elf_x86_64
 endif
 
+ifeq ($(ARCH),aarch64)
+  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
+  ARCHDIR = AArch64
+  UC_ARCH = AARCH64
+  FILENAME_CODE = aa64
+  LD_CODE = aarch64elf
+endif
+
 EDK2BASE = /usr/local/UDK2014/MyWorkSpace
 #EDK2BASE = /usr/local/edk2
 
@@ -49,6 +57,10 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
                  $(EFILIB)/UefiLib/UefiLib/OUTPUT/UefiLib.lib \
                  $(EFILIB)/UefiApplicationEntryPoint/UefiApplicationEntryPoint/OUTPUT/UefiApplicationEntryPoint.lib
 
+ifeq ($(ARCH),aarch64)
+  ALL_EFILIBS +=  $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
+endif
+
 INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
                   -I $(EDK2BASE)/MdePkg/Include \
                   -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
@@ -66,7 +78,7 @@ GPTSYNC_NAMES    = gptsync lib os_efi AutoGen ../EfiLib/BmLib
 OBJS             = $(GPTSYNC_NAMES:=.obj)
 BUILDME          = gptsync_$(FILENAME_CODE).efi
 
-OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -Os
+OPTIMFLAGS      = -fno-strict-aliasing -Wno-address -Os
 DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
 CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -DHOST_EFI_EDK2 -D__MAKEWITH_TIANO
 #CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2
index 017f3dc..5aeb195 100644 (file)
@@ -42,7 +42,7 @@
 //
 
 
-#if defined(EFI32) || defined(EFIX64)
+#if defined(EFI32) || defined(EFIX64) || defined(EFIAARCH64)
 #define CONFIG_EFI
 #endif
 
@@ -81,6 +81,7 @@ typedef CHAR16 CHARN;
 #include <sys/time.h>
 #include <fcntl.h>
 
+/*
 typedef int                 INTN;
 typedef unsigned int        UINTN;
 typedef unsigned char       UINT8;
@@ -88,6 +89,7 @@ typedef unsigned short      UINT16;
 typedef unsigned long       UINT32;
 typedef unsigned long long  UINT64;
 typedef void                VOID;
+*/
 
 typedef int                 BOOLEAN;
 #ifndef FALSE
@@ -105,9 +107,6 @@ void Print(wchar_t *format, ...);
 
 // FUTURE: use STR(),  #define Print printf
 
-#define CopyMem     memcpy
-#define CompareMem  memcmp
-
 #define copy_guid(destguid, srcguid) (memcpy(destguid, srcguid, 16))
 #define guids_are_equal(guid1, guid2) (memcmp(guid1, guid2, 16) == 0)
 
index 68cd8a5..1bd4042 100644 (file)
@@ -3,7 +3,7 @@
 
 #ifdef __MAKEWITH_GNUEFI
 
-#ifdef EFIX64
+#if defined (EFIX64) | defined (AARCH64)
 # define refit_call1_wrapper(f, a1) \
   uefi_call_wrapper(f, 1, (UINT64)(a1))
 # define refit_call2_wrapper(f, a1, a2) \
index c61f348..5fcd288 100644 (file)
@@ -69,7 +69,7 @@
 // A value of 4096 should keep us within limits on 32-bit systems, but I've
 // seen some minor artifacts at this level, so give it a bit more precision
 // on 64-bit systems....
-#if defined(EFIX64)
+#if defined(EFIX64) | defined(EFIAARCH64)
 #define FP_MULTIPLIER (UINTN) 65536
 #else
 #define FP_MULTIPLIER (UINTN) 4096
index 5fae53d..4593949 100644 (file)
@@ -34,15 +34,19 @@ freely, subject to the following restrictions:
 
 #include <string.h> /*for size_t*/
 
-// Below block of lines required for GNU-EFI (program hangs when run without them,
-// and associated function in lodepng_xtra.c)
+// Below block of lines required for GNU-EFI and TianoCore (program hangs
+// when run without them, and associated function in lodepng_xtra.c)
 int MyStrlen(const char *InString);
 #define strlen(c) MyStrlen(c)
+#include <stdlib.h>
+#define abs(x) (((x) < 0) ? -(x) : (x))
 #ifdef __MAKEWITH_GNUEFI
 #include <efi.h>
 #include <efilib.h>
-#define memcpy(a, b, c) CopyMem(a, b, c)
+#else
+#include "../include/tiano_includes.h"
 #endif
+#define memcpy(a, b, c) CopyMem(a, b, c)
 
 #ifdef __cplusplus
 #include <vector>
index 7a98575..7efad38 100644 (file)
@@ -24,7 +24,6 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
                   $(EFILIB)/DxeServicesLib/DxeServicesLib/OUTPUT/DxeServicesLib.lib \
                   $(EFILIB)/DxeServicesTableLib/DxeServicesTableLib/OUTPUT/DxeServicesTableLib.lib \
                   $(EFILIB)/DxeHobLib/DxeHobLib/OUTPUT/DxeHobLib.lib \
-                  $(EFILIB)/BaseIoLibIntrinsic/BaseIoLibIntrinsic/OUTPUT/BaseIoLibIntrinsic.lib \
                   $(EFILIB)/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib
 #                $(EFILIB)/BasePerformanceLibNull/BasePerformanceLibNull/OUTPUT/BasePerformanceLibNull.lib \
 #                /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu/OUTPUT/SecPeiDxeTimerLibCpu.lib \
@@ -34,6 +33,9 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
 #                  $(EFILIB)/../../MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeCore.lib
 #                /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeMain/DxeMain.obj
 
+ifeq ($(ARCH),aarch64)
+  ALL_EFILIBS +=    $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
+endif
 
 SOURCE_NAMES     = apple config mystrings line_edit driver_support icns lib main menu screen gpt crc32 legacy AutoGen
 OBJS             = $(SOURCE_NAMES:=.obj)
index 6bb2405..2098554 100644 (file)
@@ -21,20 +21,28 @@ ifeq ($(ARCH),x86_64)
   TARGET = refind_x64.efi
 endif
 
+ifeq ($(ARCH),aarch64)
+  LIBEG = build
+  TARGET = refind_aa64.efi
+endif
+
 LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
 LOCAL_LDFLAGS   = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/
 LOCAL_LIBS      = -leg -lmok -lEfiLib
 
 OBJS            = main.o mystrings.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o
-#OBJS            = main.o line_edit.o config.o menu.o screen.o icns.o lib.o mok.o driver_support.o variables.o sha256.o pecoff.o simple_file.o security_policy.o guid.o
 
 all: $(TARGET)
 
 include $(SRCDIR)/../Make.common
 
+$(SHLIB_TARGET): $(OBJS)
+       $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-                  -j .rela -j .reloc --target=$(FORMAT) $< $@
+                  -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
+                  -j .reloc $(FORMAT) $< $@
        chmod a-x $(TARGET)
 
 # EOF
index 5b334f1..9f9b1f3 100644 (file)
@@ -157,7 +157,7 @@ EFI_STATUS SetAppleOSInfo() {
                 Print(L"Out of resources in SetAppleOSInfo!\n");
             }
             if ((Status == EFI_SUCCESS) && (SetOs->Version == 2))
-                Status = refit_call1_wrapper (SetOs->SetOsVendor, "Apple Inc.");
+                Status = refit_call1_wrapper (SetOs->SetOsVendor, (CHAR8 *) "Apple Inc.");
             MyFreePool(AppleOSVersion);
         } // if (AppleOSVersion)
     } // if
index 6e96367..35ecc4c 100644 (file)
@@ -114,6 +114,17 @@ EFI_GUID gFreedesktopRootGuid = { 0x4f68bce3, 0xe8cd, 0x4db1, { 0x96, 0xe7, 0xfb
 #define FALLBACK_BASENAME       L"bootia32.efi"
 #define EFI_STUB_ARCH           0x014c
 EFI_GUID gFreedesktopRootGuid = { 0x44479540, 0xf297, 0x41b2, { 0x9a, 0xf7, 0xd1, 0x31, 0xd5, 0xf0, 0x45, 0x8a }};
+#elif defined (EFIAARCH64)
+#define SHELL_NAMES             L"\\EFI\\tools\\shell.efi,\\EFI\\tools\\shellaa64.efi,\\shell.efi,\\shellaa64.efi"
+#define GPTSYNC_NAMES           L"\\EFI\\tools\\gptsync.efi,\\EFI\\tools\\gptsync_aa64.efi"
+#define GDISK_NAMES             L"\\EFI\\tools\\gdisk.efi,\\EFI\\tools\\gdisk_aa64.efi"
+#define NETBOOT_NAMES           L"\\EFI\\tools\\ipxe.efi"
+#define MEMTEST_NAMES           L"memtest86.efi,memtest86_aa64.efi,memtest86aa64.efi,bootaa64.efi"
+#define DRIVER_DIRS             L"drivers,drivers_aa64"
+#define FALLBACK_FULLNAME       L"EFI\\BOOT\\bootaa64.efi"
+#define FALLBACK_BASENAME       L"bootaa64.efi"
+#define EFI_STUB_ARCH           0xaa64
+EFI_GUID gFreedesktopRootGuid = { 0xb921b045, 0x1df0, 0x41c3, { 0xaf, 0x44, 0x4c, 0x6f, 0x28, 0x0d, 0x3f, 0xae }};
 #else
 #define SHELL_NAMES             L"\\EFI\\tools\\shell.efi,\\shell.efi"
 #define GPTSYNC_NAMES           L"\\EFI\\tools\\gptsync.efi"
@@ -193,7 +204,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.3");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.4");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
@@ -208,6 +219,9 @@ static VOID AboutrEFInd(VOID)
 #elif defined(EFIX64)
         AddMenuInfoLine(&AboutMenu, PoolPrint(L" Platform: x86_64 (64 bit); Secure Boot %s",
                                               secure_mode() ? L"active" : L"inactive"));
+#elif defined(EFIAARCH64)
+        AddMenuInfoLine(&AboutMenu, PoolPrint(L" Platform: ARM (64 bit); Secure Boot %s",
+                                              secure_mode() ? L"active" : L"inactive"));
 #else
         AddMenuInfoLine(&AboutMenu, L" Platform: unknown");
 #endif
@@ -259,7 +273,7 @@ static VOID WarnSecureBootError(CHAR16 *Name, BOOLEAN Verbose) {
 // Returns TRUE if this file is a valid EFI loader file, and is proper ARCH
 static BOOLEAN IsValidLoader(EFI_FILE *RootDir, CHAR16 *FileName) {
     BOOLEAN         IsValid = TRUE;
-#if defined (EFIX64) | defined (EFI32)
+#if defined (EFIX64) | defined (EFI32) | defined (EFIAARCH64)
     EFI_STATUS      Status;
     EFI_FILE_HANDLE FileHandle;
     CHAR8           Header[512];
@@ -483,6 +497,7 @@ VOID StoreLoaderName(IN CHAR16 *Name) {
 // for information on Intel VMX features
 static VOID DoEnableAndLockVMX(VOID)
 {
+#if defined (EFIX64) | defined (EFI32)
     UINT32 msr = 0x3a;
     UINT32 low_bits = 0, high_bits = 0;
 
@@ -495,7 +510,8 @@ static VOID DoEnableAndLockVMX(VOID)
         low_bits = 0x05;
         msr = 0x3a;
         __asm__ volatile ("wrmsr" : : "c" (msr), "a" (low_bits), "d" (high_bits));
-    } 
+    }
+#endif
 } // VOID DoEnableAndLockVMX()
 
 static VOID StartLoader(LOADER_ENTRY *Entry, CHAR16 *SelectionName)