2007-05-28 Joel Sherrill <joel.sherrill@OARcorp.com>

* libmisc/Makefile.am, libmisc/monitor/mon-object.c,
	libmisc/monitor/monitor.h, sapi/include/confdefs.h,
	sapi/include/rtems/config.h, sapi/include/rtems/io.h,
	sapi/src/exinit.c, sapi/src/io.c: Eliminate maximum_drivers
	configuration parameter since it was used to configure a no longer
	used feature. Device names are now part of the filesystem not in a
	table. This also eliminated the variables _IO_Number_of_devices and
	_IO_Driver_name_table from RTEMS as well as the memory allocation
	used to populate _IO_Driver_name_table.
	* libmisc/monitor/mon-dname.c: Removed.
This commit is contained in:
Joel Sherrill
2007-05-28 15:51:01 +00:00
parent 001b4b04f6
commit ff3f8c85c3
10 changed files with 38 additions and 244 deletions

View File

@@ -1,3 +1,16 @@
2007-05-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* libmisc/Makefile.am, libmisc/monitor/mon-object.c,
libmisc/monitor/monitor.h, sapi/include/confdefs.h,
sapi/include/rtems/config.h, sapi/include/rtems/io.h,
sapi/src/exinit.c, sapi/src/io.c: Eliminate maximum_drivers
configuration parameter since it was used to configure a no longer
used feature. Device names are now part of the filesystem not in a
table. This also eliminated the variables _IO_Number_of_devices and
_IO_Driver_name_table from RTEMS as well as the memory allocation
used to populate _IO_Driver_name_table.
* libmisc/monitor/mon-dname.c: Removed.
2007-05-23 Joel Sherrill <joel.sherrill@OARcorp.com> 2007-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
* sapi/include/confdefs.h: Add CONFIGURE_MESSAGE_BUFFER_MEMORY so there * sapi/include/confdefs.h: Add CONFIGURE_MESSAGE_BUFFER_MEMORY so there

View File

@@ -42,9 +42,9 @@ noinst_LIBRARIES += libmonitor.a
libmonitor_a_SOURCES = monitor/mon-command.c monitor/mon-symbols.c \ libmonitor_a_SOURCES = monitor/mon-command.c monitor/mon-symbols.c \
monitor/mon-prmisc.c monitor/mon-monitor.c monitor/mon-object.c \ monitor/mon-prmisc.c monitor/mon-monitor.c monitor/mon-object.c \
monitor/mon-server.c monitor/mon-task.c monitor/mon-queue.c \ monitor/mon-server.c monitor/mon-task.c monitor/mon-queue.c \
monitor/mon-driver.c monitor/mon-dname.c monitor/mon-itask.c \ monitor/mon-driver.c monitor/mon-itask.c monitor/mon-extension.c \
monitor/mon-extension.c monitor/mon-manager.c monitor/mon-config.c \ monitor/mon-manager.c monitor/mon-config.c monitor/symbols.h \
monitor/symbols.h monitor/monitor.h monitor/monitor.h
if HAS_MP if HAS_MP
libmonitor_a_SOURCES += monitor/mon-mpci.c libmonitor_a_SOURCES += monitor/mon-mpci.c
endif endif

View File

