Changeset 1401076 in rtems


Ignore:
Timestamp:
Apr 19, 2012, 6:15:34 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
029ced28
Parents:
b2d9478
Message:

at91rm9200 shared: Clock driver clean up and ISR Handler Prototype Correction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/at91rm9200/clock/clock.c

    rb2d9478 r1401076  
    1010 *
    1111 *  http://www.rtems.com/license/LICENSE.
    12  *
    13  *
    14  *  $Id$
    1512 */
     13
    1614#include <rtems.h>
    1715#include <rtems/clockdrv.h>
     
    2422#include <at91rm9200_pmc.h>
    2523
    26 
    2724static unsigned long st_pimr_reload;
    2825
     
    3431static void clock_isr_on(const rtems_irq_connect_data *unused)
    3532{
    36     /* enable timer interrupt */
    37     ST_REG(ST_IER) = ST_SR_PITS;
     33  /* enable timer interrupt */
     34  ST_REG(ST_IER) = ST_SR_PITS;
    3835}
    3936
     
    4542static void clock_isr_off(const rtems_irq_connect_data *unused)
    4643{
    47     /* disable timer interrupt */
    48     ST_REG(ST_IDR) = ST_SR_PITS;
    49     return;
     44  /* disable timer interrupt */
     45  ST_REG(ST_IDR) = ST_SR_PITS;
    5046}
    5147
     
    5854static int clock_isr_is_on(const rtems_irq_connect_data *irq)
    5955{
    60     /* check timer interrupt */
    61     return ST_REG(ST_IMR) & ST_SR_PITS;
     56  /* check timer interrupt */
     57  return ST_REG(ST_IMR) & ST_SR_PITS;
    6258}
    6359
    64 rtems_isr Clock_isr(rtems_vector_number vector);
     60void Clock_isr(rtems_irq_hdl_param arg);
    6561
    6662/* Replace the first value with the clock's interrupt name. */
    67 rtems_irq_connect_data clock_isr_data = {AT91RM9200_INT_SYSIRQ,
    68                                          (rtems_irq_hdl)Clock_isr,
    69                                          NULL,
    70                                          clock_isr_on,
    71                                          clock_isr_off,
    72                                          clock_isr_is_on};
     63rtems_irq_connect_data clock_isr_data = {
     64  .name   = AT91RM9200_INT_SYSIRQ,
     65  .hdl    = Clock_isr,
     66  .handle = NULL,
     67  .on     = clock_isr_on,
     68  .off    = clock_isr_off,
     69  .isOn   = clock_isr_is_on,
     70};
    7371
    7472
     
    8785  /* the system timer is driven from SLCK */
    8886  slck = at91rm9200_get_slck();
    89   st_pimr_value =
    90     (((rtems_configuration_get_microseconds_per_tick() * slck) + (1000000/2))/ 1000000);
     87  st_pimr_value = (((rtems_configuration_get_microseconds_per_tick() * slck) +
     88                      (1000000/2))/ 1000000);
    9189  st_pimr_reload = st_pimr_value;
    9290
     
    113111  bsp_clock_nanoseconds_since_last_tick
    114112
    115 #define CLOCK_VECTOR 0
    116 
    117113#define Clock_driver_support_at_tick() \
    118114  do { \
     
    125121void Clock_driver_support_shutdown_hardware( void )
    126122{
    127     BSP_remove_rtems_irq_handler(&clock_isr_data);
     123  BSP_remove_rtems_irq_handler(&clock_isr_data);
    128124}
    129125
Note: See TracChangeset for help on using the changeset viewer.