Changeset 200748bf in rtems


Ignore:
Timestamp:
Dec 11, 2007, 3:46:10 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
2d25867
Parents:
35f1d89
Message:

2007-12-11 Joel Sherrill <joel.sherrill@…>

  • clock/clock.c, include/bsp.h, startup/bspstart.c, startup/rtems-ctor.cc: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields.
Location:
c/src/lib/libbsp/unix/posix
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/unix/posix/ChangeLog

    r35f1d89 r200748bf  
     12007-12-11      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * clock/clock.c, include/bsp.h, startup/bspstart.c,
     4        startup/rtems-ctor.cc: Eliminate copies of the Configuration Table.
     5        Use the RTEMS provided accessor macros to obtain configuration
     6        fields.
     7
    182007-12-04      Joel Sherrill <joel.sherrill@OARcorp.com>
    29
  • c/src/lib/libbsp/unix/posix/clock/clock.c

    r35f1d89 r200748bf  
    3737    (void) set_vector( clock_isr, Clock_driver_vector, 1 );
    3838
    39     _CPU_Start_clock( BSP_Configuration.microseconds_per_tick );
     39    _CPU_Start_clock( rtems_configuration_get_microseconds_per_tick() );
    4040
    4141    atexit(Clock_exit);
  • c/src/lib/libbsp/unix/posix/include/bsp.h

    r35f1d89 r200748bf  
    3232/* miscellaneous stuff assumed to exist */
    3333
    34 extern rtems_configuration_table BSP_Configuration;
    35 
    3634/*
    3735 *  Device Driver Table Entries
     
    5452/* miscellaneous stuff assumed to exist */
    5553
    56 extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
    5754extern int                       rtems_argc;
    5855extern char                    **rtems_argv;
    59 
    60 extern uint32_t                  bsp_isr_level;
    61 
    62 extern char *rtems_progname;    /* UNIX executable name */
    6356
    6457extern int cpu_number;
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    r35f1d89 r200748bf  
    2525#include <rtems/libio.h>
    2626
    27 extern rtems_configuration_table  Configuration;
    28 
    29 /*
    30  * A copy of the configuration table from the application
    31  * with some changes applied to it.
    32  */
    33 
    34 rtems_configuration_table    BSP_Configuration;
    35 rtems_multiprocessing_table  BSP_Multiprocessing;
    36 uint32_t                     bsp_isr_level;
    3727uint32_t                     Heap_size;
    3828int                          rtems_argc;
     
    120110
    121111    /*
    122      *  Copy the table (normally done in shared main).
    123      */
    124 
    125     BSP_Configuration = Configuration;
    126 
    127     /*
    128112     *  If the node number is -1 then the application better provide
    129113     *  it through environment variables RTEMS_NODE.
     
    131115     */
    132116
    133     if (BSP_Configuration.User_multiprocessing_table) {
     117    if (Configuration.User_multiprocessing_table) {
    134118        char *p;
    135119
    136         /* make a copy for possible editing */
    137         BSP_Multiprocessing = *BSP_Configuration.User_multiprocessing_table;
    138         BSP_Configuration.User_multiprocessing_table = &BSP_Multiprocessing;
    139 
    140         if (BSP_Multiprocessing.node == -1)
    141         {
     120        if (Configuration.User_multiprocessing_table->node == -1) {
    142121            p = getenv("RTEMS_NODE");
    143             BSP_Multiprocessing.node = p ? atoi(p) : 1;
     122            Configuration.User_multiprocessing_table->node = p ? atoi(p) : 1;
    144123        }
    145124
    146125        /* If needed provide maximum_nodes also */
    147         if (BSP_Multiprocessing.maximum_nodes == -1)
    148         {
     126        if (Configuration.User_multiprocessing_table->maximum_nodes == -1) {
    149127            p = getenv("RTEMS_MAXIMUM_NODES");
    150             BSP_Multiprocessing.maximum_nodes = p ? atoi(p) : 1;
     128            Configuration.User_multiprocessing_table->maximum_nodes = p ? atoi(p) : 1;
    151129        }
    152130    }
     
    156134     */
    157135
    158     if (BSP_Configuration.User_multiprocessing_table)
    159         cpu_number = BSP_Configuration.User_multiprocessing_table->node - 1;
     136    if (Configuration.User_multiprocessing_table->User_multiprocessing_table)
     137        cpu_number = Configuration.User_multiprocessing_table->node - 1;
    160138    else
    161139        cpu_number = 0;
    162140
    163141    if (getenv("RTEMS_WORKSPACE_SIZE"))
    164         BSP_Configuration.work_space_size =
     142        rtems_configuration_get_work_space_size() =
    165143           strtol(getenv("RTEMS_WORKSPACE_SIZE"), 0, 0);
    166144    else
    167         BSP_Configuration.work_space_size = DEFAULT_WORKSPACE_SIZE;
     145        rtems_configuration_get_work_space_size() = DEFAULT_WORKSPACE_SIZE;
    168146
    169147    /*
     
    172150
    173151    workspace_ptr =
    174       (uintptr_t) sbrk(BSP_Configuration.work_space_size + CPU_ALIGNMENT);
     152      (uintptr_t) sbrk(rtems_configuration_get_work_space_size() + CPU_ALIGNMENT);
    175153    workspace_ptr += CPU_ALIGNMENT - 1;
    176154    workspace_ptr &= ~(CPU_ALIGNMENT - 1);
    177155
    178     BSP_Configuration.work_space_start = (void *) workspace_ptr;
    179 
    180     /*
    181      * Add 1 extension for MPCI_fatal
    182      */
    183 
    184     if (BSP_Configuration.User_multiprocessing_table)
    185         BSP_Configuration.maximum_extensions++;
     156    Configuration.work_space_start = (void *) workspace_ptr;
    186157
    187158    CPU_CLICKS_PER_TICK = 1;
    188159
    189     /*
    190      *  Start most of RTEMS
    191      *  main() will start the rest
    192      */
    193 
    194     bsp_isr_level = rtems_initialize_executive_early( &BSP_Configuration );
    195160}
  • c/src/lib/libbsp/unix/posix/startup/rtems-ctor.cc

    r35f1d89 r200748bf  
    5050#include <stdlib.h>
    5151
    52 /*
    53  * RTEMS program name
    54  * Probably not used by anyone, but it is nice to have it.
    55  * Actually the UNIX version of CPU_INVOKE_DEBUGGER will probably
    56  * need to use it
    57  */
    58 
    59 char *rtems_progname;
    60 
    6152class RTEMS {
    6253    public:
     
    9081        rtems_argv = argv;
    9182
     83        rtems_interrupt_level bsp_isr_level;
     84
     85        /*
     86         *  Make sure interrupts are disabled.
     87         */
     88
     89        rtems_interrupt_disable( bsp_isr_level );
     90
    9291        if ((argc > 0) && argv && argv[0])
    9392            rtems_progname = argv[0];
     
    102101          invoke_non_gnu_constructors();
    103102        #endif
     103
     104        rtems_initialize_executive_early( &Configuration );
    104105
    105106        /*
Note: See TracChangeset for help on using the changeset viewer.