Fix-Point opened a new pull request, #22492:
URL: https://github.com/apache/nuttx/pull/22492

   ## Summary
   
   Part 1 of porting the hrtimer-based timer/watchdog series: enable 
CONFIG_HRTIMER unconditionally and convert the remaining wdog, workqueue and 
tickless scheduler paths from the legacy tick-based watchdog to hrtimer.
   
   - `hrtimer: introduce hrtimer_is_active()`: provide a predicate for "is the 
timer armed" based on the remaining time reported by hrtimer_gettime(), as 
needed by the watchdog upper half status query.
   - `sched: Remove conditional compilation for HRTIMER.`: drop the 
CONFIG_HRTIMER Kconfig gate; the legacy tick-based watchdog code is removed and 
wd_timer_start() is unified on hrtimer.
   - `sched/wdog: Fix Coverity CID 3933988 unchecked return value`: wrap 
hrtimer_start() in wd_timer_start() with DEBUGVERIFY().
   - `sched/wdog: Inline wdog interfaces with NULL checks`: move NULL pointer 
checks from .c files to inline wrappers 
(wd_start_abstick_internal/wd_cancel_internal + inline 
wd_start/wd_start_abstick/wd_cancel), so the compiler can optimize away 
redundant checks; add DEBUGASSERT for consistency.
   - `sched/tickless: Remove tick-based alarm/timer interfaces`: delete the 
up_alarm_tick_start/up_alarm_tick_cancel/up_timer_tick_start/up_timer_tick_cancel
 wrappers (dead code, only converted ticks to timespec); replace the NULL check 
in up_timer_getmask with DEBUGASSERT.
   - `sched/wqueue: Add hrtimer support for workqueue`: use a hrtimer in 
kwork_wqueue_s (work_timer_reset/work_timer_expired) and limit the queue delay 
to WQUEUE_MAX_DELAY.
   
   ## Impact
   
   - Kconfig: CONFIG_HRTIMER becomes unconditional; any board previously 
relying on `#ifdef CONFIG_HRTIMER` to compile out hrtimer code now always 
builds it.
   - APIs removed: 
up_alarm_tick_start/up_alarm_tick_cancel/up_timer_tick_start/up_timer_tick_cancel
 (no in-tree callers).
   - New inline API: wd_start_abstick_internal/wd_cancel_internal (internal), 
wd_start_abstick/wd_cancel/wd_start remain public with NULL checks inline.
   - Delay range checks in wd_start/wd_start_next/work_queue now use a single 
(uint64_t) comparison; clock_t is 64-bit signed, a negative delay converts to a 
huge unsigned value and is rejected by the upper-bound check.
   - wd_timer_start() now takes one argument (clock_t tick); the in_expiration 
parameter is gone with the unconditional hrtimer path.
   
   ## Testing
   
   - rv-virt:nsh64 (CONFIG_SCHED_WORKQUEUE=y) build: 0 errors, 0 warnings.
   - rv-virt:nsh64 + CONFIG_SCHED_TICKLESS=y build: 0 errors, 0 warnings.
   - wdog/wqueue objects force-recompiled to confirm the changed code is 
instantiated.
   - Oscillator/ostest: wdog.c negative-delay assertion path verified by the 
restored `(uint64_t)delay <= WDOG_MAX_DELAY` check.
   - checkpatch (`git diff | tools/checkpatch.sh -`): 0 errors on all six 
commits.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to