@@ -1,116 +0,0 @@
/*
* RTEMS monitor driver names support.
*
* There are 2 "driver" things the monitor knows about.
*
* 1. Regular RTEMS drivers.
* This is a table indexed by major device number and
* containing driver entry points only.
*
* 2. Driver name table.
* A separate table of names for drivers.
* The table converts driver names to a major number
* as index into the driver table and a minor number
* for an argument to driver.
*
* Drivers are displayed with 'driver' command.
* Names are displayed with 'dname' command.
*
* $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#include <string.h> /* strncpy() */
#define DATACOL 15
#define CONTCOL DATACOL /* continued col */
void
rtems_monitor_dname_canonical(
rtems_monitor_dname_t *canonical_dname,
void *dname_void
)
{
rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
(void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
canonical_dname->major = np->major;
canonical_dname->minor = np->minor;
}
void *
rtems_monitor_dname_next(
void *object_information,
rtems_monitor_dname_t *canonical_dname,
rtems_id *next_id
)
{
uint32_t n = rtems_get_index(*next_id);
rtems_driver_name_t *table = _IO_Driver_name_table;
rtems_driver_name_t *np = 0;
/* 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;
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
done:
_Thread_Disable_dispatch();
/*
* dummy up a fake id and name for this item
*/
canonical_dname->id = n;
canonical_dname->name = rtems_build_name('-', '-', '-', '-');
*next_id += 1;
return np;
}
void
rtems_monitor_dname_dump_header(
boolean verbose
)
{
fprintf(stdout,"\
Major:Minor Name\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
void
rtems_monitor_dname_dump(
rtems_monitor_dname_t *monitor_dname,
boolean verbose
)
{
uint32_t length = 0;
length += rtems_monitor_pad(6, length);
length += rtems_monitor_dump_hex(monitor_dname->major);
length += fprintf(stdout,":");
length += rtems_monitor_dump_hex(monitor_dname->minor);
length += rtems_monitor_pad(16, length);
length += fprintf(stdout,"%.*s",
(int) sizeof(monitor_dname->name_string),
(char *) monitor_dname->name_string);
length += fprintf(stdout,"\n");
length = 0;
}

View File

@@ -100,17 +100,6 @@ rtems_monitor_object_info_t rtems_monitor_object_info[] =
(rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header, (rtems_monitor_object_dump_header_fn) rtems_monitor_driver_dump_header,
(rtems_monitor_object_dump_fn) rtems_monitor_driver_dump, (rtems_monitor_object_dump_fn) rtems_monitor_driver_dump,
}, },
{ RTEMS_MONITOR_OBJECT_DNAME,
/* 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,
(rtems_monitor_object_dump_header_fn) rtems_monitor_dname_dump_header,
(rtems_monitor_object_dump_fn) rtems_monitor_dname_dump,
},
}; };
/* /*

View File

@@ -168,15 +168,6 @@ typedef struct {
rtems_monitor_symbol_t control; /* special functions procedure */ rtems_monitor_symbol_t control; /* special functions procedure */
} rtems_monitor_driver_t; } rtems_monitor_driver_t;
typedef struct {
rtems_id id; /* not used for drivers (yet) */
rtems_name name; /* not used for drivers (yet) */
/* end of common portion */
uint32_t major;
uint32_t minor;
char name_string[64];
} rtems_monitor_dname_t;
/* /*
* System config * System config
*/ */
@@ -229,7 +220,6 @@ typedef union {
rtems_monitor_queue_t queue; rtems_monitor_queue_t queue;
rtems_monitor_extension_t extension; rtems_monitor_extension_t extension;
rtems_monitor_driver_t driver; rtems_monitor_driver_t driver;
rtems_monitor_dname_t dname;
rtems_monitor_config_t config; rtems_monitor_config_t config;
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
rtems_monitor_mpci_t mpci; rtems_monitor_mpci_t mpci;
@@ -422,12 +412,6 @@ void rtems_monitor_driver_canonical(rtems_monitor_driver_t *, void *);
void rtems_monitor_driver_dump_header(boolean); void rtems_monitor_driver_dump_header(boolean);
void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean); void rtems_monitor_driver_dump(rtems_monitor_driver_t *, boolean);
/* dname.c */
void *rtems_monitor_dname_next(void *, rtems_monitor_dname_t *, rtems_id *);
void rtems_monitor_dname_canonical(rtems_monitor_dname_t *, void *);
void rtems_monitor_dname_dump_header(boolean);
void rtems_monitor_dname_dump(rtems_monitor_dname_t *, boolean);
/* symbols.c */ /* symbols.c */
rtems_symbol_table_t *rtems_symbol_table_create(); rtems_symbol_table_t *rtems_symbol_table_create();
void rtems_symbol_table_destroy(rtems_symbol_table_t *table); void rtems_symbol_table_destroy(rtems_symbol_table_t *table);

View File

@@ -340,10 +340,13 @@ rtems_driver_address_table Device_drivers[] = {
/* /*
* Default the number of devices per device driver. This value may be * Default the number of devices per device driver. This value may be
* overridden by the user. * overridden by the user.
*
* NOTE: This configuration parameter is obsolete. Thus we will warn the
* user that it is obsolete.
*/ */
#ifndef CONFIGURE_MAXIMUM_DEVICES #ifdef CONFIGURE_MAXIMUM_DEVICES
#define CONFIGURE_MAXIMUM_DEVICES 20 #warning "CONFIGURE_MAXIMUM_DEVICES is obsolete. Do not use any longer."
#endif #endif
#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
@@ -974,9 +977,6 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
( (_extensions) * \ ( (_extensions) * \
( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
(((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
#ifdef CONFIGURE_MP_APPLICATION #ifdef CONFIGURE_MP_APPLICATION
#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
@@ -1079,7 +1079,6 @@ itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \ CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \ CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
CONFIGURE_STACK_CHECKER_EXTENSION ) + \ CONFIGURE_STACK_CHECKER_EXTENSION ) + \
CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
CONFIGURE_MEMORY_FOR_MP + \ CONFIGURE_MEMORY_FOR_MP + \
CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
CONFIGURE_MESSAGE_BUFFER_MEMORY + \ CONFIGURE_MESSAGE_BUFFER_MEMORY + \
@@ -1175,7 +1174,6 @@ rtems_configuration_table Configuration = {
CONFIGURE_STACK_CHECKER_EXTENSION, CONFIGURE_STACK_CHECKER_EXTENSION,
CONFIGURE_MICROSECONDS_PER_TICK, CONFIGURE_MICROSECONDS_PER_TICK,
CONFIGURE_TICKS_PER_TIMESLICE, CONFIGURE_TICKS_PER_TIMESLICE,
CONFIGURE_MAXIMUM_DEVICES,
CONFIGURE_MAXIMUM_DRIVERS, CONFIGURE_MAXIMUM_DRIVERS,
CONFIGURE_NUMBER_OF_DRIVERS, /* number of device drivers */ CONFIGURE_NUMBER_OF_DRIVERS, /* number of device drivers */
Device_drivers, /* pointer to driver table */ Device_drivers, /* pointer to driver table */

View File

@@ -106,7 +106,6 @@ typedef struct {
uint32_t maximum_extensions; uint32_t maximum_extensions;
uint32_t microseconds_per_tick; uint32_t microseconds_per_tick;
uint32_t ticks_per_timeslice; uint32_t ticks_per_timeslice;
uint32_t maximum_devices;
uint32_t maximum_drivers; uint32_t maximum_drivers;
uint32_t number_of_device_drivers; uint32_t number_of_device_drivers;
rtems_driver_address_table *Device_driver_table; rtems_driver_address_table *Device_driver_table;

View File

@@ -90,8 +90,6 @@ typedef struct {
SAPI_EXTERN uint32_t _IO_Number_of_drivers; SAPI_EXTERN uint32_t _IO_Number_of_drivers;
SAPI_EXTERN rtems_driver_address_table *_IO_Driver_address_table; SAPI_EXTERN rtems_driver_address_table *_IO_Driver_address_table;
SAPI_EXTERN uint32_t _IO_Number_of_devices;
SAPI_EXTERN rtems_driver_name_t *_IO_Driver_name_table;
/* /*
* _IO_Manager_initialization * _IO_Manager_initialization
@@ -104,8 +102,7 @@ SAPI_EXTERN rtems_driver_name_t *_IO_Driver_name_table;
void _IO_Manager_initialization( void _IO_Manager_initialization(
rtems_driver_address_table *driver_table, rtems_driver_address_table *driver_table,
uint32_t drivers_in_table, uint32_t drivers_in_table,
uint32_t number_of_drivers, uint32_t number_of_drivers
uint32_t number_of_devices
); );
/* /*

View File

@@ -198,8 +198,7 @@ rtems_interrupt_level rtems_initialize_executive_early(
_IO_Manager_initialization( _IO_Manager_initialization(
configuration_table->Device_driver_table, configuration_table->Device_driver_table,
configuration_table->number_of_device_drivers, configuration_table->number_of_device_drivers,
configuration_table->maximum_drivers, configuration_table->maximum_drivers
configuration_table->maximum_devices
); );
#ifdef RTEMS_POSIX_API #ifdef RTEMS_POSIX_API

View File

@@ -37,35 +37,14 @@
void _IO_Manager_initialization( void _IO_Manager_initialization(
rtems_driver_address_table *driver_table, rtems_driver_address_table *driver_table,
uint32_t drivers_in_table, uint32_t drivers_in_table,
uint32_t number_of_drivers, uint32_t number_of_drivers
uint32_t number_of_devices
) )
{ {
void *tmp;
uint32_t index;
rtems_driver_name_t *np;
if ( number_of_drivers < drivers_in_table ) if ( number_of_drivers < drivers_in_table )
number_of_drivers = drivers_in_table; number_of_drivers = drivers_in_table;
_IO_Driver_address_table = driver_table; _IO_Driver_address_table = driver_table;
_IO_Number_of_drivers = number_of_drivers; _IO_Number_of_drivers = number_of_drivers;
_IO_Number_of_devices = number_of_devices;
tmp = _Workspace_Allocate_or_fatal_error(
sizeof( rtems_driver_name_t ) * ( number_of_devices + 1 )
);
_IO_Driver_name_table = (rtems_driver_name_t *) tmp;
for( index=0, np = _IO_Driver_name_table ;
index < _IO_Number_of_devices ;
index++, np++ ) {
np->device_name = 0;
np->device_name_length = 0;
np->major = 0;
np->minor = 0;
}
} }
/*PAGE /*PAGE
@@ -174,54 +153,6 @@ rtems_status_code rtems_io_unregister_driver(
return RTEMS_UNSATISFIED; return RTEMS_UNSATISFIED;
} }
/*PAGE
*
* rtems_io_register_name
*
* Associate a name with a driver
*
* Input Paramters:
* device_name - pointer to name string to associate with device
* major - device major number to receive name
* minor - device minor number to receive name
*
* Output Parameters:
* RTEMS_SUCCESSFUL - if successful
* error code - if unsuccessful
*/
#if 0
rtems_status_code rtems_io_register_name(
const char *device_name,
rtems_device_major_number major,
rtems_device_minor_number minor
)
{
rtems_driver_name_t *np;
uint32_t level;
uint32_t index;
/* find an empty slot */
for( index=0, np = _IO_Driver_name_table ;
index < _IO_Number_of_devices ;
index++, np++ ) {
_ISR_Disable(level);
if (np->device_name == 0) {
np->device_name = device_name;
np->device_name_length = strlen(device_name);
np->major = major;
np->minor = minor;
_ISR_Enable(level);
return RTEMS_SUCCESSFUL;
}
_ISR_Enable(level);
}
return RTEMS_TOO_MANY;
}
#endif
/*PAGE /*PAGE
* *
* rtems_io_initialize * rtems_io_initialize