Changeset 655ce0fb in rtems


Ignore:
Timestamp:
Jun 22, 2016, 11:45:02 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ce6e9ec2
Parents:
3d9fd2ce
git-author:
Sebastian Huber <sebastian.huber@…> (06/22/16 11:45:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/22/16 12:00:27)
Message:

sparc: Optimize CPU counter support

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/erc32/clock/ckinit.c

    r3d9fd2ce r655ce0fb  
    2727#include <rtems/counter.h>
    2828#include <rtems/timecounter.h>
     29#include <rtems/score/sparcimpl.h>
    2930
    3031#if SIMSPARC_FAST_IDLE==1
     
    134135#include "../../../shared/clockdrv_shell.h"
    135136
    136 SPARC_Counter _SPARC_Counter = {
    137   .counter_read = _SPARC_Counter_read_address,
    138   .counter_difference = _SPARC_Counter_difference_one,
    139   .counter_address = (uint32_t *) &_SPARC_Counter
    140 };
     137SPARC_COUNTER_DEFINITION;
  • c/src/lib/libbsp/sparc/leon2/clock/ckinit.c

    r3d9fd2ce r655ce0fb  
    2626#include <bspopts.h>
    2727#include <rtems/timecounter.h>
     28#include <rtems/score/sparcimpl.h>
    2829
    2930#if SIMSPARC_FAST_IDLE==1
     
    107108#include "../../../shared/clockdrv_shell.h"
    108109
    109 SPARC_Counter _SPARC_Counter = {
    110   .counter_read = _SPARC_Counter_read_address,
    111   .counter_difference = _SPARC_Counter_difference_one,
    112   .counter_address = (uint32_t *) &_SPARC_Counter
    113 };
     110SPARC_COUNTER_DEFINITION;
  • c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c

    r3d9fd2ce r655ce0fb  
    1717#include <rtems/counter.h>
    1818#include <rtems/sysinit.h>
     19#include <rtems/score/sparcimpl.h>
    1920
    2021static void leon3_counter_initialize(void)
     
    7475);
    7576
    76 SPARC_Counter _SPARC_Counter = {
    77   .counter_read = _SPARC_Counter_read_address,
    78   .counter_difference = _SPARC_Counter_difference_one,
    79   .counter_address = (uint32_t *) &_SPARC_Counter
    80 };
     77SPARC_COUNTER_DEFINITION;
  • cpukit/score/cpu/sparc/Makefile.am

    r3d9fd2ce r655ce0fb  
    77include_rtems_score_HEADERS = rtems/score/sparc.h
    88include_rtems_score_HEADERS += rtems/score/cpu.h
     9include_rtems_score_HEADERS += rtems/score/sparcimpl.h
    910include_rtems_score_HEADERS += rtems/score/types.h
    1011include_rtems_score_HEADERS += rtems/score/cpuatomic.h
  • cpukit/score/cpu/sparc/preinstall.am

    r3d9fd2ce r655ce0fb  
    3636PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpu.h
    3737
     38$(PROJECT_INCLUDE)/rtems/score/sparcimpl.h: rtems/score/sparcimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     39        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/sparcimpl.h
     40PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/sparcimpl.h
     41
    3842$(PROJECT_INCLUDE)/rtems/score/types.h: rtems/score/types.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
    3943        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/types.h
  • cpukit/score/cpu/sparc/rtems/score/cpu.h

    r3d9fd2ce r655ce0fb  
    13071307typedef CPU_Counter_ticks ( *SPARC_Counter_read )( void );
    13081308
    1309 typedef CPU_Counter_ticks (*SPARC_Counter_difference)(
     1309typedef CPU_Counter_ticks ( *SPARC_Counter_difference )(
    13101310  CPU_Counter_ticks second,
    13111311  CPU_Counter_ticks first
     
    13251325} SPARC_Counter;
    13261326
    1327 extern SPARC_Counter _SPARC_Counter;
    1328 
    1329 CPU_Counter_ticks _SPARC_Counter_read_address( void );
    1330 
    1331 CPU_Counter_ticks _SPARC_Counter_read_asr23( void );
    1332 
    1333 CPU_Counter_ticks _SPARC_Counter_difference_normal(
    1334   CPU_Counter_ticks second,
    1335   CPU_Counter_ticks first
    1336 );
    1337 
    1338 CPU_Counter_ticks _SPARC_Counter_difference_clock_period(
    1339   CPU_Counter_ticks second,
    1340   CPU_Counter_ticks first
    1341 );
    1342 
    1343 /*
    1344  * Returns always a value of one regardless of the parameters.  This prevents
    1345  * an infinite loop in rtems_counter_delay_ticks().  Its only a reasonably safe
    1346  * default.
    1347  */
    1348 CPU_Counter_ticks _SPARC_Counter_difference_one(
    1349   CPU_Counter_ticks second,
    1350   CPU_Counter_ticks first
    1351 );
    1352 
    1353 static inline void _SPARC_Counter_initialize(
    1354   SPARC_Counter_read                counter_read,
    1355   SPARC_Counter_difference          counter_difference,
    1356   volatile const CPU_Counter_ticks *counter_address
    1357 )
    1358 {
    1359   _SPARC_Counter.counter_read = counter_read;
    1360   _SPARC_Counter.counter_difference = counter_difference;
    1361   _SPARC_Counter.counter_address = counter_address;
    1362 }
     1327extern const SPARC_Counter _SPARC_Counter;
    13631328
    13641329static inline CPU_Counter_ticks _CPU_Counter_read( void )
  • cpukit/score/cpu/sparc/sparc-counter.c

    r3d9fd2ce r655ce0fb  
    1717#endif
    1818
    19 #include <rtems/score/cpu.h>
     19#include <rtems/score/sparcimpl.h>
    2020#include <rtems/config.h>
    2121
Note: See TracChangeset for help on using the changeset viewer.