From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2879 invoked by alias); 5 Jul 2007 07:43:21 -0000 Received: (qmail 2864 invoked by uid 22791); 5 Jul 2007 07:43:20 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1.dnsmadeeasy.com (HELO smtp1.dnsmadeeasy.com) (205.234.170.134) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jul 2007 07:43:13 +0000 Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 1FA0F2FAD12; Thu, 5 Jul 2007 07:43:12 +0000 (UTC) X-Authenticated-Name: js.dnsmadeeasy X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com Received: from avtrex.com (unknown [67.116.42.147]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP; Thu, 5 Jul 2007 07:43:11 +0000 (UTC) Received: from jennifer.localdomain ([192.168.7.221]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 5 Jul 2007 00:43:12 -0700 Message-ID: <468CA0EA.5010905@avtrex.com> Date: Thu, 05 Jul 2007 08:34:00 -0000 From: David Daney User-Agent: Thunderbird 2.0.0.4 (X11/20070615) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org Subject: Re: [Patch] 3/3 FFI: Use __builtin_flush_icache() to flush MIPS i-cache. References: <468734D3.3020908@avtrex.com> <4687370E.7090801@avtrex.com> In-Reply-To: <4687370E.7090801@avtrex.com> Content-Type: multipart/mixed; boundary="------------040702050606060101090109" X-IsSubscribed: yes 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 X-SW-Source: 2007-07/txt/msg00418.txt.bz2 This is a multi-part message in MIME format. --------------040702050606060101090109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1016 David Daney wrote: > This is the third and final part of the __builtin_flush_icache patch. > It replaces the hard coded library call to cacheflush() in the MIPS > ffi_prep_closure_loc with a call to __builtin_flush_icache(); > > For targets that support user-space i-cache flushing (mips32r2), this > will eliminate a system call from the ffi closure preparation path. > On all other targets the generated code is the same as before. > > Bootstrapped and tested on x86_64-unknown-linux-gnu all default > languages with no regressions. > > Also tested on: > x86_64 cross to mipsel-linux --with-arch=mips32 > i686 cross to mipsel-linux --with-arch=mips32r2 > > with no regressions. A new version of the patch. All that changed is the name of the builtin. It is now __builtin___clear_cache(). Tested as before. OK to commit: 2007-07-04 David Daney * src/mips/ffi.c: Don't include sys/cachectl.h. (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of cacheflush(). --------------040702050606060101090109 Content-Type: text/x-patch; name="flush-cache3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="flush-cache3.diff" Content-length: 974 Index: src/mips/ffi.c =================================================================== --- src/mips/ffi.c (revision 125997) +++ src/mips/ffi.c (working copy) @@ -27,7 +27,6 @@ #include #include -#include #if _MIPS_SIM == _ABIN32 #define FIX_ARGP \ @@ -506,6 +505,7 @@ ffi_prep_closure_loc (ffi_closure *closu unsigned int *tramp = (unsigned int *) &closure->tramp[0]; unsigned int fn; unsigned int ctx = (unsigned int) codeloc; + char *clear_location = (char *) codeloc; #if defined(FFI_MIPS_O32) FFI_ASSERT(cif->abi == FFI_O32 || cif->abi == FFI_O32_SOFT_FLOAT); @@ -525,8 +525,7 @@ ffi_prep_closure_loc (ffi_closure *closu closure->fun = fun; closure->user_data = user_data; - /* XXX this is available on Linux, but anything else? */ - cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, ICACHE); + __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); return FFI_OK; } --------------040702050606060101090109--