RTEMS | cpukit: Create DHRL Library for DRAM Latency Mitigation (!1193)
Gedare Bloom (@gedare)
gitlab at rtems.org
Fri May 22 15:00:22 UTC 2026
Gedare Bloom started a new discussion on cpukit/dhrl/dhrl.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1193#note_150841
> + }
> +
> + /* Allocate internal context via malloc */
> + ctx = (struct rtems_dhrl_control *) malloc(
> + sizeof( struct rtems_dhrl_control )
> + );
> + if ( ctx == NULL ) {
> + return RTEMS_NO_MEMORY;
> + }
> +
> + /* Initialize structure to prevent undefined behavior on failure checks */
> + ctx->worker_a_id = RTEMS_ID_NONE;
> + ctx->worker_b_id = RTEMS_ID_NONE;
> +
> + /* Embed the context back into the user's config structure */
> + config->ctx = ctx;
Should you check that `config->ctx == NULL` and make that a requirement of the API? Just from a safety perspective, how do you check/prevent someone from calling `rtems_dhrl_init` twice?
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1193#note_150841
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/20260522/6c2cb37f/attachment-0001.htm>
More information about the bugs
mailing list