summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Kuivenhoven <bemk@redhat.com>2013-11-11 15:28:19 +0100
committerBart Kuivenhoven <bemk@redhat.com>2014-03-12 13:17:10 +0100
commitcaf95212ec0add94925fef02d8daa0b90a3baee3 (patch)
tree6eac703bfa59ec2d7d30e1b9ec7529559ac1b212
parent25179e35df29805d1d46042ef73304898b261196 (diff)
downloadgnu-efi-3.0-caf95212ec0add94925fef02d8daa0b90a3baee3.tar.gz
gnu-efi-3.0-caf95212ec0add94925fef02d8daa0b90a3baee3.tar.xz
gnu-efi-3.0-caf95212ec0add94925fef02d8daa0b90a3baee3.zip
efi-apps: Add objcopy support for pe-coff
Work has been underway to add support for pe-coff on aarch64 to the binutils suite. This work has produced a framework which as of yet requires these settings to be used. Also there is something going on with a memset call that doesn't happen on intel. There supposedly is a flag disabling it there, but I heavily suspect this too hasn't been ported to aarch64 yet. Signed-off-by: Bart Kuivenhoven <bemk@redhat.com>
-rw-r--r--gnu-efi-3.0/apps/AllocPages.c4
-rw-r--r--gnu-efi-3.0/apps/Makefile9
-rw-r--r--gnu-efi-3.0/inc/aarch64/efibind.h8
-rw-r--r--gnu-efi-3.0/lib/misc.c12
4 files changed, 32 insertions, 1 deletions
diff --git a/gnu-efi-3.0/apps/AllocPages.c b/gnu-efi-3.0/apps/AllocPages.c
index 34b8c5d..4c7083d 100644
--- a/gnu-efi-3.0/apps/AllocPages.c
+++ b/gnu-efi-3.0/apps/AllocPages.c
@@ -98,6 +98,9 @@ BS_Code 0000000071902000-00000000721FEFFF 00000000000008FD 000000000000000F
#define CHAR_SPACE L' '
+#ifdef DEBUG
+#undef DEBUG
+#endif
#define DEBUG 0
INTN
@@ -174,7 +177,6 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
efi_status = uefi_call_wrapper( BS->HandleProtocol, 3, image,
&LoadedImageProtocol, &info);
-
Print(L"AllocatePage: __AllocType__ __MemType__ __NumPages__ [__Addr__]\n");
Print(L"__AllocType__ {0,1,2} -- Any, MaxAddr, Addr\n");
Print(L"__MemType__ {0..13}, Reserved ==0, LCode==1, LData==2, BSCode==3, BSData==4, ...\n");
diff --git a/gnu-efi-3.0/apps/Makefile b/gnu-efi-3.0/apps/Makefile
index 5a91289..bd7e658 100644
--- a/gnu-efi-3.0/apps/Makefile
+++ b/gnu-efi-3.0/apps/Makefile
@@ -58,7 +58,11 @@ LOADLIBES += -lefi -lgnuefi
LOADLIBES += $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
LOADLIBES += -T $(LDSCRIPT)
+ifeq ($(ARCH),aarch64)
+FORMAT := pe-aarch64-little
+else
FORMAT = efi-app-$(ARCH)
+endif
TARGET_APPS = t.efi t2.efi t3.efi t4.efi t5.efi t6.efi \
printenv.efi t7.efi tcc.efi modelist.efi \
@@ -71,8 +75,13 @@ TARGETS = $(TARGET_APPS) $(TARGET_BSDRIVERS) $(TARGET_RTDRIVERS)
all: $(TARGETS)
+ifeq ($(ARCH),aarch64)
+$(TARGET_BSDRIVERS):
+$(TARGET_RTDRIVERS):
+else
$(TARGET_BSDRIVERS): FORMAT=efi-bsdrv-$(ARCH)
$(TARGET_RTDRIVERS): FORMAT=efi-rtdrv-$(ARCH)
+endif
clean:
rm -f $(TARGETS) *~ *.o *.so
diff --git a/gnu-efi-3.0/inc/aarch64/efibind.h b/gnu-efi-3.0/inc/aarch64/efibind.h
index 7b78a5a..40f79a7 100644
--- a/gnu-efi-3.0/inc/aarch64/efibind.h
+++ b/gnu-efi-3.0/inc/aarch64/efibind.h
@@ -26,6 +26,9 @@ resolving these issues."
#error "GNU-Efi not ported for this compiler on this architecure yet"
#endif
+#define AARCH64 "aarch64"
+#define ARCH AARCH64
+
/* These defines are dependent on the widths written above, why they are in
* architecture dependent header files, I don't know. Moving them out into
* multi-architecture headerfiles might save on some code duplication, but what
@@ -91,3 +94,8 @@ typedef uint64_t UINTN;
#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
+
+#ifdef EFI_FUNCTION
+#undef EFI_FUNCTION
+#endif
+#define EFI_FUNCTION
diff --git a/gnu-efi-3.0/lib/misc.c b/gnu-efi-3.0/lib/misc.c
index 32f48cc..076f964 100644
--- a/gnu-efi-3.0/lib/misc.c
+++ b/gnu-efi-3.0/lib/misc.c
@@ -108,6 +108,18 @@ SetMem (
RtSetMem (Buffer, Size, Value);
}
+#ifdef AARCH64
+VOID
+memset (
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN UINT8 Value
+)
+{
+ return SetMem(Buffer, Size, Value);
+}
+#endif
+
VOID
CopyMem (
IN VOID *Dest,