From patchwork Tue Sep 10 13:11:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 19894 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 168FD25A72 for ; Tue, 10 Sep 2013 13:11:44 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id a11sf5243328qen.10 for ; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=sCedDqbDWpUucR1nO9RgsKpqmRJQwxcyeNqQUtzyQCs=; b=jAQ6yy3gSqBXYp/MrvbvY8ymZb4TmBgarK5U88/fQzGZU/S7hsMeD4AKl/0igzHATD M15W9dBSCMtbT79FFVaUQhjckQdi625C229tipN9x+Q4kvGxamSzDhtuTfnf/0AyQlQX 5c50sOQxigZpyBPMH+iE5Cu2QnDpSvH7xS9xknC/zkCEYYIxpGjgIuhAAkRbxjBkYLR7 vasZ9SOxHWw5CGKVcCfbCXvJWvKFQp4HfQRMsxnUhnhXJvgTcU7HLsnsWbWyWKCHey+1 qFeiopcPXb3NFEsWgvAyYMMPYyi/E4qs5yYfbDSunJ57LqM6dbPHwgzyPI3j8Wil0p+I ENMw== X-Received: by 10.58.144.232 with SMTP id sp8mr1816248veb.7.1378818703950; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.83 with SMTP id s19ls2157474qeu.7.gmail; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr22617767ved.8.1378818703724; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id fx15si4413646vec.110.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e13so5077266vbg.31 for ; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) X-Gm-Message-State: ALoCoQm3oHAZRLDBOQdMgJZ1OYKiXb0WRwWxtaXmK/H2aMUC/3ttcOOoaBAtXjvpMR27AhFKndvY X-Received: by 10.220.74.69 with SMTP id t5mr10554308vcj.18.1378818703583; Tue, 10 Sep 2013 06:11:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp649vcz; Tue, 10 Sep 2013 06:11:42 -0700 (PDT) X-Received: by 10.180.24.198 with SMTP id w6mr12953513wif.1.1378818701573; Tue, 10 Sep 2013 06:11:41 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id cs3si6930345wjc.60.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=209.85.212.172; Received: by mail-wi0-f172.google.com with SMTP id c10so653666wiw.11 for ; Tue, 10 Sep 2013 06:11:41 -0700 (PDT) X-Received: by 10.180.160.229 with SMTP id xn5mr12891671wib.62.1378818700968; Tue, 10 Sep 2013 06:11:40 -0700 (PDT) Received: from marmot.wormnet.eu (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id fv10sm3175989wic.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 06:11:40 -0700 (PDT) From: Steve Capper To: libhugetlbfs-devel@lists.sourceforge.net Cc: patches@linaro.org, linaro-dev@lists.linaro.org, Steve Capper Subject: [PATCH 1/5] Aarch64 support. Date: Tue, 10 Sep 2013 14:11:28 +0100 Message-Id: <1378818692-24952-2-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378818692-24952-1-git-send-email-steve.capper@linaro.org> References: <1378818692-24952-1-git-send-email-steve.capper@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- Makefile | 7 +++++++ ld.hugetlbfs | 2 +- sys-aarch64elf.S | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 sys-aarch64elf.S 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