From patchwork Sun Jun 4 11:59:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 101359 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp494864qgd; Sun, 4 Jun 2017 05:02:53 -0700 (PDT) X-Received: by 10.98.133.145 with SMTP id m17mr15486196pfk.164.1496577773454; Sun, 04 Jun 2017 05:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496577773; cv=none; d=google.com; s=arc-20160816; b=iLeRdH0NBFnPl8fb7DYxho3QN9IX5Y4O7eLCPBGvVmVO3RcjI8WjqQMBombGGZbcN/ DyevPk7n+kz33m1fBzhq7QOHTGW+brjf09ES2griteYtrGHvw5maKWaum2S7fvpvZo+P gTCTC3bRMwZRlB4fz65lBcJPGok35eSCtmyTgPXv6mFz5nOV5IS8P3d99RQfMXUF9Vaj nNS4dedVwn/oCDPBLBs5jNdS0ZE+kFo3TtxXl3OrG1nvx4R5hS2oF4n1rk9XoWXy6Q8c qu3i7Zkr06qyQUDACVA9QVOvqajQtvIuE5t+/f4788O3Xa/vkiUm0bQ4079xY6yv7K2M NbDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Y1iVlrEjWItRZd/tRLn5+7ISpzRbMk57TlHHGGlEt8U=; b=OM+NQAdE5rCwXnfHgW6g0Ymz1Day/9sUS02t8oa/+cP3hHsDkfham2bhT4CgkUUtEK FPMRZlRMV7uP0dyVm6U3Gezpgu7H8iWVMqD1ZFWPG9LALcm93BTcI/2QE+W4gs72gBBy vtnCxnfcnI7M89JAxUAkClsgjlGBxBJKInVFGpXLKuDFKlVMfXbnMTo6xqIZavIppoYQ /nVpJpfAe4GNwpbgBHFsXS+ddlySDw5hjDOc1BYuJrnhe+E4HIbuNRjRQeJDpTtRTnJp f42mCmAw2fSOSG1e9XsAkeUAExlLOPo66t0I/aYXQjpM7FMZor1ZmsIjZ3ZP9X303WLv 3x9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si4542326plj.223.2017.06.04.05.02.53; Sun, 04 Jun 2017 05:02:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbdFDMCg (ORCPT + 25 others); Sun, 4 Jun 2017 08:02:36 -0400 Received: from mail-sn1nam02on0058.outbound.protection.outlook.com ([104.47.36.58]:59812 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751284AbdFDMCO (ORCPT ); Sun, 4 Jun 2017 08:02:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Y1iVlrEjWItRZd/tRLn5+7ISpzRbMk57TlHHGGlEt8U=; b=AB13sVf0s5YxcMJgj9ejdjFZJ27iQzJAQx2nz+D5+etYRjE9PeUJoywJBtqOeZBKBzmLBAcG1XW6ABMdij/7Sh3XXHCcneOmhWd5yTh154qdlcMJ5aQvLErJWZM0sgxb4szfe6WmjEXY/gthkXfakC9PL6fdj6xTftdFHlMM4a0= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (176.59.55.28) by BN3PR0701MB1267.namprd07.prod.outlook.com (10.160.118.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Sun, 4 Jun 2017 12:02:00 +0000 From: Yury Norov To: Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann Cc: Yury Norov , Andrew Pinski , Andrew Pinski , Adam Borowski , Chris Metcalf , Steve Ellcey , Maxim Kuvyrkov , Ramana Radhakrishnan , Florian Weimer , Bamvor Zhangjian , Andreas Schwab , Chris Metcalf , Heiko Carstens , schwidefsky@de.ibm.com, broonie@kernel.org, Joseph Myers , christoph.muellner@theobroma-systems.com, szabolcs.nagy@arm.com, klimov.linux@gmail.com, Nathan_Lynch@mentor.com, agraf@suse.de, Prasun.Kapoor@caviumnetworks.com, geert@linux-m68k.org, philipp.tomsich@theobroma-systems.com, manuel.montezelo@gmail.com, linyongting@huawei.com, davem@davemloft.net, zhouchengming1@huawei.com Subject: [PATCH 08/20] thread: move thread bits accessors to separated file Date: Sun, 4 Jun 2017 14:59:57 +0300 Message-Id: <20170604120009.342-9-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170604120009.342-1-ynorov@caviumnetworks.com> References: <20170604120009.342-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.55.28] X-ClientProxiedBy: HE1PR09CA0074.eurprd09.prod.outlook.com (10.174.50.146) To BN3PR0701MB1267.namprd07.prod.outlook.com (10.160.118.141) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR0701MB1267: X-MS-Office365-Filtering-Correlation-Id: 318525a0-31bf-4a1a-236e-08d4ab418259 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1267; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 3:tK1fZf/sIOFnP85gOiyf/q/hGd3uwpDG9k559x8ba44FbYDrpKLv2XSq0kFkXzbMYT6ETUGJ6waVtVJS9MlrlcT+Fw1Fgs9T04JZlMXEIMBRrViKe9qZDI7/cIq291DVG4K+14MnlnJJC96AtkYbbSqgVpEYNdQVusB8eCscwDNyDSSi6QoDwJ2YUu/W0TJXVHXIH4zR6W+x8fz1+0kjwwl5iT56bHUd5UPCE5RruGRc6TySYj3Hu9CZyCotl0jCFF+10hW9mV1foF9fLnJHSUNV7fOPCUj4e1vxIu/52J3sDYS8db6oVpVAkbbjGGEsenIpwraiBC7f5hGQPyE6eg==; 25:W3LLagwAoMFUPGI4LGz4zeFcmOgZvAmVN7w3dNVccv5gaugfu0+FLd/bLyT4/LZY4HTLqaY2iAtbGu6rwlBZ0WxW2T/tED43U2433AhqJhcxaSdvJrHJ070GMLOerCJSni6+GW2JwRplhdcMOjS3X2BGxz1U47sW7kg5MqRxBDF3g6S/9TQok9B59cdXcS3c+NQBYA5PGkRXdZmQbgrTERNOWN5nJGKvwsoeEShqo9zO0e/REsWmRmivHYPxxFKZp5wLd18eYZhqOmvnljQjW9+Mq3YmBqB+Mfw7wVf+HisStmPT6LRQeYiTB/UoYuDo75zFyqSK3ouOONJ563NNsoipKpevbgaYXiIZrLwLsa7+5sTABtZtB2m5miNdLwOnHt13633V+gn1xEUv4nIpFg8w3JRtoJHar1YNkB5FvePTbCpdZwiltP5t7WY9fVeCgNLTPzVrjT5+Sr0U6R/mDkfEZ/lePBdNWhT8dsT4q/M= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 31:m7TCy59qDbq/xAZFyP2VKyowoOit2UahV26D+ZUO9bXrWtHTeHKm1amjB/uMWGNwmr3GnWEjcYt+RV47fAx8ednn+cnlNob6pQdZGBfPMNSlJ5JmILErIXAYv/RQeUR4DrOUcWdLOe4ZbuEaURuT/K/5qbhciXyqSH/AGoJNkM6BGZZlXFhjQgUNW/I6cid9mly/OTtxArYmxJXata5EJVqcHaF8+C+q7Po7aQ2vN6A=; 20:BlSUFvPSNf4sUepOikVrQpgeurM+39QagfF3je9tKkZdrsZoKfacp5iG5JPTk/KaHBwDHWdJ/P2Y8ql8W0ZDY7T5PA1keMt9Nm2VU4I/Df2zC+LxSKvOYpxlNLQydODilrDhtdtOzeJup0i0h0/EKi5Ia6GYgYn32Gy0ItJ8bV1tW/DbJb+uthFlq1rakGYLcKAPzKq8dGC5u+F2etwkBHyqoxHCZhIUSECEQQrH75rS/1Hcisa5nN/Vg/0nsp/cenPCypHRKH3LcD5ofwEeb/3lBrru+2Pgz293hUQIsRsoTJhBNJo0/LRl6eUjdeefXuBVKHEtqAhHR0ijy599DpnThx4T+Dra4wJKfvIksfjHG56NetJro29MFaDuxNdlIg07aTKC4CkKBaC7oxz3Z21Dui+aAxaAPPHVXnM/nR+0a6fGyEwHE5EyZhTMDeahrgfoFVBia2eFOXsLx3MS1h57Yu4RIzopgKQNPOX7e+9FVkpEoOvvHO22xivRirXqmujpOr6MavOxHmFDtgvRcCf/LfCzJR74t61+03SFy6WVJwAcq+N7FHB1+dA5zv8RtuIVVINxiyFEbOufr1WQGzKQ8A7tGjc5H7aR0tkXbdQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR0701MB1267; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR0701MB1267; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 4:8U8HIhum97lgsNTdYVFD78a3sD9dhPEwL7hr+OCug+rqri7FuQwEW6uMHdqqCi3f8C4kbR9TidV945KaPfdfiibm9jTko0ZH0I+35n710/ZUXlVFVM8inlX1LAG9TqKxxSHwgR2LrrNBIFSEL2MyejZN852DbBXNlOKmlpHOTFYOh0bCMFMwF2gI+cem3+aG5X5kWK5z/fZJe8bESQSd1p3LRIZDy1hDA87LCkP9Ps78y+XBh4Z1xFd0OC5/b46ALIVBZ+goTOdFu7lvmxrzjcLv6IQfDbXJRvjU6fhv8IYurH1UjfH7VffPPrfKiWoBasM7+Xg5nEGLmR7pinY6N/LxBk5EHl/vY4l+Cm3OaowpDrNc7VQy6Oj5qu5CK0MZ9mZF7xjoJ4Drx2Q7/RUz107952I/L6dnRNbJ/z1pANBFciPJ49ZeJQqQD1Q7yFwVQCRIfJAVLJKZXpvy2aSLzl9HCcRbLDdTbZmeW3nZ7vHhNFTD92PHVgex3+qoCakTdAUQ8G13fvdWJZzOOtMKX2ilxdgaaqhLmpa0LtgeNfyNr3CAdiPYmlAnplZKpLovSQVb3e3lqeXxY+lYvlPrZo0g0sZUNa7wh6Eey26QT7+72SuQLHWtEd/oAxUclKJ0txWuMbMsPq5ogD7H7xdjQ/XFlJj1+3ccSaViKHo7tq/2UGVBS0zVEkS+flyaKaqlpJ3FYrfqFhDMIT1yw7IzraYDOBuxZIWWhoHxIeiAs2MPnlavDq5zj6djngR1tf7g8mB5ll9tmbbz85rc3FCH43YKJSHf2pxvIS3FLbRb9ufH9cfyKihkOGWaoicseS1DHVT5BkCkv8ucmZmS8ScGug10YDCS/AoPucqD5LGaM7fGa5sMMTRGTBUeB03kAKOqN8X8MsSo08T7xxyAS2f80d1RytZBPtcN5au2cXTunzH7kj3Y8C7/AIwQ9smHYcGT8hAzw5U6eE5sFB2+DBkSt9MiiM+KivGGtHmVrjuwH294lSkg5xKCcXP8PxggLhZdPIo0X3gGSIxX7pT4a2n06xOPdCRwletQKKP1sTBcoQKM4Qnv6ryrn3utGtzOlM1/YU4sYmioffogIe41oi+TFH6Lru0Ljque2omH0+W13Os= X-Forefront-PRVS: 03283976A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39400400002)(39850400002)(39410400002)(2906002)(72206003)(6666003)(189998001)(2950100002)(42882006)(5003940100001)(478600001)(66066001)(6486002)(53936002)(54906002)(50986999)(76176999)(47776003)(38730400002)(6496005)(48376002)(50466002)(5660300001)(7416002)(76506005)(8676002)(81166006)(36756003)(305945005)(42186005)(33646002)(4326008)(50226002)(25786009)(1076002)(6116002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1267; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 23:eOKN+L3Da5KeyBQw8cuzpoTtsXlcEhIy+PHjRTL3PLUWKXo6HDR5MnABkWsspx2/riitrdCoILtm+T48TjItRKRYm25wo+9w2F4EBFe4QOKp29Vfn0eWo/45BlWGFTuNdLxXy43VL7awyiwn4i0f4gKxIDOeOKT9CRFxVBh4jLkwe2z1IVLf9ZYmOArd5y1Sh2CYRXOHTuVEBg9yeuqRUaQfeJOoIP+8/STnkchoYJrril8WLUmdqz42Opc50of9pi4og2sBHPeDbLiiAdNxepEn9S+g/XdtF8JQZe2ThXCwLOP+KduQPeukEwAf5JXgwq5lIVEvz71M2TUTutRqNV5UoUeVgA0A9UMEJAOr0BGWO011+NSU1X3dI3saftxWzXjvifisBO7H1Mo7nkDSxj+UguV3ZgQEjRdv/Zzl5ySX+vhMSHs0vfQ7E3XaDAdlZeIFTtQZ9Tak7hBUgc2bDe4sC7MW4sPQ2+h+9vgevc5BzsLzREx80rgup9mS6istX/eTYXALry3CU1KZmcM+Z5pwZ8qmztXbnDz+4MKI/vTgTwZbr3AQ+E86SN11IEWICzTfIlMoehscXHSaK0VKk+dB2OTbdSCfhoThr6migQzu8eKCZ+2Tnv06DrZq8Xv+Xf8JxMKE0vR9ZP2zR/nTmmAoC1w6xQVtmbt0xraa6qFZVcBDS3h3tnHsA49TawqZJVKMoF67UAjN2YdvPs7xaqHnPdkhlcjH2RgQnBeCaUfYysWAHJYVpkOwid1zFqji56lc58BmeXLUI7nvwvR46zaFmqNNGpYAjybphGT855wqKX7c3pmAIbT8NBF6kh+o0dyyxYVsTAkChv8+2D/5bCMwlH435/thc3Mzecrkkn/kxDONLsWBHGeGm2thj/mjVIhTaTQsOmcjama5ms2VrlCPfakgYH1ZZinNlOEYaQFWGP5DfZghl+yLXirWFe3Voaj9wQy3LMdpPeVUaw6NKnnHaFHoC5iigjRJkW5CdIHN1unBQ9A1MYorK8gn8YgY X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 6:AkkluWQo3iPKbdnVjcKjp/loSH43BPDd1i5qv6BI4fybTBHAnhsVtQczb2EgDL2BTB9MT3h06izjxPGen+LCJxSweGYB7X0gS1w2X3uY5sb1GdEHTyS41pwcOVOxuBT120g+1pXtlH6ktJgmhBg+g3l1UCnCnSTT2aJgZdTNQYW2bxCvFUlGXasfg3xuNFLhNQcpqtoxVYohrRm54SZvcQPMtObenJTd38KnsJKyWbdS9Af4svJyl5J1wbPj4SEtVj07/XXYkIys+oj9akrwqoNqRhRE9nMSDEN1anKD/HyLN6lzXUyIhsNXo2s31WXge/45F8dvBb6TjiNKNflPdVySTyXb7jGzF2uaBD/8hZgLkjQcrfOs9WAvi9cOe1/XQafn6FF+c0bEegy3RTw12V1hjn40+1Ci9agD0JUVlGazM+r07f59fMkmgUV6j4vyIn0mnzSyNismqnoTYSp8HpP+1+jhQPSOsW7MfERgpZBQ8bncNriP+lZp3kCQqOLhvgpFt5cjvUA6TEJenzopJw== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 5:M2cS4HJDPuhixJ5uCY4YngsOlEK/So6vmpEjTcQXwdgNYGkR7tJKlLEC+pSG07RpkUtjPn2mIsEWyYQDia/p9OqgLbhvvgz3Rpcb2DM+sEI5S/39gSPKarAxL8atwoiJQPwf+9R6fL6OV9Q2dxUm3oT+gTr5kxnagFvw0E0v9BmasrTX/V3mdtkeJoN0a2HmGScFibpjKbxj1WlA9MsNozDWip0fAbCsIngiutmnkBarwvK4chnsVEfEAix8Qz23XpqqreQ/YsaBnf2e2NXUqzMav718pVZItWDLzZ9cBntnY8bsACibNBNI64qjHyN+Ymi7ytEH3JjxGHr3HXnP/LlR1t7ES/IVygQjF+zs8FXIN6xF6C58FuLOhBZ5TsK1IKTvs2EFFMvanbIj1E55UZyf1OlvA94M0o7E3GMYeq9j5D7R6XwdPZkvn+Ff/vrTYfcxKZnno0yUBNsndGqahTJEO33PaJTNzAYBxTuau3RhobFLM1RNlgUK4WsM3G7U; 24:AVn35akino1+3p3Wt0j8eD5QozAFPTSKxFQd1hwbyTHECCrJGrLzkJGrpfh1x06aXi4pUxaqs2QA1I4z8E2AMidPS4AIfa43O1aszhztwUA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1267; 7:5wALkDrwThAfPDQXfNmv7iZ+PDyTg5l8nY8Qu6GIFMGRHGipRklWQsXKw9UHj91cTRsN6Xgl5XIeR/0AlHNP8/svjfIul19lupnJ/oZSm/8BoW+dQxVPouN5/6KQeOVyandm4bsjt5AHpWiOMghQ9PT0xoodnG69zl7WCHR4r7s6AJFMP5KUgYpyGsRLbwoL4vwUXbcMHnQ7N19NArormLV1PLm+7cO6hRHKlYww5EBvgYQtx7PCxaKwj/Eb5CCra2EAqZtmmhG1nhWkE/TTktvDmzeYWvD7wtCIylF/BsTHvBlZqfSefCmXAVCPOL1P5Fl+EkzK12UgeAaDoBsDKg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2017 12:02:00.8862 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1267 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org They may be accessed from low-level code, so isolating is a measure to avoid circular dependencies in header files. The exact reason for circular dependency is WARN_ON() macro added in patch edd63a27 "set_restore_sigmask() is never called without SIGPENDING (and never should be)" Signed-off-by: Yury Norov --- include/linux/thread_bits.h | 63 +++++++++++++++++++++++++++++++++++++++++++ include/linux/thread_info.h | 66 +++++++++------------------------------------ 2 files changed, 75 insertions(+), 54 deletions(-) create mode 100644 include/linux/thread_bits.h -- 2.11.0 diff --git a/include/linux/thread_bits.h b/include/linux/thread_bits.h new file mode 100644 index 000000000000..87354331bc7b --- /dev/null +++ b/include/linux/thread_bits.h @@ -0,0 +1,63 @@ +/* thread_bits.h: common low-level thread bits accessors */ + +#ifndef _LINUX_THREAD_BITS_H +#define _LINUX_THREAD_BITS_H + +#ifndef __ASSEMBLY__ + +#include +#include + +#ifdef CONFIG_THREAD_INFO_IN_TASK +/* + * For CONFIG_THREAD_INFO_IN_TASK kernels we need for the + * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels, + * including can cause a circular dependency on some platforms. + */ +#include +#define current_thread_info() ((struct thread_info *)current) +#endif + +/* + * flag set/clear/test wrappers + * - pass TIF_xxxx constants to these functions + */ + +static inline void set_ti_thread_flag(struct thread_info *ti, int flag) +{ + set_bit(flag, (unsigned long *)&ti->flags); +} + +static inline void clear_ti_thread_flag(struct thread_info *ti, int flag) +{ + clear_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_and_set_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_and_clear_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_bit(flag, (unsigned long *)&ti->flags); +} + +#define set_thread_flag(flag) \ + set_ti_thread_flag(current_thread_info(), flag) +#define clear_thread_flag(flag) \ + clear_ti_thread_flag(current_thread_info(), flag) +#define test_and_set_thread_flag(flag) \ + test_and_set_ti_thread_flag(current_thread_info(), flag) +#define test_and_clear_thread_flag(flag) \ + test_and_clear_ti_thread_flag(current_thread_info(), flag) +#define test_thread_flag(flag) \ + test_ti_thread_flag(current_thread_info(), flag) + +#endif /* !__ASSEMBLY__ */ +#endif /* _LINUX_THREAD_BITS_H */ diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index d7d3ea637dd0..2467f350d659 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -7,9 +7,21 @@ #ifndef _LINUX_THREAD_INFO_H #define _LINUX_THREAD_INFO_H +/* + * For per-arch arch_within_stack_frames() implementations, defined in + * asm/thread_info.h. + */ +enum { + BAD_STACK = -1, + NOT_STACK = 0, + GOOD_FRAME, + GOOD_STACK, +}; + #include #include #include +#include #ifdef CONFIG_THREAD_INFO_IN_TASK /* @@ -21,19 +33,6 @@ #define current_thread_info() ((struct thread_info *)current) #endif -#include - -/* - * For per-arch arch_within_stack_frames() implementations, defined in - * asm/thread_info.h. - */ -enum { - BAD_STACK = -1, - NOT_STACK = 0, - GOOD_FRAME, - GOOD_STACK, -}; - #include #ifdef __KERNEL__ @@ -45,47 +44,6 @@ enum { # define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK) #endif -/* - * flag set/clear/test wrappers - * - pass TIF_xxxx constants to these functions - */ - -static inline void set_ti_thread_flag(struct thread_info *ti, int flag) -{ - set_bit(flag, (unsigned long *)&ti->flags); -} - -static inline void clear_ti_thread_flag(struct thread_info *ti, int flag) -{ - clear_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_and_set_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_and_clear_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_bit(flag, (unsigned long *)&ti->flags); -} - -#define set_thread_flag(flag) \ - set_ti_thread_flag(current_thread_info(), flag) -#define clear_thread_flag(flag) \ - clear_ti_thread_flag(current_thread_info(), flag) -#define test_and_set_thread_flag(flag) \ - test_and_set_ti_thread_flag(current_thread_info(), flag) -#define test_and_clear_thread_flag(flag) \ - test_and_clear_ti_thread_flag(current_thread_info(), flag) -#define test_thread_flag(flag) \ - test_ti_thread_flag(current_thread_info(), flag) - #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES