From patchwork Tue Mar 29 11:36:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 671192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2TBb441005340 for ; Tue, 29 Mar 2011 11:37:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928Ab1C2LhB (ORCPT ); Tue, 29 Mar 2011 07:37:01 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:38895 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752683Ab1C2LhA (ORCPT ); Tue, 29 Mar 2011 07:37:00 -0400 Received: by iwn34 with SMTP id 34so72424iwn.19 for ; Tue, 29 Mar 2011 04:37:00 -0700 (PDT) Received: by 10.43.71.13 with SMTP id yi13mr8312983icb.432.1301398619993; Tue, 29 Mar 2011 04:36:59 -0700 (PDT) Received: from chimagu (w142187.ppp.asahi-net.or.jp [121.1.142.187]) by mx.google.com with ESMTPS id d10sm3613103ibb.51.2011.03.29.04.36.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2011 04:36:58 -0700 (PDT) Received: from iwamatsu by chimagu with local (Exim 4.74) (envelope-from ) id 1Q4XEL-0002o0-1M; Tue, 29 Mar 2011 20:37:01 +0900 From: Nobuhiro Iwamatsu To: linux-sh@vger.kernel.org Cc: Nobuhiro Iwamatsu Subject: [PATCH] sh: Fix build arch_ptrace function by init_fpu Date: Tue, 29 Mar 2011 20:36:59 +0900 Message-Id: <1301398619-10753-1-git-send-email-iwamatsu@nigauri.org> X-Mailer: git-send-email 1.7.4.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 29 Mar 2011 11:37:04 +0000 (UTC) diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index 2130ca6..e00ddad 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c @@ -394,9 +394,11 @@ long arch_ptrace(struct task_struct *child, long request, tmp = 0; } else { unsigned long index; +#ifdef CONFIG_SH_FPU ret = init_fpu(child); if (ret) break; +#endif index = addr - offsetof(struct user, fpu); tmp = ((unsigned long *)child->thread.xstate) [index >> 2]; @@ -428,9 +430,11 @@ long arch_ptrace(struct task_struct *child, long request, else if (addr >= offsetof(struct user, fpu) && addr < offsetof(struct user, u_fpvalid)) { unsigned long index; +#ifdef CONFIG_SH_FPU ret = init_fpu(child); if (ret) break; +#endif index = addr - offsetof(struct user, fpu); set_stopped_child_used_math(child); ((unsigned long *)child->thread.xstate) diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index c8f9764..d675b0e 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c @@ -403,9 +403,11 @@ long arch_ptrace(struct task_struct *child, long request, else if ((addr >= offsetof(struct user, fpu)) && (addr < offsetof(struct user, u_fpvalid))) { unsigned long index; +#ifdef CONFIG_SH_FPU ret = init_fpu(child); if (ret) break; +#endif index = addr - offsetof(struct user, fpu); tmp = get_fpu_long(child, index); } else if (addr == offsetof(struct user, u_fpvalid)) { @@ -445,9 +447,11 @@ long arch_ptrace(struct task_struct *child, long request, else if ((addr >= offsetof(struct user, fpu)) && (addr < offsetof(struct user, u_fpvalid))) { unsigned long index; +#ifdef CONFIG_SH_FPU ret = init_fpu(child); if (ret) break; +#endif index = addr - offsetof(struct user, fpu); ret = put_fpu_long(child, index, data); }