1 | ARM Specific Information |
---|
2 | ######################## |
---|
3 | |
---|
4 | This chapter discusses the`ARM architecture <http://en.wikipedia.org/wiki/ARM_architecture>`_ |
---|
5 | dependencies in this port of RTEMS. The ARMv4T (and compatible), ARMv7-A, |
---|
6 | ARMv7-R and ARMv7-M architecture versions are supported by RTEMS. Processors |
---|
7 | with a MMU use a static configuration which is set up during system start. SMP |
---|
8 | is supported. |
---|
9 | |
---|
10 | **Architecture Documents** |
---|
11 | |
---|
12 | For information on the ARM architecture refer to the`ARM Infocenter <http://infocenter.arm.com>`_. |
---|
13 | |
---|
14 | CPU Model Dependent Features |
---|
15 | ============================ |
---|
16 | |
---|
17 | This section presents the set of features which vary |
---|
18 | across ARM implementations and are of importance to RTEMS. The set of CPU |
---|
19 | model feature macros are defined in the file:file:`cpukit/score/cpu/arm/rtems/score/arm.h` based upon the particular CPU |
---|
20 | model flags specified on the compilation command line. |
---|
21 | |
---|
22 | CPU Model Name |
---|
23 | -------------- |
---|
24 | |
---|
25 | The macro ``CPU_MODEL_NAME`` is a string which designates |
---|
26 | the architectural level of this CPU model. See in:file:`cpukit/score/cpu/arm/rtems/score/arm.h` for the values. |
---|
27 | |
---|
28 | Count Leading Zeroes Instruction |
---|
29 | -------------------------------- |
---|
30 | |
---|
31 | The ARMv5 and later has the count leading zeroes ``clz`` instruction which |
---|
32 | could be used to speed up the find first bit operation. The use of this |
---|
33 | instruction should significantly speed up the scheduling associated with a |
---|
34 | thread blocking. This is currently not used. |
---|
35 | |
---|
36 | Floating Point Unit |
---|
37 | ------------------- |
---|
38 | |
---|
39 | The following floating point units are supported. |
---|
40 | |
---|
41 | - VFPv3-D32/NEON (for example available on Cortex-A processors) |
---|
42 | |
---|
43 | - VFPv3-D16 (for example available on Cortex-R processors) |
---|
44 | |
---|
45 | - FPv4-SP-D16 (for example available on Cortex-M processors) |
---|
46 | |
---|
47 | Multilibs |
---|
48 | ========= |
---|
49 | |
---|
50 | The following multilibs are available: |
---|
51 | |
---|
52 | # ``.``: ARMv4T, ARM instruction set |
---|
53 | |
---|
54 | # ``thumb``: ARMv4T, Thumb-1 instruction set |
---|
55 | |
---|
56 | # ``thumb/armv6-m``: ARMv6M, subset of Thumb-2 instruction set |
---|
57 | |
---|
58 | # ``thumb/armv7-a``: ARMv7-A, Thumb-2 instruction set |
---|
59 | |
---|
60 | # ``thumb/armv7-a/neon/hard``: ARMv7-A, Thumb-2 instruction set with |
---|
61 | hard-float ABI Neon and VFP-D32 support |
---|
62 | |
---|
63 | # ``thumb/armv7-r``: ARMv7-R, Thumb-2 instruction set |
---|
64 | |
---|
65 | # ``thumb/armv7-r/vfpv3-d16/hard``: ARMv7-R, Thumb-2 instruction set |
---|
66 | with hard-float ABI VFP-D16 support |
---|
67 | |
---|
68 | # ``thumb/armv7-m``: ARMv7-M, Thumb-2 instruction set with hardware |
---|
69 | integer division (SDIV/UDIV) |
---|
70 | |
---|
71 | # ``thumb/armv7-m/fpv4-sp-d16``: ARMv7-M, Thumb-2 instruction set with |
---|
72 | hardware integer division (SDIV/UDIV) and hard-float ABI FPv4-SP support |
---|
73 | |
---|
74 | # ``eb/thumb/armv7-r``: ARMv7-R, Big-endian Thumb-2 instruction set |
---|
75 | |
---|
76 | # ``eb/thumb/armv7-r/vfpv3-d16/hard``: ARMv7-R, Big-endian Thumb-2 |
---|
77 | instruction set with hard-float ABI VFP-D16 support |
---|
78 | |
---|
79 | Multilib 1. and 2. support the standard ARM7TDMI and ARM926EJ-S targets. |
---|
80 | |
---|
81 | Multilib 3. supports the Cortex-M0 and Cortex-M1 cores. |
---|
82 | |
---|
83 | Multilib 8. supports the Cortex-M3 and Cortex-M4 cores, which have a special |
---|
84 | hardware integer division instruction (this is not present in the A and R |
---|
85 | profiles). |
---|
86 | |
---|
87 | Multilib 9. supports the Cortex-M4 cores with a floating point unit. |
---|
88 | |
---|
89 | Multilib 4. and 5. support the Cortex-A processors. |
---|
90 | |
---|
91 | Multilib 6., 7., 10. and 11. support the Cortex-R processors. Here also |
---|
92 | big-endian variants are available. |
---|
93 | |
---|
94 | Use for example the following GCC options |
---|
95 | .. code:: c |
---|
96 | |
---|
97 | -mthumb -march=armv7-a -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 |
---|
98 | |
---|
99 | to build an application or BSP for the ARMv7-A architecture and tune the code |
---|
100 | for a Cortex-A9 processor. It is important to select the options used for the |
---|
101 | multilibs. For example |
---|
102 | .. code:: c |
---|
103 | |
---|
104 | -mthumb -mcpu=cortex-a9 |
---|
105 | |
---|
106 | alone will not select the ARMv7-A multilib. |
---|
107 | |
---|
108 | Calling Conventions |
---|
109 | =================== |
---|
110 | |
---|
111 | Please refer to the`Procedure Call Standard for the ARM Architecture <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042c/IHI0042C_aapcs.pdf>`_. |
---|
112 | |
---|
113 | Memory Model |
---|
114 | ============ |
---|
115 | |
---|
116 | A flat 32-bit memory model is supported. The board support package must take |
---|
117 | care about the MMU if necessary. |
---|
118 | |
---|
119 | Interrupt Processing |
---|
120 | ==================== |
---|
121 | |
---|
122 | The ARMv4T (and compatible) architecture has seven exception types: |
---|
123 | |
---|
124 | - Reset |
---|
125 | |
---|
126 | - Undefined |
---|
127 | |
---|
128 | - Software Interrupt (SWI) |
---|
129 | |
---|
130 | - Prefetch Abort |
---|
131 | |
---|
132 | - Data Abort |
---|
133 | |
---|
134 | - Interrupt (IRQ) |
---|
135 | |
---|
136 | - Fast Interrupt (FIQ) |
---|
137 | |
---|
138 | Of these types only the IRQ has explicit operating system support. It is |
---|
139 | intentional that the FIQ is not supported by the operating system. Without |
---|
140 | operating system support for the FIQ it is not necessary to disable them during |
---|
141 | critical sections of the system. |
---|
142 | |
---|
143 | The ARMv7-M architecture has a completely different exception model. Here |
---|
144 | interrupts are disabled with a write of 0x80 to the ``basepri_max`` |
---|
145 | register. This means that all exceptions and interrupts with a priority value |
---|
146 | of greater than or equal to 0x80 are disabled. Thus exceptions and interrupts |
---|
147 | with a priority value of less than 0x80 are non-maskable with respect to the |
---|
148 | operating system and therefore must not use operating system services. Several |
---|
149 | support libraries of chip vendors implicitly shift the priority value somehow |
---|
150 | before the value is written to the NVIC IPR register. This can easily lead to |
---|
151 | confusion. |
---|
152 | |
---|
153 | Interrupt Levels |
---|
154 | ---------------- |
---|
155 | |
---|
156 | There are exactly two interrupt levels on ARM with respect to RTEMS. Level |
---|
157 | zero corresponds to interrupts enabled. Level one corresponds to interrupts |
---|
158 | disabled. |
---|
159 | |
---|
160 | Interrupt Stack |
---|
161 | --------------- |
---|
162 | |
---|
163 | The board support package must initialize the interrupt stack. The memory for |
---|
164 | the stacks is usually reserved in the linker script. |
---|
165 | |
---|
166 | Default Fatal Error Processing |
---|
167 | ============================== |
---|
168 | |
---|
169 | The default fatal error handler for this architecture performs the |
---|
170 | following actions: |
---|
171 | |
---|
172 | - disables operating system supported interrupts (IRQ), |
---|
173 | |
---|
174 | - places the error code in ``r0``, and |
---|
175 | |
---|
176 | - executes an infinite loop to simulate a halt processor instruction. |
---|
177 | |
---|
178 | Symmetric Multiprocessing |
---|
179 | ========================= |
---|
180 | |
---|
181 | SMP is supported on ARMv7-A. Available platforms are the Altera Cyclone V and |
---|
182 | the Xilinx Zynq. |
---|
183 | |
---|
184 | Thread-Local Storage |
---|
185 | ==================== |
---|
186 | |
---|
187 | Thread-local storage is supported. |
---|
188 | |
---|
189 | .. COMMENT: COPYRIGHT (c) 1988-2009. |
---|
190 | |
---|
191 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
192 | |
---|
193 | .. COMMENT: All rights reserved. |
---|
194 | |
---|