avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is fault


From: anonymous
Subject: [avr-libc-dev] [bug #14616] definition of sei() in interrupts.h is faulty
Date: Thu, 22 Sep 2005 15:00:01 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

URL:
  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14616>

                 Summary: definition of sei() in interrupts.h is faulty
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Do 22.09.2005 um 14:59
                Category: Header
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
        Percent Complete: 0%
        Originator Email: address@hidden
             Open/Closed: Open

    _______________________________________________________

Details:

Hi,

we need to change the definition of the sei macro in interrupts.h such that
it reads

#define sei()  __asm__ __volatile__ ("sei" : : : "memory")

instead of 

#define sei()  __asm__ __volatile__ ("sei" ::)

I just had a situation where protecting an assignment by;

cli ();
uint16_t_variable_in_memory = value;
sei ();

did not work since avr-gcc did interchange the assignment and the sei()
because it did not know anything on the possible side-effects of sei()!

For the same reason I think that we should add a macro

#define write_sreg(value)  __asm__ __volatile__ ("out __SREG__,%0" : : "r"
(value) : "memory")

that signalizes gcc that writing the SREG could have possible side effects on
the memory!

Yours,

Bjoern



    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
bjoern --PUNKT-- haase --AT-- de --PUNKT-- bosch --PUNKT-- com | Originator
Email




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14616>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]