From patchwork Mon Apr 16 09:18:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 133441 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp3353024ljb; Mon, 16 Apr 2018 02:20:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx49NdoOqijL8oJKL1Bp3JudSdi9+c1hyOoYkuOdqHpdLZXmjoZ64AU3+gmb/CRbfFaIjMHC7 X-Received: by 10.233.237.140 with SMTP id c134mr7319485qkg.323.1523870450140; Mon, 16 Apr 2018 02:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523870450; cv=none; d=google.com; s=arc-20160816; b=u//MqBJCXRBVgGxgzfqznw+a7x6ht68XqkP3IY6TXRhLK7dUBIXe7UHVwY2yqwuSfQ P1cJ3CzLbgo2jfyZKbtSwgFGZFvVAIseyAlBYHtlGE18PNyLkex82hLFfW7P2kKHoxeL TxGTsc/RRc6jxcFJ4/3EZM0hOMsG8u5bubpKEWKA7y6WFetDDmCVZtV3IDO3EOkOal59 PuGu9SK5KHXEIAl/rwEUOy3cdPCBcpsKA1gs4Zs3x7dLLYVmwK23mnELVygLZbDLs9we Gr2VIOXSJlrVb3IGT/GXlI/KWLsi6ShcaBKGt0nFv1zVfxJ8LdWi7sOqYs7Kpq3K3Ntt 4JLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from :arc-authentication-results; bh=RcI2nwpBuOCZkhM1ZCItVLTK9R+OyHfMXbKbkll9rVg=; b=ZIlaEKZ6yjQKpQuNufi6oX6cODv7RfQv8HwstShV3vZTz0TvDaHqKYxgzO2bgZoV6d hoxcMc4TMbAdRM6QWNTnKSSXkfDRnpTnqc8xhxiDt9HXaOuLWgLO0mKSgXOizxjQHtgC oig6cZC0/26jNgdaG+/FmBHobPJeff/zhW/Fd8Jck3RAcXZPoBJLd7nagBSFQQCyR+ac B8w3oh0475yfqTaTW0rpJel0eNaUlS1R5Ii7yTvKl0pSaq0sTdNgY7HNVuFQiY8Ilzww PAruKAEQuBfktOwMlAGwIi7Vmg3jxesbHh4bq41wiv9u2tSlMUCt11gQxuFuA4GWuIST CYzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p184si6807699qkd.73.2018.04.16.02.20.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Apr 2018 02:20:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:59275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f80Jd-0005jk-IS for patch@linaro.org; Mon, 16 Apr 2018 05:20:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f80I5-0004t7-5z for qemu-devel@nongnu.org; Mon, 16 Apr 2018 05:19:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f80Hz-0005OR-Ai for qemu-devel@nongnu.org; Mon, 16 Apr 2018 05:19:13 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:34523 helo=mx07-00178001.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f80Hz-0005Nw-1Q for qemu-devel@nongnu.org; Mon, 16 Apr 2018 05:19:07 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w3G9Eaj1008035; Mon, 16 Apr 2018 11:18:53 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2hb8hf1nbh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Apr 2018 11:18:53 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1073238; Mon, 16 Apr 2018 09:18:51 +0000 (GMT) Received: from Webmail-eu.st.com (gpxdag5node4.st.com [10.75.127.77]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AB5AB24E9; Mon, 16 Apr 2018 09:18:51 +0000 (GMT) Received: from gnx2104.gnb.st.com (10.75.127.116) by GPXDAG5NODE4.st.com (10.75.127.77) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 16 Apr 2018 11:18:51 +0200 From: Christophe Lyon To: , , , , Date: Mon, 16 Apr 2018 11:18:25 +0200 Message-ID: <20180416091845.7315-1-christophe.lyon@st.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 X-Originating-IP: [10.75.127.116] X-ClientProxiedBy: GPXDAG1NODE6.st.com (10.75.127.67) To GPXDAG5NODE4.st.com (10.75.127.77) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-04-16_05:, , signatures=0 X-MIME-Autoconverted: from 8bit to quoted-printable by mx08-.pphosted.com id w3G9Eaj1008035 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 91.207.212.93 Subject: [Qemu-devel] [PATCH] linux-user: Add ARM get_tls syscall support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Co-Authored-By: Mickaël Guêné Signed-off-by: Christophe Lyon -- 2.6.3 Reviewed-by: Peter Maydell diff --git a/linux-user/arm/target_syscall.h b/linux-user/arm/target_syscall.h index 94e2a42..afc0772 100644 --- a/linux-user/arm/target_syscall.h +++ b/linux-user/arm/target_syscall.h @@ -16,6 +16,7 @@ struct target_pt_regs { #define ARM_NR_breakpoint (ARM_NR_BASE + 1) #define ARM_NR_cacheflush (ARM_NR_BASE + 2) #define ARM_NR_set_tls (ARM_NR_BASE + 5) +#define ARM_NR_get_tls (ARM_NR_BASE + 6) #define ARM_NR_semihosting 0x123456 #define ARM_NR_thumb_semihosting 0xAB diff --git a/linux-user/main.c b/linux-user/main.c index 8907a84..2acac36 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -720,6 +720,9 @@ void cpu_loop(CPUARMState *env) case ARM_NR_breakpoint: env->regs[15] -= env->thumb ? 2 : 4; goto excp_debug; + case ARM_NR_get_tls: + env->regs[0] = cpu_get_tls(env); + break; default: gemu_log("qemu: Unsupported ARM syscall: 0x%x\n", n);