LWN.net Logo

SC(var, newval)) missing the address parameter

SC(var, newval)) missing the address parameter

Posted Nov 13, 2007 13:20 UTC (Tue) by tyhik (subscriber, #14747)
Parent article: Memory part 6: More things programmers can do

"Here we have to use a special load instruction (LL) and we do not have to pass the current
value of the memory location to SC since the processor knows if the memory location has been
modified in the meantime."

How precisely the CPU knows the location, depends on arch. According to "MIPS Architecture for
Programmers", MIPS cpu-s remember the block of memory previously accessed with LL; depending
on CPU, the block may be from word size to page size. The sc instruction on MIPS has the
address parameter. Therefore, in general, the "SC(var, newval)" should have the address
parameter too.



(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds