source: rtems-docs/porting/cpu_init.rst @ b0f2977

4.115
Last change on this file since b0f2977 was b0f2977, checked in by Joel Sherrill <joel@…>, on 10/28/16 at 01:01:47

porting: Fix code-block markup

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