sched/wdog: Change the return type of wd_gettime from int to sclock_t

to handle 64bits sclock_t correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-05-18 21:58:18 +08:00 committed by Petro Karashchenko
parent 753aa98ca7
commit 5b0b4bd586
3 changed files with 7 additions and 5 deletions

View File

@ -569,8 +569,10 @@ static void governor_timer(int domain)
if (state < PM_SLEEP && !pdom->stay[pdom->state]) if (state < PM_SLEEP && !pdom->stay[pdom->state])
{ {
int delay = pmtick[state] + pdomstate->btime - clock_systime_ticks(); sclock_t delay = pmtick[state] +
int left = wd_gettime(&pdomstate->wdog); pdomstate->btime -
clock_systime_ticks();
sclock_t left = wd_gettime(&pdomstate->wdog);
if (delay <= 0) if (delay <= 0)
{ {

View File

@ -160,7 +160,7 @@ int wd_cancel(FAR struct wdog_s *wdog);
* *
****************************************************************************/ ****************************************************************************/
int wd_gettime(FAR struct wdog_s *wdog); sclock_t wd_gettime(FAR struct wdog_s *wdog);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -50,7 +50,7 @@
* *
****************************************************************************/ ****************************************************************************/
int wd_gettime(FAR struct wdog_s *wdog) sclock_t wd_gettime(FAR struct wdog_s *wdog)
{ {
irqstate_t flags; irqstate_t flags;
@ -64,7 +64,7 @@ int wd_gettime(FAR struct wdog_s *wdog)
*/ */
FAR struct wdog_s *curr; FAR struct wdog_s *curr;
int delay = 0; sclock_t delay = 0;
for (curr = (FAR struct wdog_s *)g_wdactivelist.head; for (curr = (FAR struct wdog_s *)g_wdactivelist.head;
curr != NULL; curr != NULL;