This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why is defined PPC_ISYNC defined as "sync;isync"


On Sun, Dec 7, 2008 at 9:43 PM, Sean P Curry
<spcurry5@linux.vnet.ibm.com> wrote:
> Can anyone tell me why the macro PPC_ISYNC (located in
> libc/sysdeps/powerpc/powerpc[32/64]/dl-machine.c) is defined as: asm
> volatile("sync; isync"...) ?? (why is the "sync" instruction present
> before the "isync")

Hi Sean,

'sync' is a data-cache synchronization instruction, i.e. a memory
barrier that synchronizes loads and stores.

'isync' is a context synchronization instruction.  It guarantees that
all instructions prior to the isync are completed before the isync
completes.

They're coupled together because isync may complete before storage
access associated with instructions preceding the isync instruction
have been performed and we don't want that, hence we need to perform a
sync as well.

Ryan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]