source: rtems-docs/porting/cpu_init.rst @ 42d50d7

5
Last change on this file since 42d50d7 was 7497f5e, checked in by Joel Sherrill <joel@…>, on 10/28/16 at 20:57:11

porting: Review and tidy up multiple formatting issues.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. COMMENT: COPYRIGHT (c) 1988-2002.
4.. COMMENT: On-Line Applications Research Corporation (OAR).
5.. COMMENT: All rights reserved.
6
7CPU Initialization
8##################
9
10This section describes the general CPU and system initialization sequence
11as it pertains to the CPU dependent code.
12
13Introduction
14============
15
16XXX general startup sequence description rewritten to make it more
17applicable to CPU depdent code in executive
18
19Initializing the CPU
20====================
21
22The _CPU_Initialize routine performs processor dependent initialization.
23
24.. code-block:: c
25
26    void _CPU_Initialize(
27      void            (*thread_dispatch)  /* may be ignored */
28    )
29
30The thread_dispatch argument is the address of the entry point for the
31routine called at the end of an ISR once it has been decided a context
32switch is necessary.  On some compilation systems it is difficult to call
33a high-level language routine from assembly.  Providing the address of the
34_Thread_ISR_Dispatch routine allows the porter an easy way to obtain this
35critical address and thus provides an easy way to work around this
36limitation on these systems.
37
38If you encounter this problem save the entry point in a CPU dependent
39variable as shown below:
40
41.. code-block:: c
42
43    _CPU_Thread_dispatch_pointer = thread_dispatch;
44
45During the initialization of the context for tasks with floating point,
46the CPU dependent code is responsible for initializing the floating point
47context.  If there is not an easy way to initialize the FP context during
48Context_Initialize, then it is usually easier to save an "uninitialized"
49FP context here and copy it to the task's during Context_Initialize.  If
50this technique is used to initialize the FP contexts, then it is important
51to ensure that the state of the floating point unit is in a coherent,
52initialized state.
Note: See TracBrowser for help on using the repository browser.