source: rtems-docs/porting/cpu_init.rst @ 62d58f2

5
Last change on this file since 62d58f2 was e52906b, checked in by Sebastian Huber <sebastian.huber@…>, on 01/09/19 at 15:14:06

Simplify SPDX-License-Identifier comment

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