From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18864 invoked by alias); 6 Apr 2018 09:00:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 18673 invoked by uid 89); 6 Apr 2018 09:00:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtprelay.synopsys.com Received: from smtprelay.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Apr 2018 09:00:35 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id A95FF24E0BE9; Fri, 6 Apr 2018 02:00:33 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 9503C5148; Fri, 6 Apr 2018 02:00:33 -0700 (PDT) Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 83DCD5145; Fri, 6 Apr 2018 02:00:33 -0700 (PDT) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 02:00:33 -0700 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 14:30:31 +0530 Received: from nl20droid1.internal.synopsys.com (10.100.24.228) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 6 Apr 2018 14:30:30 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 5/5] [ARC] Clear the instruction cache using syscalls. Date: Fri, 06 Apr 2018 09:00:00 -0000 Message-ID: <1523005214-1611-6-git-send-email-claziss@synopsys.com> In-Reply-To: <1523005214-1611-1-git-send-email-claziss@synopsys.com> References: <1523005214-1611-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-04/txt/msg00295.txt.bz2 Clear the instruction cache from `beg' to `end'. This makes an inline system call to SYS_cacheflush. gcc/ 2017-03-28 Claudiu Zissulescu * config/arc/linux.h (CLEAR_INSN_CACHE): Define. --- gcc/config/arc/linux.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/config/arc/linux.h b/gcc/config/arc/linux.h index 4e87dfe..96d548e 100644 --- a/gcc/config/arc/linux.h +++ b/gcc/config/arc/linux.h @@ -109,3 +109,17 @@ along with GCC; see the file COPYING3. If not see /* Build attribute: procedure call standard. */ #undef ATTRIBUTE_PCS #define ATTRIBUTE_PCS 3 + +/* Clear the instruction cache from `beg' to `end'. This makes an + inline system call to SYS_cacheflush. */ +#undef CLEAR_INSN_CACHE +#define CLEAR_INSN_CACHE(beg, end) \ +{ \ + register unsigned long _beg __asm ("r0") = (unsigned long) (beg); \ + register unsigned long _end __asm ("r1") = (unsigned long) (end); \ + register unsigned long _xtr __asm ("r2") = 0; \ + register unsigned long _scno __asm ("r8") = 244; \ + __asm __volatile ("trap_s 0 ; sys_cache_sync" \ + : "=r" (_beg) \ + : "0" (_beg), "r" (_end), "r" (_xtr), "r" (_scno)); \ +} -- 1.9.1