From 8e13ca61cfde65896457384af35054b3f9ee6835 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 18 Oct 2000 15:21:35 +0000 Subject: 2000-10-18 Joel Sherrill * mpc6xx/clock/c_clock.c, mpc6xx/clock/c_clock.h: Removed use of bsp.h and replaced it with use of proper interfaces or explicit externs of required functions and data. * mpc6xx/timer/timer.c: Ditto. --- c/src/lib/libcpu/powerpc/ChangeLog | 7 +++++++ c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c | 5 +++-- c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.h | 25 +++++++++++++++++++++++-- c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c | 6 +++++- 4 files changed, 38 insertions(+), 5 deletions(-) (limited to 'c/src') diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog index 15b11b8fb6..786f2f8676 100644 --- a/c/src/lib/libcpu/powerpc/ChangeLog +++ b/c/src/lib/libcpu/powerpc/ChangeLog @@ -1,3 +1,10 @@ +2000-10-18 Joel Sherrill + + * mpc6xx/clock/c_clock.c, mpc6xx/clock/c_clock.h: Removed use of + bsp.h and replaced it with use of proper interfaces or explicit + externs of required functions and data. + * mpc6xx/timer/timer.c: Ditto. + 2000-09-04 Ralf Corsepius * mpc505/timer/Makefile.am, mpc505/vectors/Makefile.am, diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c index 988215fa26..8281ec0a57 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c @@ -26,6 +26,7 @@ #include #include #include +#include /* for printk() */ /* * Clock ticks since initialization @@ -140,7 +141,7 @@ rtems_device_driver Clock_initialize( ) { Clock_Decrementer_value = (BSP_bus_frequency/BSP_time_base_divisor)* - (BSP_Configuration.microseconds_per_tick/1000); + (rtems_configuration_get_microseconds_per_tick()/1000); if (!BSP_connect_clock_handler ()) { printk("Unable to initialize system clock\n"); @@ -182,7 +183,7 @@ rtems_device_driver Clock_control( goto done; Clock_Decrementer_value = (BSP_bus_frequency/BSP_time_base_divisor)* - (BSP_Configuration.microseconds_per_tick/1000); + (rtems_configuration_get_microseconds_per_tick()/1000); if (args->command == rtems_build_name('I', 'S', 'R', ' ')) clockIsr(); diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.h b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.h index 237273f6f9..bfb7242c5e 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.h +++ b/c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.h @@ -24,16 +24,37 @@ #define _LIB_LIBCPU_C_CLOCK_H #include -#include +/* #include */ /* - * Theses functions and variables represent the API exported by the CPU to the BSP + * These functions and variables represent the API exported by the + * CPU to the BSP. */ + extern void clockOff (void* unused); extern void clockOn (void* unused); extern void clockIsr (void); extern int clockIsOn (void* unused); +/* + * These functions and variables represent the assumptions of this + * driver on the BSP. + */ + +extern int BSP_disconnect_clock_handler (void); +/* + * PCI Bus Frequency + */ +extern unsigned int BSP_bus_frequency; +/* + * processor clock frequency + */ +extern unsigned int BSP_processor_frequency; +/* + * Time base divisior (how many tick for 1 second). + */ +extern unsigned int BSP_time_base_divisor; + #endif diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c index 307cfcac6b..35abdc87ed 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c @@ -19,8 +19,9 @@ */ #include +#include #include -#include +/* #include */ rtems_unsigned64 Timer_driver_Start_time; @@ -60,6 +61,9 @@ void Timer_initialize() /* * Read_timer */ + +extern int BSP_Convert_decrementer( unsigned32 ); + int Read_timer() { rtems_unsigned64 total64; -- cgit v1.2.3