From: Sam Ravnborg <sam@xxxxxxxxxxxx> Date: Sun, 20 May 2012 22:44:47 +0200 > This is what I came up with - on top of the other patches I sent > which introduced flushi(). > Only RFC for now - I plan to submit a longer set > of patches that does most of the work to allow leon > to be used in parallel with the sun platfroms. Looks great. If you want to get fancy you can write a macro for the whole section dance and LEON insn entry stuff. > The sparc64 code I copied the run-time patching from used > the following sequence for flushing the ICache: > > wmb(); > __asm__ __volatile__("flush %0" : : "r" (addr + 0)); > > Compare this to the flushi() variant: > #define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory") > > As far as I understand the macros "wmb()" is just another way to tell > gcc what it may do. And the "memory" clobber in flushi() > serve the same purpose as wmb(). > > On sparc64 wmb() is: __asm__ __volatile__("":::"memory") > > One could introduce flushi() in the relevant functions in setup_64.c.. On sparc64wmb() used to actually do something, with a membar (MEMory BARrier) instruction, which sparc32 doesn't have and doesn't need. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html