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.
This commit is contained in:
Joel Sherrill
1998-04-15 20:50:31 +00:00
parent b6394ae434
commit bd9c3d1e76
58 changed files with 99 additions and 892 deletions

View File

@@ -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.
*/

View File

@@ -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( \

View File

@@ -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( \

View File

@@ -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 );

View File

@@ -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);

View File

@@ -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);

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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 );

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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 */

View File

@@ -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 );

View File

@@ -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);
}

View File

@@ -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 );

View File

@@ -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 */
}

View File

@@ -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 );

View File

@@ -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 */
}

View File

@@ -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 );

View File

@@ -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 */
}

View File

@@ -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;

View File

@@ -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.
*/
}

View File

@@ -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;

View File

@@ -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.
*/
}

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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 );

View File

@@ -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);
}

View File

@@ -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 );

View File

@@ -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);
}

View File

@@ -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 );

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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.
*/
}

View File

@@ -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 */

View File

@@ -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.
*/
}

View File

@@ -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 */

View File

@@ -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.
*/
}

View File

@@ -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 );

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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 );

View File

@@ -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 );
}

View File

@@ -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 ?
*/

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -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 );
}

View File

@@ -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);

View File

@@ -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
*/
/*
* Add 1 extension for MPCI_fatal
*/
rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS);
if (BSP_Configuration.User_multiprocessing_table)
BSP_Configuration.maximum_extensions++;
/*
* Add 1 extension for MPCI_fatal
*/
CPU_CLICKS_PER_TICK = 1;
if (BSP_Configuration.User_multiprocessing_table)
BSP_Configuration.maximum_extensions++;
/*
* Start most of RTEMS
* main() will start the rest
*/
CPU_CLICKS_PER_TICK = 1;
/*
* 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
);
}

View File

@@ -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.
*/

View File

@@ -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.
*/

View File

@@ -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( \