1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

10 Commits

Author SHA1 Message Date
Marian Buschsieweke
1879f58512
cpu/atmega_common: Cleanup state flags
- Use one byte of RAM to track both IRQ and UART TX state
- Fix incorrect use of volatile
2020-02-06 15:41:41 +01:00
Marian Buschsieweke
2b1bee750a
cpu/atmega_common: Stop using reserved names
Names with two leading underscores are reserved in any context of the c
 standard, and thus must not be used. This ATmega platform used it however for
 defining internal stuff. This commit fixes this.
2019-11-23 11:56:11 +01:00
Marian Buschsieweke
70cf9b34c7
cpu/atmega_common: Add barriers to irq_*()
To prevent reordering of accesses to the interrupt control register when link
time optimization (LTO) is enabled, memory barriers are needed. Without LTO
calls to the external functions irq_disable(), irq_restore(), irq_enable() and
irq_is_in() have the same affect as compiler barriers, as the compiler is unable
to prove that reordering of memory accesses is safe (from a single-threaded
point of view). With LTO the compiler can easily prove that reordering is safe
from a single-threaded point of view: Thus, the compiler may move memory
accesses wrapped in irq_disable(), irq_restore() across those calls.

The memory barriers will have no effect on non-LTO builds.
2019-04-25 17:42:15 +02:00
Marian Buschsieweke
48fabca38d
cpu/atmega_common: Fix return value of irq_enable
Citing the doc of irq_enable():

    @return Previous value of status register. [...]

On atmega however the new value of the status register is returned, not the one
prior to enabling interrupts.
2019-04-25 17:42:02 +02:00
Josarn
2ef1001ec7 cpu/atmega_common: use __temp_reg__ 2018-03-30 10:22:32 +02:00
86665b71bf cpu: adapt to COREIF_NG removal 2017-11-16 14:40:16 +01:00
c3f7186d4e unify usage of inline assembly 2016-03-31 22:23:35 +02:00
7fcb2b718e cpu: atmega: implement irq_arch_in 2015-09-14 10:47:28 +02:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
Hinnerk van Bruinehsen
a6b77b4745 cpu: atmega_common: Initial import 2014-08-27 16:22:48 +02:00