1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1996. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @ifinfo |
---|
10 | @node Memory Model, Memory Model Introduction, Calling Conventions User-Provided Routines, Top |
---|
11 | @end ifinfo |
---|
12 | @chapter Memory Model |
---|
13 | @ifinfo |
---|
14 | @menu |
---|
15 | * Memory Model Introduction:: |
---|
16 | * Memory Model Flat Memory Model:: |
---|
17 | @end menu |
---|
18 | @end ifinfo |
---|
19 | |
---|
20 | @ifinfo |
---|
21 | @node Memory Model Introduction, Memory Model Flat Memory Model, Memory Model, Memory Model |
---|
22 | @end ifinfo |
---|
23 | @section Introduction |
---|
24 | |
---|
25 | A processor may support any combination of memory |
---|
26 | models ranging from pure physical addressing to complex demand |
---|
27 | paged virtual memory systems. RTEMS supports a flat memory |
---|
28 | model which ranges contiguously over the processor's allowable |
---|
29 | address space. RTEMS does not support segmentation or virtual |
---|
30 | memory of any kind. The appropriate memory model for RTEMS |
---|
31 | provided by the targeted processor and related characteristics |
---|
32 | of that model are described in this chapter. |
---|
33 | |
---|
34 | @ifinfo |
---|
35 | @node Memory Model Flat Memory Model, Interrupt Processing, Memory Model Introduction, Memory Model |
---|
36 | @end ifinfo |
---|
37 | @section Flat Memory Model |
---|
38 | |
---|
39 | The SPARC architecture supports a flat 32-bit address |
---|
40 | space with addresses ranging from 0x00000000 to 0xFFFFFFFF (4 |
---|
41 | gigabytes). Each address is represented by a 32-bit value and |
---|
42 | is byte addressable. The address may be used to reference a |
---|
43 | single byte, half-word (2-bytes), word (4 bytes), or doubleword |
---|
44 | (8 bytes). Memory accesses within this address space are |
---|
45 | performed in big endian fashion by the SPARC. Memory accesses |
---|
46 | which are not properly aligned generate a "memory address not |
---|
47 | aligned" trap (type number 7). The following table lists the |
---|
48 | alignment requirements for a variety of data accesses: |
---|
49 | |
---|
50 | @ifset use-ascii |
---|
51 | @example |
---|
52 | @group |
---|
53 | +--------------+-----------------------+ |
---|
54 | | Data Type | Alignment Requirement | |
---|
55 | +--------------+-----------------------+ |
---|
56 | | byte | 1 | |
---|
57 | | half-word | 2 | |
---|
58 | | word | 4 | |
---|
59 | | doubleword | 8 | |
---|
60 | +--------------+-----------------------+ |
---|
61 | @end group |
---|
62 | @end example |
---|
63 | @end ifset |
---|
64 | |
---|
65 | @ifset use-tex |
---|
66 | @sp 1 |
---|
67 | @tex |
---|
68 | \centerline{\vbox{\offinterlineskip\halign{ |
---|
69 | \vrule\strut#& |
---|
70 | \hbox to 1.75in{\enskip\hfil#\hfil}& |
---|
71 | \vrule#& |
---|
72 | \hbox to 1.75in{\enskip\hfil#\hfil}& |
---|
73 | \vrule#\cr |
---|
74 | \noalign{\hrule} |
---|
75 | &\bf Data Type &&\bf Alignment Requirement&\cr\noalign{\hrule} |
---|
76 | &byte&&1&\cr\noalign{\hrule} |
---|
77 | &half-word&&2&\cr\noalign{\hrule} |
---|
78 | &word&&4&\cr\noalign{\hrule} |
---|
79 | &doubleword&&8&\cr\noalign{\hrule} |
---|
80 | }}\hfil} |
---|
81 | @end tex |
---|
82 | @end ifset |
---|
83 | |
---|
84 | @ifset use-html |
---|
85 | @html |
---|
86 | <CENTER> |
---|
87 | <TABLE COLS=2 WIDTH="60%" BORDER=2> |
---|
88 | <TR><TD ALIGN=center><STRONG>Data Type</STRONG></TD> |
---|
89 | <TD ALIGN=center><STRONG>Alignment Requirement</STRONG></TD></TR> |
---|
90 | <TR><TD ALIGN=center>byte</TD> |
---|
91 | <TD ALIGN=center>1</TD></TR> |
---|
92 | <TR><TD ALIGN=center>half-word</TD> |
---|
93 | <TD ALIGN=center>2</TD></TR> |
---|
94 | <TR><TD ALIGN=center>word</TD> |
---|
95 | <TD ALIGN=center>4</TD></TR> |
---|
96 | <TR><TD ALIGN=center>doubleword</TD> |
---|
97 | <TD ALIGN=center>8</TD></TR> |
---|
98 | </TABLE> |
---|
99 | </CENTER> |
---|
100 | @end html |
---|
101 | @end ifset |
---|
102 | |
---|
103 | Doubleword load and store operations must use a pair |
---|
104 | of registers as their source or destination. This pair of |
---|
105 | registers must be an adjacent pair of registers with the first |
---|
106 | of the pair being even numbered. For example, a valid |
---|
107 | destination for a doubleword load might be input registers 0 and |
---|
108 | 1 (i0 and i1). The pair i1 and i2 would be invalid. [NOTE: |
---|
109 | Some assemblers for the SPARC do not generate an error if an odd |
---|
110 | numbered register is specified as the beginning register of the |
---|
111 | pair. In this case, the assembler assumes that what the |
---|
112 | programmer meant was to use the even-odd pair which ends at the |
---|
113 | specified register. This may or may not have been a correct |
---|
114 | assumption.] |
---|
115 | |
---|
116 | RTEMS does not support any SPARC Memory Management |
---|
117 | Units, therefore, virtual memory or segmentation systems |
---|
118 | involving the SPARC are not supported. |
---|
119 | |
---|