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