Changeset db77b92 in rtems


Ignore:
Timestamp:
Sep 15, 2008, 10:05:19 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
c0e00eb7
Parents:
f1359069
Message:

2008-09-15 Joel Sherrill <joel.sherrill@…>

  • shared/startup/bspstart.c, shared/startup/pretaskinghook.c: Add use of bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization.
  • shared/startup/bspgetworkarea.c: New file.
Location:
c/src/lib/libbsp/powerpc
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/ChangeLog

    rf1359069 rdb77b92  
     12008-09-15      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * shared/startup/bspstart.c, shared/startup/pretaskinghook.c: Add use
     4        of bsp_get_work_area() in its own file and rely on BSP Framework to
     5        perform more initialization.
     6        * shared/startup/bspgetworkarea.c: New file.
     7
    182008-09-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/powerpc/shared/startup/bspstart.c

    rf1359069 rdb77b92  
    2323
    2424#include <bsp.h>
    25 #include <rtems/libio.h>
    26 #include <rtems/libcsupport.h>
    2725#include <rtems/bspIo.h>
    2826#include <bsp/consoleIo.h>
     
    7775 */
    7876unsigned int BSP_mem_size;
    79 /*
    80  * Where the heap starts; is used by bsp_pretasking_hook;
    81  */
    82 unsigned int BSP_heap_start;
     77
    8378/*
    8479 * PCI Bus Frequency
     
    114109 */
    115110
    116 void bsp_libc_init( void *, uint32_t, int );
    117 
    118 void save_boot_params(RESIDUAL* r3, void *r4, void* r5, char *additional_boot_options)
     111void save_boot_params(
     112  RESIDUAL *r3,
     113  void     *r4,
     114  void     *r5,
     115  char     *additional_boot_options
     116)
    119117{
    120118
     
    152150  uint32_t intrStackStart;
    153151  uint32_t intrStackSize;
    154   unsigned char *work_space_start;
    155152  ppc_cpu_id_t myCpu;
    156153  ppc_cpu_revision_t myCpuRevision;
     
    231228  intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
    232229  intrStackSize = rtems_configuration_get_interrupt_stack_size();
    233   BSP_heap_start = intrStackStart + intrStackSize;
    234230
    235231  /*
     
    359355  bsp_clicks_per_usec    = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
    360356
    361 #ifdef SHOW_MORE_INIT_SETTINGS
    362   printk("rtems_configuration_get_work_space_size() = %x\n",
    363           rtems_configuration_get_work_space_size());
    364 #endif
    365 
    366   work_space_start =
    367     (unsigned char *)BSP_mem_size - rtems_configuration_get_work_space_size();
    368 
    369   if ( work_space_start <= ((unsigned char *)__rtems_end) + INIT_STACK_SIZE +
    370         rtems_configuration_get_interrupt_stack_size()) {
    371     printk( "bspstart: Not enough RAM!!!\n" );
    372     bsp_cleanup();
    373   }
    374 
    375   Configuration.work_space_start = work_space_start;
    376 
    377357  /*
    378358   * Initalize RTEMS IRQ system
  • c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c

    rf1359069 rdb77b92  
    2929#include <rtems/malloc.h>
    3030
    31 void bsp_libc_init( void *, uint32_t, int );
    32 
    3331/*
    34  *  Function:   bsp_pretasking_hook
    35  *  Created:    95/03/10
     32 *  bsp_pretasking_hook
    3633 *
    3734 *  Description:
    3835 *      BSP pretasking hook.  Called just before drivers are initialized.
    39  *      Used to setup libc and install any BSP extensions.
    4036 *
    4137 *  NOTES:
     
    4743void bsp_pretasking_hook(void)
    4844{
    49   uint32_t        heap_size;
    50   uint32_t        heap_sbrk_spared;
    51   extern uint32_t _bsp_sbrk_init(uint32_t, uint32_t*);
    52 
    53   /* make sure it's properly aligned */
    54   BSP_heap_start = (BSP_heap_start + CPU_ALIGNMENT - 1) & ~(CPU_ALIGNMENT-1);
    55 
    56   heap_size = (BSP_mem_size - BSP_heap_start) - rtems_configuration_get_work_space_size();
    57   heap_sbrk_spared=_bsp_sbrk_init(BSP_heap_start, &heap_size);
    58 
    59 #ifdef SHOW_MORE_INIT_SETTINGS
    60   printk( "HEAP start %x  size %x (%x bytes spared for sbrk)\n",
    61              BSP_heap_start, heap_size, heap_sbrk_spared);
    62 #endif   
    63 
    64   /* Must install sbrk helpers since we rely on sbrk for giving
    65    * us even the first chunk of memory (bsp_libc_init(heap start==NULL))
    66    */
    67 
    68   rtems_malloc_sbrk_helpers = &rtems_malloc_sbrk_helpers_table;
    69 
    70   bsp_libc_init((void *) 0, heap_size, heap_sbrk_spared);
    71 
    7245  /* Note that VME support may be omitted also by
    7346   * providing a no-op  BSP_vme_config routine
Note: See TracChangeset for help on using the changeset viewer.