From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Sat, 10 Feb 2007 01:57:36 -0600 Subject: [U-Boot-Users] [PATCH0/2] Re-do the patch for adding DO_SYNC in flash_write_cmd In-Reply-To: <200702100840.46587.sr@denx.de> References: <20070210010420.CD5CB353CAA@atlas.denx.de> <45CD72DF.8070409@orkun.us> <200702100840.46587.sr@denx.de> Message-ID: <45CD7AF0.2020209@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Stefan Roese wrote: > On Saturday 10 February 2007 08:23, Tolunay Orkun wrote: >>>> We need to define SYNC as asm("sync;"). >>> Or, to be sure, ""sync;isync" >> OK. > > I would not do this. Please let a "sync" instruction _not_ do a "isync" too. > There will be times when you explicitly _don't_ what this. Could you give a specific example. There is also "eieio" and "msync" to consider though these usually map to former two (or vice versa). >>> Where is the problem? Which code includes include/ppc_asm.tmpl ? Why >>> cannot we have the same definition once for C and again for >>> assembler? >> I agree, I think we can define the equivalent one in a C header file >> >> #define SYNC asm("sync; isync;") >> >> I am not sure if the assembler one is ever included in the C code. > > Why not use > > #define sync() __asm__ __volatile__ ("sync" : : : "memory"); > > from include/asm-ppc/io.h? This seems to be exactly what we need. > I would rather prefer an uppercase SYNC since it is a macro but whatever style you guys choose is OK with me. Please you and Wolfgang decide on this matter. I do not want to confuse Haiying with conflicting messages. Tolunay