Changeset 9c325fb2 in rtems


Ignore:
Timestamp:
Jul 16, 2008, 8:22:20 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
c702dd8
Parents:
10f095c
Message:

2008-07-16 Joel Sherrill <joel.sherrill@…>

  • mpc6xx/clock/c_clock.c: Add fast idle.
Location:
c/src/lib/libcpu/powerpc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/ChangeLog

    r10f095c r9c325fb2  
     12008-07-16      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * mpc6xx/clock/c_clock.c: Add fast idle.
     4
    152008-07-14      Sebastian Huber <sebastian.huber@embedded-brains.de>
    26
  • c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c

    r10f095c r9c325fb2  
    2828#include <libcpu/cpuIdent.h>
    2929#include <libcpu/spr.h>
    30 #include <rtems/bspIo.h>                     /* for printk() */
     30#include <rtems/bspIo.h>                /* for printk() */
     31
     32#include <bspopts.h>   /* for CLOCK_DRIVER_USE_FAST_IDLE */
    3133
    3234SPR_RW(BOOKE_TCR)
     
    9597static void clockHandler(void)
    9698{
     99
     100  #if defined(CLOCK_DRIVER_USE_FAST_IDLE)
     101    do {
     102      rtems_clock_tick();
     103    } while ( _Thread_Executing == _Thread_Idle &&
     104              _Thread_Heir == _Thread_Executing);
     105
     106  #else
    97107    rtems_clock_tick();
     108  #endif
    98109}
    99110
     
    120131   */
    121132  do {
    122         register uint32_t flags;
    123         rtems_interrupt_disable(flags);
    124         asm volatile ("mfdec %0; add %0, %0, %1; mtdec %0":"=&r"(decr):"r"(Clock_Decrementer_value));
    125         rtems_interrupt_enable(flags);
    126 
    127         Clock_driver_ticks += 1;
    128 
    129         /*
    130          *  Real Time Clock counter/timer is set to automatically reload.
    131          */
    132         clock_handler();
     133  register uint32_t flags;
     134  rtems_interrupt_disable(flags);
     135  asm volatile (
     136    "mfdec %0; add %0, %0, %1; mtdec %0"
     137    : "=&r"(decr)
     138    : "r"(Clock_Decrementer_value));
     139  rtems_interrupt_enable(flags);
     140
     141  Clock_driver_ticks += 1;
     142
     143  /*
     144   *  Real Time Clock counter/timer is set to automatically reload.
     145   */
     146  clock_handler();
    133147  } while ( decr < 0 );
    134148}
     
    171185uint32_t   msr_value;
    172186
    173         _CPU_MSR_GET( msr_value );
    174 
    175         if ( ppc_cpu_is_bookE() && ! (_read_BOOKE_TCR() & BOOKE_TCR_DIE) )
    176                 msr_value = 0;
    177 
    178         if (msr_value & MSR_EE) return 1;
    179 
    180         return 0;
     187  _CPU_MSR_GET( msr_value );
     188
     189  if ( ppc_cpu_is_bookE() && ! (_read_BOOKE_TCR() & BOOKE_TCR_DIE) )
     190    msr_value = 0;
     191
     192  if (msr_value & MSR_EE) return 1;
     193
     194  return 0;
    181195}
    182196
     
    256270
    257271    tcr  = _read_BOOKE_TCR();
    258         tcr |= BOOKE_TCR_ARE;
    259         tcr &= ~BOOKE_TCR_DIE;
     272    tcr |= BOOKE_TCR_ARE;
     273    tcr &= ~BOOKE_TCR_DIE;
    260274    _write_BOOKE_TCR(tcr);
    261275
Note: See TracChangeset for help on using the changeset viewer.