• Sandrine Bailleux's avatar
    Bug fix in the SP804 dual timer driver · 54312877
    Sandrine Bailleux authored
    The generic delay timer driver expects a pointer to a timer_ops_t
    structure containing the specific timer driver information. It
    doesn't make a copy of the structure, instead it just keeps the
    pointer. Therefore, this pointer must remain valid over time.
    
    The SP804 driver doesn't satisfy this requirement. The
    sp804_timer_init() macro creates a temporary instanciation of the
    timer_ops_t structure on the fly and passes it to the generic
    delay timer. When this temporary instanciation gets deallocated,
    the generic delay timer is left with a pointer to invalid data.
    
    This patch fixes this bug by statically allocating the SP804
    timer_ops_t structure.
    
    Change-Id: I8fbf75907583aef06701e3fd9fabe0b2c9bc95bf
    54312877
sp804_delay_timer.h 2.05 KB