Цитата(adnega @ Jul 1 2015, 09:03)

Мне всегда казалось, что запись в bit-band обеспечивает атомарность. Неужели это не так?
Мне тоже. Почему то в programming manual об этом ничего не нашел, перечитал Yiu J., The Definitive Guide to the ARM Cortex-M3
One of the most important advantages or properties of a bit-band operation is that it is atomic. ...
With the Cortex-M3 bit-band feature, this kind of race condition can be avoided because the READ-
MODIFY-WRITE is carried out at the hardware level and is atomic (the two transfers cannot be pulled
apart) and interrupts cannot take place between them.
Цитата
Как понимать "read-modify-write"? Это по сколько бит? По 1/8/16/32?
Нашел такое:
Bit band accesses can use byte, halfword, or word transfers. The bit band transfer size matches the transfer size of the instruction making the bit band access.
и такое
For write operations, the written bit data are shifted to the required bit position, and a READ-MODIFY-WRITE is performed.
Цитата
Как быть с регистрами, где чтение имеет побочное действие?
А при чтении тоже считывается не один бит?
For read operations, the word is read and the chosen bit location is shifted to the LSB of the read return data.
Получается, что засада может быть с регистрами вида rc_w0 и rc_w1 (для которых собственно битбанд и не нужен), на что я и напоролся