As Weddington, Eric wrote:

> If we do that, we might as well make it a public symbol, yes?:
> #define memory_barrier()  __asm__ __volatile__(""::"memory")

I hesitate to add stuff like that to existing header files.
memory_barrier belongs into the application namespace, so existing
applications could legitimately already use that name (and are likely
doing it in case they really need the functionality).

Would you like _MEMORY_BARRIER() more?  That's in the implementation
namespace.

Likewise, the same goes for using nop(), as tempting as it is.  Again,
_NOP() would be fine, as will __nop().

An alternative is to start a new header file for it, so users who want
these definitions can "opt-in" them.

Another definition that just came to mind: setting the JTD bit, a
timed sequence.  See here:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=553919#553836

for a sample implementation.  I wouldn't see any of the existing
header files where that really fits.  (It needs to be polished up, I
think some controllers use MCUCR, and some use MCUCSR for JTD.)


If we decide for a new header file, how to name it?  <avr/asm.h>?
<avr/misc.h>?

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


_______________________________________________
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to