Boolean TestAndSet(
UInt32 bit
UInt8 *startAddress);
Boolean TestAndClear(
UInt32 bit
UInt8 *startAddress);
TestAndSet sets and TestAndClear clears a single bit in a byte at a specified address. They return true if the bit was already set or cleared respectively and false otherwise.
TestAndSet and TestAndClear may be called from task level, secondary interrupt level, or hardware interrupt level.