source: rtems/c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c @ f335672

4.104.114.95
Last change on this file since f335672 was 5b9e302c, checked in by Till Straumann <strauman@…>, on 05/23/08 at 21:34:35

2008-05-23 Till Straumann <strauman@…>

  • shared/startup/pretaskinghook.c: removed declaration of BSP_vme_config() (which is already declared in <bsp/VME.h>. Removed test for NULL-ness of BSP_vme_config; gcc doesn't seem to understand that the linker may define this to be NULL... Silences a compiler warning (and users can always provide an empty routine).
  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 *  bsp_pretasking_hook().
3 *  Initializes the heap, libc and VME.
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  Modified to support the MCP750.
13 *  Modifications Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
14 *
15 *  $Id$
16 */
17
18#include <string.h>
19
20#include <bsp.h>
21#ifndef BSP_HAS_NO_VME
22#include <bsp/VME.h>
23#endif
24
25#ifdef SHOW_MORE_INIT_SETTINGS
26#include <rtems/bspIo.h>
27#endif
28
29#include <rtems/malloc.h>
30
31void bsp_libc_init( void *, uint32_t, int );
32
33/*
34 *  Function:   bsp_pretasking_hook
35 *  Created:    95/03/10
36 *
37 *  Description:
38 *      BSP pretasking hook.  Called just before drivers are initialized.
39 *      Used to setup libc and install any BSP extensions.
40 *
41 *  NOTES:
42 *      Must not use libc (to do io) from here, since drivers are
43 *      not yet initialized.
44 *
45 */
46
47void bsp_pretasking_hook(void)
48{
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
72  /* Note that VME support may be omitted also by
73   * providing a no-op  BSP_vme_config routine
74   */
75#ifndef BSP_HAS_NO_VME
76  /*
77   * Initialize VME bridge - needs working PCI
78   * and IRQ subsystems...
79   *
80   * NOTE: vmeUniverse driver now uses shared interrupts.
81   *       this requires malloc/free which are not available
82   *       from bspstart()...
83   */
84#ifdef SHOW_MORE_INIT_SETTINGS
85  printk("Going to initialize VME bridge\n");
86#endif
87  BSP_vme_config();
88#endif
89
90#ifdef SHOW_MORE_INIT_SETTINGS
91  printk("Leaving bsp_pretasking_hook\n");
92#endif
93}
Note: See TracBrowser for help on using the repository browser.