diff options
Diffstat (limited to 'c/src/lib/libcpu/powerpc/mpc750/clock')
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc750/clock/Makefile.in | 74 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.c | 208 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.h | 54 |
3 files changed, 0 insertions, 336 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc750/clock/Makefile.in b/c/src/lib/libcpu/powerpc/mpc750/clock/Makefile.in deleted file mode 100644 index 281fcbcf4a..0000000000 --- a/c/src/lib/libcpu/powerpc/mpc750/clock/Makefile.in +++ /dev/null @@ -1,74 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -top_builddir = ../../.. -subdir = powerpc/mpc750/clock - -RTEMS_ROOT = @RTEMS_ROOT@ -PROJECT_ROOT = @PROJECT_ROOT@ - -VPATH = @srcdir@ - -# C source names, if any, go here -- minus the .c -C_PIECES = c_clock -C_FILES = $(C_PIECES:%=%.c) -C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) - -H_FILES = $(srcdir)/c_clock.h - -# Assembly source names, if any, go here -- minus the .S -S_PIECES = -S_FILES = $(S_PIECES:%=%.S) -S_O_FILES = $(S_FILES:%.S=${ARCH}/%.o) - -SRCS = $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS = $(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -INSTALL_CHANGE = @INSTALL_CHANGE@ -mkinstalldirs = $(SHELL) $(top_srcdir)/@RTEMS_TOPdir@/mkinstalldirs - -INSTALLDIRS = $(PROJECT_INCLUDE)/libcpu - -$(INSTALLDIRS): - @$(mkinstalldirs) $(INSTALLDIRS) - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) preinstall $(OBJS) - -preinstall: $(INSTALLDIRS) $(H_FILES) - @$(INSTALL_CHANGE) -m 644 $(H_FILES) $(PROJECT_INCLUDE)/libcpu - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.c b/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.c deleted file mode 100644 index b3d93f8f34..0000000000 --- a/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Clock Tick Device Driver - * - * This routine utilizes the Decrementer Register common to the PPC family. - * - * The tick frequency is directly programmed to the configured number of - * microseconds per tick. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * Modified to support the MPC750. - * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr - * - * $Id$ - */ - -#include <rtems.h> -#include <rtems/libio.h> -#include <stdlib.h> /* for atexit() */ -#include <assert.h> -#include <libcpu/cpu.h> -#include <libcpu/c_clock.h> - -/* - * Clock ticks since initialization - */ - -volatile rtems_unsigned32 Clock_driver_ticks; - -/* - * This is the value programmed into the count down timer. - */ - -rtems_unsigned32 Clock_Decrementer_value; - -/* - * These are set by clock driver during its init - */ - -rtems_device_major_number rtems_clock_major = ~0; -rtems_device_minor_number rtems_clock_minor; - -void clockOff(void* unused) -{ - if (BSP_Configuration.ticks_per_timeslice) { - /* - * Nothing to do as we cannot disable all interrupts and - * the decrementer interrupt enable is MSR_EE - */ - } -} -void clockOn(void* unused) -{ - PPC_Set_decrementer( Clock_Decrementer_value ); -} - -/* - * Clock_isr - * - * This is the clock tick interrupt handler. - * - * Input parameters: - * vector - vector number - * - * Output parameters: NONE - * - * Return values: NONE - * - */ -void clockIsr() -{ - /* - * The driver has seen another tick. - */ - - PPC_Set_decrementer( Clock_Decrementer_value ); - - Clock_driver_ticks += 1; - - /* - * Real Time Clock counter/timer is set to automatically reload. - */ - - rtems_clock_tick(); -} - -int clockIsOn(void* unused) -{ - unsigned32 msr_value; - - _CPU_MSR_GET( msr_value ); - if (msr_value & MSR_EE) return 1; - return 0; -} - - -/* - * Clock_exit - * - * This routine allows the clock driver to exit by masking the interrupt and - * disabling the clock's counter. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Clock_exit( void ) -{ - if ( BSP_Configuration.ticks_per_timeslice ) { - (void) BSP_disconnect_clock_handler (); - } -} - -/* - * Clock_initialize - * - * This routine initializes the clock driver. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - Clock_Decrementer_value = (BSP_bus_frequency/4000)* - (BSP_Configuration.microseconds_per_tick/1000); - - if (!BSP_connect_clock_handler ()) { - printk("Unable to initialize system clock\n"); - rtems_fatal_error_occurred(1); - } - /* make major/minor avail to others such as shared memory driver */ - - rtems_clock_major = major; - rtems_clock_minor = minor; - - return RTEMS_SUCCESSFUL; -} /* Clock_initialize */ - -/* - * Clock_control - * - * This routine is the clock device driver control entry point. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - rtems_libio_ioctl_args_t *args = pargp; - - if (args == 0) - goto done; - - Clock_Decrementer_value = (BSP_bus_frequency/4000)* - (BSP_Configuration.microseconds_per_tick/1000); - - if (args->command == rtems_build_name('I', 'S', 'R', ' ')) - clockIsr(); - else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) - { - if (!BSP_connect_clock_handler ()) { - printk("Error installing clock interrupt handler!\n"); - rtems_fatal_error_occurred(1); - } - } -done: - return RTEMS_SUCCESSFUL; -} - - - - - - diff --git a/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.h b/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.h deleted file mode 100644 index 2c2fd00bf7..0000000000 --- a/c/src/lib/libcpu/powerpc/mpc750/clock/c_clock.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Clock Tick Device Driver - * - * This routine utilizes the Decrementer Register common to the PPC family. - * - * The tick frequency is directly programmed to the configured number of - * microseconds per tick. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * Modified to support the MPC750. - * Modifications Copyright (c) 1999 Eric Valette valette@crf.canon.fr - * - * $Id$ - */ - -#ifndef _LIB_LIBCPU_C_CLOCK_H -#define _LIB_LIBCPU_C_CLOCK_H - -#include <rtems.h> - -/* - * Theses 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); - -/* - * Theses functions and variables represent the expected API nedeed by the CPU - * NOTE for JOEL : I would prefer to have an include of <bsp.h> as it would - * materialize the API (and providing a default bsp.h) could formalize the - * (generic + cpu_familly + cpu_specific)/ BSP interface. - */ -extern rtems_configuration_table BSP_Configuration; -extern unsigned int BSP_bus_frequency; - -extern int BSP_disconnect_clock_handler (void); -extern int BSP_connect_clock_handler (void); -extern int printk(const char *, ...) __attribute__((format(printf, 1, 2))); - -#endif - - - - - |