summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-28 15:30:29 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-28 15:30:29 +0000
commit7f6a24abdd1793e394e4d5d49de1f4ca0e00297a (patch)
treefbdb1ec31289dabb5bf41ed769d4b40ca8cf9a9a /c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
parentMoved _Thread_Information -> _RTEMS_tasks_Information. (diff)
downloadrtems-7f6a24abdd1793e394e4d5d49de1f4ca0e00297a.tar.bz2
Added unused priority ceiling parameter to rtems_semaphore_create.
Rearranged code to created thread handler routines to initialize, start, restart, and "close/delete" a thread. Made internal threads their own object class. This now uses the thread support routines for starting and initializing a thread. Insured deleted tasks are freed to the Inactive pool associated with the correct Information block. Added an RTEMS API specific data area to the thread control block. Beginnings of removing the word "rtems" from the core.
Diffstat (limited to 'c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c')
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c81
1 files changed, 64 insertions, 17 deletions
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c b/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
index 426b55137b..e4e695ad82 100644
--- a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
+++ b/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c
@@ -16,8 +16,12 @@
#include <stdlib.h>
#include <rtems.h>
+#include <rtems/libio.h>
#include <bsp.h>
-#include <clockdrv.h>
+
+void Clock_exit( void );
+rtems_isr Clock_isr( rtems_vector_number vector );
+
/*
* The interrupt vector number associated with the clock tick device
@@ -30,6 +34,7 @@
* 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;
/*
@@ -43,27 +48,17 @@ volatile rtems_unsigned32 Clock_driver_ticks;
rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
/*
- * The previous ISR on this clock tick interrupt vector.
+ * These are set by clock driver during its init
*/
-
-rtems_isr_entry Old_ticker;
+
+rtems_device_major_number rtems_clock_major = ~0;
+rtems_device_minor_number rtems_clock_minor;
/*
- * Clock_initialize
- *
- * Device driver entry point for clock tick driver initialization.
+ * The previous ISR on this clock tick interrupt vector.
*/
-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 );
-}
+rtems_isr_entry Old_ticker;
/*
* Reinstall_clock
@@ -141,3 +136,55 @@ void Clock_exit( void )
/* XXX: If necessary, restore the old vector */
}
}
+
+/*
+ * 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((rtems_isr_entry) 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(CLOCK_VECTOR);
+ }
+ else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
+ {
+ ReInstall_clock(args->buffer);
+ }
+
+done:
+ return RTEMS_SUCCESSFUL;
+}