You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current firmware, framebuffer is declared as a pointer to volatile unsigned int which is unnecessary at some places. In current firmware volatile is used in defining framebuffer pointer in hdmi_in, pattern and heartbeat files. We should clean up unnecessary usage of volatile in existing C firmware.
volatile is a C directive used when we want out memory accesses to ordered as specified in the code sequence and not subject to possible reordering by compiler optimizations. We should declare framebuffer variable as volatile when the DMA can be writing to the framebuffer locations at the same time the CPU is accessing/writing to it. This ensures that the two reads from the same memory location are guaranteed to return the same value.
This is added as per discussion with @shenki and @mithro from irc logs here.
Reading material about memory ordering.
The text was updated successfully, but these errors were encountered:
In the current firmware, framebuffer is declared as a pointer to
volatile unsigned int
which is unnecessary at some places. In current firmwarevolatile
is used in defining framebuffer pointer in hdmi_in, pattern and heartbeat files. We should clean up unnecessary usage of volatile in existing C firmware.volatile definitions in hdmi_in0.c
volatile definitions in pattern.c
volatile definitions in heartbeat.c
volatile
is a C directive used when we want out memory accesses to ordered as specified in the code sequence and not subject to possible reordering by compiler optimizations. We should declare framebuffer variable asvolatile
when the DMA can be writing to the framebuffer locations at the same time the CPU is accessing/writing to it. This ensures that the two reads from the same memory location are guaranteed to return the same value.This is added as per discussion with @shenki and @mithro from irc logs here.
Reading material about memory ordering.
The text was updated successfully, but these errors were encountered: