1 | /* |
---|
2 | * BSP startup |
---|
3 | * |
---|
4 | * This routine starts the application. It includes application, |
---|
5 | * board, and monitor specific initialization and configuration. |
---|
6 | * The generic CPU dependent initialization has been performed |
---|
7 | * before this routine is invoked. |
---|
8 | * |
---|
9 | * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia |
---|
10 | * Author: Victor V. Vengerov <vvv@oktet.ru> |
---|
11 | * |
---|
12 | * Based on work: |
---|
13 | * Author: |
---|
14 | * David Fiddes, D.J@fiddes.surfaid.org |
---|
15 | * http://www.calm.hw.ac.uk/davidf/coldfire/ |
---|
16 | * |
---|
17 | * COPYRIGHT (c) 1989-1998. |
---|
18 | * On-Line Applications Research Corporation (OAR). |
---|
19 | * Copyright assigned to U.S. Government, 1994. |
---|
20 | * |
---|
21 | * The license and distribution terms for this file may be |
---|
22 | * found in the file LICENSE in this distribution or at |
---|
23 | * |
---|
24 | * http://www.OARcorp.com/rtems/license.html. |
---|
25 | * |
---|
26 | * $Id$ |
---|
27 | */ |
---|
28 | |
---|
29 | #include <bsp.h> |
---|
30 | #include <rtems/libio.h> |
---|
31 | |
---|
32 | #include <rtems/libcsupport.h> |
---|
33 | |
---|
34 | #include <string.h> |
---|
35 | |
---|
36 | /* |
---|
37 | * The original table from the application and our copy of it with |
---|
38 | * some changes. |
---|
39 | */ |
---|
40 | |
---|
41 | extern rtems_configuration_table Configuration; |
---|
42 | rtems_configuration_table BSP_Configuration; |
---|
43 | |
---|
44 | rtems_cpu_table Cpu_table; |
---|
45 | |
---|
46 | extern unsigned int _RamSize; |
---|
47 | |
---|
48 | |
---|
49 | char *rtems_progname; |
---|
50 | |
---|
51 | /* |
---|
52 | * Use the shared implementations of the following routines |
---|
53 | */ |
---|
54 | |
---|
55 | void bsp_postdriver_hook(void); |
---|
56 | void bsp_libc_init( void *, unsigned32, int ); |
---|
57 | void bsp_pretasking_hook(void); /* m68k version */ |
---|
58 | |
---|
59 | /* bsp_start -- |
---|
60 | * This routine does the bulk of the system initialisation. |
---|
61 | */ |
---|
62 | void bsp_start( void ) |
---|
63 | { |
---|
64 | extern void *_WorkspaceBase; |
---|
65 | extern unsigned long _M68k_Ramsize; |
---|
66 | _M68k_Ramsize = (unsigned long)&_RamSize; /* size set in linker script */ |
---|
67 | |
---|
68 | |
---|
69 | /* |
---|
70 | * Need to "allocate" the memory for the RTEMS Workspace and |
---|
71 | * tell the RTEMS configuration where it is. This memory is |
---|
72 | * not malloc'ed. It is just "pulled from the air". |
---|
73 | */ |
---|
74 | |
---|
75 | BSP_Configuration.work_space_start = (void *)&_WorkspaceBase; |
---|
76 | |
---|
77 | /* |
---|
78 | * initialize the CPU table for this BSP |
---|
79 | */ |
---|
80 | Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ |
---|
81 | |
---|
82 | Cpu_table.postdriver_hook = bsp_postdriver_hook; |
---|
83 | |
---|
84 | Cpu_table.do_zero_of_workspace = TRUE; |
---|
85 | |
---|
86 | Cpu_table.interrupt_stack_size = 4096; |
---|
87 | |
---|
88 | Cpu_table.interrupt_vector_table = (m68k_isr *)0; /* vectors at start of RAM */ |
---|
89 | |
---|
90 | } |
---|