source: rtems/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c @ eba2e4f

4.104.114.84.95
Last change on this file since eba2e4f was eba2e4f, checked in by Joel Sherrill <joel.sherrill@…>, on 11/01/00 at 21:19:23

2000-11-01 Joel Sherrill <joel@…>

  • startup/bspstart.c: assoc.h, error.h, libio_.h, libio.h, and libcsupport.h moved from libc to lib/include/rtems and now must be referenced as <rtems/XXX.h>. Header file order was cleaned up while doing this.
  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2 *
3 *  This routine starts the application.  It includes application,
4 *  board, and monitor specific initialization and configuration.
5 *  The generic CPU dependent initialization has been performed
6 *  before this routine is invoked.
7 *
8 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
9 *
10 *  COPYRIGHT (c) 1995 by i-cubed ltd.
11 *
12 *  To anyone who acknowledges that this file is provided "AS IS"
13 *  without any express or implied warranty:
14 *      permission to use, copy, modify, and distribute this file
15 *      for any purpose is hereby granted without fee, provided that
16 *      the above copyright notice and this notice appears in all
17 *      copies, and that the name of i-cubed limited not be used in
18 *      advertising or publicity pertaining to distribution of the
19 *      software without specific, written prior permission.
20 *      i-cubed limited makes no representations about the suitability
21 *      of this software for any purpose.
22 *
23 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c:
24 *
25 *  COPYRIGHT (c) 1989-1999.
26 *  On-Line Applications Research Corporation (OAR).
27 *
28 *  The license and distribution terms for this file may be
29 *  found in the file LICENSE in this distribution or at
30 *  http://www.OARcorp.com/rtems/license.html.
31 *
32 *  $Id$
33 */
34
35#include <string.h>
36
37#include <bsp.h>
38#include <rtems/libio.h>
39#include <rtems/libcsupport.h>
40 
41/*
42 *  The original table from the application and our copy of it with
43 *  some changes.
44 */
45
46extern rtems_configuration_table Configuration;
47
48rtems_configuration_table  BSP_Configuration;
49
50rtems_cpu_table Cpu_table;
51
52char *rtems_progname;
53
54/*
55 *  Use the shared implementations of the following routines
56 */
57 
58void bsp_postdriver_hook(void);
59void bsp_libc_init( void *, unsigned32, int );
60
61/*
62 *  Function:   bsp_pretasking_hook
63 *  Created:    95/03/10
64 *
65 *  Description:
66 *      BSP pretasking hook.  Called just before drivers are initialized.
67 *      Used to setup libc and install any BSP extensions.
68 *
69 *  NOTES:
70 *      Must not use libc (to do io) from here, since drivers are
71 *      not yet initialized.
72 *
73 */
74 
75void bsp_pretasking_hook(void)
76{
77    extern int _end;
78    rtems_unsigned32        heap_start;
79
80    heap_start = (rtems_unsigned32) &_end;
81    if (heap_start & (CPU_ALIGNMENT-1))
82        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
83
84    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
85 
86#ifdef RTEMS_DEBUG
87    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
88#endif
89}
90 
91/*
92 *  bsp_start
93 *
94 *  This routine does the bulk of the system initialization.
95 */
96
97void bsp_start( void )
98{
99  /*
100   *  Allocate the memory for the RTEMS Work Space.  This can come from
101   *  a variety of places: hard coded address, malloc'ed from outside
102   *  RTEMS world (e.g. simulator or primitive memory manager), or (as
103   *  typically done by stock BSPs) by subtracting the required amount
104   *  of work space from the last physical address on the CPU board.
105   */
106
107  /*
108   *  Need to "allocate" the memory for the RTEMS Workspace and
109   *  tell the RTEMS configuration where it is.  This memory is
110   *  not malloc'ed.  It is just "pulled from the air".
111   */
112
113  BSP_Configuration.work_space_start = (void *)
114      RAM_END - BSP_Configuration.work_space_size;
115
116  /*
117   *  initialize the CPU table for this BSP
118   */
119
120  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
121  Cpu_table.postdriver_hook = bsp_postdriver_hook;
122  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
123
124  Cpu_table.clicks_per_usec = 10;
125  Cpu_table.serial_per_sec = 10000000;
126  Cpu_table.serial_external_clock = 1;
127  Cpu_table.serial_xon_xoff = 0;
128  Cpu_table.serial_cts_rts = 1;
129  Cpu_table.serial_rate = 9600;
130  Cpu_table.timer_average_overhead = 2;
131  Cpu_table.timer_least_valid = 3;
132}
Note: See TracBrowser for help on using the repository browser.