diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 03aed91b3a..2e20d72ac9 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: August 31, 2016

+

Last Updated: February 7, 2017

@@ -2324,7 +2324,7 @@ config ARCH_SIM

-
4.3.4.4.1 up_timer_initialize()
+
4.3.4.4.1 <arch>_timer_initialize()

Function Prototype:

Description:

Description:

- Return the elapsed time since power-up (or, more correctly, since up_timer_initialize() was called). This function is functionally equivalent to clock_gettime() for the clock ID CLOCK_MONOTONIC. This function provides the basis for reporting the current time and also is used to eliminate error build-up from small errors in interval time calculations. + Return the elapsed time since power-up (or, more correctly, since <arch>_timer_initialize() was called). This function is functionally equivalent to clock_gettime() for the clock ID CLOCK_MONOTONIC. This function provides the basis for reporting the current time and also is used to eliminate error build-up from small errors in interval time calculations.

Input Parameters:

diff --git a/TODO b/TODO index eefde1ac50..0d6206f2d2 100644 --- a/TODO +++ b/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 diff --git a/arch/arm/src/a1x/a1x_timerisr.c b/arch/arm/src/a1x/a1x_timerisr.c index d4e827b13d..04407d1051 100644 --- a/arch/arm/src/a1x/a1x_timerisr.c +++ b/arch/arm/src/a1x/a1x_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/c5471/c5471_timerisr.c b/arch/arm/src/c5471/c5471_timerisr.c index 6f1ca3da87..1720a13bf9 100644 --- a/arch/arm/src/c5471/c5471_timerisr.c +++ b/arch/arm/src/c5471/c5471_timerisr.c @@ -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); } diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c index a97cd40a92..5182598246 100644 --- a/arch/arm/src/common/up_initialize.c +++ b/arch/arm/src/common/up_initialize.c @@ -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 */ diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index 36095a87a4..a634c86df6 100644 --- a/arch/arm/src/common/up_internal.h +++ b/arch/arm/src/common/up_internal.h @@ -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 **************************************************/ diff --git a/arch/arm/src/dm320/dm320_timerisr.c b/arch/arm/src/dm320/dm320_timerisr.c index e88cac0630..33ed932666 100644 --- a/arch/arm/src/dm320/dm320_timerisr.c +++ b/arch/arm/src/dm320/dm320_timerisr.c @@ -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 * * 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); } diff --git a/arch/arm/src/efm32/efm32_timerisr.c b/arch/arm/src/efm32/efm32_timerisr.c index 4810d5c3b6..095143482b 100644 --- a/arch/arm/src/efm32/efm32_timerisr.c +++ b/arch/arm/src/efm32/efm32_timerisr.c @@ -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 * Pierre-noel Bouteville @@ -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 */ diff --git a/arch/arm/src/imx1/imx_timerisr.c b/arch/arm/src/imx1/imx_timerisr.c index 77facd7cc9..c18f72efab 100644 --- a/arch/arm/src/imx1/imx_timerisr.c +++ b/arch/arm/src/imx1/imx_timerisr.c @@ -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 * * 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); } diff --git a/arch/arm/src/imx6/imx_timerisr.c b/arch/arm/src/imx6/imx_timerisr.c index 4c76666493..dbfc878eb8 100644 --- a/arch/arm/src/imx6/imx_timerisr.c +++ b/arch/arm/src/imx6/imx_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/kinetis/kinetis_timerisr.c b/arch/arm/src/kinetis/kinetis_timerisr.c index a418a5e823..48e411dcf5 100644 --- a/arch/arm/src/kinetis/kinetis_timerisr.c +++ b/arch/arm/src/kinetis/kinetis_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/kl/kl_timerisr.c b/arch/arm/src/kl/kl_timerisr.c index bcd17b0648..bf40610275 100644 --- a/arch/arm/src/kl/kl_timerisr.c +++ b/arch/arm/src/kl/kl_timerisr.c @@ -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 * * 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 diff --git a/arch/arm/src/lpc11xx/lpc11_timerisr.c b/arch/arm/src/lpc11xx/lpc11_timerisr.c index 6bbd6e0878..b5054c79ca 100644 --- a/arch/arm/src/lpc11xx/lpc11_timerisr.c +++ b/arch/arm/src/lpc11xx/lpc11_timerisr.c @@ -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 * * 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 diff --git a/arch/arm/src/lpc17xx/lpc17_timerisr.c b/arch/arm/src/lpc17xx/lpc17_timerisr.c index d0f48a57d1..4f6d318642 100644 --- a/arch/arm/src/lpc17xx/lpc17_timerisr.c +++ b/arch/arm/src/lpc17xx/lpc17_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index 24defd5a52..027dfa6e7e 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index 9ff6cf862a..6d85b07c0f 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -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 diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index a2607f6266..ab01f01ced 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -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 * * 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) diff --git a/arch/arm/src/lpc43xx/lpc43_rit.c b/arch/arm/src/lpc43xx/lpc43_rit.c index e42fc7db43..c0bf633256 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_rit.c @@ -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; diff --git a/arch/arm/src/lpc43xx/lpc43_rit.h b/arch/arm/src/lpc43xx/lpc43_rit.h index 3088b8fe11..d8d1fa1e06 100644 --- a/arch/arm/src/lpc43xx/lpc43_rit.h +++ b/arch/arm/src/lpc43xx/lpc43_rit.h @@ -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); diff --git a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c index f7c94d3a6e..ce0f7d6375 100644 --- a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c @@ -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(); diff --git a/arch/arm/src/lpc43xx/lpc43_timerisr.c b/arch/arm/src/lpc43xx/lpc43_timerisr.c index 2b728f7fb4..8b02b4c099 100644 --- a/arch/arm/src/lpc43xx/lpc43_timerisr.c +++ b/arch/arm/src/lpc43xx/lpc43_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/moxart/moxart_timer.c b/arch/arm/src/moxart/moxart_timer.c index e2c115bee8..1b281f05dd 100644 --- a/arch/arm/src/moxart/moxart_timer.c +++ b/arch/arm/src/moxart/moxart_timer.c @@ -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 * * 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); diff --git a/arch/arm/src/nuc1xx/nuc_timerisr.c b/arch/arm/src/nuc1xx/nuc_timerisr.c index d30e81b85c..c32dcc66c0 100644 --- a/arch/arm/src/nuc1xx/nuc_timerisr.c +++ b/arch/arm/src/nuc1xx/nuc_timerisr.c @@ -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 * * 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. diff --git a/arch/arm/src/sam34/sam4cm_tickless.c b/arch/arm/src/sam34/sam4cm_tickless.c index 54b6c943af..8f3ee17509 100644 --- a/arch/arm/src/sam34/sam4cm_tickless.c +++ b/arch/arm/src/sam34/sam4cm_tickless.c @@ -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); diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index 6ebdc2ffd4..00dde9aa7c 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/sama5/sam_tickless.c b/arch/arm/src/sama5/sam_tickless.c index 4ae30bf718..bb3c678561 100644 --- a/arch/arm/src/sama5/sam_tickless.c +++ b/arch/arm/src/sama5/sam_tickless.c @@ -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); diff --git a/arch/arm/src/sama5/sam_timerisr.c b/arch/arm/src/sama5/sam_timerisr.c index 3861b1217a..3495bc6427 100644 --- a/arch/arm/src/sama5/sam_timerisr.c +++ b/arch/arm/src/sama5/sam_timerisr.c @@ -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 * * 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. diff --git a/arch/arm/src/samdl/sam_timerisr.c b/arch/arm/src/samdl/sam_timerisr.c index 327e8b72b0..5236ee45b5 100644 --- a/arch/arm/src/samdl/sam_timerisr.c +++ b/arch/arm/src/samdl/sam_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/samv7/sam_tickless.c b/arch/arm/src/samv7/sam_tickless.c index 95f4b8754f..1cda5dcc73 100644 --- a/arch/arm/src/samv7/sam_tickless.c +++ b/arch/arm/src/samv7/sam_tickless.c @@ -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); diff --git a/arch/arm/src/samv7/sam_timerisr.c b/arch/arm/src/samv7/sam_timerisr.c index 9e167aeae7..c2c30ea0af 100644 --- a/arch/arm/src/samv7/sam_timerisr.c +++ b/arch/arm/src/samv7/sam_timerisr.c @@ -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 * * 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) */ diff --git a/arch/arm/src/stm32/stm32_tickless.c b/arch/arm/src/stm32/stm32_tickless.c index 82d7a593d2..fafa9bcadf 100644 --- a/arch/arm/src/stm32/stm32_tickless.c +++ b/arch/arm/src/stm32/stm32_tickless.c @@ -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); diff --git a/arch/arm/src/stm32/stm32_timerisr.c b/arch/arm/src/stm32/stm32_timerisr.c index b9c3fa1ab3..cb0bd885a7 100644 --- a/arch/arm/src/stm32/stm32_timerisr.c +++ b/arch/arm/src/stm32/stm32_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/stm32f7/stm32_timerisr.c b/arch/arm/src/stm32f7/stm32_timerisr.c index db9c685cdf..07cfd01d0f 100644 --- a/arch/arm/src/stm32f7/stm32_timerisr.c +++ b/arch/arm/src/stm32f7/stm32_timerisr.c @@ -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 * * 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: * diff --git a/arch/arm/src/stm32l4/stm32l4_tickless.c b/arch/arm/src/stm32l4/stm32l4_tickless.c index 9474f720c5..2d742daa1f 100644 --- a/arch/arm/src/stm32l4/stm32l4_tickless.c +++ b/arch/arm/src/stm32l4/stm32l4_tickless.c @@ -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); diff --git a/arch/arm/src/stm32l4/stm32l4_timerisr.c b/arch/arm/src/stm32l4/stm32l4_timerisr.c index ee02fc01fa..fff106e852 100644 --- a/arch/arm/src/stm32l4/stm32l4_timerisr.c +++ b/arch/arm/src/stm32l4/stm32l4_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/str71x/str71x_timerisr.c b/arch/arm/src/str71x/str71x_timerisr.c index 3604e6aa73..553705d24c 100644 --- a/arch/arm/src/str71x/str71x_timerisr.c +++ b/arch/arm/src/str71x/str71x_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/tiva/tiva_timerisr.c b/arch/arm/src/tiva/tiva_timerisr.c index 76fd7e96cb..41b8f0e4ed 100644 --- a/arch/arm/src/tiva/tiva_timerisr.c +++ b/arch/arm/src/tiva/tiva_timerisr.c @@ -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 * * 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 */ diff --git a/arch/arm/src/tms570/tms570_timerisr.c b/arch/arm/src/tms570/tms570_timerisr.c index 4744ccbdb8..8833791452 100644 --- a/arch/arm/src/tms570/tms570_timerisr.c +++ b/arch/arm/src/tms570/tms570_timerisr.c @@ -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 * * 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 */ diff --git a/arch/avr/src/at32uc3/at32uc3_timerisr.c b/arch/avr/src/at32uc3/at32uc3_timerisr.c index e0d6cc6c35..79118a15d8 100644 --- a/arch/avr/src/at32uc3/at32uc3_timerisr.c +++ b/arch/avr/src/at32uc3/at32uc3_timerisr.c @@ -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 * * 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 */ diff --git a/arch/avr/src/at90usb/at90usb_timerisr.c b/arch/avr/src/at90usb/at90usb_timerisr.c index 0c53d2386c..a2c6a089f1 100644 --- a/arch/avr/src/at90usb/at90usb_timerisr.c +++ b/arch/avr/src/at90usb/at90usb_timerisr.c @@ -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 * * 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 */ diff --git a/arch/avr/src/atmega/atmega_timerisr.c b/arch/avr/src/atmega/atmega_timerisr.c index c0572b030a..ead918e7c3 100644 --- a/arch/avr/src/atmega/atmega_timerisr.c +++ b/arch/avr/src/atmega/atmega_timerisr.c @@ -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 * * 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 diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index 55a9b16753..3db612d237 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -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 */ diff --git a/arch/avr/src/common/up_internal.h b/arch/avr/src/common/up_internal.h index 64eecb658c..ded50aec53 100644 --- a/arch/avr/src/common/up_internal.h +++ b/arch/avr/src/common/up_internal.h @@ -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 */ diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index 1d75e24baf..b4d3fcde07 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.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 */ diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h index ca582195fc..f6f79a9c42 100644 --- a/arch/hc/src/common/up_internal.h +++ b/arch/hc/src/common/up_internal.h @@ -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 */ diff --git a/arch/hc/src/m9s12/m9s12_timerisr.c b/arch/hc/src/m9s12/m9s12_timerisr.c index c0c74697ff..eef0613ded 100644 --- a/arch/hc/src/m9s12/m9s12_timerisr.c +++ b/arch/hc/src/m9s12/m9s12_timerisr.c @@ -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 * * 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 */ diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c index 609ce62f82..a07c189cf6 100644 --- a/arch/mips/src/common/up_initialize.c +++ b/arch/mips/src/common/up_initialize.c @@ -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 */ diff --git a/arch/mips/src/common/up_internal.h b/arch/mips/src/common/up_internal.h index f14bc63b3c..4dc2b54907 100644 --- a/arch/mips/src/common/up_internal.h +++ b/arch/mips/src/common/up_internal.h @@ -261,7 +261,7 @@ void up_serialinit(void); /* System timer */ -void up_timer_initialize(void); +void mips_timer_initialize(void); /* Network */ diff --git a/arch/mips/src/pic32mx/pic32mx-timerisr.c b/arch/mips/src/pic32mx/pic32mx-timerisr.c index 4543c638e4..73cdc8b3cb 100644 --- a/arch/mips/src/pic32mx/pic32mx-timerisr.c +++ b/arch/mips/src/pic32mx/pic32mx-timerisr.c @@ -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 * * 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 */ diff --git a/arch/mips/src/pic32mz/pic32mz-timerisr.c b/arch/mips/src/pic32mz/pic32mz-timerisr.c index cbbdf886ca..63ca681a1e 100644 --- a/arch/mips/src/pic32mz/pic32mz-timerisr.c +++ b/arch/mips/src/pic32mz/pic32mz-timerisr.c @@ -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 * * 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 */ diff --git a/arch/misoc/src/common/misoc_timerisr.c b/arch/misoc/src/common/misoc_timerisr.c index 3de69520be..38266b6455 100644 --- a/arch/misoc/src/common/misoc_timerisr.c +++ b/arch/misoc/src/common/misoc_timerisr.c @@ -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 */ diff --git a/arch/renesas/src/common/up_initialize.c b/arch/renesas/src/common/up_initialize.c index fc61dc0e36..49fc1f55d1 100644 --- a/arch/renesas/src/common/up_initialize.c +++ b/arch/renesas/src/common/up_initialize.c @@ -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 */ diff --git a/arch/renesas/src/common/up_internal.h b/arch/renesas/src/common/up_internal.h index e04157953a..99bc118818 100644 --- a/arch/renesas/src/common/up_internal.h +++ b/arch/renesas/src/common/up_internal.h @@ -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); diff --git a/arch/renesas/src/m16c/m16c_timerisr.c b/arch/renesas/src/m16c/m16c_timerisr.c index 02570de1cc..8d1e8b15e8 100644 --- a/arch/renesas/src/m16c/m16c_timerisr.c +++ b/arch/renesas/src/m16c/m16c_timerisr.c @@ -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 * * 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 */ diff --git a/arch/renesas/src/sh1/sh1_timerisr.c b/arch/renesas/src/sh1/sh1_timerisr.c index c291735ad2..a16b17a71d 100644 --- a/arch/renesas/src/sh1/sh1_timerisr.c +++ b/arch/renesas/src/sh1/sh1_timerisr.c @@ -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 * * 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 */ diff --git a/arch/risc-v/src/common/up_initialize.c b/arch/risc-v/src/common/up_initialize.c index a31051f3e3..205768b00d 100644 --- a/arch/risc-v/src/common/up_initialize.c +++ b/arch/risc-v/src/common/up_initialize.c @@ -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 */ diff --git a/arch/risc-v/src/common/up_internal.h b/arch/risc-v/src/common/up_internal.h index f18d937150..bed5f05760 100644 --- a/arch/risc-v/src/common/up_internal.h +++ b/arch/risc-v/src/common/up_internal.h @@ -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 **************************************************/ diff --git a/arch/risc-v/src/nr5m100/nr5_timerisr.c b/arch/risc-v/src/nr5m100/nr5_timerisr.c index 5406b0f851..fc168a12c8 100644 --- a/arch/risc-v/src/nr5m100/nr5_timerisr.c +++ b/arch/risc-v/src/nr5m100/nr5_timerisr.c @@ -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 * * 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 */ diff --git a/arch/sim/src/up_tickless.c b/arch/sim/src/up_tickless.c index 11177de5c5..9097f751f7 100644 --- a/arch/sim/src/up_tickless.c +++ b/arch/sim/src/up_tickless.c @@ -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); diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index a089d5a774..2817204734 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -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 */ diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h index 810bece03a..4d1c4bfe3d 100644 --- a/arch/x86/src/common/up_internal.h +++ b/arch/x86/src/common/up_internal.h @@ -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 */ diff --git a/arch/x86/src/qemu/qemu_timerisr.c b/arch/x86/src/qemu/qemu_timerisr.c index adf844d24c..ca1ff272f7 100644 --- a/arch/x86/src/qemu/qemu_timerisr.c +++ b/arch/x86/src/qemu/qemu_timerisr.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 * * 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 */ diff --git a/arch/z16/src/common/up_initialize.c b/arch/z16/src/common/up_initialize.c index cb423278b3..59ee8138cd 100644 --- a/arch/z16/src/common/up_initialize.c +++ b/arch/z16/src/common/up_initialize.c @@ -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 */ diff --git a/arch/z16/src/common/up_internal.h b/arch/z16/src/common/up_internal.h index d0fc6d4404..caf7bf826e 100644 --- a/arch/z16/src/common/up_internal.h +++ b/arch/z16/src/common/up_internal.h @@ -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); diff --git a/arch/z16/src/z16f/z16f_timerisr.c b/arch/z16/src/z16f/z16f_timerisr.c index ad6e499385..c9d75e6fa0 100644 --- a/arch/z16/src/z16f/z16f_timerisr.c +++ b/arch/z16/src/z16f/z16f_timerisr.c @@ -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 * * 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); } diff --git a/arch/z80/src/common/up_initialize.c b/arch/z80/src/common/up_initialize.c index b74368979d..036ce03b37 100644 --- a/arch/z80/src/common/up_initialize.c +++ b/arch/z80/src/common/up_initialize.c @@ -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 diff --git a/arch/z80/src/common/up_internal.h b/arch/z80/src/common/up_internal.h index 2f1436967d..d12d837341 100644 --- a/arch/z80/src/common/up_internal.h +++ b/arch/z80/src/common/up_internal.h @@ -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 * * 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 */ diff --git a/arch/z80/src/ez80/ez80_timerisr.c b/arch/z80/src/ez80/ez80_timerisr.c index 26a4fae447..ec21d58382 100644 --- a/arch/z80/src/ez80/ez80_timerisr.c +++ b/arch/z80/src/ez80/ez80_timerisr.c @@ -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 * * 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. diff --git a/arch/z80/src/z180/z180_timerisr.c b/arch/z80/src/z180/z180_timerisr.c index 11f0bc92ce..29984d77bd 100644 --- a/arch/z80/src/z180/z180_timerisr.c +++ b/arch/z80/src/z180/z180_timerisr.c @@ -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 * * 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 */ diff --git a/arch/z80/src/z8/z8_timerisr.c b/arch/z80/src/z8/z8_timerisr.c index d387c770c6..b399c12d8b 100644 --- a/arch/z80/src/z8/z8_timerisr.c +++ b/arch/z80/src/z8/z8_timerisr.c @@ -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 * * 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); } diff --git a/configs/ea3131/locked/mklocked.sh b/configs/ea3131/locked/mklocked.sh index 97a126015d..1d4c0ab929 100755 --- a/configs/ea3131/locked/mklocked.sh +++ b/configs/ea3131/locked/mklocked.sh @@ -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 diff --git a/configs/xtrs/src/xtr_irq.c b/configs/xtrs/src/xtr_irq.c index 38047c9d66..fb9890390a 100644 --- a/configs/xtrs/src/xtr_irq.c +++ b/configs/xtrs/src/xtr_irq.c @@ -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) */ diff --git a/configs/xtrs/src/xtr_timerisr.c b/configs/xtrs/src/xtr_timerisr.c index 62afe947aa..5c12e6630c 100644 --- a/configs/xtrs/src/xtr_timerisr.c +++ b/configs/xtrs/src/xtr_timerisr.c @@ -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 * * 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 */ } diff --git a/configs/z80sim/src/z80_irq.c b/configs/z80sim/src/z80_irq.c index 3bfdb00035..b1fa22dc4c 100644 --- a/configs/z80sim/src/z80_irq.c +++ b/configs/z80sim/src/z80_irq.c @@ -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) */ diff --git a/configs/z80sim/src/z80_timerisr.c b/configs/z80sim/src/z80_timerisr.c index 91c1b809d8..cd0bb57292 100644 --- a/configs/z80sim/src/z80_timerisr.c +++ b/configs/z80sim/src/z80_timerisr.c @@ -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 */ } - diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index b2da611d1b..82b3086092 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -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); *