1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1997. |
---|
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 | RTEMS supports applications in which the application |
---|
40 | and the executive execute within a single thirty-two bit address |
---|
41 | space. Thus RTEMS and the application share a common four |
---|
42 | gigabyte address space within a single space. The PA-RISC |
---|
43 | automatically converts every address from a logical to a |
---|
44 | physical address each time it is used. The PA-RISC uses |
---|
45 | information provided in the page table to perform this |
---|
46 | translation. The following protection levels are assumed: |
---|
47 | |
---|
48 | @itemize @bullet |
---|
49 | @item a single code segment at protection level (0) which |
---|
50 | contains all application and executive code. |
---|
51 | |
---|
52 | @item a single data segment at protection level zero (0) which |
---|
53 | contains all application and executive data. |
---|
54 | @end itemize |
---|
55 | |
---|
56 | The PA-RISC space registers and associated stack -- |
---|
57 | including the stack pointer r27 -- must be initialized when the |
---|
58 | initialize_executive directive is invoked. RTEMS treats the |
---|
59 | space registers as system resources shared by all tasks and does |
---|
60 | not modify or context switch them. |
---|
61 | |
---|
62 | This memory model supports a flat 32-bit address |
---|
63 | space with addresses ranging from 0x00000000 to 0xFFFFFFFF (4 |
---|
64 | gigabytes). Each address is represented by a 32-bit value and |
---|
65 | memory is addressable. The address may be used to reference a |
---|
66 | single byte, half-word (2-bytes), or word (4 bytes). |
---|
67 | |
---|
68 | RTEMS does not require that logical addresses map |
---|
69 | directly to physical addresses, although it is desirable in many |
---|
70 | applications to do so. RTEMS does not need any additional |
---|
71 | information when physical addresses do not map directly to |
---|
72 | physical addresses. By not requiring that logical addresses map |
---|
73 | directly to physical addresses, the memory space of an RTEMS |
---|
74 | space can be separated from that of a ROM monitor. For example, |
---|
75 | a ROM monitor may load application programs into a separate |
---|
76 | logical address space from itself. |
---|
77 | |
---|
78 | RTEMS assumes that the space registers contain the |
---|
79 | selector for the single data segment when a directive is |
---|
80 | invoked. This assumption is especially important when |
---|
81 | developing interrupt service routines. |
---|
82 | |
---|