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 ++++- c/src/lib/libbsp/a29k/portsw/include/bsp.h | 6 --- c/src/lib/libbsp/a29k/portsw/startup/bspstart.c | 30 ------------- c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h | 5 --- .../lib/libbsp/hppa1.1/simhppa/startup/bspstart.c | 20 --------- c/src/lib/libbsp/i386/force386/include/bsp.h | 6 --- c/src/lib/libbsp/i386/force386/startup/bspstart.c | 23 ---------- c/src/lib/libbsp/i386/go32/include/bsp.h | 6 --- c/src/lib/libbsp/i386/go32/startup/bspstart.c | 15 ------- c/src/lib/libbsp/i386/i386ex/include/bsp.h | 6 --- c/src/lib/libbsp/i386/i386ex/startup/bspstart.c | 25 ----------- c/src/lib/libbsp/i386/pc386/startup/bspstart.c | 25 ----------- c/src/lib/libbsp/i960/cvme961/include/bsp.h | 6 --- c/src/lib/libbsp/i960/cvme961/startup/bspstart.c | 27 ------------ c/src/lib/libbsp/m68k/dmv152/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c | 23 +--------- c/src/lib/libbsp/m68k/efi332/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/efi332/startup/bspstart.c | 23 ---------- c/src/lib/libbsp/m68k/efi68k/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c | 23 ---------- c/src/lib/libbsp/m68k/gen68302/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c | 32 -------------- c/src/lib/libbsp/m68k/gen68360/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c | 30 ------------- c/src/lib/libbsp/m68k/idp/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/idp/startup/bspstart.c | 23 ---------- c/src/lib/libbsp/m68k/mvme136/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c | 22 ---------- c/src/lib/libbsp/m68k/mvme147/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c | 22 ---------- c/src/lib/libbsp/m68k/mvme147s/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c | 22 ---------- c/src/lib/libbsp/m68k/mvme162/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c | 23 ---------- c/src/lib/libbsp/m68k/ods68302/include/bsp.h | 6 --- c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c | 31 ------------- c/src/lib/libbsp/mips/p4000/include/bsp.h | 6 --- c/src/lib/libbsp/mips/p4000/startup/bspstart.c | 34 +-------------- c/src/lib/libbsp/mips64orion/p4000/include/bsp.h | 6 --- .../libbsp/mips64orion/p4000/startup/bspstart.c | 34 +-------------- c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h | 6 --- c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c | 51 +--------------------- c/src/lib/libbsp/powerpc/papyrus/include/bsp.h | 6 --- .../lib/libbsp/powerpc/papyrus/startup/bspstart.c | 33 -------------- c/src/lib/libbsp/powerpc/psim/include/bsp.h | 6 --- c/src/lib/libbsp/powerpc/psim/startup/bspstart.c | 32 ++------------ c/src/lib/libbsp/sh/gensh1/include/bsp.h | 6 --- c/src/lib/libbsp/sh/gensh1/startup/bspstart.c | 26 +---------- c/src/lib/libbsp/shared/main.c | 48 +++++++++++++++++++- c/src/lib/libbsp/sparc/erc32/include/bsp.h | 6 --- c/src/lib/libbsp/sparc/erc32/startup/bspstart.c | 25 ----------- c/src/lib/libbsp/unix/posix/include/bsp.h | 6 --- c/src/lib/libbsp/unix/posix/startup/bspstart.c | 36 +++++++-------- c/src/lib/libc/libio.c | 18 -------- 56 files changed, 90 insertions(+), 873 deletions(-) (limited to 'c/src') 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( \ diff --git a/c/src/lib/libbsp/a29k/portsw/include/bsp.h b/c/src/lib/libbsp/a29k/portsw/include/bsp.h index 89dae051a5..d3fb0630a8 100644 --- a/c/src/lib/libbsp/a29k/portsw/include/bsp.h +++ b/c/src/lib/libbsp/a29k/portsw/include/bsp.h @@ -82,12 +82,6 @@ extern rtems_configuration_table BSP_Configuration; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c b/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c index 6c5f396f39..666a0f3d68 100644 --- a/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c +++ b/c/src/lib/libbsp/a29k/portsw/startup/bspstart.c @@ -123,18 +123,6 @@ int bsp_start( * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -151,28 +139,10 @@ int bsp_start( * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_system_initialization_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - _settrap( 109,&a29k_enable_sup); _settrap( 110,&a29k_disable_sup); _settrap( 111,&a29k_enable_all_sup); diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h index 28359d2d3e..cc7f44dd9a 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h +++ b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h @@ -92,11 +92,6 @@ extern int use_print_buffer; #define CONSOLE_DRIVER_TABLE_ENTRY \ { tty_initialize, tty_open, tty_close, tty_read, tty_write, tty_control } -/* - * How many libio files we want - */ -#define BSP_LIBIO_MAX_FDS 20 - #define HPPA_INTERRUPT_EXTERNAL_MPCI HPPA_INTERRUPT_EXTERNAL_10 rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int); diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c index a84f967504..4a94bcfb9d 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c @@ -172,12 +172,6 @@ void bsp_start(void) cpu_number = 0; #endif - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *)MY_WORK_SPACE; if (BSP_Configuration.work_space_size) BSP_Configuration.work_space_size = WORKSPACE_SIZE; @@ -189,23 +183,15 @@ void bsp_start(void) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; /* register drivers */ - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - /* * Don't zero out the workspace. The simulator did it for us. */ Cpu_table.do_zero_of_workspace = FALSE; - Cpu_table.interrupt_stack_size = (12 * 1024); - Cpu_table.extra_mpci_receive_server_stack = 0; - /* * Set this artificially low for the simulator */ @@ -245,12 +231,6 @@ void bsp_start(void) BSP_Configuration.maximum_extensions++; #endif - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Add 1 extension for MPCI_fatal */ diff --git a/c/src/lib/libbsp/i386/force386/include/bsp.h b/c/src/lib/libbsp/i386/force386/include/bsp.h index fdf3c2455f..125e53ec88 100644 --- a/c/src/lib/libbsp/i386/force386/include/bsp.h +++ b/c/src/lib/libbsp/i386/force386/include/bsp.h @@ -142,12 +142,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/i386/force386/startup/bspstart.c b/c/src/lib/libbsp/i386/force386/startup/bspstart.c index f32fc798f1..c4ea26cdfb 100644 --- a/c/src/lib/libbsp/i386/force386/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/force386/startup/bspstart.c @@ -87,40 +87,17 @@ void bsp_start( void ) outport_byte( 0x00, 0x3f ); /* resets VMEbus request level */ - /* - * we do not use the pretasking_hook. - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_table_segment = get_ds(); Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table; Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) RAM_END - BSP_Configuration.work_space_size; - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); } diff --git a/c/src/lib/libbsp/i386/go32/include/bsp.h b/c/src/lib/libbsp/i386/go32/include/bsp.h index eb32b3ba66..a2f79040ef 100644 --- a/c/src/lib/libbsp/i386/go32/include/bsp.h +++ b/c/src/lib/libbsp/i386/go32/include/bsp.h @@ -138,12 +138,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ int _IBMPC_chrdy( char * ch ); diff --git a/c/src/lib/libbsp/i386/go32/startup/bspstart.c b/c/src/lib/libbsp/i386/go32/startup/bspstart.c index eeef55eed9..958591ec8c 100644 --- a/c/src/lib/libbsp/i386/go32/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/go32/startup/bspstart.c @@ -105,19 +105,10 @@ int main( rtems_progname = "RTEMS"; Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.predriver_hook = NULL; Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - Cpu_table.do_zero_of_workspace = TRUE; Cpu_table.interrupt_table_segment = 0;/* get_ds(); */ Cpu_table.interrupt_table_offset = (void *)0; Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - BSP_Configuration = Configuration; BSP_Configuration.work_space_start = sbrk( Configuration.work_space_size ); if ( BSP_Configuration.work_space_start == 0 ) { @@ -128,12 +119,6 @@ int main( _exit( 1 ); } - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - rtems_initialize_executive( &BSP_Configuration, &Cpu_table ); /* does not return */ diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h index 9f5527de2a..896f4e5cc3 100644 --- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h +++ b/c/src/lib/libbsp/i386/i386ex/include/bsp.h @@ -112,12 +112,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c index 9fc13e0262..d71f182230 100644 --- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c @@ -97,28 +97,10 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_table_segment = get_ds(); - Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table; - Cpu_table.interrupt_stack_size = 4096; /* STACK_MINIMUM_SIZE */ - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; #if defined(RTEMS_POSIX_API) BSP_Configuration.work_space_size *= 3; @@ -133,11 +115,4 @@ void bsp_start( void ) /* console_reserve_resources( &BSP_Configuration ); */ - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - } diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c index 773d3ba804..305545dee0 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c @@ -118,33 +118,8 @@ void bsp_start( void ) Cpu_table.interrupt_stack_size = 4096; Cpu_table.extra_mpci_receive_server_stack = 0; - /* Copy user's table and make necessary adjustments. */ - - BSP_Configuration = Configuration; - /* Place RTEMS workspace at top of physical RAM (RAM_END defined in 'bsp.h' */ BSP_Configuration.work_space_start = (void *)(RAM_END - BSP_Configuration.work_space_size); - - /* Tell libio how many fd's we want and allow it to tweak config. */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - -#if 0 - rtems_initialize_executive(&BSP_Configuration, &Cpu_table); - /* does not return */ - - /*-------------------------------------------------------------------------+ - | We only return here if the executive has finished. This happens when the - | task has called exit(). We will then call _exit() which is part of the bsp. - +--------------------------------------------------------------------------*/ - - for (;;) - _exit(0); - - /* no cleanup necessary for PC386 */ - - return 0; -#endif } /* bsp_start */ diff --git a/c/src/lib/libbsp/i960/cvme961/include/bsp.h b/c/src/lib/libbsp/i960/cvme961/include/bsp.h index c09a5e7ded..ce55317090 100644 --- a/c/src/lib/libbsp/i960/cvme961/include/bsp.h +++ b/c/src/lib/libbsp/i960/cvme961/include/bsp.h @@ -129,12 +129,6 @@ BSP_EXTERN i960ca_control_table *Ctl_tbl; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c b/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c index 0b9e523f65..c05d697292 100644 --- a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c +++ b/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c @@ -106,38 +106,11 @@ void bsp_start( void ) Prcb->reg_cache_cfg = 8; i960_soft_reset( Prcb ); - /* - * we do not use the pretasking_hook. - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - Cpu_table.Prcb = Prcb; - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); } diff --git a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h b/c/src/lib/libbsp/m68k/dmv152/include/bsp.h index 746cfa812f..3553c9c0c9 100644 --- a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h +++ b/c/src/lib/libbsp/m68k/dmv152/include/bsp.h @@ -154,12 +154,6 @@ extern m68k_isr_entry M68Kvec[]; /* vector table address */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c index fef39736d1..0de6b80078 100644 --- a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c @@ -116,28 +116,13 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - Cpu_table.do_zero_of_workspace = TRUE; + Cpu_table.interrupt_stack_size = 4096; m68k_get_vbr( vbr ); Cpu_table.interrupt_vector_table = vbr; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); @@ -147,11 +132,5 @@ void bsp_start( void ) console_reserve_resources( &BSP_Configuration ); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* Clock_exit is done as an atexit() function */ } diff --git a/c/src/lib/libbsp/m68k/efi332/include/bsp.h b/c/src/lib/libbsp/m68k/efi332/include/bsp.h index b25768000a..1279d32c39 100644 --- a/c/src/lib/libbsp/m68k/efi332/include/bsp.h +++ b/c/src/lib/libbsp/m68k/efi332/include/bsp.h @@ -130,12 +130,6 @@ extern int stack_start; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c index c2fc402aeb..533684193c 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c @@ -92,37 +92,14 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - m68k_get_vbr( vbr ); Cpu_table.interrupt_vector_table = vbr; - Cpu_table.interrupt_stack_size = 0; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* Clock_exit is done as an atexit() function */ } diff --git a/c/src/lib/libbsp/m68k/efi68k/include/bsp.h b/c/src/lib/libbsp/m68k/efi68k/include/bsp.h index 91d36ac465..de2ea0461b 100644 --- a/c/src/lib/libbsp/m68k/efi68k/include/bsp.h +++ b/c/src/lib/libbsp/m68k/efi68k/include/bsp.h @@ -132,12 +132,6 @@ extern rtems_unsigned32 Timer_interrupts; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c index 8c382683b5..4b89a87499 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c @@ -100,37 +100,14 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - m68k_get_vbr( vbr ); Cpu_table.interrupt_vector_table = vbr; - Cpu_table.interrupt_stack_size = 0; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* Clock_exit is done as an atexit() function */ } diff --git a/c/src/lib/libbsp/m68k/gen68302/include/bsp.h b/c/src/lib/libbsp/m68k/gen68302/include/bsp.h index 1f52cc01cc..8c97c0891a 100644 --- a/c/src/lib/libbsp/m68k/gen68302/include/bsp.h +++ b/c/src/lib/libbsp/m68k/gen68302/include/bsp.h @@ -95,12 +95,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c index ddf6cde530..aa71c6faab 100644 --- a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c @@ -92,19 +92,6 @@ void bsp_start( void ) Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/; #endif - - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -118,26 +105,7 @@ void bsp_start( void ) * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - } diff --git a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h b/c/src/lib/libbsp/m68k/gen68360/include/bsp.h index 7bc9cf164d..a52dc1e69c 100644 --- a/c/src/lib/libbsp/m68k/gen68360/include/bsp.h +++ b/c/src/lib/libbsp/m68k/gen68360/include/bsp.h @@ -94,12 +94,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c index 3a693e1fe5..8ccbd4b78c 100644 --- a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c @@ -88,19 +88,6 @@ void bsp_start( void ) Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/; #endif - - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -113,25 +100,8 @@ void bsp_start( void ) * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ } diff --git a/c/src/lib/libbsp/m68k/idp/include/bsp.h b/c/src/lib/libbsp/m68k/idp/include/bsp.h index f58ea8fa17..25dcfd5def 100644 --- a/c/src/lib/libbsp/m68k/idp/include/bsp.h +++ b/c/src/lib/libbsp/m68k/idp/include/bsp.h @@ -67,12 +67,6 @@ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c index 8bd79b215e..858de3fbfb 100644 --- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c @@ -123,36 +123,13 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* led_putnum('e'); * for debugging purposes only */ /* Clock_exit is done as an atexit() function */ diff --git a/c/src/lib/libbsp/m68k/mvme136/include/bsp.h b/c/src/lib/libbsp/m68k/mvme136/include/bsp.h index 148bd79264..e88bf90c4c 100644 --- a/c/src/lib/libbsp/m68k/mvme136/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mvme136/include/bsp.h @@ -138,12 +138,6 @@ extern m68k_isr_entry M68Kvec[]; /* vector table address */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c index 916aa3accd..b7890f4598 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c @@ -106,33 +106,11 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); } diff --git a/c/src/lib/libbsp/m68k/mvme147/include/bsp.h b/c/src/lib/libbsp/m68k/mvme147/include/bsp.h index d0de0890a9..3868406a97 100644 --- a/c/src/lib/libbsp/m68k/mvme147/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mvme147/include/bsp.h @@ -164,12 +164,6 @@ extern m68k_isr_entry M68Kvec[]; /* vector table address */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c index 47644874ae..2fd917d6f0 100644 --- a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c @@ -112,33 +112,11 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); } diff --git a/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h b/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h index 8eea282cdb..be58a3c445 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mvme147s/include/bsp.h @@ -228,12 +228,6 @@ extern m68k_isr_entry M68Kvec[]; /* vector table address */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c index 2e61a621c0..85e6d8fb2a 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c @@ -171,33 +171,11 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); } diff --git a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h index 3c5bb7d1d3..b362a2b94c 100644 --- a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h +++ b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h @@ -270,12 +270,6 @@ typedef volatile struct gcsr_regs { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c index 1e304b1a1d..4c5c359ebb 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c @@ -129,33 +129,10 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - BSP_Configuration.work_space_start = (void *) (RAM_END - BSP_Configuration.work_space_size); } diff --git a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h b/c/src/lib/libbsp/m68k/ods68302/include/bsp.h index 6c11ced33a..11b9f4cbd7 100644 --- a/c/src/lib/libbsp/m68k/ods68302/include/bsp.h +++ b/c/src/lib/libbsp/m68k/ods68302/include/bsp.h @@ -109,12 +109,6 @@ extern "C" { * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c index 4b25d1bc96..a1f9e1dc3c 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c @@ -91,19 +91,6 @@ void bsp_start( void ) Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/; #endif - - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -117,25 +104,7 @@ void bsp_start( void ) * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ } diff --git a/c/src/lib/libbsp/mips/p4000/include/bsp.h b/c/src/lib/libbsp/mips/p4000/include/bsp.h index d6dcc834f6..da700b8dba 100644 --- a/c/src/lib/libbsp/mips/p4000/include/bsp.h +++ b/c/src/lib/libbsp/mips/p4000/include/bsp.h @@ -102,12 +102,6 @@ extern rtems_configuration_table BSP_Configuration; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ mips_isr_entry set_vector( /* returns old vector */ diff --git a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c b/c/src/lib/libbsp/mips/p4000/startup/bspstart.c index 6a3b4378b4..bdd0c3074d 100644 --- a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c +++ b/c/src/lib/libbsp/mips/p4000/startup/bspstart.c @@ -100,50 +100,20 @@ void bsp_start( void ) * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is * not malloc'ed. It is just "pulled from the air". */ - BSP_Configuration.work_space_start = (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7); + BSP_Configuration.work_space_start = + (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7); /* * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - } diff --git a/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h b/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h index d6dcc834f6..da700b8dba 100644 --- a/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h +++ b/c/src/lib/libbsp/mips64orion/p4000/include/bsp.h @@ -102,12 +102,6 @@ extern rtems_configuration_table BSP_Configuration; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ mips_isr_entry set_vector( /* returns old vector */ diff --git a/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c b/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c index 6a3b4378b4..bdd0c3074d 100644 --- a/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c +++ b/c/src/lib/libbsp/mips64orion/p4000/startup/bspstart.c @@ -100,50 +100,20 @@ void bsp_start( void ) * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is * not malloc'ed. It is just "pulled from the air". */ - BSP_Configuration.work_space_start = (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7); + BSP_Configuration.work_space_start = + (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7); /* * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - } 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 003cce797e..7bdef2de3f 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 @@ -81,12 +81,6 @@ extern rtems_configuration_table BSP_Configuration; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_cleanup( void ); diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c index 4d3b896307..a902b4a478 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c @@ -78,17 +78,8 @@ void bsp_pretasking_hook(void) * This routine does the bulk of the system initialization. */ -int bsp_start( - int argc, - char **argv, - char **environp -) +void bsp_start( void ) { - if ((argc > 0) && argv && argv[0]) - rtems_progname = argv[0]; - else - rtems_progname = "RTEMS"; - /* * Allocate the memory for the RTEMS Work Space. This can come from * a variety of places: hard coded address, malloc'ed from outside @@ -97,18 +88,6 @@ int bsp_start( * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -121,35 +100,7 @@ int bsp_start( * initialize the CPU table for this BSP */ - /* - * we do not use the pretasking_hook - */ - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4096; - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - - /* - * Start RTEMS - */ - - rtems_initialize_executive( &BSP_Configuration, &Cpu_table ); - - bsp_cleanup(); - - return 0; } diff --git a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h b/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h index c246c56610..d66328b924 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/papyrus/include/bsp.h @@ -107,12 +107,6 @@ extern rtems_cpu_table Cpu_table; /* owned by BSP */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ rtems_isr_entry set_vector( /* returns old vector */ diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c index 0765a0bd8e..245b26de96 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c @@ -106,18 +106,6 @@ void bsp_start( void ) * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -132,36 +120,15 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = 4 * 1024; - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - Cpu_table.clicks_per_usec = 10; - Cpu_table.serial_per_sec = 10000000; - Cpu_table.serial_external_clock = 1; - Cpu_table.serial_xon_xoff = 0; - Cpu_table.serial_cts_rts = 1; - Cpu_table.serial_rate = 9600; - Cpu_table.timer_average_overhead = 2; - Cpu_table.timer_least_valid = 3; } diff --git a/c/src/lib/libbsp/powerpc/psim/include/bsp.h b/c/src/lib/libbsp/powerpc/psim/include/bsp.h index 28de2d66dd..b166159bbe 100644 --- a/c/src/lib/libbsp/powerpc/psim/include/bsp.h +++ b/c/src/lib/libbsp/powerpc/psim/include/bsp.h @@ -122,12 +122,6 @@ extern int CLOCK_SPEED; extern int end; /* last address in the program */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ void bsp_start( void ); diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c index 9deea041c6..8b68345c8c 100644 --- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c @@ -188,46 +188,28 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; /* bsp_spurious_initialize;*/ - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - /* + * Is this true? + * * PSIM does zero out memory BUT only when IT begins execution. Thus * if we want to have a clean slate in the workspace each time we * begin execution of OUR application, then we must zero the workspace. + * + * It is true that it takes simulated time to clear the memory. */ Cpu_table.do_zero_of_workspace = FALSE; - /* - * This should be enough interrupt stack. - */ - Cpu_table.interrupt_stack_size = (12 * 1024); - /* - * SIS does not support MP configurations so there is really no way - * to check this out. - */ - - Cpu_table.extra_mpci_receive_server_stack = 0; - /* * The monitor likes the exception table to be at 0x0. */ Cpu_table.exceptions_in_RAM = TRUE; - /* - * Copy the table and allocate memory for the RTEMS Workspace - */ - - BSP_Configuration = Configuration; - #if defined(RTEMS_POSIX_API) BSP_Configuration.work_space_size *= 3; #endif @@ -282,10 +264,4 @@ void bsp_start( void ) CPU_PPC_CLICKS_PER_TICK = BSP_Configuration.microseconds_per_tick * (int) &PSIM_INSTRUCTIONS_PER_MICROSECOND; } - - /* - * Initialize RTEMS. main() will finish it up and start multitasking. - */ - - rtems_libio_config( &BSP_Configuration, BSP_LIBIO_MAX_FDS ); } diff --git a/c/src/lib/libbsp/sh/gensh1/include/bsp.h b/c/src/lib/libbsp/sh/gensh1/include/bsp.h index 1ba0b07576..ea7c370d77 100644 --- a/c/src/lib/libbsp/sh/gensh1/include/bsp.h +++ b/c/src/lib/libbsp/sh/gensh1/include/bsp.h @@ -107,12 +107,6 @@ extern void bsp_cleanup( void ); * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* * FIXME: Should this go to libcpu/sh/sh7032 ? */ diff --git a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c index dc25759d47..e9e72c3830 100644 --- a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c +++ b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c @@ -67,7 +67,7 @@ void bsp_libc_init( void *, unsigned32, int ); void bsp_pretasking_hook(void) { - bsp_libc_init((&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0); + bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0); #ifdef RTEMS_DEBUG rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); @@ -98,12 +98,6 @@ void bsp_start(void) * of work space from the last physical address on the CPU board. */ - /* - * Copy the Configuration Table .. so we can change it - */ - - BSP_Configuration = Configuration; - /* * Need to "allocate" the memory for the RTEMS Workspace and * tell the RTEMS configuration where it is. This memory is @@ -131,28 +125,10 @@ void bsp_start(void) Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - - Cpu_table.do_zero_of_workspace = TRUE; - #if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE ) Cpu_table.interrupt_stack_size = 4096; #endif - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Don't forget the other CPU Table entries. - */ - - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); } diff --git a/c/src/lib/libbsp/shared/main.c b/c/src/lib/libbsp/shared/main.c index 7d5138d84f..5a49524cba 100644 --- a/c/src/lib/libbsp/shared/main.c +++ b/c/src/lib/libbsp/shared/main.c @@ -24,6 +24,7 @@ char *rtems_progname; extern void bsp_start( void ); extern void bsp_cleanup( void ); +extern rtems_configuration_table Configuration; extern rtems_configuration_table BSP_Configuration; extern rtems_cpu_table Cpu_table; @@ -46,17 +47,60 @@ int boot_card(int argc, char **argv) { int status; - /* the atexit hook will be before the static destructor list's entry - point */ + /* + * Set default values for the CPU Table fields all ports must have. + * These values can be overridden in bsp_start() but they are + * right most of the time. + */ + + Cpu_table.pretasking_hook = NULL; + Cpu_table.predriver_hook = NULL; + Cpu_table.postdriver_hook = NULL; + Cpu_table.idle_task = NULL; + Cpu_table.do_zero_of_workspace = TRUE; + Cpu_table.interrupt_stack_size = RTEMS_MINIMUM_STACK_SIZE; + Cpu_table.extra_mpci_receive_server_stack = 0; + Cpu_table.stack_allocate_hook = NULL; + Cpu_table.stack_free_hook = NULL; + + + /* + * Copy the configuration table so we and the BSP wants to change it. + */ + + BSP_Configuration = Configuration; + + /* + * The atexit hook will be before the static destructor list's entry + * point. + */ + bsp_start(); + /* + * Initialize RTEMS but do NOT start multitasking. + */ + bsp_isr_level = rtems_initialize_executive_early( &BSP_Configuration, &Cpu_table ); + /* + * Call main() and get the global constructors invoked if there + * are any. + */ + status = main(argc, argv); + /* + * Perform any BSP specific shutdown actions. + */ + bsp_cleanup(); + /* + * Now return to the start code. + */ + return status; } diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h index eef586db00..f6c3a46586 100644 --- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h +++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h @@ -142,12 +142,6 @@ extern int end; /* last address in the program */ * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* miscellaneous stuff assumed to exist */ diff --git a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c b/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c index 166fe3cfac..e660e64d25 100644 --- a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c +++ b/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c @@ -198,19 +198,13 @@ void bsp_start( void ) */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - - Cpu_table.predriver_hook = NULL; /* bsp_spurious_initialize;*/ - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.idle_task = NULL; /* do not override system IDLE task */ - /* * SIS does zero out memory BUT only when IT begins execution. Thus * if we want to have a clean slate in the workspace each time we * begin execution of OUR application, then we must zero the workspace. */ - Cpu_table.do_zero_of_workspace = TRUE; /* @@ -219,19 +213,6 @@ void bsp_start( void ) Cpu_table.interrupt_stack_size = (24 * 1024); - /* - * SIS does not support MP configurations so there is really no way - * to check this out. - */ - - Cpu_table.extra_mpci_receive_server_stack = 0; - - /* - * Copy the table and allocate memory for the RTEMS Workspace - */ - - BSP_Configuration = Configuration; - #if defined(RTEMS_POSIX_API) BSP_Configuration.work_space_size *= 3; #endif @@ -273,10 +254,4 @@ void bsp_start( void ) */ CPU_SPARC_CLICKS_PER_TICK = BSP_Configuration.microseconds_per_tick; - - /* - * Initialize RTEMS. main() will finish it up and start multitasking. - */ - - rtems_libio_config( &BSP_Configuration, BSP_LIBIO_MAX_FDS ); } diff --git a/c/src/lib/libbsp/unix/posix/include/bsp.h b/c/src/lib/libbsp/unix/posix/include/bsp.h index e7cfe46c85..923a9abf17 100644 --- a/c/src/lib/libbsp/unix/posix/include/bsp.h +++ b/c/src/lib/libbsp/unix/posix/include/bsp.h @@ -72,12 +72,6 @@ extern rtems_configuration_table BSP_Configuration; * NOTE: Use the standard Clock driver entry */ -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - /* functions */ rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int); diff --git a/c/src/lib/libbsp/unix/posix/startup/bspstart.c b/c/src/lib/libbsp/unix/posix/startup/bspstart.c index 4e0955e32a..71d85409ca 100644 --- a/c/src/lib/libbsp/unix/posix/startup/bspstart.c +++ b/c/src/lib/libbsp/unix/posix/startup/bspstart.c @@ -128,7 +128,7 @@ void bsp_start(void) unsigned32 workspace_ptr; /* - * Copy the table + * Copy the table (normally done in shared main). */ BSP_Configuration = Configuration; @@ -214,28 +214,22 @@ void bsp_start(void) Cpu_table.extra_mpci_receive_server_stack = 0; - /* - * Tell libio how many fd's we want and allow it to tweak config - */ - - rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); - - /* - * Add 1 extension for MPCI_fatal - */ + /* + * Add 1 extension for MPCI_fatal + */ - if (BSP_Configuration.User_multiprocessing_table) - BSP_Configuration.maximum_extensions++; + if (BSP_Configuration.User_multiprocessing_table) + BSP_Configuration.maximum_extensions++; - CPU_CLICKS_PER_TICK = 1; + CPU_CLICKS_PER_TICK = 1; - /* - * Start most of RTEMS - * main() will start the rest - */ + /* + * Start most of RTEMS + * main() will start the rest + */ - bsp_isr_level = rtems_initialize_executive_early( - &BSP_Configuration, - &Cpu_table - ); + bsp_isr_level = rtems_initialize_executive_early( + &BSP_Configuration, + &Cpu_table + ); } diff --git a/c/src/lib/libc/libio.c b/c/src/lib/libc/libio.c index 4ac3666a1e..cdb89e22de 100644 --- a/c/src/lib/libc/libio.c +++ b/c/src/lib/libc/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. */ -- cgit v1.2.3