hal: compile hal_timerSetWakeup only when implemented#763
hal: compile hal_timerSetWakeup only when implemented#763julianuziemblo wants to merge 1 commit into
Conversation
_threads_updateWakeup (the only user of hal_timerSetWakeup) does anything only if hal_timerSetWakeup is implemented to do anything. Else, it just queries the tree for no reason. This commit introduces CPU_SUPPORTS_TIMER_WAKEUP symbol to define _threads_updateWakeup only if the wakeup is suppored to eliminate unnecessary tree searches
edd11ab to
6c15417
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces the CPU_SUPPORTS_TIMER_WAKEUP macro across various hardware abstraction layer (HAL) configurations to indicate whether a specific architecture supports timer-based wakeup functionality. It cleans up the codebase by removing non-functional stubs of hal_timerSetWakeup and uses conditional compilation in hal/timer.h and proc/threads.c to handle architectures without this support. I have no feedback to provide.
|
This change is kinda against our generic guidelines, i.e. only introduce |
Technically there is no other way to avoid "mindless" tree searches, but I get what you mean. Still, I'd argue we should keep this change or a similar one that removes the unneeded action. |
|
_threads_updateWakeup (the only user of hal_timerSetWakeup) does anything only if hal_timerSetWakeup is implemented to do anything. Else, it just queries the tree for no reason. This commit introduces CPU_SUPPORTS_TIMER_WAKEUP symbol to define _threads_updateWakeup only if the wakeup is suppored to eliminate unnecessary tree searches
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment