up_timer_initialize() is named incorrectly. The prefix should be the architecture name, not up_ since it is private to the architecture. up_timerisr() is similarly misnamed and should also be private since it is used only with the xyz_timerisr.c files. Also updat TODO list.
This commit is contained in:
parent
9395704192
commit
62a1f6f110
@ -12,7 +12,7 @@
|
||||
<h1><big><font color="#3c34ec">
|
||||
<i>NuttX RTOS Porting Guide</i>
|
||||
</font></big></h1>
|
||||
<p>Last Updated: August 31, 2016</p>
|
||||
<p>Last Updated: February 7, 2017</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2324,7 +2324,7 @@ config ARCH_SIM
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#uptimerinit"><code>up_timer_initialize()</code></a>:
|
||||
<a href="#uptimerinit"><i><arch></i><code>_timer_initialize()</code></a>:
|
||||
Initializes the timer facilities. Called early in the intialization sequence (by <code>up_intialize()</code>).
|
||||
</li>
|
||||
<li>
|
||||
@ -2380,11 +2380,11 @@ config ARCH_SIM
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h5><a name="uptimerinit">4.3.4.4.1 <code>up_timer_initialize()</code></a></h5>
|
||||
<h5><a name="uptimerinit">4.3.4.4.1 <i><arch></i><code>_timer_initialize()</code></a></h5>
|
||||
<p><b>Function Prototype</b>:</p>
|
||||
<ul><pre>
|
||||
#include <nuttx/arch.h>
|
||||
void up_timer_initialize(void);
|
||||
#include "up_internal.h"
|
||||
void <i><arch></i>_timer_initialize()(void);
|
||||
</pre></ul>
|
||||
<p><b>Description</b>:</p>
|
||||
<ul>
|
||||
@ -2410,7 +2410,7 @@ void up_timer_initialize(void);
|
||||
int up_timer_gettime(FAR struct timespec *ts);
|
||||
</pre></ul>
|
||||
<p><b>Description</b>:</p>
|
||||
Return the elapsed time since power-up (or, more correctly, since <code>up_timer_initialize()</code> was called). This function is functionally equivalent to <code>clock_gettime()</code> for the clock ID <code>CLOCK_MONOTONIC</code>. 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.
|
||||
Return the elapsed time since power-up (or, more correctly, since <i><arch></i><code>_timer_initialize()</code> was called). This function is functionally equivalent to <code>clock_gettime()</code> for the clock ID <code>CLOCK_MONOTONIC</code>. 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.
|
||||
<ul>
|
||||
</ul>
|
||||
<p><b>Input Parameters</b>:</p>
|
||||
|
164
TODO
164
TODO
@ -1,4 +1,4 @@
|
||||
NuttX TODO List (Last updated January 10, 2017)
|
||||
NuttX TODO List (Last updated February 7, 2017)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||
@ -9,10 +9,10 @@ issues related to each board port.
|
||||
|
||||
nuttx/:
|
||||
|
||||
(12) Task/Scheduler (sched/)
|
||||
(10) Task/Scheduler (sched/)
|
||||
(1) SMP
|
||||
(1) Memory Management (mm/)
|
||||
(1) Power Management (drivers/pm)
|
||||
(0) Power Management (drivers/pm)
|
||||
(3) Signals (sched/signal, arch/)
|
||||
(2) pthreads (sched/pthread)
|
||||
(0) Message Queues (sched/mqueue)
|
||||
@ -165,133 +165,6 @@ o Task/Scheduler (sched/)
|
||||
incompatibilities could show up in porting some code).
|
||||
Priority: Low
|
||||
|
||||
Title: RELEASE SEMAPHORES HELD BY CANCELED THREADS:
|
||||
Description: Commit: fecb9040d0e54baf14b729e556a832febfe8229e: "In
|
||||
case a thread is doing a blocking operation (e.g. read())
|
||||
on a serial device, while it is being terminated by
|
||||
pthread_cancel(), then uart_close() gets called, but
|
||||
the semaphore (dev->recv.sem in the above example) is
|
||||
still blocked.
|
||||
|
||||
"This means that once the serial device is opened next
|
||||
time, data will arrive on the serial port (and driver
|
||||
interrupts handled as normal), but the received characters
|
||||
never arrive in the reader thread.
|
||||
|
||||
This patch addresses the problem by re-initializing the
|
||||
semaphores on the last uart_close() on the device."
|
||||
|
||||
Yahoo! Groups message 7726: "I think that the system
|
||||
should be required to handle pthread_cancel safely in
|
||||
all cases. In the NuttX model, a task is like a Unix
|
||||
process and a pthread is like a Unix thread. Canceling
|
||||
threads should always be safe (or at least as unsafe) as
|
||||
under Unix because the model is complete for pthreads...
|
||||
|
||||
"So, in my opinion, this is a generic system issue, not
|
||||
specific to the serial driver. I could also implement
|
||||
logic to release all semaphores held by a thread when
|
||||
it exits -- but only if priority inheritance is enabled;
|
||||
because only in that case does the code have any memory
|
||||
of which threads actually hold the semaphore.
|
||||
|
||||
"The patch I just incorporated is also insufficient. It
|
||||
works only if the serial driver is shut down when the
|
||||
thread is canceled. But what if there are other open
|
||||
references to the driver? Then the driver will not be
|
||||
shut down, the semaphores will not be re-initialized, and
|
||||
the semaphore counts will still be off by one.
|
||||
|
||||
"I think that the system needs to automatically release any
|
||||
semaphores held by a thread being killed asynchronously?
|
||||
It seems necessary to me."
|
||||
|
||||
UPDATE; The logic enabled when priority inheritance is
|
||||
enabled for this purpose is insufficient. It provides
|
||||
hooks so that given a semaphore it can traverse all
|
||||
holders. What is needed would be logic so that given
|
||||
a task, you can traverse all semaphores held by the task,
|
||||
releasing each semaphore count held by the exiting task.
|
||||
Nothing like this exists now so that solution is not
|
||||
imminent.
|
||||
|
||||
UPDATE: The basic fix to release the semaphore count if
|
||||
a thread is killed via pthread_cancel() or task_delete()
|
||||
has been implemented (2014-12-13). See the new file:
|
||||
sched/semaphore/sem_recover.c However, the general
|
||||
issue of freeing semaphores when a thread exists still
|
||||
exists.
|
||||
Status: Open
|
||||
Priority: Medium-ish
|
||||
|
||||
Title: ISSUES WITH PRIORITY INHERITANCE WHEN SEMAPHORE/MUTX IS USED AS IPC
|
||||
Description: Semaphores have multiple uses. The typical usage is where
|
||||
the semaphore is used as lock on one or more resources. In
|
||||
this typical case, priority inheritance works perfectly: The
|
||||
holder of a semaphore count must be remembered so that its
|
||||
priority can be boosted if a higher priority task requires a
|
||||
count from the semaphore. It remains the holder until the
|
||||
same task calls sem_post() to release the count on the
|
||||
semaphore.
|
||||
|
||||
But a different usage model for semaphores is for signalling
|
||||
events. In this case, the semaphore count is initialized to
|
||||
zero and the receiving task calls sem_wait() to wait for the
|
||||
next event of interest. When an event of interest is
|
||||
detected by another task (or even an interrupt handler),
|
||||
sem_post() is called which increments the count to 1 and
|
||||
wakes up the receiving task.
|
||||
|
||||
For example, in the following TASK A waits for events and
|
||||
TASK B (or perhaps an interrupt handler) signals task A of
|
||||
the occurence of the events by posting the semaphore:
|
||||
|
||||
---------------------- ---------------
|
||||
TASK A TASK B
|
||||
---------------------- ---------------
|
||||
sem_init(sem, 0, 0);
|
||||
sem_wait(sem);
|
||||
sem_post(sem);
|
||||
Awakens as holder
|
||||
---------------------- ---------------
|
||||
|
||||
These two usage models are really very different and priority
|
||||
inheritance simply does not apply when the semaphore is used for
|
||||
signalling rather than locking. In this signalling case
|
||||
priority inheritance can interfere with the operation of the
|
||||
semaphore. The problem is that when TASK A is awakened it is
|
||||
a holder of the semaphore. Normally, a task is removed from
|
||||
the holder list when it finally releases the semaphore via
|
||||
sem_post().
|
||||
|
||||
However, TASK A never calls sem_post(sem) so it becomes
|
||||
*permanently* a holder of the semaphore and may have its
|
||||
priority boosted at any time when any other task tries to
|
||||
acquire the semaphore.
|
||||
|
||||
The fix is to call sem_setprotocol(SEM_PRIO_NONE) immediately
|
||||
after the sem_init() call so that there will be no priority
|
||||
inheritance operations on this semaphore used for signalling.
|
||||
|
||||
NOTE also that in NuttX, pthread mutexes are build on top of
|
||||
binary semaphores. As a result, the above recommendation also
|
||||
applies when pthread mutexes are used for inter-thread
|
||||
signaling. That is, a mutex that is used for signaling should
|
||||
be initialize like this (simplified, no error checking here):
|
||||
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_PRIO_NONE);
|
||||
pthread_mutex_init(&mutex, &attr);
|
||||
|
||||
Status: Closed. If you have priority inheritance enabled and you use
|
||||
semaphores for signalling events, then you *must* call
|
||||
sem_setprotocol(SEM_PRIO_NONE) immediately after initializing
|
||||
the semaphore.
|
||||
Priority: High.
|
||||
|
||||
Title: SCALABILITY
|
||||
Description: Task control information is retained in simple lists. This
|
||||
is completely appropriate for small embedded systems where
|
||||
@ -436,37 +309,12 @@ o Memory Management (mm/)
|
||||
o Power Management (drivers/pm)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Title: PM CALLBACKS AREN'T BASED ON DOMAIN
|
||||
Description: Recently support for different power domains was added. Prior
|
||||
to this, only a single domain (the "IDLE" domain was supported).
|
||||
Having multiple power domains extends the basic concept to
|
||||
support power management for different functionality. For
|
||||
example, a UI may be managed separately from, say, some network
|
||||
functionality.
|
||||
|
||||
One thing that was missed when the PM domains was added was
|
||||
support for domain-specific driver callbacks: Currently, all
|
||||
callbacks will be invoked for all PM domain events making it
|
||||
impossible to distinguish the domain in the driver.
|
||||
|
||||
Possibilities:
|
||||
- Add a domain value to the PM registration function. In this
|
||||
case, callbacks would be retained separately for each domain
|
||||
and those callbacks would be invoked only for domain-specific
|
||||
events.
|
||||
- Add a domain value to the PM callback functions. In this case,
|
||||
each driver would receive events from all domains and could
|
||||
respond different (or ignore) events from other domains.
|
||||
Status: Open
|
||||
Priority: Currently low because I know of no use of the multiple PM
|
||||
domains. But, obviously, this would become important if the
|
||||
features were used.
|
||||
o Signals (sched/signal, arch/)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Title: STANDARD SIGNALS
|
||||
Description: 'Standard' signals and signal actions are not supported.
|
||||
(e.g., SIGINT, SIGSEGV, etc).
|
||||
(e.g., SIGINT, SIGSEGV, etc). Default is only SIG_IGN.
|
||||
|
||||
Update: SIGCHLD is supported if so configured.
|
||||
Status: Open. No further changes are planned.
|
||||
@ -501,7 +349,9 @@ o pthreads (sched/pthreads)
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Title: PTHREAD_PRIO_PROTECT
|
||||
Description: Extend pthread_mutexattr_setprotocol() support PTHREAD_PRIO_PROTECT:
|
||||
Description: Extend pthread_mutexattr_setprotocol(). It should support
|
||||
PTHREAD_PRIO_PROTECT (and so should its non-standard counterpart
|
||||
sem_setproto()).
|
||||
|
||||
"When a thread owns one or more mutexes initialized with the
|
||||
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/a1x/a1x_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -70,19 +70,11 @@
|
||||
#define TMR_INTERVAL ((TMR0_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: a1x_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -90,7 +82,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int a1x_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Only a TIMER0 interrupt is expected here */
|
||||
|
||||
@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -142,7 +138,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr);
|
||||
|
||||
/* Enable interrupts from the TIMER 0 port */
|
||||
|
||||
|
@ -70,19 +70,11 @@
|
||||
#define PTV 0x00000003
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: c5471_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for
|
||||
@ -90,7 +82,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int c5471_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -99,7 +91,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -107,7 +103,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
@ -122,6 +118,6 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)c5471_timerisr);
|
||||
up_enable_irq(C5471_IRQ_SYSTIMER);
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ void up_initialize(void)
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
up_timer_initialize();
|
||||
arm_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -462,8 +462,7 @@ void up_restorefpu(const uint32_t *regs);
|
||||
|
||||
/* System timer *************************************************************/
|
||||
|
||||
void up_timer_initialize(void);
|
||||
int up_timerisr(int irq, uint32_t *regs);
|
||||
void arm_timer_initialize(void);
|
||||
|
||||
/* Low level serial output **************************************************/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* arch/arm/src/dm320/dm320_timerisr.c
|
||||
* arch/arm/src/chip/dm320_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -97,19 +97,11 @@
|
||||
#define DM320_TMR0_PRSCL 9 /* (see above) */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: dm320_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -117,7 +109,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int dm320_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -126,7 +118,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -134,7 +130,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
up_disable_irq(DM320_IRQ_SYSTIMER);
|
||||
|
||||
@ -151,7 +147,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)dm320_timerisr);
|
||||
up_enable_irq(DM320_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/efm32/efm32_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Pierre-noel Bouteville <pnb990@gmail.com>
|
||||
@ -74,19 +74,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: efm32_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -94,7 +86,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int efm32_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -103,7 +95,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -111,7 +107,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -129,7 +125,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* arch/arm/src/imx1/imx_timerisr.c
|
||||
* arch/arm/src/chip/imx_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -52,23 +52,11 @@
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: imx_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -76,7 +64,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int imx_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
uint32_t tstat;
|
||||
int ret = -EIO;
|
||||
@ -100,7 +88,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -108,7 +100,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t tctl;
|
||||
|
||||
@ -158,7 +150,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)imx_timerisr);
|
||||
up_enable_irq(IMX_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/imx6/imx_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -102,14 +102,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_output_compare
|
||||
* Function: imx_output_compare
|
||||
*
|
||||
* Description:
|
||||
* Handle one pending output compare interrupt.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void up_output_compare(uint32_t sr, uint32_t of)
|
||||
static void imx_output_compare(uint32_t sr, uint32_t of)
|
||||
{
|
||||
/* Check for a pending output compare interrupt */
|
||||
|
||||
@ -122,11 +122,7 @@ static void up_output_compare(uint32_t sr, uint32_t of)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: imx_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -134,7 +130,7 @@ static void up_output_compare(uint32_t sr, uint32_t of)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int imx_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Sample the SR (once) */
|
||||
|
||||
@ -146,14 +142,18 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
|
||||
/* Process all pending output compare interrupt */
|
||||
|
||||
up_output_compare(sr, GPT_INT_OF1);
|
||||
up_output_compare(sr, GPT_INT_OF2);
|
||||
up_output_compare(sr, GPT_INT_OF3);
|
||||
imx_output_compare(sr, GPT_INT_OF1);
|
||||
imx_output_compare(sr, GPT_INT_OF2);
|
||||
imx_output_compare(sr, GPT_INT_OF3);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -161,7 +161,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint32_t cr;
|
||||
@ -260,7 +260,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr);
|
||||
|
||||
/* Enable all three GPT output compare interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kinetis/kinetis_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -78,19 +78,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: kinetis_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -98,7 +90,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int kinetis_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -143,7 +139,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kl/kl_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -93,19 +93,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: kl_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -113,7 +105,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int kl_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -122,7 +114,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -130,7 +126,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -147,7 +143,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(KL_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(KL_IRQ_SYSTICK, (xcpt_t)kl_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
||||
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc11xx/lpc11_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -93,19 +93,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc11_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -113,7 +105,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int lpc11_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -122,7 +114,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -130,7 +126,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -147,7 +143,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(LPC11_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(LPC11_IRQ_SYSTICK, (xcpt_t)lpc11_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
||||
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc17xx/lpc17_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -79,19 +79,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc17_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -99,7 +91,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int lpc17_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -108,7 +100,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -116,7 +112,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -139,7 +135,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(LPC17_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(LPC17_IRQ_SYSTICK, (xcpt_t)lpc17_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc214x/lpc214x_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -72,19 +72,11 @@
|
||||
#define tmr_putreg32(v,o) putreg32((v), LPC214X_TMR0_BASE+(o))
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc214x_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for
|
||||
@ -93,9 +85,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||
int up_timerisr(uint32_t *regs)
|
||||
static int lpc214x_timerisr(uint32_t *regs)
|
||||
#else
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int lpc214x_timerisr(int irq, uint32_t *regs)
|
||||
#endif
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint16_t mcr;
|
||||
|
||||
@ -158,9 +154,10 @@ void up_timer_initialize(void)
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||
up_attach_vector(LPC214X_IRQ_SYSTIMER, LPC214X_SYSTIMER_VEC, (vic_vector_t)up_timerisr);
|
||||
up_attach_vector(LPC214X_IRQ_SYSTIMER, LPC214X_SYSTIMER_VEC,
|
||||
(vic_vector_t)lpc214x_timerisr);
|
||||
#else
|
||||
(void)irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)lpc214x_timerisr);
|
||||
#endif
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
@ -81,19 +81,11 @@
|
||||
#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV) / TICK_PER_SEC)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc23xx_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for
|
||||
@ -102,9 +94,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||
int up_timerisr(uint32_t * regs)
|
||||
static int lpc23xx_timerisr(uint32_t * regs)
|
||||
#else
|
||||
int up_timerisr(int irq, uint32_t * regs)
|
||||
static int lpc23xx_timerisr(int irq, uint32_t * regs)
|
||||
#endif
|
||||
{
|
||||
static uint32_t tick;
|
||||
@ -138,7 +130,11 @@ int up_timerisr(int irq, uint32_t * regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -146,7 +142,7 @@ int up_timerisr(int irq, uint32_t * regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint16_t mcr;
|
||||
|
||||
@ -191,9 +187,9 @@ void up_timer_initialize(void)
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||
up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) up_timerisr);
|
||||
up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) lpc23xx_timerisr);
|
||||
#else
|
||||
(void)irq_attach(IRQ_SYSTIMER, (xcpt_t) up_timerisr);
|
||||
(void)irq_attach(IRQ_SYSTIMER, (xcpt_t)lpc23xx_timerisr);
|
||||
#ifdef CONFIG_ARCH_IRQPRIO
|
||||
up_prioritize_irq(IRQ_SYSTIMER, PRIORITY_HIGHEST);
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc31xx/lpc31_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -54,23 +54,11 @@
|
||||
#include "lpc31.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc31_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -78,7 +66,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int lpc31_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Clear the lattched timer interrupt (Writing any value to the CLEAR register
|
||||
* clears the interrupt generated by the counter timer
|
||||
@ -93,7 +81,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -101,7 +93,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint64_t load;
|
||||
@ -143,7 +135,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)lpc31_timerisr);
|
||||
|
||||
/* Clear any latched timer interrupt (Writing any value to the CLEAR register
|
||||
* clears the latched interrupt generated by the counter timer)
|
||||
|
@ -154,7 +154,7 @@ static inline void lpc43_RIT_timer_stop(void)
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t ticks_per_int;
|
||||
uint32_t mask_bits = 0;
|
||||
|
@ -58,8 +58,6 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void);
|
||||
int up_timer_gettime(FAR struct timespec *ts);
|
||||
int up_alarm_cancel(FAR struct timespec *ts);
|
||||
int up_alarm_start(FAR const struct timespec *ts);
|
||||
int up_timer_cancel(FAR struct timespec *ts);
|
||||
|
@ -595,7 +595,7 @@ static int lpc43_tl_isr(int irq, FAR void *context)
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
flags = enter_critical_section();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc43xx/lpc43_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -78,19 +78,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: lpc43_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -98,7 +90,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int lpc43_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -138,7 +134,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)lpc43_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* arch/arm/src/moxart/moxart_timer.c
|
||||
* MoxaRT internal Timer Driver
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -90,7 +90,7 @@ static uint32_t cmp = BOARD_32KOSC_FREQUENCY / 100;
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: moxart_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -98,7 +98,7 @@ static uint32_t cmp = BOARD_32KOSC_FREQUENCY / 100;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int moxart_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
uint32_t state;
|
||||
|
||||
@ -117,7 +117,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Setup MoxaRT timer 0 to cause system ticks.
|
||||
@ -127,7 +131,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
|
||||
@ -144,7 +148,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt */
|
||||
|
||||
irq_attach(IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(IRQ_SYSTIMER, (xcpt_t)moxart_timerisr);
|
||||
up_enable_irq(IRQ_SYSTIMER);
|
||||
ftintc010_set_trig_mode(IRQ_SYSTIMER, 1);
|
||||
ftintc010_set_trig_level(IRQ_SYSTIMER, 0);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/nuc1xx/nuc_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -100,11 +100,7 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
@ -152,11 +148,7 @@ static inline void nuc_lock(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: nuc_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -164,7 +156,7 @@ static inline void nuc_lock(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int nuc_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -173,7 +165,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -181,7 +177,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -230,7 +226,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)nuc_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts. We need to select the core clock here if
|
||||
* we are not using one of the alternative clock sources above.
|
||||
|
@ -39,7 +39,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -206,7 +206,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
@ -292,7 +292,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/sam34/sam_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -100,19 +100,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: sam_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -120,7 +112,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int sam_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -129,7 +121,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -137,7 +133,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -167,7 +163,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -218,7 +218,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -242,7 +242,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
@ -304,7 +304,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/sama5/sam_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -76,19 +76,11 @@
|
||||
#define PIT_PIV ((PIT_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: sam_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -96,7 +88,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int sam_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* "When CPIV and PICNT values are obtained by reading the Periodic
|
||||
* Interval Value Register (PIT_PIVR), the overflow counter (PICNT) is
|
||||
@ -118,7 +110,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -126,7 +122,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -140,7 +136,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(SAM_IRQ_PIT, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(SAM_IRQ_PIT, (xcpt_t)sam_timerisr);
|
||||
|
||||
/* Set the PIT overflow value (PIV), enable the PIT, and enable
|
||||
* interrupts from the PIT.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/samdl/sam_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -83,19 +83,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: sam_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -103,7 +95,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int sam_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -112,7 +104,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -120,7 +116,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -137,7 +133,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the initialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -254,7 +254,7 @@ static void sam_oneshot_handler(void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -290,7 +290,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/samv7/sam_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -86,19 +86,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: sam_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -106,7 +98,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int sam_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -134,7 +130,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts (no divide-by-8) */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -162,7 +162,7 @@ static void stm32_oneshot_handler(void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -186,7 +186,7 @@ static void stm32_oneshot_handler(void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
@ -244,7 +244,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32/stm32_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -86,19 +86,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: stm32_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -106,7 +98,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int stm32_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -152,7 +148,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32f7/stm32_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -92,19 +92,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: stm32_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -112,7 +104,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int stm32_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -121,7 +113,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -129,7 +125,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -140,7 +136,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts:
|
||||
*
|
||||
|
@ -40,7 +40,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
||||
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||
* Called early in the initialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -163,7 +163,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -187,7 +187,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||
uint64_t max_delay;
|
||||
@ -245,7 +245,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* arm_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32l4/stm32l4_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -86,19 +86,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: stm32l4_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -106,7 +98,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int stm32l4_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -152,7 +148,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)stm32l4_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -114,19 +114,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: str71x_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -134,7 +126,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int str71x_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
uint16_t ocar;
|
||||
|
||||
@ -158,7 +150,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -166,7 +162,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
@ -208,7 +204,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)str71x_timerisr);
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/tiva/tiva_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -76,19 +76,11 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: tiva_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -96,7 +88,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int tiva_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -105,7 +97,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -113,7 +109,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -130,7 +126,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)tiva_timerisr);
|
||||
|
||||
/* Enable SysTick interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/tms570/tms570_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -118,11 +118,11 @@
|
||||
#define RTI_CMP0 ((CONFIG_USEC_PER_TICK * (RTI_FRC0CLK / 100000) + 50) / 100)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timerisr
|
||||
* Name: tms570_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -130,7 +130,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int tms570_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Cleear the RTI Compare 0 interrupts */
|
||||
|
||||
@ -143,7 +143,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -151,7 +155,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void arm_timer_initialize(void)
|
||||
{
|
||||
/* Disable all RTI interrupts */
|
||||
|
||||
@ -190,7 +194,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the interrupt handler to the RTI Compare 0 interrupt */
|
||||
|
||||
DEBUGVERIFY(irq_attach(TMS570_REQ_RTICMP0, (xcpt_t)up_timerisr));
|
||||
DEBUGVERIFY(irq_attach(TMS570_REQ_RTICMP0, (xcpt_t)tms570_timerisr));
|
||||
|
||||
/* Enable RTI compare 0 interrupts at the VIM */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/at32uc3/at32uc3_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -130,10 +130,6 @@
|
||||
# define AV32_TOP (144-1)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
@ -153,11 +149,7 @@ static void rtc_waitnotbusy(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: at32uc3_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -165,7 +157,7 @@ static void rtc_waitnotbusy(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int at32uc3_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Clear the pending timer interrupt */
|
||||
|
||||
@ -178,7 +170,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -187,7 +183,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void avr_timer_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
@ -223,7 +219,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(AVR32_IRQ_RTC, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(AVR32_IRQ_RTC, (xcpt_t)at32uc3_timerisr);
|
||||
|
||||
/* Enable RTC interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/at90usb/at90usb_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -101,20 +101,12 @@
|
||||
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: at90usb_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -122,7 +114,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int at90usb_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -131,7 +123,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -140,7 +136,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void avr_timer_initialize(void)
|
||||
{
|
||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||
*
|
||||
@ -172,7 +168,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)at90usb_timerisr);
|
||||
|
||||
/* Enable the interrupt on compare match A */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/atmega/atmega_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -101,20 +101,12 @@
|
||||
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: atmega_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -122,7 +114,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int atmega_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -131,7 +123,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: avr_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -140,7 +136,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void avr_timer_initialize(void)
|
||||
{
|
||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||
*
|
||||
@ -173,9 +169,9 @@ void up_timer_initialize(void)
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
#if defined(ATMEGA_IRQ_T1COMPA)
|
||||
(void)irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)atmega_timerisr);
|
||||
#elif defined(ATMEGA_IRQ_TIM1_COMPA)
|
||||
(void)irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)atmega_timerisr);
|
||||
#else
|
||||
# error "Unable to find IRQ for timer"
|
||||
#endif
|
||||
|
@ -228,7 +228,7 @@ void up_initialize(void)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
up_timer_initialize();
|
||||
avr_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -143,7 +143,6 @@ void up_irqinitialize(void);
|
||||
void weak_function up_dmainitialize(void);
|
||||
#endif
|
||||
void up_sigdeliver(void);
|
||||
int up_timerisr(int irq, uint32_t *regs);
|
||||
void up_lowputc(char ch);
|
||||
void up_puts(const char *str);
|
||||
void up_lowputs(const char *str);
|
||||
@ -185,7 +184,7 @@ void lowconsole_init(void);
|
||||
|
||||
/* Defined in chip/xxx_timerisr.c */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void avr_timer_initialize(void);
|
||||
|
||||
/* Defined in chip/xxx_ethernet.c */
|
||||
|
||||
|
@ -154,7 +154,7 @@ void up_initialize(void)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
up_timer_initialize();
|
||||
hc_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -173,8 +173,7 @@ void up_sigdeliver(void);
|
||||
|
||||
/* System timer initialization */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
int up_timerisr(int irq, uint32_t *regs);
|
||||
void hc_timer_initialize(void);
|
||||
|
||||
/* Debug output */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/hc/src/m9s12/m9s12_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -119,19 +119,11 @@
|
||||
#define MODCNT_VALUE ((((uint32_t)HCS12_OSCCLK + (MODCNT_DENOM/2))/ MODCNT_DENOM) - 1)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: m9s12_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -139,7 +131,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int m9s12_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Clear real time interrupt flag */
|
||||
|
||||
@ -152,7 +144,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: hc_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the system timer
|
||||
@ -160,7 +156,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void hc_timer_initialize(void)
|
||||
{
|
||||
uint32_t tmp;
|
||||
uint8_t regval;
|
||||
@ -175,7 +171,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(HCS12_IRQ_VRTI, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(HCS12_IRQ_VRTI, (xcpt_t)m9s12_timerisr);
|
||||
|
||||
/* Enable RTI interrupt by setting the RTIE bit */
|
||||
|
||||
|
@ -156,7 +156,7 @@ void up_initialize(void)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
up_timer_initialize();
|
||||
mips_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -261,7 +261,7 @@ void up_serialinit(void);
|
||||
|
||||
/* System timer */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void mips_timer_initialize(void);
|
||||
|
||||
/* Network */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/mips/src/pic32mx/pic32mx_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -125,19 +125,11 @@
|
||||
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: pc32mx_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -145,20 +137,24 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int pc32mx_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Clear the pending timer interrupt */
|
||||
/* Clear the pending timer interrupt */
|
||||
|
||||
putreg32(INT_T1, PIC32MX_INT_IFS0CLR);
|
||||
putreg32(INT_T1, PIC32MX_INT_IFS0CLR);
|
||||
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mips_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -166,7 +162,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void mips_timer_initialize(void)
|
||||
{
|
||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||
@ -187,7 +183,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(PIC32MX_IRQ_T1, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(PIC32MX_IRQ_T1, (xcpt_t)pc32mx_timerisr);
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/mips/src/pic32mz/pic32mz_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -124,19 +124,11 @@
|
||||
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: pc32mz_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -144,20 +136,24 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int pc32mz_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Clear the pending timer interrupt */
|
||||
/* Clear the pending timer interrupt */
|
||||
|
||||
up_clrpend_irq(PIC32MZ_IRQ_T1);
|
||||
up_clrpend_irq(PIC32MZ_IRQ_T1);
|
||||
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mips_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -165,7 +161,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void mips_timer_initialize(void)
|
||||
{
|
||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||
@ -183,7 +179,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)pc32mz_timerisr);
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: misoc_timer_isr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -95,7 +95,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, void *context)
|
||||
int misoc_timer_isr(int irq, void *context)
|
||||
{
|
||||
/* Clear event pending */
|
||||
|
||||
@ -108,7 +108,7 @@ int up_timerisr(int irq, void *context)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Function: misoc_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -139,7 +139,7 @@ void misoc_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(TIMER0_INTERRUPT, up_timerisr);
|
||||
(void)irq_attach(TIMER0_INTERRUPT, misoc_timer_isr);
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
||||
|
@ -145,7 +145,7 @@ void up_initialize(void)
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
up_timer_initialize();
|
||||
renesas_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -158,13 +158,12 @@ void up_prefetchabort(uint32_t *regs);
|
||||
int up_saveusercontext(uint32_t *regs);
|
||||
void up_sigdeliver(void);
|
||||
void up_syscall(uint32_t *regs);
|
||||
int up_timerisr(int irq, uint32_t *regs);
|
||||
void up_undefinedinsn(uint32_t *regs);
|
||||
void up_lowputc(char ch);
|
||||
void up_puts(const char *str);
|
||||
void up_lowputs(const char *str);
|
||||
|
||||
/* Defined in up_vectors.S */
|
||||
/* Defined in xyz_vectors.S */
|
||||
|
||||
void up_vectorundefinsn(void);
|
||||
void up_vectorswi(void);
|
||||
@ -174,7 +173,7 @@ void up_vectoraddrexcptn(void);
|
||||
void up_vectorirq(void);
|
||||
void up_vectorfiq(void);
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
/* Defined in xyz_serial.c */
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
void up_earlyconsoleinit(void);
|
||||
@ -192,15 +191,15 @@ void lowconsole_init(void);
|
||||
# define lowconsole_init()
|
||||
#endif
|
||||
|
||||
/* Defined in up_watchdog.c */
|
||||
/* Defined in xyz_watchdog.c */
|
||||
|
||||
void up_wdtinit(void);
|
||||
|
||||
/* Defined in up_timerisr.c */
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void renesas_timer_initialize(void);
|
||||
|
||||
/* Defined in board/up_lcd.c */
|
||||
/* Defined in board/xyz_lcd.c */
|
||||
|
||||
#ifdef CONFIG_LCD_CONSOLE
|
||||
void up_lcdinit(void);
|
||||
@ -210,7 +209,7 @@ void up_lcdputc(char ch);
|
||||
# define up_lcdputc(ch)
|
||||
#endif
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
/* Defined in board/xyz_network.c */
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
void up_netinitialize(void);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/renesas/src/m16c/m16c_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -107,19 +107,11 @@
|
||||
((M16C_XIN_FREQ / M16C_PRESCALE_VALUE / CLK_TCK) - 1)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Definitions
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: m16c_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -127,16 +119,20 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int m16c_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: renesas_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -144,7 +140,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void renesas_timer_initialize(void)
|
||||
{
|
||||
/* Make sure that no timers are running and that all timer interrupts are
|
||||
* disabled.
|
||||
@ -170,7 +166,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the interrupt handler */
|
||||
|
||||
irq_attach(M16C_SYSTIMER_IRQ, (xcpt_t)up_timerisr);
|
||||
irq_attach(M16C_SYSTIMER_IRQ, (xcpt_t)m16c_timerisr);
|
||||
|
||||
/* Enable timer interrupts */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/renesas/src/sh1/sh1_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -113,19 +113,11 @@
|
||||
#define TCNT_PER_TICK ((TCNT_CLOCK + (CLK_TCK-1))/ CLK_TCK)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: sh1_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -133,25 +125,29 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int sh1_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
uint8_t reg8;
|
||||
uint8_t reg8;
|
||||
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
sched_process_timer();
|
||||
|
||||
/* Clear ITU0 interrupt status flag */
|
||||
/* Clear ITU0 interrupt status flag */
|
||||
|
||||
reg8 = getreg8(SH1_ITU0_TSR);
|
||||
reg8 &= ~SH1_ITUTSR_IMFA;
|
||||
putreg8(reg8, SH1_ITU0_TSR);
|
||||
reg8 = getreg8(SH1_ITU0_TSR);
|
||||
reg8 &= ~SH1_ITUTSR_IMFA;
|
||||
putreg8(reg8, SH1_ITU0_TSR);
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: renesas_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -159,7 +155,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void renesas_timer_initialize(void)
|
||||
{
|
||||
uint8_t reg8;
|
||||
|
||||
@ -187,7 +183,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the IMIA0 IRQ */
|
||||
|
||||
irq_attach(SH1_SYSTIMER_IRQ, (xcpt_t)up_timerisr);
|
||||
irq_attach(SH1_SYSTIMER_IRQ, (xcpt_t)sh1_timerisr);
|
||||
|
||||
/* Enable interrupts on GRA compare match */
|
||||
|
||||
|
@ -155,7 +155,7 @@ void up_initialize(void)
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||
up_timer_initialize();
|
||||
riscv_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -142,8 +142,7 @@ uint32_t up_get_newintctx(void);
|
||||
|
||||
/* System timer *************************************************************/
|
||||
|
||||
void up_timer_initialize(void);
|
||||
int up_timerisr(int irq, void *context);
|
||||
void riscv_timer_initialize(void);
|
||||
|
||||
/* Low level serial output **************************************************/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/risc-v/src/nr5m100/nr5_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Modified for RISC-V:
|
||||
@ -84,19 +84,17 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static uint64_t g_systick = 0;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Global Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: nr5m100_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -104,9 +102,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint64_t g_systick = 0;
|
||||
|
||||
int up_timerisr(int irq, void *context)
|
||||
static int nr5m100_timerisr(int irq, void *context)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -114,6 +110,10 @@ int up_timerisr(int irq, void *context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Global Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_get_systick
|
||||
*
|
||||
@ -128,7 +128,7 @@ uint64_t up_get_systick(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Function: riscv_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -136,7 +136,7 @@ uint64_t up_get_systick(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void riscv_timer_initialize(void)
|
||||
{
|
||||
/* Set the SysTick interrupt to the default priority */
|
||||
|
||||
@ -146,7 +146,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(NR5_IRQ_SYSTICK, up_timerisr);
|
||||
(void)irq_attach(NR5_IRQ_SYSTICK, nr5m100_timerisr);
|
||||
|
||||
/* Configure and enable SysTick to interrupt at the requested rate */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* void sim_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the intialization sequence (by up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
@ -96,7 +96,7 @@ static bool g_timer_active;
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
* Name: sim_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
@ -120,7 +120,7 @@ static bool g_timer_active;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void sim_timer_initialize(void)
|
||||
{
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ void up_timer_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* sim_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
|
@ -156,7 +156,7 @@ void up_initialize(void)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
up_timer_initialize();
|
||||
x86_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -215,7 +215,7 @@ void up_addregion(void);
|
||||
# define up_addregion()
|
||||
#endif
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
/* Defined in xyz_serial.c */
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
void up_earlyserialinit(void);
|
||||
@ -233,13 +233,13 @@ void lowconsole_init(void);
|
||||
# define lowconsole_init()
|
||||
#endif
|
||||
|
||||
/* Defined in up_watchdog.c */
|
||||
/* Defined in xyz_watchdog.c */
|
||||
|
||||
void up_wdtinit(void);
|
||||
|
||||
/* Defined in up_timerisr.c */
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void x86_timer_initialize(void);
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/x86/src/qemu/qemu_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Based on Bran's kernel development tutorials. Rewritten for JamesM's
|
||||
@ -80,20 +80,12 @@
|
||||
|
||||
#define PIT_DIVISOR ((uint32_t)PIT_CLOCK/(uint32_t)CLK_TCK)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: qemu_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -101,12 +93,12 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int up_timerisr(int irq, uint32_t *regs)
|
||||
static int qemu_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -114,7 +106,7 @@ static int up_timerisr(int irq, uint32_t *regs)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Function: x86_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -122,7 +114,7 @@ static int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void x86_timer_initialize(void)
|
||||
{
|
||||
/* uint32_t to avoid compile time overflow errors */
|
||||
|
||||
@ -131,7 +123,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach to the timer interrupt handler */
|
||||
|
||||
(void)irq_attach(IRQ0, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(IRQ0, (xcpt_t)qemu_timerisr);
|
||||
|
||||
/* Send the command byte to configure counter 0 */
|
||||
|
||||
|
@ -156,7 +156,7 @@ void up_initialize(void)
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
up_timer_initialize();
|
||||
z16_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Register devices */
|
||||
|
@ -146,7 +146,6 @@ void up_restoreusercontext(FAR chipreg_t *regs);
|
||||
void up_irqinitialize(void);
|
||||
int up_saveusercontext(FAR chipreg_t *regs);
|
||||
void up_sigdeliver(void);
|
||||
int up_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
#if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC)
|
||||
void up_lowputc(char ch);
|
||||
@ -154,13 +153,13 @@ void up_lowputc(char ch);
|
||||
# define up_lowputc(ch)
|
||||
#endif
|
||||
|
||||
/* Defined in up_allocateheap.c */
|
||||
/* Defined in xyz_allocateheap.c */
|
||||
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
void up_addregion(void);
|
||||
#endif
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
/* Defined in xyz_serial.c */
|
||||
|
||||
#ifdef USE_SERIALDRIVER
|
||||
void up_earlyserialinit(void);
|
||||
@ -171,15 +170,15 @@ void up_serialinit(void);
|
||||
void lowconsole_init(void);
|
||||
#endif
|
||||
|
||||
/* Defined in up_timerisr.c */
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void z16_timer_initialize(void);
|
||||
|
||||
/* Defined in up_irq.c */
|
||||
/* Defined in xyz_irq.c */
|
||||
|
||||
void up_ack_irq(int irq);
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
/* Defined in board/xyz_network.c */
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
void up_netinitialize(void);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/z16/src/z16f/z16f_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -70,19 +70,11 @@ extern _Erom uint8_t SYS_CLK_FREQ;
|
||||
#define _DEFCLK ((uint32_t)&SYS_CLK_FREQ)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: z16f_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -90,16 +82,20 @@ extern _Erom uint8_t SYS_CLK_FREQ;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int z16f_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z16_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize
|
||||
@ -107,7 +103,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void z16_timer_initialize(void)
|
||||
{
|
||||
uint32_t reload;
|
||||
uint32_t scaledfreq;
|
||||
@ -228,6 +224,6 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt (leaving at priority 0) */
|
||||
|
||||
irq_attach(Z16F_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(Z16F_IRQ_SYSTIMER, (xcpt_t)z16f_timerisr);
|
||||
up_enable_irq(Z16F_IRQ_SYSTIMER);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ void up_initialize(void)
|
||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||
/* Initialize the system timer interrupt */
|
||||
|
||||
up_timer_initialize();
|
||||
z80_timer_initialize();
|
||||
#endif
|
||||
|
||||
/* Initialize the CPU for those that use it (only for the Z180). This
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/common/up_internal.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -133,7 +133,6 @@ extern "C"
|
||||
/* Supplied by chip- or board-specific logic */
|
||||
|
||||
void up_irqinitialize(void);
|
||||
int up_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
#ifdef USE_LOWSERIALINIT
|
||||
void up_lowserialinit(void);
|
||||
@ -143,7 +142,7 @@ void up_lowserialinit(void);
|
||||
|
||||
FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs);
|
||||
|
||||
/* Define in up_sigdeliver */
|
||||
/* Define in zyz_sigdeliver */
|
||||
|
||||
void up_sigdeliver(void);
|
||||
|
||||
@ -153,13 +152,13 @@ void up_sigdeliver(void);
|
||||
int up_mmuinit(void);
|
||||
#endif
|
||||
|
||||
/* Defined in up_allocateheap.c */
|
||||
/* Defined in xyz_allocateheap.c */
|
||||
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
void up_addregion(void);
|
||||
#endif
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
/* Defined in xyz_serial.c */
|
||||
|
||||
#ifdef USE_SERIALDRIVER
|
||||
void up_serialinit(void);
|
||||
@ -195,9 +194,9 @@ void ramlog_consoleinit(void);
|
||||
|
||||
void up_puts(const char *str);
|
||||
|
||||
/* Defined in up_timerisr.c */
|
||||
/* Defined in xyz_timerisr.c */
|
||||
|
||||
void up_timer_initialize(void);
|
||||
void z80_timer_initialize(void);
|
||||
|
||||
/* Architecture specific hook into the timer interrupt handler */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/ez80/ez80_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -49,24 +49,12 @@
|
||||
#include "clock/clock.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: ez80_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -74,7 +62,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, chipreg_t *regs)
|
||||
static int ez80_timerisr(int irq, chipreg_t *regs)
|
||||
{
|
||||
/* Read the appropriate timer0 register to clear the interrupt */
|
||||
|
||||
@ -100,7 +88,11 @@ int up_timerisr(int irq, chipreg_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -108,7 +100,7 @@ int up_timerisr(int irq, chipreg_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void z80_timer_initialize(void)
|
||||
{
|
||||
uint16_t reload;
|
||||
|
||||
@ -118,7 +110,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach system timer interrupts */
|
||||
|
||||
irq_attach(EZ80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(EZ80_IRQ_SYSTIMER, (xcpt_t)ez80_timerisr);
|
||||
|
||||
/* Set up the timer reload value */
|
||||
/* Write to the timer reload register to set the reload value.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/z180/z180_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -72,19 +72,11 @@
|
||||
#define A180_PRT0_RELOAD (Z180_PRT_CLOCK / CLK_TCK)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: z180_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -92,7 +84,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, chipreg_t *regs)
|
||||
static int z180_timerisr(int irq, chipreg_t *regs)
|
||||
{
|
||||
/* "When TMDR0 decrements to 0, TIF0 is set to 1. This generates an interrupt
|
||||
* request if enabled by TIE0 = 1. TIF0 is reset to 0 when TCR is read and
|
||||
@ -110,7 +102,11 @@ int up_timerisr(int irq, chipreg_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -118,7 +114,7 @@ int up_timerisr(int irq, chipreg_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void z80_timer_initialize(void)
|
||||
{
|
||||
uint8_t regval;
|
||||
|
||||
@ -146,7 +142,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach the timer interrupt vector */
|
||||
|
||||
(void)irq_attach(Z180_PRT0, (xcpt_t)up_timerisr);
|
||||
(void)irq_attach(Z180_PRT0, (xcpt_t)z180_timerisr);
|
||||
|
||||
/* And enable the timer interrupt */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/z8/z8_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -49,18 +49,6 @@
|
||||
#include "clock/clock.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -70,7 +58,11 @@
|
||||
extern uint32_t get_freq(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z8_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions
|
||||
@ -78,16 +70,20 @@ extern uint32_t get_freq(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, uint32_t *regs)
|
||||
static int z8_timerisr(int irq, uint32_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
/* Process timer interrupt */
|
||||
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
sched_process_timer();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: z80_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -95,7 +91,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void z80_timer_initialize(void)
|
||||
{
|
||||
uint32_t reload;
|
||||
|
||||
@ -141,7 +137,7 @@ void up_timer_initialize(void)
|
||||
|
||||
/* Attach and enable the timer interrupt (leaving at priority 0 */
|
||||
|
||||
irq_attach(Z8_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(Z8_IRQ_SYSTIMER, (xcpt_t)z8_timerisr);
|
||||
up_enable_irq(Z8_IRQ_SYSTIMER);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ echo "EXTERN(up_vectoraddrexcptn)" >>ld-locked.inc
|
||||
#
|
||||
# Of course, this list must be extended as interrupt handlers are added.
|
||||
|
||||
echo "EXTERN(up_timer_initialize)" >>ld-locked.inc
|
||||
echo "EXTERN(arm_timer_initialize)" >>ld-locked.inc
|
||||
|
||||
answer=$(checkconfig CONFIG_LPC31_UART)
|
||||
if [ "$answer" = y ]; then
|
||||
|
@ -44,6 +44,16 @@
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
int xtrs_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_irqinitialize
|
||||
****************************************************************************/
|
||||
@ -56,10 +66,11 @@ void up_irqinitialize(void)
|
||||
*
|
||||
* NOTE: Normally, there are seperate enables for "global" interrupts
|
||||
* and specific device interrupts. In such a "normal" case, the timer
|
||||
* interrupt should be attached and enabled in the function up_timer_initialize()
|
||||
* interrupt should be attached and enabled in the function
|
||||
* xtrs_timer_initialize()
|
||||
*/
|
||||
|
||||
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)xtrs_timerisr);
|
||||
|
||||
/* And finally, enable interrupts (including the timer) */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/xtrs/src/xtr_timerisr.c
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -46,24 +46,12 @@
|
||||
#include "clock/clock.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: xtrs_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions of
|
||||
@ -71,7 +59,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
int xtrs_timerisr(int irq, FAR chipreg_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -80,7 +68,7 @@ int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Function: xtrs_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -88,7 +76,7 @@ int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void xtrs_timer_initialize(void)
|
||||
{
|
||||
/* The timer interrupt was attached in up_irqinitialize -- see comments there */
|
||||
}
|
||||
|
@ -45,20 +45,10 @@
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
int z80sim_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -76,10 +66,11 @@ void up_irqinitialize(void)
|
||||
*
|
||||
* NOTE: Normally, there are seperate enables for "global" interrupts
|
||||
* and specific device interrupts. In such a "normal" case, the timer
|
||||
* interrupt should be attached and enabled in the function up_timer_initialize()
|
||||
* interrupt should be attached and enabled in the function
|
||||
* z80sim_timer_initialize()
|
||||
*/
|
||||
|
||||
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
||||
irq_attach(Z80_IRQ_SYSTIMER, (xcpt_t)z80sim_timerisr);
|
||||
|
||||
/* And finally, enable interrupts (including the timer) */
|
||||
|
||||
|
@ -46,24 +46,12 @@
|
||||
#include "clock/clock.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timerisr
|
||||
* Function: z80sim_timerisr
|
||||
*
|
||||
* Description:
|
||||
* The timer ISR will perform a variety of services for various portions of
|
||||
@ -71,7 +59,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
int z80sim_timerisr(int irq, FAR chipreg_t *regs)
|
||||
{
|
||||
/* Process timer interrupt */
|
||||
|
||||
@ -80,7 +68,7 @@ int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: up_timer_initialize
|
||||
* Function: z80sim_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called during start-up to initialize the timer
|
||||
@ -88,8 +76,7 @@ int up_timerisr(int irq, FAR chipreg_t *regs)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_timer_initialize(void)
|
||||
void z80sim_timer_initialize(void)
|
||||
{
|
||||
/* The timer interrupt was attached in up_irqinitialize -- see comments there */
|
||||
}
|
||||
|
||||
|
@ -1402,8 +1402,9 @@ int up_prioritize_irq(int irq, int priority);
|
||||
* is suppressed and the platform specific code is expected to provide the
|
||||
* following custom functions.
|
||||
*
|
||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
||||
* early in the intialization sequence (by up_intialize()).
|
||||
* Architecture specific timer initialiation logic initializes the timer
|
||||
* facilities. This happens early in the intialization sequence (via
|
||||
* up_intialize()).
|
||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||
* time from the platform specific time source.
|
||||
*
|
||||
@ -1434,42 +1435,13 @@ int up_prioritize_irq(int irq, int priority);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializes all platform-specific timer facilities. This function is
|
||||
* called early in the initialization sequence by up_intialize().
|
||||
* On return, the current up-time should be available from
|
||||
* up_timer_gettime() and the interval timer is ready for use (but not
|
||||
* actively timing).
|
||||
*
|
||||
* Provided by platform-specific code and called from the architecture-
|
||||
* specific logic.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
* Assumptions:
|
||||
* Called early in the initialization sequence before any special
|
||||
* concurrency protections are required.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Prototyped in up_internal.h in all cases. */
|
||||
void up_timer_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_timer_gettime
|
||||
*
|
||||
* Description:
|
||||
* Return the elapsed time since power-up (or, more correctly, since
|
||||
* up_timer_initialize() was called). This function is functionally
|
||||
* equivalent to:
|
||||
* the archtecture-specific timer was initialized). This function is
|
||||
* functionally equivalent to:
|
||||
*
|
||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user