diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-08-17 19:51:51 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-08-17 19:51:51 +0000 |
commit | b06e68ef1f6df69cc86d72356c3a002054a35fad (patch) | |
tree | 722b2da3cc83f1cf03019cab8cf895a509eb6801 /c/src/lib/libcpu | |
parent | variable length messages (diff) | |
download | rtems-b06e68ef1f6df69cc86d72356c3a002054a35fad.tar.bz2 |
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
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libcpu/hppa1.1/clock/clock.c | 66 |
1 files changed, 55 insertions, 11 deletions
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 <rtems.h> #include <bsp.h> -#include <clockdrv.h> +#include <rtems/libio.h> #include <stdlib.h> /* for atexit() */ @@ -24,6 +25,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; +} |