txcotrader
txcotrader

Reputation: 595

powerpc assembly translation

Can someone who is good at assembly for the power pc help me decipher this code?

extern inline void out_8(volatile unsigned char __iomem *addr, u8 val)
{
    __asm__ __volatile__("sync;\n"
                 "stb%U0%X0 %1,%0;\n"
                 : "=m" (*addr)
                 : "r" (val));
}

Thank you very much for your help.

Upvotes: 1

Views: 277

Answers (1)

Michael Dorgan
Michael Dorgan

Reputation: 12515

Sync - meaning a memory and out of order buffer - flush caches and such followed by a store byte. Looks like a memory barrier byte write. Confirming... yep. sync is used to make sure all previous instructions have completed on the processor and no following instructions have started. Interesting thing is, the symc usually happens after the store instead of before for so the above code is confirming there are no other writes pending before executing the byte write.

Upvotes: 1

Related Questions