diff options
Diffstat (limited to 'c/src/lib')
-rw-r--r-- | c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c | 81 | ||||
-rw-r--r-- | c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h | 15 | ||||
-rw-r--r-- | c/src/lib/libc/libio.c | 21 | ||||
-rw-r--r-- | c/src/lib/libc/support.c | 4 | ||||
-rw-r--r-- | c/src/lib/libmisc/monitor/mon-task.c | 8 | ||||
-rw-r--r-- | c/src/lib/libmisc/stackchk/check.c | 2 |
6 files changed, 100 insertions, 31 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; +} diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h b/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h index 0f1c94caf4..5bb7c62577 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h +++ b/c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h @@ -23,6 +23,7 @@ extern "C" { #endif #include <rtems.h> +#include <clockdrv.h> /* * Define the time limits for RTEMS Test Suite test durations. @@ -67,6 +68,20 @@ extern "C" { extern rtems_configuration_table BSP_Configuration; +/* + * Console driver init + */ + +rtems_device_driver console_initialize( + rtems_device_major_number, rtems_device_minor_number minor, void *); + +#define CONSOLE_DRIVER_TABLE_ENTRY \ + { console_initialize, NULL, NULL, NULL, NULL, NULL } + +/* + * NOTE: Use the standard Clock driver entry + */ + /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libc/libio.c b/c/src/lib/libc/libio.c index ce41643a09..f2046501ce 100644 --- a/c/src/lib/libc/libio.c +++ b/c/src/lib/libc/libio.c @@ -111,10 +111,13 @@ rtems_libio_init(void) rtems_libio_last_iop = rtems_libio_iops + (rtems_libio_number_iops - 1); } - rc = rtems_semaphore_create(RTEMS_LIBIO_SEM, - 1, - RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, - &rtems_libio_semaphore); + rc = rtems_semaphore_create( + RTEMS_LIBIO_SEM, + 1, + RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, + RTEMS_NO_PRIORITY, + &rtems_libio_semaphore + ); if (rc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred(rc); } @@ -199,9 +202,13 @@ rtems_libio_allocate(void) * Got one; create a semaphore for it */ - rc = rtems_semaphore_create(RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops), - 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, - &iop->sem); + rc = rtems_semaphore_create( + RTEMS_LIBIO_IOP_SEM(iop - rtems_libio_iops), + 1, + RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, + RTEMS_NO_PRIORITY, + &iop->sem + ); if (rc != RTEMS_SUCCESSFUL) goto failed; diff --git a/c/src/lib/libc/support.c b/c/src/lib/libc/support.c index ac7b06963d..c4e207df0a 100644 --- a/c/src/lib/libc/support.c +++ b/c/src/lib/libc/support.c @@ -22,7 +22,7 @@ void MY_task_set_note( unsigned32 note ) { - the_thread->Notepads[ notepad ] = note; + the_thread->RTEMS_API->Notepads[ notepad ] = note; } @@ -31,7 +31,7 @@ unsigned32 MY_task_get_note( unsigned32 notepad ) { - return the_thread->Notepads[ notepad ]; + return the_thread->RTEMS_API->Notepads[ notepad ]; } void *MY_CPU_Context_FP_start( diff --git a/c/src/lib/libmisc/monitor/mon-task.c b/c/src/lib/libmisc/monitor/mon-task.c index 4e5b80aed6..1f4dee7dee 100644 --- a/c/src/lib/libmisc/monitor/mon-task.c +++ b/c/src/lib/libmisc/monitor/mon-task.c @@ -21,16 +21,16 @@ rtems_monitor_task_canonical( Thread_Control *rtems_thread = (Thread_Control *) thread_void; canonical_task->entry = rtems_thread->Start.entry_point; - canonical_task->argument = rtems_thread->Start.initial_argument; + canonical_task->argument = rtems_thread->Start.numeric_argument; canonical_task->stack = rtems_thread->Start.Initial_stack.area; canonical_task->stack_size = rtems_thread->Start.Initial_stack.size; canonical_task->priority = rtems_thread->current_priority; canonical_task->state = rtems_thread->current_state; canonical_task->wait_id = rtems_thread->Wait.id; - canonical_task->events = rtems_thread->pending_events; + canonical_task->events = rtems_thread->RTEMS_API->pending_events; canonical_task->modes = rtems_thread->current_modes; - canonical_task->attributes = rtems_thread->attribute_set; - (void) memcpy(canonical_task->notepad, rtems_thread->Notepads, sizeof(canonical_task->notepad)); + canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->RTEMS_API->attribute_set */; + (void) memcpy(canonical_task->notepad, rtems_thread->RTEMS_API->Notepads, sizeof(canonical_task->notepad)); (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args)); } diff --git a/c/src/lib/libmisc/stackchk/check.c b/c/src/lib/libmisc/stackchk/check.c index 1d30bc813e..f9f32c5204 100644 --- a/c/src/lib/libmisc/stackchk/check.c +++ b/c/src/lib/libmisc/stackchk/check.c @@ -433,7 +433,7 @@ void Stack_check_Dump_usage( void ) class_index++ ) { information = _Objects_Information_table[ class_index ]; if ( information && information->is_thread ) { - for ( i=1 ; i < information->maximum ; i++ ) { + for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; Stack_check_Dump_threads_usage( the_thread ); if ( the_thread == _Thread_Executing ) |