From patchwork Fri Jul 12 20:12:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f197.google.com (mail-gh0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D510A25E34 for ; Fri, 12 Jul 2013 20:13:05 +0000 (UTC) Received: by mail-gh0-f197.google.com with SMTP id r20sf10709159ghr.4 for ; Fri, 12 Jul 2013 13:13:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=O1vZo+Omnawx5mNlnCL6+qW2lf7okvbYsVCRlGNUEWE=; b=Wtt7wTed476ndVrpwPhS1MbiPdDKI+/FLHvhdx3Zruv3uuh3gHRLltesPFGfJeoPny 3GLYIcYzewt17DuS+LZ+rY75S0Pb5LBGgf9KLYbBVBThYGAHzOWsYZY/zbxkexNhg2MF JqzENgb7bqXvcB8yDvAuG02sBG2xvNayi8p1uI2W9zgLy2PVIDe08E6EnypWEw3Pl0Ds 1XDPZ9jg1tzrzImWit3UUFqs7xGfeeG66U12BgjQo5+CQth8N6f6iN5k+bSJJbUY7PuQ AiWkqBMLbTLSEk6q62+nIaolhD4hDr0TYhLGTaZEKTLWaAxSBpBpyukTtYKloxu+9nB1 pPnw== X-Received: by 10.236.54.135 with SMTP id i7mr24077621yhc.33.1373659985216; Fri, 12 Jul 2013 13:13:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.99 with SMTP id ot3ls3348776qeb.40.gmail; Fri, 12 Jul 2013 13:13:05 -0700 (PDT) X-Received: by 10.52.122.113 with SMTP id lr17mr21250580vdb.100.1373659984931; Fri, 12 Jul 2013 13:13:04 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id b1si12647652veg.137.2013.07.12.13.13.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:13:04 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so8022136vcb.38 for ; Fri, 12 Jul 2013 13:13:04 -0700 (PDT) X-Received: by 10.221.21.74 with SMTP id qr10mr25173413vcb.25.1373659984572; Fri, 12 Jul 2013 13:13:04 -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.149.77 with SMTP id s13csp147063vcv; Fri, 12 Jul 2013 13:13:03 -0700 (PDT) X-Received: by 10.152.28.66 with SMTP id z2mr20115563lag.5.1373659979524; Fri, 12 Jul 2013 13:12:59 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id a3si3566719lak.119.2013.07.12.13.12.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 13:12:59 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Uxji2-00064c-9G; Fri, 12 Jul 2013 21:12:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paul Brook , Aurelien Jarno , Jia Liu , Alexander Graf , Blue Swirl , Guan Xuetao , Riku Voipio Subject: [PATCH 8/8] linux-user: Enable NPTL for m68k Date: Fri, 12 Jul 2013 21:12:53 +0100 Message-Id: <1373659973-23289-9-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> References: <1373659973-23289-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQkeBcdQePpE6NAwt88hymvVDbZP7xEBS/QDVR1FHyI1TaCVwJqNTQJZmE4eiRkktVvfLS2L X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 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: , For m68k, per-thread data is a purely kernel construct with no CPU level support. Implement it via a field in the TaskState structure, used by cpu_set_tls() and the set_thread_area/get_thread_area syscalls. This allows us to enable compilation with NPTL. Signed-off-by: Peter Maydell --- configure | 1 - linux-user/m68k/target_cpu.h | 6 +++++- linux-user/qemu.h | 1 + linux-user/syscall.c | 10 ++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 117191e..67e6437 100755 --- a/configure +++ b/configure @@ -4203,7 +4203,6 @@ case "$target_name" in m68k) bflt="yes" gdb_xml_files="cf-core.xml cf-fp.xml" - target_nptl="no" ;; microblaze|microblazeel) TARGET_ARCH=microblaze diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index 8a2a305..cad9c90 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp) env->dregs[0] = 0; } -/* TODO: need to implement cpu_set_tls() */ +static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls) +{ + TaskState *ts = env->opaque; + ts->tp_value = newtls; +} #endif diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 8c420da..1ff0fa8 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -121,6 +121,7 @@ typedef struct TaskState { #endif #ifdef TARGET_M68K int sim_syscalls; + abi_ulong tp_value; #endif #if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32) /* Extra fields for semihosted binaries. */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 00a0390..c580793 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8558,6 +8558,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #elif defined(TARGET_I386) && defined(TARGET_ABI32) ret = do_set_thread_area(cpu_env, arg1); break; +#elif defined(TARGET_M68K) + { + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; + ts->tp_value = arg1; + } #else goto unimplemented_nowarn; #endif @@ -8566,6 +8571,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, case TARGET_NR_get_thread_area: #if defined(TARGET_I386) && defined(TARGET_ABI32) ret = do_get_thread_area(cpu_env, arg1); +#elif defined(TARGET_M68K) + { + TaskState *ts = ((CPUArchState *)cpu_env)->opaque; + ts->tp_value = arg1; + } #else goto unimplemented_nowarn; #endif