From bd9c3d1e76df8b4e774f50dbaf1bd5ebeeb7a154 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 15 Apr 1998 20:50:31 +0000 Subject: Numerous changes which in total greatly reduced the amount of source code in each BSP's bspstart.c. These changes were: + confdefs.h now knows libio's semaphore requirements + shared/main.c now copies Configuration to BSP_Configuration + shared/main.c fills in the Cpu_table with default values This removed the need for rtems_libio_config() and the constant BSP_LIBIO_MAX_FDS in every BSP. Plus now the maximum number of open files can now be set on the gcc command line. --- c/src/exec/libcsupport/src/libio.c | 18 ------------------ c/src/exec/sapi/headers/confdefs.h | 10 +++++++++- c/src/exec/sapi/include/confdefs.h | 10 +++++++++- 3 files changed, 18 insertions(+), 20 deletions(-) (limited to 'c/src/exec') diff --git a/c/src/exec/libcsupport/src/libio.c b/c/src/exec/libcsupport/src/libio.c index 4ac3666a1e..cdb89e22de 100644 --- a/c/src/exec/libcsupport/src/libio.c +++ b/c/src/exec/libcsupport/src/libio.c @@ -101,24 +101,6 @@ rtems_register_libio_handler( handlers[handler_index] = *handler; } - -void -rtems_libio_config( - rtems_configuration_table *config, - unsigned32 max_fds -) -{ - rtems_libio_number_iops = max_fds; - - /* - * tweak config to reflect # of semaphores we will need - */ - - /* one for iop table */ - config->RTEMS_api_configuration->maximum_semaphores += 1; - config->RTEMS_api_configuration->maximum_semaphores += max_fds; -} - /* * Called by bsp startup code to init the libio area. */ diff --git a/c/src/exec/sapi/headers/confdefs.h b/c/src/exec/sapi/headers/confdefs.h index 446ab040e5..eb27a8412e 100644 --- a/c/src/exec/sapi/headers/confdefs.h +++ b/c/src/exec/sapi/headers/confdefs.h @@ -39,6 +39,13 @@ extern posix_api_configuration_table Configuration_POSIX_API; #define CONFIGURE_NEWLIB_EXTENSION 1 #define CONFIGURE_MALLOC_REGION 1 +#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 +#endif + +#define CONFIGURE_LIBIO_SEMAPHORES \ + (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) + /* * Stack Checker Requirements */ @@ -477,7 +484,8 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = { #define CONFIGURE_EXECUTIVE_RAM_SIZE \ (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \ CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ - CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \ + CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ + CONFIGURE_LIBIO_SEMAPHORES) + \ CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ CONFIGURE_MEMORY_FOR_REGIONS( \ diff --git a/c/src/exec/sapi/include/confdefs.h b/c/src/exec/sapi/include/confdefs.h index 446ab040e5..eb27a8412e 100644 --- a/c/src/exec/sapi/include/confdefs.h +++ b/c/src/exec/sapi/include/confdefs.h @@ -39,6 +39,13 @@ extern posix_api_configuration_table Configuration_POSIX_API; #define CONFIGURE_NEWLIB_EXTENSION 1 #define CONFIGURE_MALLOC_REGION 1 +#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 +#endif + +#define CONFIGURE_LIBIO_SEMAPHORES \ + (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) + /* * Stack Checker Requirements */ @@ -477,7 +484,8 @@ posix_initialization_threads_table POSIX_Initialization_threads[] = { #define CONFIGURE_EXECUTIVE_RAM_SIZE \ (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \ CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ - CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \ + CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ + CONFIGURE_LIBIO_SEMAPHORES) + \ CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ CONFIGURE_MEMORY_FOR_REGIONS( \ -- cgit v1.2.3