From patchwork Tue Sep 3 19:12:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 19733 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 556BB24869 for ; Tue, 3 Sep 2013 19:12:51 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id ox1sf7058239veb.8 for ; Tue, 03 Sep 2013 12:12:51 -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:sender:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=foumrEZkspNYgLWvZIz3lRj2bDHOG+fg8+TIu1OlrpA=; b=cIfWXj1T31s672j71ddUcTW78JMfD6lKrb4TY4zy1xuzSPFB1ju/yds918gtdtob8n /TZ4jlDkWocHNF2A0zj7WJuNXI+IK8ZY4Fmak6+0kGSoHaQuQFzm/ScTKKkbu/yCtF4I 581fYJsPgAobl7gtJgch5bbozDccg3ksuAkud37H7b+BYPRI48h5mvLMDmcUJoqgqBMQ B9V/i38s3P4OPU7QTaMRzPzEGdl6zOOqD2XG6URU+XaqsNy5PLc/9CvZ7ft/gVkFt2kC V2bM80yXvG7JIDeTH1HsU5SaRjszxtfSnDvsAqHthwlrP16Y1tCf8Y2sNN0hgD6FDhZE hWGw== X-Received: by 10.236.51.9 with SMTP id a9mr11133380yhc.41.1378235571117; Tue, 03 Sep 2013 12:12:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.72 with SMTP id eo8ls82863qeb.41.gmail; Tue, 03 Sep 2013 12:12:51 -0700 (PDT) X-Received: by 10.52.162.228 with SMTP id yd4mr21905vdb.52.1378235570986; Tue, 03 Sep 2013 12:12:50 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id p7si3357745vdv.42.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id b10so4301291vea.21 for ; Tue, 03 Sep 2013 12:12:50 -0700 (PDT) X-Gm-Message-State: ALoCoQl+MCL1qKv1zp9o/D2CJA3DMCzO/DtczorB3UfJwxV7eyfcr9VEniHLyBnzWArqQGFiHMQe X-Received: by 10.52.34.40 with SMTP id w8mr24375216vdi.7.1378235570877; Tue, 03 Sep 2013 12:12:50 -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 u4csp190487vcz; Tue, 3 Sep 2013 12:12:50 -0700 (PDT) X-Received: by 10.180.219.75 with SMTP id pm11mr19308784wic.47.1378235550496; Tue, 03 Sep 2013 12:12:30 -0700 (PDT) Received: from chiark.greenend.org.uk (v6.chiark.greenend.org.uk. [2001:ba8:1e3::]) by mx.google.com with ESMTPS id ev12si3783826wid.34.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 12:12:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pmaydell@chiark.greenend.org.uk designates 2001:ba8:1e3:: as permitted sender) client-ip=2001:ba8:1e3::; Received: by chiark.greenend.org.uk (Debian Exim 4.72 #1) with local (return-path pmaydell@chiark.greenend.org.uk) id 1VGw1Y-0005oW-O2; Tue, 03 Sep 2013 20:12:24 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Andreas Schwab , Alexander Graf , "Mian M. Hamayun" , kvmarm@lists.cs.columbia.edu, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH v6 18/24] linux-user: Implement cpu_set_tls() and cpu_clone_regs() for AArch64 Date: Tue, 3 Sep 2013 20:12:18 +0100 Message-Id: <1378235544-22290-19-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> References: <1378235544-22290-1-git-send-email-peter.maydell@linaro.org> Sender: Peter Maydell X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 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: , From: Alexander Graf Signed-off-by: Alexander Graf Signed-off-by: John Rigby [PMM: pulled out from another patch; don't use is_a64() here; moved to linux-user from target-arm] Signed-off-by: Peter Maydell --- linux-user/aarch64/target_cpu.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 linux-user/aarch64/target_cpu.h diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h new file mode 100644 index 0000000..6f5539b --- /dev/null +++ b/linux-user/aarch64/target_cpu.h @@ -0,0 +1,35 @@ +/* + * ARM AArch64 specific CPU ABI and functions for linux-user + * + * Copyright (c) 2013 Alexander Graf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * 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, see . + */ +#ifndef TARGET_CPU_H +#define TARGET_CPU_H + +static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->xregs[31] = newsp; + } + env->xregs[0] = 0; +} + +static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + env->sr.tpidr_el0 = newtls; +} + +#endif