diff options
Diffstat (limited to 'c/src/libmisc')
-rw-r--r-- | c/src/libmisc/error/error.c | 4 | ||||
-rw-r--r-- | c/src/libmisc/monitor/mon-dname.c | 3 | ||||
-rw-r--r-- | c/src/libmisc/monitor/mon-extension.c | 14 | ||||
-rw-r--r-- | c/src/libmisc/monitor/mon-object.c | 5 | ||||
-rw-r--r-- | c/src/libmisc/monitor/mon-server.c | 2 | ||||
-rw-r--r-- | c/src/libmisc/monitor/mon-task.c | 18 | ||||
-rw-r--r-- | c/src/libmisc/stackchk/check.c | 51 | ||||
-rw-r--r-- | c/src/libmisc/stackchk/internal.h | 2 |
8 files changed, 66 insertions, 33 deletions
diff --git a/c/src/libmisc/error/error.c b/c/src/libmisc/error/error.c index 8cf46f0565..cfe1858e08 100644 --- a/c/src/libmisc/error/error.c +++ b/c/src/libmisc/error/error.c @@ -91,8 +91,8 @@ rtems_assoc_t rtems_status_assoc[] = { { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , }, { "directive not implemented", RTEMS_NOT_IMPLEMENTED, }, { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, }, - { "internal multiprocessing only", RTEMS_PROXY_BLOCKING, }, { "could not get enough memory", RTEMS_NO_MEMORY, }, + { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, }, { 0, 0, 0 }, }; @@ -134,7 +134,7 @@ static int rtems_verror( if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ local_errno = errno; - if (_Configuration_Is_multiprocessing()) + if (_System_state_Is_multiprocessing) fprintf(stderr, "[%d] ", _Configuration_MP_table->node); if (rtems_progname && *rtems_progname) diff --git a/c/src/libmisc/monitor/mon-dname.c b/c/src/libmisc/monitor/mon-dname.c index fd10f3e333..b9907eb42b 100644 --- a/c/src/libmisc/monitor/mon-dname.c +++ b/c/src/libmisc/monitor/mon-dname.c @@ -57,7 +57,8 @@ rtems_monitor_dname_next( rtems_driver_name_t *table = object_information; rtems_driver_name_t *np = 0; - for (np = table + n ; n<RTEMS_MAX_DRIVER_NAMES; n++, np++) +/* XXX should we be using _IO_Number_of_devices */ + for (np = table + n ; n<_IO_Number_of_devices; n++, np++) if (np->device_name) goto done; diff --git a/c/src/libmisc/monitor/mon-extension.c b/c/src/libmisc/monitor/mon-extension.c index 48dfb96a2d..230fab9ddf 100644 --- a/c/src/libmisc/monitor/mon-extension.c +++ b/c/src/libmisc/monitor/mon-extension.c @@ -22,20 +22,20 @@ rtems_monitor_extension_canonical( rtems_extensions_table *e = &rtems_extension->Extension.Callouts; rtems_monitor_symbol_canonical_by_value(&canonical_extension->create, - e->rtems_task_create); + e->thread_create); rtems_monitor_symbol_canonical_by_value(&canonical_extension->start, - e->rtems_task_start); + e->thread_start); rtems_monitor_symbol_canonical_by_value(&canonical_extension->restart, - e->rtems_task_restart); + e->thread_restart); rtems_monitor_symbol_canonical_by_value(&canonical_extension->delete, - e->rtems_task_delete); + e->thread_delete); rtems_monitor_symbol_canonical_by_value(&canonical_extension->tswitch, - e->task_switch); + e->thread_switch); rtems_monitor_symbol_canonical_by_value(&canonical_extension->begin, - e->task_begin); + e->thread_begin); rtems_monitor_symbol_canonical_by_value(&canonical_extension->exitted, - e->task_exitted); + e->thread_exitted); rtems_monitor_symbol_canonical_by_value(&canonical_extension->fatal, e->fatal); } diff --git a/c/src/libmisc/monitor/mon-object.c b/c/src/libmisc/monitor/mon-object.c index 619ae5cf79..2f92845586 100644 --- a/c/src/libmisc/monitor/mon-object.c +++ b/c/src/libmisc/monitor/mon-object.c @@ -92,7 +92,10 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] = (rtems_monitor_object_dump_fn) rtems_monitor_driver_dump, }, { RTEMS_OBJECT_DNAME, - (void *) &rtems_driver_name_table[0], + /* XXX now that the driver name table is allocated from the */ + /* XXX Workspace, this does not work */ + (void *) 0, + /* (void *) _IO_Driver_name_table, */ sizeof(rtems_monitor_dname_t), (rtems_monitor_object_next_fn) rtems_monitor_dname_next, (rtems_monitor_object_canonical_fn) rtems_monitor_dname_canonical, diff --git a/c/src/libmisc/monitor/mon-server.c b/c/src/libmisc/monitor/mon-server.c index e3e2da5069..5ff5688c9c 100644 --- a/c/src/libmisc/monitor/mon-server.c +++ b/c/src/libmisc/monitor/mon-server.c @@ -219,7 +219,7 @@ rtems_monitor_server_init( { rtems_status_code status; - if (_Configuration_Is_multiprocessing() && + if (_System_state_Is_multiprocessing && (_Configuration_MP_table->maximum_nodes > 1)) { unsigned32 maximum_nodes = _Configuration_MP_table->maximum_nodes; diff --git a/c/src/libmisc/monitor/mon-task.c b/c/src/libmisc/monitor/mon-task.c index 1f4dee7dee..95b650d429 100644 --- a/c/src/libmisc/monitor/mon-task.c +++ b/c/src/libmisc/monitor/mon-task.c @@ -19,6 +19,9 @@ rtems_monitor_task_canonical( ) { Thread_Control *rtems_thread = (Thread_Control *) thread_void; + RTEMS_API_Control *api; + + api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ]; canonical_task->entry = rtems_thread->Start.entry_point; canonical_task->argument = rtems_thread->Start.numeric_argument; @@ -27,11 +30,18 @@ rtems_monitor_task_canonical( 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->RTEMS_API->pending_events; - canonical_task->modes = rtems_thread->current_modes; - 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)); + canonical_task->events = api->pending_events; + +/* XXX modes and attributes only exist in the RTEMS API .. */ +/* XXX not directly in the core thread.. they will have to be derived */ +/* XXX if they are important enough to include anymore. */ + canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */ + canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */; + (void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad)); +/* XXX more to fix */ +/* (void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args)); +*/ } diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c index f9f32c5204..c2ee9a0a10 100644 --- a/c/src/libmisc/stackchk/check.c +++ b/c/src/libmisc/stackchk/check.c @@ -18,18 +18,9 @@ * */ -#include <rtems/system.h> -#include <rtems/extension.h> -#include <rtems/fatal.h> -#include <rtems/heap.h> -#include <rtems/stack.h> -#include <rtems/thread.h> -#ifdef XXX_RTEMS_H_FIXED -#include <bsp.h> -#else -#include <rtems/config.h> +#include <rtems.h> + extern rtems_configuration_table BSP_Configuration; -#endif #include <assert.h> #include <stdio.h> @@ -56,6 +47,7 @@ rtems_extensions_table Stack_check_Extension_table = { 0, /* rtems_task_restart */ 0, /* rtems_task_delete */ Stack_check_Switch_extension, /* task_switch */ + 0, /* task_post_switch */ Stack_check_Begin_extension, /* task_begin */ 0, /* task_exitted */ Stack_check_Fatal_extension, /* fatal */ @@ -133,9 +125,13 @@ unsigned32 stack_check_initialized = 0; void Stack_check_Initialize( void ) { - rtems_status_code status; - Objects_Id id_ignored; - unsigned32 *p; + rtems_status_code status; + Objects_Id id_ignored; + unsigned32 *p; + unsigned32 i; + unsigned32 class_index; + Thread_Control *the_thread; + Objects_Information *information; if (stack_check_initialized) return; @@ -171,10 +167,31 @@ void Stack_check_Initialize( void ) * So pretend here that we actually ran create and begin extensions. */ + /* XXX + * + * Technically this has not been done for any task created before this + * happened. So just run through them and fix the situation. + */ +#if 0 if (_Thread_Executing) { Stack_check_Create_extension(_Thread_Executing, _Thread_Executing); } +#endif + +#if 0 + for ( class_index = OBJECTS_CLASSES_FIRST ; + class_index <= OBJECTS_CLASSES_LAST ; + class_index++ ) { + information = _Objects_Information_table[ class_index ]; + if ( information && information->is_thread ) { + for ( i=1 ; i <= information->maximum ; i++ ) { + the_thread = (Thread_Control *)information->local_table[ i ]; + Stack_check_Create_extension( the_thread, the_thread ); + } + } + } +#endif /* * If appropriate, setup the interrupt stack for high water testing @@ -197,13 +214,15 @@ void Stack_check_Initialize( void ) * Stack_check_Create_extension */ -void Stack_check_Create_extension( +boolean Stack_check_Create_extension( Thread_Control *running, Thread_Control *the_thread ) { - if (the_thread && (the_thread != _Thread_Executing)) + if (the_thread /* XXX && (the_thread != _Thread_Executing) */ ) stack_check_dope_stack(&the_thread->Start.Initial_stack); + + return TRUE; } /*PAGE diff --git a/c/src/libmisc/stackchk/internal.h b/c/src/libmisc/stackchk/internal.h index 19c9f5e267..7cecbd6e1a 100644 --- a/c/src/libmisc/stackchk/internal.h +++ b/c/src/libmisc/stackchk/internal.h @@ -50,7 +50,7 @@ typedef struct { * Stack_check_Create_extension */ -void Stack_check_Create_extension( +boolean Stack_check_Create_extension( Thread_Control *running, Thread_Control *the_thread ); |