Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:0xAX/linux-insides
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAX committed Aug 31, 2016
2 parents c300e19 + d626d5c commit 8474b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DataStructures/bitmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static inline void __clear_bit(long nr, volatile unsigned long *addr)
}
```
Yes. As we see, it takes the same set of arguments and contains very similar block of inline assembler. It just uses the [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) instruction instead of `bts`. As we can understand form the function's name, it clears a given bit by the given address. The `btr` instruction acts like `btr`. This instruction also selects a given bit which is specified in the first operand, stores its value in the `CF` flag register and clears this bit in the given bit array which is specified with second operand.
Yes. As we see, it takes the same set of arguments and contains very similar block of inline assembler. It just uses the [btr](http://x86.renejeschke.de/html/file_module_x86_id_24.html) instruction instead of `bts`. As we can understand form the function's name, it clears a given bit by the given address. The `btr` instruction acts like `bts`. This instruction also selects a given bit which is specified in the first operand, stores its value in the `CF` flag register and clears this bit in the given bit array which is specified with second operand.
The atomic variant of the `__clear_bit` is `clear_bit`:
Expand Down Expand Up @@ -283,7 +283,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr)
}
```
It is similar on `set_bit` function, but also has two differences. The first difference is `xor` operation instead of `or` and the second is `bts` instead of `bts`.
It is similar on `set_bit` function, but also has two differences. The first difference is `xor` operation instead of `or` and the second is `btc` instead of `bts`.
For this moment we know the most important architecture-specific operations with bit arrays. Time to look at generic bitmap API.
Expand Down

0 comments on commit 8474b88

Please sign in to comment.