source: rtems-docs/cpu-supplement/atmel_avr.rst @ 12dccfe

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

Remove superfluous "All rights reserved."

  • Property mode set to 100644
File size: 4.1 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. Copyright (C) 1988, 2006 On-Line Applications Research Corporation (OAR)
4
5Atmel AVR Specific Information
6******************************
7
8This chapter discusses the AVR architecture dependencies in this port of RTEMS.
9
10**Architecture Documents**
11
12For information on the AVR architecture, refer to the following documents
13available from Atmel.
14
15TBD
16
17- See other CPUs for documentation reference formatting examples.
18
19CPU Model Dependent Features
20============================
21
22CPUs of the AVR 53X only differ in the peripherals and thus in the device
23drivers. This port does not yet support the 56X dual core variants.
24
25Count Leading Zeroes Instruction
26--------------------------------
27
28The AVR CPU has the XXX instruction which could be used to speed up the find
29first bit operation.  The use of this instruction should significantly speed up
30the scheduling associated with a thread blocking.
31
32Calling Conventions
33===================
34
35Processor Background
36--------------------
37
38The AVR architecture supports a simple call and return mechanism.  A subroutine
39is invoked via the call (``call``) instruction.  This instruction saves the
40return address in the ``RETS`` register and transfers the execution to the
41given address.
42
43It is the called funcions responsability to use the link instruction to reserve
44space on the stack for the local variables.  Returning from a subroutine is
45done by using the RTS (``RTS``) instruction which loads the PC with the adress
46stored in RETS.
47
48It is is important to note that the ``call`` instruction does not automatically
49save or restore any registers.  It is the responsibility of the high-level
50language compiler to define the register preservation and usage convention.
51
52Register Usage
53--------------
54
55A called function may clobber all registers, except RETS, R4-R7, P3-P5, FP and
56SP.  It may also modify the first 12 bytes in the caller's stack frame which is
57used as an argument area for the first three arguments (which are passed in
58R0...R3 but may be placed on the stack by the called function).
59
60Parameter Passing
61-----------------
62
63RTEMS assumes that the AVR GCC calling convention is followed.  The first three
64parameters are stored in registers R0, R1, and R2.  All other parameters are
65put pushed on the stack.  The result is returned through register R0.
66
67Memory Model
68============
69
70The AVR family architecutre support a single unified 4 GB byte address space
71using 32-bit addresses. It maps all resources like internal and external memory
72and IO registers into separate sections of this common address space.
73
74The AVR architcture supports some form of memory protection via its Memory
75Management Unit. Since the AVR port runs in supervisior mode this memory
76protection mechanisms are not used.
77
78Interrupt Processing
79====================
80
81Discussed in this chapter are the AVR's interrupt response and control
82mechanisms as they pertain to RTEMS.
83
84Vectoring of an Interrupt Handler
85---------------------------------
86
87TBD
88
89Disabling of Interrupts by RTEMS
90--------------------------------
91
92During interrupt disable critical sections, RTEMS disables interrupts to level
93N (N) before the execution of this section and restores them to the previous
94level upon completion of the section. RTEMS uses the instructions CLI and STI
95to enable and disable Interrupts. Emulation, Reset, NMI and Exception
96Interrupts are never disabled.
97
98Interrupt Stack
99---------------
100
101The AVR Architecture works with two different kind of stacks, User and
102Supervisor Stack. Since RTEMS and its Application run in supervisor mode, all
103interrupts will use the interrupted tasks stack for execution.
104
105Default Fatal Error Processing
106==============================
107
108The default fatal error handler for the AVR performs the following
109actions:
110
111- disables processor interrupts,
112
113- places the error code in *r0*, and
114
115- executes an infinite loop (``while(0);`` to
116  simulate a halt processor instruction.
117
118Symmetric Multiprocessing
119=========================
120
121SMP is not supported.
122
123Thread-Local Storage
124====================
125
126Thread-local storage is not supported due to a broken tool chain.
127
128Board Support Packages
129======================
130
131System Reset
132------------
133
134TBD
Note: See TracBrowser for help on using the repository browser.