mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:
sched: Rename all use of system_t to clock_t.
syscall: Rename all use of system_t to clock_t.
net: Rename all use of system_t to clock_t.
libs: Rename all use of system_t to clock_t.
fs: Rename all use of system_t to clock_t.
drivers: Rename all use of system_t to clock_t.
arch: Rename all use of system_t to clock_t.
include: Remove definition of systime_t; rename all use of system_t to clock_t.
This commit is contained in:
@@ -205,7 +205,7 @@ struct efm32_trace_s
|
||||
uint32_t i2c_reg_state; /* I2C register I2Cx_STATES */
|
||||
uint32_t i2c_reg_if; /* I2C register I2Cx_IF */
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
int dcnt; /* Interrupt count when status change */
|
||||
};
|
||||
|
||||
@@ -254,7 +254,7 @@ struct efm32_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -610,9 +610,9 @@ static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int efm32_i2c_sem_waitdone(FAR struct efm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
|
||||
/* Get the timeout value */
|
||||
|
||||
|
||||
@@ -1681,8 +1681,8 @@ static int efm32_ctrl_sendsetup(FAR struct efm32_usbhost_s *priv,
|
||||
FAR const struct usb_ctrlreq_s *req)
|
||||
{
|
||||
FAR struct efm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
@@ -1911,8 +1911,8 @@ static ssize_t efm32_in_transfer(FAR struct efm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct efm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop until the transfer completes (i.e., buflen is decremented to zero)
|
||||
@@ -2170,8 +2170,8 @@ static ssize_t efm32_out_transfer(FAR struct efm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct efm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
size_t xfrlen;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
@@ -4380,8 +4380,8 @@ static int efm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct efm32_usbhost_s *priv = (FAR struct efm32_usbhost_s *)drvr;
|
||||
FAR struct efm32_ctrlinfo_s *ep0info = (FAR struct efm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
@@ -4465,8 +4465,8 @@ static int efm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct efm32_usbhost_s *priv = (FAR struct efm32_usbhost_s *)drvr;
|
||||
FAR struct efm32_ctrlinfo_s *ep0info = (FAR struct efm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -1744,9 +1744,9 @@ static int kinetis_attach(FAR struct sdio_dev_s *dev)
|
||||
static int kinetis_sendcmd(FAR struct sdio_dev_s *dev, uint32_t cmd,
|
||||
uint32_t arg)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
uint32_t regval;
|
||||
uint32_t cmdidx;
|
||||
|
||||
@@ -2066,9 +2066,9 @@ static int kinetis_cancel(FAR struct sdio_dev_s *dev)
|
||||
|
||||
static int kinetis_waitresponse(FAR struct sdio_dev_s *dev, uint32_t cmd)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
uint32_t errors;
|
||||
int ret = OK;
|
||||
|
||||
|
||||
@@ -352,8 +352,8 @@ static inline int lc823450_i2c_sem_waitdone(FAR struct lc823450_i2c_priv_s *priv
|
||||
static inline int lc823450_i2c_sem_waitdone(FAR struct lc823450_i2c_priv_s *priv)
|
||||
{
|
||||
uint32_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
|
||||
@@ -373,12 +373,12 @@ uint64_t sddep_set_timeout(uint64_t t)
|
||||
SINT_T sddep_wait_status(UI_32 req_status, UI_32 *status,
|
||||
struct SdDrCfg_s *cfg)
|
||||
{
|
||||
systime_t tick0 = clock_systimer();
|
||||
clock_t tick0 = clock_systimer();
|
||||
int ret = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
systime_t tick1 = clock_systimer();
|
||||
clock_t tick1 = clock_systimer();
|
||||
*status = sdif_get_status(cfg->regbase);
|
||||
if (req_status & (*status))
|
||||
{
|
||||
|
||||
@@ -217,7 +217,7 @@ struct stm32_trace_s
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
enum stm32_intstate_e event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -259,7 +259,7 @@ struct stm32_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -646,9 +646,9 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
@@ -705,9 +705,9 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
systime_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
clock_t timeout;
|
||||
uint32_t cr1;
|
||||
uint32_t sr1;
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ struct stm32_trace_s
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
uint32_t event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -289,7 +289,7 @@ struct stm32_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -655,9 +655,9 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
#else
|
||||
static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
@@ -714,9 +714,9 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
systime_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
clock_t timeout;
|
||||
uint32_t cr1;
|
||||
uint32_t sr1;
|
||||
|
||||
|
||||
@@ -1607,8 +1607,8 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
FAR const struct usb_ctrlreq_s *req)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
@@ -1837,7 +1837,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
clock_t start;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
|
||||
@@ -1909,7 +1909,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
systime_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2195,8 +2195,8 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
size_t xfrlen;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
@@ -4410,8 +4410,8 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
@@ -4495,8 +4495,8 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -1612,8 +1612,8 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
FAR const struct usb_ctrlreq_s *req)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
@@ -1842,7 +1842,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
clock_t start;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
|
||||
@@ -1914,7 +1914,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
systime_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2200,8 +2200,8 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
size_t xfrlen;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
@@ -4415,8 +4415,8 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
@@ -4500,8 +4500,8 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ struct stm32_trace_s
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
enum stm32_intstate_e event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -252,7 +252,7 @@ struct stm32_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -680,9 +680,9 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
@@ -820,9 +820,9 @@ stm32_i2c_disable_autoend(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
systime_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
clock_t timeout;
|
||||
uint32_t cr;
|
||||
uint32_t sr;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ struct stm32_trace_s
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
enum stm32_intstate_e event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -275,7 +275,7 @@ struct stm32_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -701,9 +701,9 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
@@ -760,9 +760,9 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
||||
|
||||
static inline void stm32_i2c_sem_waitstop(FAR struct stm32_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
systime_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
clock_t timeout;
|
||||
uint32_t cr1;
|
||||
uint32_t sr1;
|
||||
|
||||
|
||||
@@ -199,11 +199,11 @@ enum stm32f0_trace_e
|
||||
|
||||
struct stm32f0_trace_s
|
||||
{
|
||||
uint32_t status; /* I2C 32-bit SR2|SR1 status */
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
uint32_t status; /* I2C 32-bit SR2|SR1 status */
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
enum stm32f0_intstate_e event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -245,7 +245,7 @@ struct stm32f0_i2c_priv_s
|
||||
|
||||
#ifdef CONFIG_I2C_TRACE
|
||||
int tndx; /* Trace array index */
|
||||
systime_t start_time; /* Time when the trace was started */
|
||||
clock_t start_time; /* Time when the trace was started */
|
||||
|
||||
/* The actual trace data */
|
||||
|
||||
@@ -622,9 +622,9 @@ static inline int stm32f0_i2c_sem_waitdone(FAR struct stm32f0_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int stm32f0_i2c_sem_waitdone(FAR struct stm32f0_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Get the timeout value */
|
||||
@@ -762,9 +762,9 @@ stm32f0_i2c_disable_autoend(FAR struct stm32f0_i2c_priv_s *priv)
|
||||
|
||||
static inline void stm32f0_i2c_sem_waitstop(FAR struct stm32f0_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
systime_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
clock_t timeout;
|
||||
uint32_t cr;
|
||||
uint32_t sr;
|
||||
|
||||
|
||||
@@ -1607,8 +1607,8 @@ static int stm32_ctrl_sendsetup(FAR struct stm32_usbhost_s *priv,
|
||||
FAR const struct usb_ctrlreq_s *req)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
@@ -1837,7 +1837,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
clock_t start;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
|
||||
@@ -1909,7 +1909,7 @@ static ssize_t stm32_in_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
systime_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
if (elapsed >= STM32_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2195,8 +2195,8 @@ static ssize_t stm32_out_transfer(FAR struct stm32_usbhost_s *priv, int chidx,
|
||||
FAR uint8_t *buffer, size_t buflen)
|
||||
{
|
||||
FAR struct stm32_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
size_t xfrlen;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
@@ -4409,8 +4409,8 @@ static int stm32_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
@@ -4494,8 +4494,8 @@ static int stm32_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32_usbhost_s *priv = (FAR struct stm32_usbhost_s *)drvr;
|
||||
FAR struct stm32_ctrlinfo_s *ep0info = (FAR struct stm32_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -1610,8 +1610,8 @@ static int stm32l4_ctrl_sendsetup(FAR struct stm32l4_usbhost_s *priv,
|
||||
FAR const struct usb_ctrlreq_s *req)
|
||||
{
|
||||
FAR struct stm32l4_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Loop while the device reports NAK (and a timeout is not exceeded */
|
||||
@@ -1841,7 +1841,7 @@ static ssize_t stm32l4_in_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
size_t buflen)
|
||||
{
|
||||
FAR struct stm32l4_chan_s *chan;
|
||||
systime_t start;
|
||||
clock_t start;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
|
||||
@@ -1913,7 +1913,7 @@ static ssize_t stm32l4_in_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
* if not then try again.
|
||||
*/
|
||||
|
||||
systime_t elapsed = clock_systimer() - start;
|
||||
clock_t elapsed = clock_systimer() - start;
|
||||
if (elapsed >= STM32L4_DATANAK_DELAY)
|
||||
{
|
||||
/* Timeout out... break out returning the NAK as
|
||||
@@ -2200,8 +2200,8 @@ static ssize_t stm32l4_out_transfer(FAR struct stm32l4_usbhost_s *priv,
|
||||
size_t buflen)
|
||||
{
|
||||
FAR struct stm32l4_chan_s *chan;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
size_t xfrlen;
|
||||
ssize_t xfrd;
|
||||
int ret;
|
||||
@@ -4415,8 +4415,8 @@ static int stm32l4_ctrlin(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32l4_usbhost_s *priv = (FAR struct stm32l4_usbhost_s *)drvr;
|
||||
FAR struct stm32l4_ctrlinfo_s *ep0info = (FAR struct stm32l4_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
@@ -4500,8 +4500,8 @@ static int stm32l4_ctrlout(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep0,
|
||||
FAR struct stm32l4_usbhost_s *priv = (FAR struct stm32l4_usbhost_s *)drvr;
|
||||
FAR struct stm32l4_ctrlinfo_s *ep0info = (FAR struct stm32l4_ctrlinfo_s *)ep0;
|
||||
uint16_t buflen;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int retries;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ struct tiva_trace_s
|
||||
uint32_t count; /* Interrupt count when status change */
|
||||
enum tiva_trace_e event; /* Last event that occurred with this status */
|
||||
uint32_t parm; /* Parameter associated with the event */
|
||||
systime_t time; /* First of event or first status */
|
||||
clock_t time; /* First of event or first status */
|
||||
};
|
||||
|
||||
/* I2C Device hardware configuration */
|
||||
@@ -235,7 +235,7 @@ struct tiva_i2c_priv_s
|
||||
|
||||
int tndx; /* Trace array index */
|
||||
int tcount; /* Number of events with this status */
|
||||
systime_t ttime; /* Time when the trace was started */
|
||||
clock_t ttime; /* Time when the trace was started */
|
||||
uint32_t tstatus; /* Last status read */
|
||||
|
||||
/* The actual trace data */
|
||||
@@ -786,9 +786,9 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
||||
#else
|
||||
static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv)
|
||||
{
|
||||
systime_t timeout;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t timeout;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
uint32_t status;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ static int sim_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
{
|
||||
FAR struct sim_oneshot_lowerhalf_s *priv =
|
||||
(FAR struct sim_oneshot_lowerhalf_s *)lower;
|
||||
systime_t ticks;
|
||||
clock_t ticks;
|
||||
int64_t nsec;
|
||||
|
||||
DEBUGASSERT(priv != NULL && callback != NULL && ts != NULL);
|
||||
@@ -212,7 +212,7 @@ static int sim_start(FAR struct oneshot_lowerhalf_s *lower,
|
||||
|
||||
nsec = (int64_t)ts->tv_sec * NSEC_PER_SEC +
|
||||
(int64_t)ts->tv_nsec;
|
||||
ticks = (systime_t)((nsec + NSEC_PER_TICK - 1) / NSEC_PER_TICK);
|
||||
ticks = (clock_t)((nsec + NSEC_PER_TICK - 1) / NSEC_PER_TICK);
|
||||
|
||||
/* Save the callback information and start the timer */
|
||||
|
||||
|
||||
+2
-2
@@ -169,8 +169,8 @@ static const struct file_operations g_ft80x_fops =
|
||||
static int ft80x_fade(FAR struct ft80x_dev_s *priv,
|
||||
FAR const struct ft80x_fade_s *fade)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int32_t delay;
|
||||
int32_t duty;
|
||||
int16_t endduty;
|
||||
|
||||
@@ -1126,8 +1126,8 @@ static int mmcsd_eventwait(FAR struct mmcsd_state_s *priv,
|
||||
|
||||
static int mmcsd_transferready(FAR struct mmcsd_state_s *priv)
|
||||
{
|
||||
systime_t starttime;
|
||||
systime_t elapsed;
|
||||
clock_t starttime;
|
||||
clock_t elapsed;
|
||||
uint32_t r1;
|
||||
int ret;
|
||||
|
||||
@@ -2767,9 +2767,9 @@ static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv)
|
||||
{
|
||||
uint32_t response;
|
||||
uint32_t sdcapacity = MMCSD_ACMD41_STDCAPACITY;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
int ret;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
/* Assume failure to identify the card */
|
||||
|
||||
|
||||
@@ -426,8 +426,8 @@ static int mmcsd_waitready(FAR struct mmcsd_slot_s *slot)
|
||||
{
|
||||
FAR struct spi_dev_s *spi = slot->spi;
|
||||
uint8_t response;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
|
||||
/* Wait until the card is no longer busy (up to 500MS) */
|
||||
|
||||
@@ -531,8 +531,8 @@ static uint32_t mmcsd_sendcmd(FAR struct mmcsd_slot_s *slot,
|
||||
case MMCSD_CMDRESP_R1B:
|
||||
{
|
||||
uint32_t busy = 0;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
|
||||
start = START_TIME;
|
||||
do
|
||||
@@ -944,8 +944,8 @@ static int mmcsd_recvblock(FAR struct mmcsd_slot_s *slot, uint8_t *buffer,
|
||||
int nbytes)
|
||||
{
|
||||
FAR struct spi_dev_s *spi = slot->spi;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
uint8_t token;
|
||||
|
||||
/* Wait up to the maximum to receive a valid data token. taccess is the
|
||||
@@ -1560,8 +1560,8 @@ static int mmcsd_mediainitialize(FAR struct mmcsd_slot_s *slot)
|
||||
FAR struct spi_dev_s *spi = slot->spi;
|
||||
uint8_t csd[16];
|
||||
uint32_t result = MMCSD_SPIR1_IDLESTATE;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
@@ -418,8 +418,8 @@ static int sst39vf_chiperase(FAR struct sst39vf_dev_s *priv)
|
||||
{
|
||||
#if 0
|
||||
struct sst39vf_wrinfo_s wrinfo;
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
#endif
|
||||
|
||||
/* Send the sequence to erase the chip */
|
||||
@@ -489,8 +489,8 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
{
|
||||
struct sst39vf_wrinfo_s wrinfo;
|
||||
#if 0
|
||||
systime_t start;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t elapsed;
|
||||
#endif
|
||||
|
||||
/* Set up the sector address */
|
||||
|
||||
@@ -745,9 +745,9 @@ static void enc_wrbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
|
||||
static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
|
||||
uint8_t bits, uint8_t value)
|
||||
{
|
||||
systime_t start = clock_systimer();
|
||||
systime_t elapsed;
|
||||
uint8_t rddata;
|
||||
clock_t start = clock_systimer();
|
||||
clock_t elapsed;
|
||||
uint8_t rddata;
|
||||
|
||||
/* Loop until the exit condition is met */
|
||||
|
||||
|
||||
@@ -640,8 +640,8 @@ static void enc_wrreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
|
||||
static int enc_waitreg(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
|
||||
uint16_t bits, uint16_t value)
|
||||
{
|
||||
systime_t start = clock_systimer();
|
||||
systime_t elapsed;
|
||||
clock_t start = clock_systimer();
|
||||
clock_t elapsed;
|
||||
uint16_t rddata;
|
||||
|
||||
/* Loop until the exit condition is met */
|
||||
|
||||
+2
-2
@@ -433,8 +433,8 @@ static void slip_txtask(int argc, FAR char *argv[])
|
||||
{
|
||||
FAR struct slip_driver_s *priv;
|
||||
unsigned int index = *(argv[1]) - '0';
|
||||
systime_t start_ticks;
|
||||
systime_t now_ticks;
|
||||
clock_t start_ticks;
|
||||
clock_t now_ticks;
|
||||
unsigned int hsec;
|
||||
|
||||
nerr("index: %d\n", index);
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ struct pm_domain_s
|
||||
|
||||
/* stime - The time (in ticks) at the start of the current time slice */
|
||||
|
||||
systime_t stime;
|
||||
clock_t stime;
|
||||
};
|
||||
|
||||
/* This structure encapsulates all of the global data used by the PM module */
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
void pm_activity(int domain, int priority)
|
||||
{
|
||||
FAR struct pm_domain_s *pdom;
|
||||
systime_t now;
|
||||
clock_t now;
|
||||
uint32_t accum;
|
||||
irqstate_t flags;
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
enum pm_state_e pm_checkstate(int domain)
|
||||
{
|
||||
FAR struct pm_domain_s *pdom;
|
||||
systime_t now;
|
||||
clock_t now;
|
||||
irqstate_t flags;
|
||||
|
||||
/* Get a convenience pointer to minimize all of the indexing */
|
||||
|
||||
@@ -110,7 +110,7 @@ static void uart_pollnotify(FAR uart_dev_t *dev, pollevent_t eventset);
|
||||
static int uart_putxmitchar(FAR uart_dev_t *dev, int ch, bool oktoblock);
|
||||
static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer,
|
||||
size_t buflen);
|
||||
static int uart_tcdrain(FAR uart_dev_t *dev, systime_t timeout);
|
||||
static int uart_tcdrain(FAR uart_dev_t *dev, clock_t timeout);
|
||||
|
||||
/* Character driver methods */
|
||||
|
||||
@@ -397,7 +397,7 @@ static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer,
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
static int uart_tcdrain(FAR uart_dev_t *dev, systime_t timeout)
|
||||
static int uart_tcdrain(FAR uart_dev_t *dev, clock_t timeout)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -412,7 +412,7 @@ static int uart_tcdrain(FAR uart_dev_t *dev, systime_t timeout)
|
||||
if (ret >= 0)
|
||||
{
|
||||
irqstate_t flags;
|
||||
systime_t start;
|
||||
clock_t start;
|
||||
|
||||
/* Trigger emission to flush the contents of the tx buffer */
|
||||
|
||||
@@ -487,7 +487,7 @@ static int uart_tcdrain(FAR uart_dev_t *dev, systime_t timeout)
|
||||
{
|
||||
while (!uart_txempty(dev))
|
||||
{
|
||||
systime_t elapsed;
|
||||
clock_t elapsed;
|
||||
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
nxsig_usleep(POLL_DELAY_USEC);
|
||||
|
||||
@@ -640,9 +640,9 @@ int spirit_update_status(FAR struct spirit_library_s *spirit)
|
||||
int spirit_waitstatus(FAR struct spirit_library_s *spirit,
|
||||
enum spirit_state_e state, unsigned int msec)
|
||||
{
|
||||
systime_t start;
|
||||
systime_t ticks;
|
||||
systime_t elapsed;
|
||||
clock_t start;
|
||||
clock_t ticks;
|
||||
clock_t elapsed;
|
||||
int ret;
|
||||
|
||||
#ifdef CONFIG_DEBUG_SPI_INFO
|
||||
@@ -664,7 +664,7 @@ int spirit_waitstatus(FAR struct spirit_library_s *spirit,
|
||||
#if (MSEC_PER_TICK * USEC_PER_MSEC) == USEC_PER_TICK
|
||||
ticks = (msec + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK;
|
||||
#else
|
||||
ticks = ((systime_t)msec * USEC_PER_MSEC + (USEC_PER_TICK - 1)) /
|
||||
ticks = ((clock_t)msec * USEC_PER_MSEC + (USEC_PER_TICK - 1)) /
|
||||
USEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t linesize;
|
||||
off_t offset;
|
||||
ssize_t ret;
|
||||
systime_t ticktime;
|
||||
clock_t ticktime;
|
||||
|
||||
#if defined(CONFIG_HAVE_DOUBLE) && defined(CONFIG_LIBC_FLOATINGPOINT)
|
||||
double now;
|
||||
|
||||
+1
-1
@@ -408,7 +408,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
||||
}
|
||||
else if (timeout > 0)
|
||||
{
|
||||
systime_t ticks;
|
||||
clock_t ticks;
|
||||
|
||||
/* "Implementations may place limitations on the granularity of
|
||||
* timeout intervals. If the requested timeout interval requires
|
||||
|
||||
+11
-13
@@ -43,8 +43,10 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -215,6 +217,7 @@
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* This structure is used to report CPU usage for a particular thread */
|
||||
|
||||
#ifdef CONFIG_SCHED_CPULOAD
|
||||
@@ -225,20 +228,15 @@ struct cpuload_s
|
||||
};
|
||||
#endif
|
||||
|
||||
/* This type is the natural with of the system timer */
|
||||
/* This non-standard type used to hold relative clock ticks that may take
|
||||
* negative values. Because of its non-portable nature the type sclock_t
|
||||
* should be used only within the OS proper and not by portable applications.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef uint64_t systime_t;
|
||||
typedef int64_t sclock_t;
|
||||
#else
|
||||
typedef uint32_t systime_t;
|
||||
#endif
|
||||
|
||||
/* This type used to hold relative ticks that may have negative value */
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef int64_t ssystime_t;
|
||||
#else
|
||||
typedef int32_t ssystime_t;
|
||||
typedef int32_t sclock_t;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -261,7 +259,7 @@ extern "C"
|
||||
*/
|
||||
|
||||
#ifdef __HAVE_KERNEL_GLOBALS
|
||||
EXTERN volatile systime_t g_system_timer;
|
||||
EXTERN volatile clock_t g_system_timer;
|
||||
|
||||
#ifndef CONFIG_SYSTEM_TIME64
|
||||
# define clock_systimer() g_system_timer
|
||||
@@ -361,7 +359,7 @@ void clock_resynchronize(FAR struct timespec *rtc_diff);
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__HAVE_KERNEL_GLOBALS) || defined(CONFIG_SYSTEM_TIME64)
|
||||
systime_t clock_systimer(void);
|
||||
clock_t clock_systimer(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -439,7 +439,7 @@ struct sixlowpan_reassbuf_s
|
||||
* be cancelled.
|
||||
*/
|
||||
|
||||
systime_t rb_time;
|
||||
clock_t rb_time;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -326,7 +326,7 @@ struct sporadic_s
|
||||
uint8_t nrepls; /* Number of active replenishments */
|
||||
uint32_t repl_period; /* Sporadic replenishment period */
|
||||
uint32_t budget; /* Sporadic execution budget period */
|
||||
systime_t eventtime; /* Time thread suspended or [re-]started */
|
||||
clock_t eventtime; /* Time thread suspended or [re-]started */
|
||||
|
||||
/* This is the last interval timer activated */
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ int nxsem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nxsem_tickwait(FAR sem_t *sem, systime_t start, uint32_t delay);
|
||||
int nxsem_tickwait(FAR sem_t *sem, clock_t start, uint32_t delay);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxsem_post
|
||||
|
||||
@@ -292,8 +292,8 @@ struct work_s
|
||||
struct dq_entry_s dq; /* Implements a doubly linked list */
|
||||
worker_t worker; /* Work callback */
|
||||
FAR void *arg; /* Callback argument */
|
||||
systime_t qtime; /* Time work queued */
|
||||
systime_t delay; /* Delay until work performed */
|
||||
clock_t qtime; /* Time work queued */
|
||||
clock_t delay; /* Delay until work performed */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -361,7 +361,7 @@ int work_usrstart(void);
|
||||
****************************************************************************/
|
||||
|
||||
int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
||||
FAR void *arg, systime_t delay);
|
||||
FAR void *arg, clock_t delay);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: work_cancel
|
||||
|
||||
+6
-1
@@ -231,7 +231,12 @@ typedef int16_t blksize_t;
|
||||
typedef unsigned int socklen_t;
|
||||
typedef uint16_t sa_family_t;
|
||||
|
||||
/* Used for system times in clock ticks (equivalent to systime_t) */
|
||||
/* Used for system times in clock ticks. This type is the natural width of
|
||||
* the system timer.
|
||||
*
|
||||
* NOTE: The signed-ness of clock_t is not specified at OpenGroup.org. An
|
||||
* unsigned type is used to support the full range of the internal clock.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef uint64_t clock_t;
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
static int work_qqueue(FAR struct usr_wqueue_s *wqueue,
|
||||
FAR struct work_s *work, worker_t worker,
|
||||
FAR void *arg, systime_t delay)
|
||||
FAR void *arg, clock_t delay)
|
||||
{
|
||||
DEBUGASSERT(work != NULL);
|
||||
|
||||
@@ -157,7 +157,7 @@ static int work_qqueue(FAR struct usr_wqueue_s *wqueue,
|
||||
****************************************************************************/
|
||||
|
||||
int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
||||
FAR void *arg, systime_t delay)
|
||||
FAR void *arg, clock_t delay)
|
||||
{
|
||||
if (qid == USRWORK)
|
||||
{
|
||||
|
||||
@@ -119,11 +119,11 @@ void work_process(FAR struct usr_wqueue_s *wqueue)
|
||||
volatile FAR struct work_s *work;
|
||||
worker_t worker;
|
||||
FAR void *arg;
|
||||
systime_t elapsed;
|
||||
systime_t remaining;
|
||||
systime_t stick;
|
||||
systime_t ctick;
|
||||
systime_t next;
|
||||
clock_t elapsed;
|
||||
clock_t remaining;
|
||||
clock_t stick;
|
||||
clock_t ctick;
|
||||
clock_t next;
|
||||
int ret;
|
||||
|
||||
/* Then process queued work. Lock the work queue while we process items
|
||||
|
||||
+1
-1
@@ -297,7 +297,7 @@ EXTERN uint8_t g_reassembly_timer;
|
||||
|
||||
/* Time of last poll */
|
||||
|
||||
EXTERN systime_t g_polltime;
|
||||
EXTERN clock_t g_polltime;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
|
||||
@@ -82,7 +82,7 @@ enum devif_packet_type
|
||||
|
||||
/* Time of last poll */
|
||||
|
||||
systime_t g_polltime;
|
||||
clock_t g_polltime;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -708,8 +708,8 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
||||
|
||||
int devif_timer(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
||||
{
|
||||
systime_t now;
|
||||
systime_t elapsed;
|
||||
clock_t now;
|
||||
clock_t elapsed;
|
||||
int bstop = false;
|
||||
|
||||
/* Get the elapsed time since the last poll in units of half seconds
|
||||
@@ -733,7 +733,7 @@ int devif_timer(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
||||
* boundary to avoid error build-up).
|
||||
*/
|
||||
|
||||
g_polltime += (TICK_PER_HSEC * (systime_t)hsec);
|
||||
g_polltime += (TICK_PER_HSEC * (clock_t)hsec);
|
||||
|
||||
/* Perform periodic activitives that depend on hsec > 0 */
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ struct icmp_recvfrom_s
|
||||
FAR struct devif_callback_s *recv_cb; /* Reference to callback instance */
|
||||
FAR struct socket *recv_sock; /* IPPROTO_ICMP socket structure */
|
||||
sem_t recv_sem; /* Use to manage the wait for the response */
|
||||
systime_t recv_time; /* Start time for determining timeouts */
|
||||
clock_t recv_time; /* Start time for determining timeouts */
|
||||
in_addr_t recv_from; /* The peer we received the request from */
|
||||
FAR uint8_t *recv_buf; /* Location to return the response */
|
||||
uint16_t recv_buflen; /* Size of the response */
|
||||
|
||||
@@ -89,7 +89,7 @@ struct icmp_sendto_s
|
||||
FAR struct devif_callback_s *snd_cb; /* Reference to callback instance */
|
||||
FAR struct socket *snd_sock; /* IPPROTO_ICMP socket structure */
|
||||
sem_t snd_sem; /* Use to manage the wait for send complete */
|
||||
systime_t snd_time; /* Start time for determining timeouts */
|
||||
clock_t snd_time; /* Start time for determining timeouts */
|
||||
in_addr_t snd_toaddr; /* The peer to send the request to */
|
||||
FAR const uint8_t *snd_buf; /* ICMP header + data payload */
|
||||
uint16_t snd_buflen; /* Size of the ICMP header + data payload */
|
||||
|
||||
@@ -74,7 +74,7 @@ struct icmpv6_recvfrom_s
|
||||
FAR struct devif_callback_s *recv_cb; /* Reference to callback instance */
|
||||
FAR struct socket *recv_sock; /* IPPROTO_ICMP6 socket structure */
|
||||
sem_t recv_sem; /* Use to manage the wait for the response */
|
||||
systime_t recv_time; /* Start time for determining timeouts */
|
||||
clock_t recv_time; /* Start time for determining timeouts */
|
||||
struct in6_addr recv_from; /* The peer we received the request from */
|
||||
FAR uint8_t *recv_buf; /* Location to return the response */
|
||||
uint16_t recv_buflen; /* Size of the response */
|
||||
|
||||
@@ -89,7 +89,7 @@ struct icmpv6_sendto_s
|
||||
FAR struct devif_callback_s *snd_cb; /* Reference to callback instance */
|
||||
FAR struct socket *snd_sock; /* IPPROTO_ICMP6 socket structure */
|
||||
sem_t snd_sem; /* Use to manage the wait for send complete */
|
||||
systime_t snd_time; /* Start time for determining timeouts */
|
||||
clock_t snd_time; /* Start time for determining timeouts */
|
||||
struct in6_addr snd_toaddr; /* The peer to send the request to */
|
||||
FAR const uint8_t *snd_buf; /* ICMPv6 header + data payload */
|
||||
uint16_t snd_buflen; /* Size of the ICMPv6 header + data payload */
|
||||
|
||||
@@ -82,7 +82,7 @@ struct tcp_close_s
|
||||
FAR struct socket *cl_psock; /* Reference to the TCP socket */
|
||||
sem_t cl_sem; /* Signals disconnect completion */
|
||||
int cl_result; /* The result of the close */
|
||||
systime_t cl_start; /* Time close started (in ticks) */
|
||||
clock_t cl_start; /* Time close started (in ticks) */
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -93,7 +93,7 @@ struct inet_recvfrom_s
|
||||
{
|
||||
FAR struct socket *ir_sock; /* The parent socket structure */
|
||||
#ifdef CONFIG_NET_SOCKOPTS
|
||||
systime_t ir_starttime; /* rcv start time for determining timeout */
|
||||
clock_t ir_starttime; /* rcv start time for determining timeout */
|
||||
#endif
|
||||
FAR struct devif_callback_s *ir_cb; /* Reference to callback instance */
|
||||
sem_t ir_sem; /* Semaphore signals recv completion */
|
||||
|
||||
@@ -136,7 +136,7 @@ static void sixlowpan_reass_expire(void)
|
||||
{
|
||||
FAR struct sixlowpan_reassbuf_s *reass;
|
||||
FAR struct sixlowpan_reassbuf_s *next;
|
||||
systime_t elapsed;
|
||||
clock_t elapsed;
|
||||
|
||||
/* If reassembly timed out, cancel it */
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ struct sixlowpan_send_s
|
||||
sem_t s_waitsem; /* Supports waiting for driver events */
|
||||
int s_result; /* The result of the transfer */
|
||||
uint16_t s_timeout; /* Send timeout in deciseconds */
|
||||
systime_t s_time; /* Last send time for determining timeout */
|
||||
clock_t s_time; /* Last send time for determining timeout */
|
||||
FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by UDP or ICMP header. */
|
||||
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
||||
FAR const void *s_buf; /* Data to send */
|
||||
@@ -120,8 +120,8 @@ static inline bool send_timeout(FAR struct sixlowpan_send_s *sinfo)
|
||||
{
|
||||
/* Check if the configured timeout has elapsed */
|
||||
|
||||
systime_t timeo_ticks = DSEC2TICK(sinfo->s_timeout);
|
||||
systime_t elapsed = clock_systimer() - sinfo->s_time;
|
||||
clock_t timeo_ticks = DSEC2TICK(sinfo->s_timeout);
|
||||
clock_t elapsed = clock_systimer() - sinfo->s_time;
|
||||
|
||||
if (elapsed >= timeo_ticks)
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@ struct sixlowpan_send_s
|
||||
sem_t s_waitsem; /* Supports waiting for driver events */
|
||||
int s_result; /* The result of the transfer */
|
||||
uint16_t s_timeout; /* Send timeout in deciseconds */
|
||||
systime_t s_time; /* Last send time for determining timeout */
|
||||
clock_t s_time; /* Last send time for determining timeout */
|
||||
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
||||
FAR const uint8_t *s_buf; /* Data to send */
|
||||
size_t s_buflen; /* Length of data in buf */
|
||||
@@ -307,8 +307,8 @@ static inline bool send_timeout(FAR struct sixlowpan_send_s *sinfo)
|
||||
{
|
||||
/* Check if the configured timeout has elapsed */
|
||||
|
||||
systime_t timeo_ticks = DSEC2TICK(sinfo->s_timeout);
|
||||
systime_t elapsed = clock_systimer() - sinfo->s_time;
|
||||
clock_t timeo_ticks = DSEC2TICK(sinfo->s_timeout);
|
||||
clock_t elapsed = clock_systimer() - sinfo->s_time;
|
||||
|
||||
if (elapsed >= timeo_ticks)
|
||||
{
|
||||
|
||||
@@ -69,10 +69,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int net_timeo(systime_t start_time, socktimeo_t timeo)
|
||||
int net_timeo(clock_t start_time, socktimeo_t timeo)
|
||||
{
|
||||
systime_t timeo_ticks = DSEC2TICK(timeo);
|
||||
systime_t elapsed = clock_systimer() - start_time;
|
||||
clock_t timeo_ticks = DSEC2TICK(timeo);
|
||||
clock_t elapsed = clock_systimer() - start_time;
|
||||
|
||||
if (elapsed >= timeo_ticks)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user