Skip to content

Commit

Permalink
Documentation: teaching: labs: interrupts: add BTS pseudocode
Browse files Browse the repository at this point in the history
Add pseudocode that explains the BTS instruction.

Signed-off-by: Octavian Purdila <tavi@cs.pub.ro>
  • Loading branch information
tavip committed Mar 30, 2020
1 parent 5027261 commit 98debdc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Documentation/teaching/lectures/smp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,13 @@ parallelism. This is a typical spin lock implementation:
spin_unlock:
mov [my_lock], 0

**bts** - bit test and set; it copies the src bit from the dts
memory address to the carry flag and then sets it
**bts dts, src** - bit test and set; it copies the src bit from the dts
memory address to the carry flag and then sets it:

.. code-block:: c
CF <- dts[src]
dts[src] <- 1
As it can be seen, the spin lock uses an atomic instruction to make
Expand Down

0 comments on commit 98debdc

Please sign in to comment.