2018-08-27 19:55:30 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* drivers/timers/arch_alarm.c
|
|
|
|
*
|
2020-08-22 18:36:57 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2018-08-27 19:55:30 +02:00
|
|
|
*
|
2020-08-22 18:36:57 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2018-08-27 19:55:30 +02:00
|
|
|
*
|
2020-08-22 18:36:57 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2018-08-27 19:55:30 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <nuttx/arch.h>
|
|
|
|
#include <nuttx/clock.h>
|
|
|
|
#include <nuttx/timers/arch_alarm.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
|
|
|
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
|
|
|
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static FAR struct oneshot_lowerhalf_s *g_oneshot_lower;
|
|
|
|
|
2023-09-04 11:45:45 +02:00
|
|
|
#ifndef CONFIG_SCHED_TICKLESS
|
|
|
|
static clock_t g_current_tick;
|
|
|
|
#endif
|
|
|
|
|
2018-08-27 19:55:30 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void udelay_accurate(useconds_t microseconds)
|
|
|
|
{
|
|
|
|
struct timespec now;
|
|
|
|
struct timespec end;
|
|
|
|
struct timespec delta;
|
|
|
|
|
|
|
|
ONESHOT_CURRENT(g_oneshot_lower, &now);
|
2024-05-24 15:55:42 +02:00
|
|
|
clock_nsec2time(&delta, (uint64_t)microseconds * NSEC_PER_USEC);
|
2018-08-27 19:55:30 +02:00
|
|
|
clock_timespec_add(&now, &delta, &end);
|
|
|
|
|
2020-02-07 06:38:52 +01:00
|
|
|
while (clock_timespec_compare(&now, &end) < 0)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
|
|
|
ONESHOT_CURRENT(g_oneshot_lower, &now);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void udelay_coarse(useconds_t microseconds)
|
|
|
|
{
|
|
|
|
volatile int i;
|
|
|
|
|
|
|
|
/* We'll do this a little at a time because we expect that the
|
|
|
|
* CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in
|
|
|
|
* the divisions of its calculation. We'll use the largest values that
|
|
|
|
* we can in order to prevent significant error buildup in the loops.
|
|
|
|
*/
|
|
|
|
|
|
|
|
while (microseconds > 1000)
|
|
|
|
{
|
|
|
|
for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
microseconds -= 1000;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (microseconds > 100)
|
|
|
|
{
|
|
|
|
for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
microseconds -= 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (microseconds > 10)
|
|
|
|
{
|
|
|
|
for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
microseconds -= 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (microseconds > 0)
|
|
|
|
{
|
|
|
|
for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
microseconds--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-08 18:51:09 +01:00
|
|
|
static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
|
|
|
|
FAR void *arg)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2022-09-23 08:36:49 +02:00
|
|
|
clock_t now = 0;
|
2018-08-27 19:55:30 +02:00
|
|
|
|
2018-11-08 18:51:09 +01:00
|
|
|
#ifdef CONFIG_SCHED_TICKLESS
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
|
|
|
|
nxsched_alarm_tick_expiration(now);
|
2018-08-27 19:55:30 +02:00
|
|
|
#else
|
2022-09-23 08:36:49 +02:00
|
|
|
clock_t delta;
|
2018-08-27 19:55:30 +02:00
|
|
|
|
2018-11-08 18:51:09 +01:00
|
|
|
do
|
|
|
|
{
|
2022-09-23 08:36:49 +02:00
|
|
|
clock_t next;
|
2018-11-08 18:51:09 +01:00
|
|
|
|
2019-03-21 02:27:40 +01:00
|
|
|
nxsched_process_timer();
|
2023-09-04 11:45:45 +02:00
|
|
|
next = ++g_current_tick;
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
|
|
|
|
delta = next - now;
|
2018-11-08 18:51:09 +01:00
|
|
|
}
|
2022-09-23 08:36:49 +02:00
|
|
|
while ((sclock_t)delta <= 0);
|
2018-11-08 18:51:09 +01:00
|
|
|
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback, NULL, delta);
|
2018-08-27 19:55:30 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void up_alarm_set_lowerhalf(FAR struct oneshot_lowerhalf_s *lower)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_SCHED_TICKLESS
|
2022-09-23 08:36:49 +02:00
|
|
|
clock_t ticks;
|
|
|
|
#endif
|
2018-08-27 19:55:30 +02:00
|
|
|
|
|
|
|
g_oneshot_lower = lower;
|
|
|
|
|
2022-09-23 08:36:49 +02:00
|
|
|
#ifdef CONFIG_SCHED_TICKLESS
|
|
|
|
ONESHOT_TICK_MAX_DELAY(g_oneshot_lower, &ticks);
|
|
|
|
g_oneshot_maxticks = ticks < UINT32_MAX ? ticks : UINT32_MAX;
|
|
|
|
#else
|
2023-09-04 11:45:45 +02:00
|
|
|
ONESHOT_TICK_CURRENT(g_oneshot_lower, &g_current_tick);
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback, NULL, 1);
|
2018-08-27 19:55:30 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: up_timer_gettime
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Return the elapsed time since power-up (or, more correctly, since
|
2023-02-17 12:26:18 +01:00
|
|
|
* the architecture-specific timer was initialized). This function is
|
2018-08-27 19:55:30 +02:00
|
|
|
* functionally equivalent to:
|
|
|
|
*
|
|
|
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
|
|
|
*
|
|
|
|
* when clockid is CLOCK_MONOTONIC.
|
|
|
|
*
|
|
|
|
* This function provides the basis for reporting the current time and
|
|
|
|
* also is used to eliminate error build-up from small errors in interval
|
|
|
|
* time calculations.
|
|
|
|
*
|
|
|
|
* Provided by platform-specific code and called from the RTOS base code.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* ts - Provides the location in which to return the up-time.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) is returned on success; a negated errno value is returned on
|
|
|
|
* any failure.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* Called from the normal tasking context. The implementation must
|
|
|
|
* provide whatever mutual exclusion is necessary for correct operation.
|
|
|
|
* This can include disabling interrupts in order to assure atomic register
|
|
|
|
* operations.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_CLOCK_TIMEKEEPING
|
2022-09-26 04:02:52 +02:00
|
|
|
void weak_function up_timer_getmask(FAR clock_t *mask)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2018-11-08 19:06:44 +01:00
|
|
|
*mask = 0;
|
2018-08-27 19:55:30 +02:00
|
|
|
|
2018-11-08 19:06:44 +01:00
|
|
|
if (g_oneshot_lower != NULL)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2022-09-26 04:02:52 +02:00
|
|
|
clock_t maxticks;
|
2018-11-08 19:06:44 +01:00
|
|
|
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_MAX_DELAY(g_oneshot_lower, &maxticks);
|
2018-08-27 19:55:30 +02:00
|
|
|
|
2019-02-27 15:41:08 +01:00
|
|
|
for (; ; )
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2022-09-26 04:02:52 +02:00
|
|
|
clock_t next = (*mask << 1) | 1;
|
2018-11-08 19:06:44 +01:00
|
|
|
if (next > maxticks)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
*mask = next;
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
2018-11-08 19:06:44 +01:00
|
|
|
}
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
2021-04-11 01:58:15 +02:00
|
|
|
#endif
|
|
|
|
|
2022-09-23 08:36:49 +02:00
|
|
|
#if defined(CONFIG_SCHED_TICKLESS) || defined(CONFIG_CLOCK_TIMEKEEPING)
|
2022-09-26 04:02:52 +02:00
|
|
|
int weak_function up_timer_gettick(FAR clock_t *ticks)
|
|
|
|
{
|
|
|
|
int ret = -EAGAIN;
|
|
|
|
|
|
|
|
if (g_oneshot_lower != NULL)
|
|
|
|
{
|
2022-09-23 08:36:49 +02:00
|
|
|
ret = ONESHOT_TICK_CURRENT(g_oneshot_lower, ticks);
|
2022-09-26 04:02:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2024-08-22 17:14:42 +02:00
|
|
|
|
|
|
|
int weak_function up_timer_gettime(struct timespec *ts)
|
|
|
|
{
|
|
|
|
int ret = -EAGAIN;
|
|
|
|
|
|
|
|
if (g_oneshot_lower != NULL)
|
|
|
|
{
|
|
|
|
ret = ONESHOT_CURRENT(g_oneshot_lower, ts);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2022-09-26 04:02:52 +02:00
|
|
|
#endif
|
|
|
|
|
2018-08-27 19:55:30 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: up_alarm_cancel
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Cancel the alarm and return the time of cancellation of the alarm.
|
|
|
|
* These two steps need to be as nearly atomic as possible.
|
2019-03-21 02:34:23 +01:00
|
|
|
* nxsched_alarm_expiration() will not be called unless the alarm is
|
2018-08-27 19:55:30 +02:00
|
|
|
* restarted with up_alarm_start().
|
|
|
|
*
|
|
|
|
* If, as a race condition, the alarm has already expired when this
|
|
|
|
* function is called, then time returned is the current time.
|
|
|
|
*
|
|
|
|
* NOTE: This function may execute at a high rate with no timer running (as
|
|
|
|
* when pre-emption is enabled and disabled).
|
|
|
|
*
|
|
|
|
* Provided by platform-specific code and called from the RTOS base code.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* ts - Location to return the expiration time. The current time should
|
|
|
|
* returned if the alarm is not active. ts may be NULL in which
|
|
|
|
* case the time is not returned.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) is returned on success. A call to up_alarm_cancel() when
|
|
|
|
* the timer is not active should also return success; a negated errno
|
|
|
|
* value is returned on any failure.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* May be called from interrupt level handling or from the normal tasking
|
|
|
|
* level. Interrupts may need to be disabled internally to assure
|
|
|
|
* non-reentrancy.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_SCHED_TICKLESS
|
2022-09-23 08:36:49 +02:00
|
|
|
int weak_function up_alarm_tick_cancel(FAR clock_t *ticks)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2018-11-08 19:06:44 +01:00
|
|
|
int ret = -EAGAIN;
|
|
|
|
|
|
|
|
if (g_oneshot_lower != NULL)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2022-09-23 08:36:49 +02:00
|
|
|
ret = ONESHOT_TICK_CANCEL(g_oneshot_lower, ticks);
|
|
|
|
ONESHOT_TICK_CURRENT(g_oneshot_lower, ticks);
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
|
|
|
|
2018-11-08 19:06:44 +01:00
|
|
|
return ret;
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: up_alarm_start
|
|
|
|
*
|
|
|
|
* Description:
|
2019-03-21 02:34:23 +01:00
|
|
|
* Start the alarm. nxsched_alarm_expiration() will be called when the
|
2018-08-27 19:55:30 +02:00
|
|
|
* alarm occurs (unless up_alaram_cancel is called to stop it).
|
|
|
|
*
|
|
|
|
* Provided by platform-specific code and called from the RTOS base code.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
2020-08-22 19:15:21 +02:00
|
|
|
* ts - The time in the future at the alarm is expected to occur. When the
|
|
|
|
* alarm occurs the timer logic will call nxsched_alarm_expiration().
|
2018-08-27 19:55:30 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Zero (OK) is returned on success; a negated errno value is returned on
|
|
|
|
* any failure.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* May be called from interrupt level handling or from the normal tasking
|
|
|
|
* level. Interrupts may need to be disabled internally to assure
|
|
|
|
* non-reentrancy.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_SCHED_TICKLESS
|
2022-09-23 08:36:49 +02:00
|
|
|
int weak_function up_alarm_tick_start(clock_t ticks)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2018-11-08 19:06:44 +01:00
|
|
|
int ret = -EAGAIN;
|
2018-08-27 19:55:30 +02:00
|
|
|
|
2018-11-08 19:06:44 +01:00
|
|
|
if (g_oneshot_lower != NULL)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2022-12-06 13:00:17 +01:00
|
|
|
clock_t now;
|
2022-09-23 08:36:49 +02:00
|
|
|
clock_t delta;
|
2018-11-08 19:06:44 +01:00
|
|
|
|
2022-09-23 08:36:49 +02:00
|
|
|
ONESHOT_TICK_CURRENT(g_oneshot_lower, &now);
|
|
|
|
delta = ticks - now;
|
|
|
|
if ((sclock_t)delta < 0)
|
|
|
|
{
|
|
|
|
delta = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = ONESHOT_TICK_START(g_oneshot_lower, oneshot_callback,
|
|
|
|
NULL, delta);
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
|
|
|
|
2018-11-08 19:06:44 +01:00
|
|
|
return ret;
|
2018-08-27 19:55:30 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-02-15 14:14:17 +01:00
|
|
|
/****************************************************************************
|
2022-01-24 19:45:18 +01:00
|
|
|
* Name: up_perf_*
|
2019-01-27 17:15:51 +01:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* The first interface simply provides the current time value in unknown
|
|
|
|
* units. NOTE: This function may be called early before the timer has
|
|
|
|
* been initialized. In that event, the function should just return a
|
|
|
|
* start time of zero.
|
|
|
|
*
|
|
|
|
* Nothing is assumed about the units of this time value. The following
|
|
|
|
* are assumed, however: (1) The time is an unsigned integer value, (2)
|
|
|
|
* the time is monotonically increasing, and (3) the elapsed time (also
|
|
|
|
* in unknown units) can be obtained by subtracting a start time from
|
|
|
|
* the current time.
|
|
|
|
*
|
|
|
|
* The second interface simple converts an elapsed time into well known
|
|
|
|
* units.
|
2020-02-15 14:14:17 +01:00
|
|
|
****************************************************************************/
|
2019-01-27 17:15:51 +01:00
|
|
|
|
2023-08-08 05:12:41 +02:00
|
|
|
#ifndef CONFIG_ARCH_PERF_EVENTS
|
|
|
|
void up_perf_init(FAR void *arg)
|
2023-04-18 08:37:00 +02:00
|
|
|
{
|
|
|
|
UNUSED(arg);
|
|
|
|
}
|
|
|
|
|
2023-08-08 05:12:41 +02:00
|
|
|
unsigned long up_perf_gettime(void)
|
2019-01-27 17:15:51 +01:00
|
|
|
{
|
2023-04-07 13:30:20 +02:00
|
|
|
unsigned long ret = 0;
|
2019-01-27 17:15:51 +01:00
|
|
|
|
|
|
|
if (g_oneshot_lower != NULL)
|
|
|
|
{
|
|
|
|
struct timespec ts;
|
|
|
|
|
|
|
|
ONESHOT_CURRENT(g_oneshot_lower, &ts);
|
2024-05-24 15:55:42 +02:00
|
|
|
ret = clock_time2nsec(&ts);
|
2019-01-27 17:15:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2023-08-08 05:12:41 +02:00
|
|
|
unsigned long up_perf_getfreq(void)
|
2022-01-25 19:07:43 +01:00
|
|
|
{
|
2023-08-30 11:48:55 +02:00
|
|
|
return NSEC_PER_SEC;
|
2022-01-25 19:07:43 +01:00
|
|
|
}
|
|
|
|
|
2023-08-30 11:48:55 +02:00
|
|
|
void up_perf_convert(unsigned long elapsed, FAR struct timespec *ts)
|
2019-01-27 17:15:51 +01:00
|
|
|
{
|
2024-05-24 15:55:42 +02:00
|
|
|
clock_nsec2time(ts, elapsed);
|
2019-01-27 17:15:51 +01:00
|
|
|
}
|
2023-08-08 05:12:41 +02:00
|
|
|
#endif /* CONFIG_ARCH_PERF_EVENTS */
|
2019-01-27 17:15:51 +01:00
|
|
|
|
2018-08-27 19:55:30 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: up_mdelay
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Delay inline for the requested number of milliseconds.
|
|
|
|
* *** NOT multi-tasking friendly ***
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-01-24 19:59:36 +01:00
|
|
|
void weak_function up_mdelay(unsigned int milliseconds)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
|
|
|
up_udelay(USEC_PER_MSEC * milliseconds);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: up_udelay
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Delay inline for the requested number of microseconds.
|
|
|
|
*
|
|
|
|
* *** NOT multi-tasking friendly ***
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-01-24 19:59:36 +01:00
|
|
|
void weak_function up_udelay(useconds_t microseconds)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
2018-11-08 19:06:44 +01:00
|
|
|
if (g_oneshot_lower != NULL)
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
|
|
|
udelay_accurate(microseconds);
|
|
|
|
}
|
2018-11-08 19:06:44 +01:00
|
|
|
else /* Oneshot timer hasn't been initialized yet */
|
2018-08-27 19:55:30 +02:00
|
|
|
{
|
|
|
|
udelay_coarse(microseconds);
|
|
|
|
}
|
|
|
|
}
|