diff options
Diffstat (limited to 'c/src/lib/libcpu/a29k/clock')
-rw-r--r-- | c/src/lib/libcpu/a29k/clock/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/lib/libcpu/a29k/clock/Makefile.am | 32 | ||||
-rw-r--r-- | c/src/lib/libcpu/a29k/clock/ckinit.c | 213 | ||||
-rw-r--r-- | c/src/lib/libcpu/a29k/clock/clock.S | 126 | ||||
-rw-r--r-- | c/src/lib/libcpu/a29k/clock/clock.h | 7 |
5 files changed, 0 insertions, 380 deletions
diff --git a/c/src/lib/libcpu/a29k/clock/.cvsignore b/c/src/lib/libcpu/a29k/clock/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/lib/libcpu/a29k/clock/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/lib/libcpu/a29k/clock/Makefile.am b/c/src/lib/libcpu/a29k/clock/Makefile.am deleted file mode 100644 index 390681f1fb..0000000000 --- a/c/src/lib/libcpu/a29k/clock/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -## -## $Id$ -## - - -PGM = $(ARCH)/clock.rel - -C_FILES = ckinit.c -OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -noinst_HEADERS = clock.h - -S_FILES = clock.S -OBJS += $(S_FILES:%.S=$(ARCH)/%.$(OBJEXT)) - -include $(top_srcdir)/../../../../../automake/compile.am -include $(top_srcdir)/../../../../../automake/lib.am - -# -# (OPTIONAL) Add local stuff here using += -# - -$(PGM): $(OBJS) - $(make-rel) - -all-local: $(ARCH) $(OBJS) $(PGM) - -.PRECIOUS: $(PGM) - -EXTRA_DIST = Makefile ckinit.c clock.S clock.h - -include $(top_srcdir)/../../../../../automake/local.am diff --git a/c/src/lib/libcpu/a29k/clock/ckinit.c b/c/src/lib/libcpu/a29k/clock/ckinit.c deleted file mode 100644 index 5ab24b38e8..0000000000 --- a/c/src/lib/libcpu/a29k/clock/ckinit.c +++ /dev/null @@ -1,213 +0,0 @@ -/* ckinit.c - * - * This file provides a template for the clock device driver initialization. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#ifndef lint -static char _sccsid[] = "@(#)ckinit.c 03/15/96 1.1\n"; -#endif - -#include <stdlib.h> - -#include <rtems.h> -#include <rtems/libio.h> - -#include "clock.h" - -extern int CPU_CLOCK_RATE_MHZ; /* provided in bsp */ - -#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */ - -void Clock_exit( void ); -rtems_isr Clock_isr( rtems_vector_number vector ); - - -/* - * The interrupt vector number associated with the clock tick device - * driver. - */ - -#define CLOCK_VECTOR 14 - -/* - * Clock_driver_ticks is a monotonically increasing counter of the - * number of clock ticks since the driver was initialized. - */ - -volatile rtems_unsigned32 Clock_driver_ticks; - - -/* - * These are set by clock driver during its init - */ - -rtems_device_major_number rtems_clock_major = ~0; -rtems_device_minor_number rtems_clock_minor; - -/* - * The previous ISR on this clock tick interrupt vector. - */ - -rtems_isr_entry Old_ticker; - -void Clock_exit( void ); - -static unsigned32 a29k_timer_rate = 0; - -/* - * Isr Handler - */ - -rtems_isr Clock_isr( - rtems_vector_number vector -) -{ -/* - * bump the number of clock driver ticks since initialization - * - * determine if it is time to announce the passing of tick as configured - * to RTEMS through the rtems_clock_tick directive - * - * perform any timer dependent tasks - */ - - a29k_clear_timer(); - - Clock_driver_ticks += 1; - - rtems_clock_tick(); -} - -/* User callback shell (set from Clock_Control) */ -static void (*user_callback)(void); - -rtems_isr User_Clock_isr( - rtems_vector_number vector -) -{ - /* refresh the internal CPU timer */ - a29k_clear_timer(); - - if (user_callback) - user_callback(); -} - -/* - * Install_clock - * - * Install a clock tick handler and reprograms the chip. This - * is used to initially establish the clock tick. - */ - -void Install_clock( - rtems_isr_entry clock_isr -) -{ - /* - * Initialize the clock tick device driver variables - */ - - Clock_driver_ticks = 0; - - /* - * If ticks_per_timeslice is configured as non-zero, then the user - * wants a clock tick. - */ - - if ( rtems_configuration_get_ticks_per_timeslice() ) { - Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - /* - * Hardware specific initialize goes here - */ - - a29k_timer_rate = rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND; - a29k_init_timer( a29k_timer_rate ); - } - - /* - * Schedule the clock cleanup routine to execute if the application exits. - */ - - atexit( Clock_exit ); -} - -/* - * Clean up before the application exits - */ - -void Clock_exit( void ) -{ - if ( rtems_configuration_get_ticks_per_timeslice() ) { - - /* a29k: turn off the timer interrupts */ - a29k_disable_timer(); - - } -} - -/* - * Clock_initialize - * - * Device driver entry point for clock tick driver initialization. - */ - -rtems_device_driver Clock_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - Install_clock( Clock_isr ); - - /* - * make major/minor avail to others such as shared memory driver - */ - - rtems_clock_major = major; - rtems_clock_minor = minor; - - return RTEMS_SUCCESSFUL; -} - -rtems_device_driver Clock_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - rtems_unsigned32 isrlevel; - rtems_libio_ioctl_args_t *args = pargp; - - if (args == 0) - goto done; - - /* - * This is hokey, but until we get a defined interface - * to do this, it will just be this simple... - */ - - if (args->command == rtems_build_name('I', 'S', 'R', ' ')) - { - Clock_isr(CLOCK_VECTOR); - } - else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) - { - rtems_interrupt_disable( isrlevel ); - user_callback = (void (*)(void))args->buffer; - (void) set_vector( User_Clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); - } - -done: - return RTEMS_SUCCESSFUL; -} diff --git a/c/src/lib/libcpu/a29k/clock/clock.S b/c/src/lib/libcpu/a29k/clock/clock.S deleted file mode 100644 index a8fa2f8446..0000000000 --- a/c/src/lib/libcpu/a29k/clock/clock.S +++ /dev/null @@ -1,126 +0,0 @@ -; -#if 0 -; .include "register.ah" - .include "amd.ah" - .include "pswmacro.ah" - - .text -; .equ IN,0x2000000 - .reg CLOCK,gr78 - .reg SECS,gr79 - .equ CPUCLK,16 - .equ RATE,100 - .reg it0,gr64 - .reg it1,gr65 - .reg v0,gr96 -timer_clear_sup: - const it0,IN - consth it0,IN - mfsr it1,tmr - andn it1,it1,it0 - mtsr tmr,it1 - const it0,RATE - cplt it0,CLOCK,it0 - jmpf it0,carry - add CLOCK,CLOCK,1 - iret -carry: - const CLOCK,0 - add SECS,SECS,1 - iret - - .equ TICKS,(CPUCLK*1000000/RATE) -; .equ IE,0x1000000 -timer_init_sup: - const it0,TICKS - consth it0,TICKS - mtsr tmc,it0 - const it0,(IE|TICKS) - consth it0,(IE|TICKS) - mtsr tmr,it0 - const SECS,0 - const CLOCK,0 - iret - -timer_get_sup: - add gr96,SECS,0 - iret - -timer_disable_sup: - mfsr it0,ops - const it1,TD - consth it1,TD - andn it0,it1,it0 - mtsr ops,it0 - iret -#endif - - .global _a29k_init_timer -_a29k_init_timer: -#if 0 - push msp,lr0 - const lr2,INIT_TIMER - consth lr2,INIT_TIMER - const lr3,timer_init_sup - consth lr3,timer_init_sup - const v0,__settrap - consth v0,__settrap - calli lr0,v0 - nop - - const lr2,CLEAR_TIMER - consth lr2,CLEAR_TIMER - const lr3,timer_clear_sup - consth lr3,timer_clear_sup - const v0,__settrap - consth v0,__settrap - calli lr0,v0 - nop - - const lr2,DISABLE_TIMER - consth lr2,DISABLE_TIMER - const lr3,timer_disable_sup - consth lr3,timer_disable_sup - const v0,__settrap - consth v0,__settrap - calli lr0,v0 - nop - - const lr2,GET_TIMER - consth lr2,GET_TIMER - const lr3,timer_get_sup - consth lr3,timer_get_sup - const v0,__settrap - consth v0,__settrap - calli lr0,v0 - nop - - asneq INIT_TIMER,gr1,gr1 - pop lr0,msp - jmpi lr0 - nop -#endif - - .global _a29k_clear_timer -_a29k_clear_timer: -#if 0 -; asneq CLEAR_TIMER,gr1,gr1 - jmpi lr0 - nop -#endif - - .global _a29k_disable_timer -_a29k_disable_timer: -#if 0 - asneq DISABLE_TIMER,gr1,gr1 - jmpi lr0 - nop -#endif - - .global _a29k_get_timer -_a29k_get_timer: -#if 0 - asneq GET_TIMER,gr1,gr1 - jmpi lr0 - nop -#endif diff --git a/c/src/lib/libcpu/a29k/clock/clock.h b/c/src/lib/libcpu/a29k/clock/clock.h deleted file mode 100644 index 5e45157c86..0000000000 --- a/c/src/lib/libcpu/a29k/clock/clock.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * $Id$ - */ - -extern void a29k_init_timer( unsigned32 timer_clock_interval ); -extern void a29k_disable_timer(void); -extern void a29k_clear_timer(void); |