The asm statements you see in spin_lock and spin_unlock refer to the
lock by implication from its value, rather than by its address. As long
as GCC uses the actual memory location this is fine, and produces better
code than using the address.
The dummy_lock cast prevents GCC from "optimising" the lock by copying
it into a register and using that in the asm. It works because GCC is not
clever enough to optimise a 100-entry array in this way.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/