Changeset b5e7018 in rtems


Ignore:
Timestamp:
Dec 3, 2007, 10:24:44 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
fee125b3
Parents:
8e1b35f
Message:

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

  • Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the remaining CPU Table fields to the Configuration Table. This included pretasking_hook, predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace, extra_mpci_receive_server_stack, stack_allocate_hook, and stack_free_hook. As a side-effect of this effort some multiprocessing code was made conditional and some style clean up occurred.
Location:
c/src/lib/libbsp
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/gp32/ChangeLog

    r8e1b35f rb5e7018  
     12007-12-03      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
     4        remaining CPU Table fields to the Configuration Table. This included
     5        pretasking_hook, predriver_hook, postdriver_hook, idle_task,
     6        do_zero_of_workspace, extra_mpci_receive_server_stack,
     7        stack_allocate_hook, and stack_free_hook. As a side-effect of this
     8        effort some multiprocessing code was made conditional and some style
     9        clean up occurred.
     10
    1112007-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
    212
  • c/src/lib/libbsp/arm/gp32/Makefile.am

    r8e1b35f rb5e7018  
    2929noinst_PROGRAMS += startup.rel
    3030startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
     31    ../../shared/bsppredriverhook.c \
    3132    startup/bspstart.c startup/exit.c startup/memmap.c \
    3233    ../../shared/bootcard.c ../../shared/sbrk.c \
  • c/src/lib/libbsp/arm/gp32/include/bsp.h

    r8e1b35f rb5e7018  
    6565#define CONFIGURE_INTERRUPT_STACK_MEMORY  (16 * 1024)
    6666
     67/*
     68 *  This BSP provides its own IDLE task to override the RTEMS one.
     69 *  So we prototype it and define the constant confdefs.h expects
     70 *  to configure a BSP specific one.
     71 */
     72void bsp_idle_task(void);
     73
     74#define BSP_IDLE_TASK_BODY bsp_idle_task
     75
    6776#ifdef __cplusplus
    6877}
  • c/src/lib/libbsp/arm/gp32/startup/bspstart.c

    r8e1b35f rb5e7018  
    100100    uint32_t REFCNT;
    101101    int i;
    102     /* If we don't have command line arguments set default program name. */
    103 
    104     Cpu_table.pretasking_hook      = bsp_pretasking_hook; /* init libc, etc. */
    105     Cpu_table.predriver_hook       = NULL;                /* use system's    */
    106     Cpu_table.postdriver_hook      = bsp_postdriver_hook;
    107     Cpu_table.idle_task            = bsp_idle_task;
    108     Cpu_table.interrupt_stack_size = 4096;
    109     Cpu_table.extra_mpci_receive_server_stack = 0;
    110102
    111103    /* stop RTC */
  • c/src/lib/libbsp/arm/rtl22xx/ChangeLog

    r8e1b35f rb5e7018  
     12007-12-03      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
     4        remaining CPU Table fields to the Configuration Table. This included
     5        pretasking_hook, predriver_hook, postdriver_hook, idle_task,
     6        do_zero_of_workspace, extra_mpci_receive_server_stack,
     7        stack_allocate_hook, and stack_free_hook. As a side-effect of this
     8        effort some multiprocessing code was made conditional and some style
     9        clean up occurred.
     10
    1112007-11-03      Ray Xu <rayx.cn@gmail.com>
    212
  • c/src/lib/libbsp/arm/rtl22xx/Makefile.am

    r8e1b35f rb5e7018  
    3030include_HEADERS += ../../arm/shared/comm/uart.h
    3131startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
     32    ../../shared/bsppredriverhook.c \
    3233    startup/bspstart.c startup/bspclean.c ../../shared/bootcard.c \
    33     ../../shared/sbrk.c \
    34     ../../shared/gnatinstallhandler.c
     34    ../../shared/sbrk.c ../../shared/gnatinstallhandler.c
    3535startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
    3636startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
     
    7676startup_rel-bsplibc.o \
    7777startup_rel-bsppost.o \
     78startup_rel-bsppredriverhook.o \
    7879startup_rel-bspstart.o \
    7980startup_rel-sbrk.o
  • c/src/lib/libbsp/arm/rtl22xx/include/bsp.h

    r8e1b35f rb5e7018  
    122122#define RTL8019AS_BASE            0x82000000                //
    123123
    124 
    125 
    126 
    127 /*
    128  *  Define the interrupt mechanism for Time Test 27
    129  *
    130  *  NOTE: Following are not defined and are board independent
    131  *
    132  */
    133124struct rtems_bsdnet_ifconfig;
    134125int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
     
    146137#define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach
    147138
     139/*
     140 *  BSP Configuration Default Overrides
     141 */
     142#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
     143
    148144#ifdef __cplusplus
    149145}
  • c/src/lib/libbsp/arm/rtl22xx/startup/bspstart.c

    r8e1b35f rb5e7018  
    185185    VICProtection = 0;
    186186
    187 
    188     Cpu_table.pretasking_hook        = bsp_pretasking_hook;
    189     Cpu_table.postdriver_hook        = bsp_postdriver_hook;
    190     Cpu_table.do_zero_of_workspace   = TRUE;
    191     BSP_Configuration.microseconds_per_tick=100000;
    192187    /* Place RTEMS workspace at beginning of free memory. */
    193188    BSP_Configuration.work_space_start = (void *)&_bss_free_start;
  • c/src/lib/libbsp/powerpc/mvme5500/ChangeLog

    r8e1b35f rb5e7018  
     12007-12-03      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
     4        remaining CPU Table fields to the Configuration Table. This included
     5        pretasking_hook, predriver_hook, postdriver_hook, idle_task,
     6        do_zero_of_workspace, extra_mpci_receive_server_stack,
     7        stack_allocate_hook, and stack_free_hook. As a side-effect of this
     8        effort some multiprocessing code was made conditional and some style
     9        clean up occurred.
     10
    1112007-11-30      Till Straumann <strauman@slac.stanford.edu>
    212
  • c/src/lib/libbsp/powerpc/mvme5500/Makefile.am

    r8e1b35f rb5e7018  
    3535    ../../powerpc/shared/startup/pretaskinghook.c \
    3636    ../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
    37     startup/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
     37    ../../shared/bsppredriverhook.c startup/bspclean.c \
     38    ../../shared/bsplibc.c ../../shared/bsppost.c \
    3839    ../../shared/gnatinstallhandler.c startup/reboot.c
    3940startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
  • c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h

    r8e1b35f rb5e7018  
    124124RTEMS_BSP_NETWORK_DRIVER_ATTACH(/* struct rtems_bsdnet_ifconfig * */);
    125125
     126/*
     127 *  BSP Configuration Default Overrides
     128 */
     129#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
     130
    126131/* As per Linux, This should be in the ppc/system.h */
    127132
  • c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c

    r8e1b35f rb5e7018  
    2020 *  Modified to support the MVME5500 board.
    2121 *  Also, the settings of L1, L2, and L3 caches is not necessary here.
    22  *  (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003, 2004, 2005
     22 *  (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003-2007
    2323 * 
    2424 *  $Id$
     
    7979
    8080typedef struct CmdLineRec_ {
    81                 unsigned long   size;
    82                 char            buf[0];
     81    unsigned long  size;
     82    char           buf[0];
    8383} CmdLineRec, *CmdLine;
    8484
    8585
    86 #define mtspr(reg, val) \
    87         __asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
    88 
    89 
    90 #define mfspr(reg) \
    91         ( { unsigned val; \
    92           __asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
    93           val; } )
     86#define mtspr(reg, val)  \
     87  __asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
     88
     89
     90#define mfspr(reg) \
     91  ( { unsigned val; \
     92    __asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
     93    val; } )
    9494
    9595/*
     
    122122unsigned char ConfVPD_buff[200];
    123123
    124 #define CMDLINE_BUF_SIZE        2048
     124#define CMDLINE_BUF_SIZE  2048
    125125
    126126static char cmdline_buf[CMDLINE_BUF_SIZE];
     
    173173  extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
    174174  extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
    175   memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
    176   memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
    177   memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
     175
     176  memset(
     177    __SBSS_START__,
     178    0,
     179    ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__)
     180  );
     181  memset(
     182    __SBSS2_START__,
     183    0,
     184    ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__)
     185  );
     186  memset(
     187    __bss_start,
     188    0,
     189    ((unsigned) __rtems_end) - ((unsigned)__bss_start)
     190  );
    178191}
    179192
     
    214227 */
    215228void
    216 save_boot_params(void *r3, void *r4, void* r5, char *cmdline_start, char *cmdline_end)
     229save_boot_params(
     230  void *r3,
     231  void *r4,
     232  void* r5,
     233  char *cmdline_start,
     234  char *cmdline_end
     235)
    217236{
    218 int             i=cmdline_end-cmdline_start;
    219         if ( i >= CMDLINE_BUF_SIZE )
    220                 i = CMDLINE_BUF_SIZE-1;
    221         else if ( i < 0 )
    222                 i = 0;
    223         memmove(cmdline_buf, cmdline_start, i);
    224         cmdline_buf[i]=0;
     237  int i=cmdline_end-cmdline_start;
     238
     239  if ( i >= CMDLINE_BUF_SIZE )
     240    i = CMDLINE_BUF_SIZE-1;
     241  else if ( i < 0 )
     242    i = 0;
     243
     244  memmove(cmdline_buf, cmdline_start, i);
     245  cmdline_buf[i]=0;
    225246}
    226247
     
    237258#endif
    238259  unsigned char *stack;
    239   unsigned long  *r1sp;
     260  unsigned long  *r1sp;
    240261#ifdef SHOW_LCR1_REGISTER
    241262  unsigned l1cr;
     
    252273  ppc_cpu_id_t myCpu;
    253274  ppc_cpu_revision_t myCpuRevision;
    254   Triv121PgTbl  pt=0;
     275  Triv121PgTbl  pt=0;
    255276
    256277  /* Till Straumann: 4/2005
     
    275296   * store the result in global variables so that it can be used latter...
    276297   */
    277   myCpu         = get_ppc_cpu_type();
     298  myCpu   = get_ppc_cpu_type();
    278299  myCpuRevision = get_ppc_cpu_revision();
    279300
     
    288309   * so that it can be printed without accessing R1.
    289310   */
    290   stack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
    291 
    292  /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
     311  stack = ((unsigned char*) __rtems_end) +
     312          INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
     313
     314  /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
    293315  *((uint32_t *)stack) = 0;
    294316
     
    296318  __asm__ __volatile__("mr %0, %%r1":"=r"(r1sp));
    297319  while (--r1sp >= (unsigned long*)__rtems_end)
    298           *r1sp=0xeeeeeeee;
     320    *r1sp=0xeeeeeeee;
    299321
    300322  /*
     
    324346   */
    325347  initialize_exceptions();
     348
    326349  /*
    327350   * Init MMU block address translation to enable hardware
     
    355378#endif 
    356379
    357   BSP_mem_size                          =  _512M;
    358   /* TODO: calculate the BSP_bus_frequency using the REF_CLK bit of System Status  register */
     380  BSP_mem_size         =  _512M;
     381  /* TODO: calculate the BSP_bus_frequency using the REF_CLK bit
     382   *       of System Status  register
     383   */
    359384  /* rtems_bsp_delay_in_bus_cycles are defined in registers.h */
    360   BSP_bus_frequency                     = 133333333;
    361   BSP_processor_frequency               = 1000000000;
    362   BSP_time_base_divisor                 = 4000;/* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
     385  BSP_bus_frequency      = 133333333;
     386  BSP_processor_frequency    = 1000000000;
     387  /* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
     388  BSP_time_base_divisor      = 4000;
    363389
    364390
     
    383409   */
    384410
    385   Cpu_table.pretasking_hook      = bsp_pretasking_hook;    /* init libc, etc. */
    386   Cpu_table.postdriver_hook      = bsp_postdriver_hook;
    387   Cpu_table.do_zero_of_workspace = TRUE;
    388411  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
    389412  /* P94 : 7455 TB/DECR is clocked by the system bus clock frequency */
    390   _CPU_Table                     = Cpu_table;/* S. Kate Feng <feng1@bnl.gov>, for rtems_bsp_delay() */
    391 
    392   bsp_clicks_per_usec    = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
    393   printk("BSP_Configuration.work_space_size = %x\n", BSP_Configuration.work_space_size);
     413
     414  bsp_clicks_per_usec    = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
     415
     416  printk(
     417    "BSP_Configuration.work_space_size = %x\n",
     418     BSP_Configuration.work_space_size
     419  );
     420
    394421  work_space_start =
    395422    (unsigned char *)BSP_mem_size - BSP_Configuration.work_space_size;
    396423
    397   if ( work_space_start <= ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
     424  if ( work_space_start <=
     425       ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
    398426    printk( "bspstart: Not enough RAM!!!\n" );
    399427    bsp_cleanup();
Note: See TracChangeset for help on using the changeset viewer.