Changeset f817b02 in rtems for c/src/lib/libcpu/mips/clock


Ignore:
Timestamp:
Nov 4, 1999, 6:05:09 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
707f5c7
Parents:
d5704c6
Message:

The files in libcpu should not be directly dependent on any BSP. In
particular, using bsp.h, or getting information from the BSP which
should properly be obtained from RTEMS is forbidden. This is
necessary to strengthen the division between the BSP independent
parts of RTEMS and the BSPs themselves. This started after
comments and analysis by Ralf Corsepius <corsepiu@…>.
The changes primarily eliminated the need to include bsp.h and
peeking at BSP_Configuration. The use of Cpu_table in each
BSP needs to be eliminated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/mips/clock/ckinit.c

    rd5704c6 rf817b02  
    4444#include <rtems.h>
    4545#include <rtems/libio.h>
    46 #include <bsp.h>
    4746
    4847#define EXT_INT5    0x8000  /* external interrupt 5 */
     
    5049#include "clock.h"
    5150
     51/* formerly in the BSP */
     52#if 0
    5253#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */
     54#endif
     55
     56#define CLOCKS_PER_MICROSECOND \
     57  rtems_cpu_configuration_get_clicks_per_microsecond()
     58/* to avoid including the bsp */
     59mips_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int );
    5360
    5461void Clock_exit( void );
     
    153160
    154161  Clock_driver_ticks = 0;
    155   Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;
     162  Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
    156163
    157164  /*
     
    160167   */
    161168
    162   if ( BSP_Configuration.ticks_per_timeslice ) {
     169  if ( rtems_configuration_get_ticks_per_timeslice() ) {
    163170    Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    164171    /*
     
    166173     */
    167174
    168     mips_timer_rate = BSP_Configuration.microseconds_per_tick * CLOCKS_PER_MICROSECOND;
     175    mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND;
    169176    mips_set_timer( mips_timer_rate );
    170177    enable_int(CLOCK_VECTOR_MASK);
     
    184191void Clock_exit( void )
    185192{
    186   if ( BSP_Configuration.ticks_per_timeslice ) {
    187 
     193  if ( rtems_configuration_get_ticks_per_timeslice() ) {
    188194    /* mips: turn off the timer interrupts */
    189195    disable_int(CLOCK_VECTOR_MASK);
    190 
    191196  }
    192197}
Note: See TracChangeset for help on using the changeset viewer.