From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 920 invoked by alias); 1 Jul 2007 17:51:27 -0000 Received: (qmail 912 invoked by uid 22791); 1 Jul 2007 17:51:26 -0000 X-Spam-Check-By: sourceware.org Received: from phoenix.bawue.net (HELO mail.bawue.net) (193.7.176.60) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 01 Jul 2007 17:51:24 +0000 Received: from lagash (88-106-245-10.dynamic.dsl.as9105.com [88.106.245.10]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bawue.net (Postfix) with ESMTP id 6C82BB866E; Sun, 1 Jul 2007 19:51:21 +0200 (CEST) Received: from ths by lagash with local (Exim 4.67) (envelope-from ) id 1I53Zw-00035K-T8; Sun, 01 Jul 2007 18:51:20 +0100 Date: Sun, 01 Jul 2007 17:51:00 -0000 From: Thiemo Seufer To: Paolo Bonzini Cc: David Daney , gcc-patches@gcc.gnu.org Subject: Re: [Patch] 1/3 Add new builtin __builtin_flush_icache(). Message-ID: <20070701175120.GC10490@networkno.de> References: <468734D3.3020908@avtrex.com> <46875F54.8070905@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46875F54.8070905@gnu.org> User-Agent: Mutt/1.5.16 (2007-06-11) 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/msg00030.txt.bz2 Paolo Bonzini wrote: > >> The prototype for the new built-in is: >> void __builtin_flush_icache(void *location, size_t len); >> As one might expect, it flushes the region of memory pointed to by >> location with length len from the instruction cache. The >> new builtin and the flush_icache insn would be the preferred mechanism >> to flushing the i-cache. > > libgcc already exports __clear_cache with this prototype: > > void > __clear_cache (char *beg __attribute__((__unused__)), > char *end __attribute__((__unused__))) On MIPS{32,64}R2 an icache flush can be done inline with synci instructions. Older revisions need a syscall. Thiemo