From b06e68ef1f6df69cc86d72356c3a002054a35fad Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Aug 1995 19:51:51 +0000 Subject: Numerous miscellaneous features incorporated from Tony Bennett (tbennett@divnc.com) including the following major additions: + variable length messages + named devices + debug monitor + association tables/variables --- c/src/lib/libcpu/hppa1.1/clock/clock.c | 66 ++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 11 deletions(-) (limited to 'c/src/lib/libcpu/hppa1.1/clock/clock.c') diff --git a/c/src/lib/libcpu/hppa1.1/clock/clock.c b/c/src/lib/libcpu/hppa1.1/clock/clock.c index 62bb8e2826..d91f85d440 100644 --- a/c/src/lib/libcpu/hppa1.1/clock/clock.c +++ b/c/src/lib/libcpu/hppa1.1/clock/clock.c @@ -14,8 +14,9 @@ * $Id$ */ +#include #include -#include +#include #include /* for atexit() */ @@ -23,6 +24,13 @@ extern rtems_cpu_table Cpu_table; /* owned by BSP */ typedef unsigned long long hppa_click_count_t; +/* + * These are set by clock driver during its init + */ + +rtems_device_major_number rtems_clock_major = ~0; +rtems_device_minor_number rtems_clock_minor; + /* * CPU_HPPA_CLICKS_PER_TICK is either a #define or an rtems_unsigned32 * allocated and set by bsp_start() @@ -41,16 +49,7 @@ rtems_unsigned64 Clock_clicks; /* running total of cycles */ rtems_unsigned32 Clock_clicks_interrupt; -rtems_device_driver Clock_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp, - rtems_id tid, - rtems_unsigned32 *rval -) -{ - Install_clock(Clock_isr); -} +void Clock_exit(void); void ReInstall_clock(rtems_isr_entry new_clock_isr) @@ -218,3 +217,48 @@ Clock_delay(rtems_unsigned32 microseconds) } } +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_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(HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER); + } + else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) + { + ReInstall_clock(args->buffer); + } + +done: + return RTEMS_SUCCESSFUL; +} -- cgit v1.2.3