mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Update to use 64-bit timer when available
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* libc/wqueue/work_process.c
|
||||
*
|
||||
* Copyright (C) 2009-2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -72,22 +72,6 @@
|
||||
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -109,17 +93,17 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void work_process(FAR struct kwork_wqueue_s *wqueue, uint32_t period, int wndx)
|
||||
void work_process(FAR struct kwork_wqueue_s *wqueue, systime_t period, int wndx)
|
||||
{
|
||||
volatile FAR struct work_s *work;
|
||||
worker_t worker;
|
||||
irqstate_t flags;
|
||||
FAR void *arg;
|
||||
uint32_t elapsed;
|
||||
uint32_t remaining;
|
||||
uint32_t stick;
|
||||
uint32_t ctick;
|
||||
uint32_t next;
|
||||
systime_t elapsed;
|
||||
systime_t remaining;
|
||||
systime_t stick;
|
||||
systime_t ctick;
|
||||
systime_t next;
|
||||
|
||||
/* Then process queued work. We need to keep interrupts disabled while
|
||||
* we process items in the work list.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* sched/wqueue/wqueue.h
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -46,6 +46,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <queue.h>
|
||||
|
||||
#include <nuttx/clock.h>
|
||||
|
||||
#ifdef CONFIG_SCHED_WORKQUEUE
|
||||
|
||||
/****************************************************************************
|
||||
@@ -72,7 +74,7 @@ struct kworker_s
|
||||
|
||||
struct kwork_wqueue_s
|
||||
{
|
||||
uint32_t delay; /* Delay between polling cycles (ticks) */
|
||||
systime_t delay; /* Delay between polling cycles (ticks) */
|
||||
struct dq_queue_s q; /* The queue of pending work */
|
||||
struct kworker_s worker[1]; /* Describes a worker thread */
|
||||
};
|
||||
@@ -84,7 +86,7 @@ struct kwork_wqueue_s
|
||||
#ifdef CONFIG_SCHED_HPWORK
|
||||
struct hp_wqueue_s
|
||||
{
|
||||
uint32_t delay; /* Delay between polling cycles (ticks) */
|
||||
systime_t delay; /* Delay between polling cycles (ticks) */
|
||||
struct dq_queue_s q; /* The queue of pending work */
|
||||
struct kworker_s worker[1]; /* Describes the single high priority worker */
|
||||
};
|
||||
@@ -97,7 +99,7 @@ struct hp_wqueue_s
|
||||
#ifdef CONFIG_SCHED_LPWORK
|
||||
struct lp_wqueue_s
|
||||
{
|
||||
uint32_t delay; /* Delay between polling cycles (ticks) */
|
||||
systime_t delay; /* Delay between polling cycles (ticks) */
|
||||
struct dq_queue_s q; /* The queue of pending work */
|
||||
|
||||
/* Describes each thread in the low priority queue's thread pool */
|
||||
@@ -183,7 +185,7 @@ int work_lpstart(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void work_process(FAR struct kwork_wqueue_s *wqueue, uint32_t period, int wndx);
|
||||
void work_process(FAR struct kwork_wqueue_s *wqueue, systime_t period, int wndx);
|
||||
|
||||
#endif /* CONFIG_SCHED_WORKQUEUE */
|
||||
#endif /* __SCHED_WQUEUE_WQUEUE_H */
|
||||
|
||||
Reference in New Issue
Block a user