[U-Boot-Users] [PATCH0/2] Re-do the patch for adding DO_SYNC in flash_write_cmd

Stefan Roese sr at denx.de
Sat Feb 10 08:40:45 CET 2007


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.

> > 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.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
=====================================================================




More information about the U-Boot mailing list