RTEMS | cpukit: Create DHRL Library for DRAM Latency Mitigation (!1193)
Wayne Thornton (@wmthornton-dev)
gitlab at rtems.org
Wed May 20 20:49:11 UTC 2026
Wayne Thornton commented on a discussion on cpukit/dhrl/dhrl.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1193#note_150619
> + safe_size >>= 1;
> + }
> +
> + dhrl_debug_printk(
> + "\nDetermining DDR Interleave Bit (Testing bits 6 to %u)...\n",
> + max_safe_bit
> + );
> +
> + for ( uint8_t bit = 6; bit <= max_safe_bit; bit++ ) {
> + uintptr_t interleave_mask = ( 1ULL << bit );
> + uintptr_t target_base = (uintptr_t) ctx->active_config.base_memory_region;
> +
> + volatile uint8_t *addr_a = (volatile uint8_t *) ( target_base &
> + ~interleave_mask );
> + volatile uint8_t *addr_b = (volatile uint8_t *) ( target_base |
> + interleave_mask );
I used it out of habit to match the `dhrl_fetch_data` signature, but it's semantically incorrect. I'll remove the `volatile` qualifiers here so they are just standard `uint8_t *`. The `volatile` cast will only be applied at the exact point of the dead-load to prevent compiler optimization.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1193#note_150619
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260520/7202ee6a/attachment-0001.htm>
More information about the bugs
mailing list