diff mbox

[1/5] Aarch64 support.

Message ID 1378818692-24952-2-git-send-email-steve.capper@linaro.org
State New
Headers show

Commit Message

Steve Capper Sept. 10, 2013, 1:11 p.m. UTC
This patch adds support for Aarch64.

As with ARMv7, We do not add the xBT/xBDT style linker scripts as
these have been deprecated in favour of adjusting the page sizes
via command line parameter to ld.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
 Makefile         |  7 +++++++
 ld.hugetlbfs     |  2 +-
 sys-aarch64elf.S | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 sys-aarch64elf.S
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 48205af..0e61701 100644
--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,12 @@  TMPLIB32 = lib
 ELF32 += armelf_linux_eabi
 CUSTOM_LDSCRIPTS = no
 else
+ifeq ($(ARCH),aarch64)
+CC64 = gcc
+ELF64 = aarch64elf
+TMPLIB64 = lib64
+CUSTOM_LDSCRIPTS = no
+else
 ifeq ($(ARCH),i386)
 CC32 = gcc
 ELF32 = elf_i386
@@ -100,6 +106,7 @@  endif
 endif
 endif
 endif
+endif
 
 ifdef CC32
 OBJDIRS += obj32
diff --git a/ld.hugetlbfs b/ld.hugetlbfs
index d6d12c4..5128aa2 100755
--- a/ld.hugetlbfs
+++ b/ld.hugetlbfs
@@ -91,7 +91,7 @@  case "$EMU" in
 elf32ppclinux|elf64ppc)	HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB)) ;;
 elf_i386|elf_x86_64)	HPAGE_SIZE=$((4*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
 elf_s390|elf64_s390)	HPAGE_SIZE=$((1*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
-armelf_linux_eabi)	HPAGE_SIZE=$((2*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
+armelf_linux_eabi|aarch64elf)	HPAGE_SIZE=$((2*MB)) SLICE_SIZE=$HPAGE_SIZE ;;
 esac
 
 if [ "$HTLB_ALIGN" == "slice" ]; then
diff --git a/sys-aarch64elf.S b/sys-aarch64elf.S
new file mode 100644
index 0000000..54799d3
--- /dev/null
+++ b/sys-aarch64elf.S
@@ -0,0 +1,34 @@ 
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2013 Linaro Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+        .text
+
+        .globl  direct_syscall
+
+
+direct_syscall:
+	uxtw	x8, w0
+	mov	x0, x1
+	mov	x1, x2
+	mov	x2, x3
+	mov	x3, x4
+	mov	x4, x5
+	mov	x5, x6
+	mov	x6, x7
+	svc	0x0
+	ret