Why is defined PPC_ISYNC defined as "sync;isync"
Ryan Arnold
ryan.arnold@gmail.com
Mon Dec 8 15:59:00 GMT 2008
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
More information about the Libc-help
mailing list