1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1998. |
---|
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 CPU Model Dependent Features, CPU Model Dependent Features Introduction, Preface, Top |
---|
11 | @end ifinfo |
---|
12 | @chapter CPU Model Dependent Features |
---|
13 | @ifinfo |
---|
14 | @menu |
---|
15 | * CPU Model Dependent Features Introduction:: |
---|
16 | * CPU Model Dependent Features CPU Model Name:: |
---|
17 | * CPU Model Dependent Features bswap Instruction:: |
---|
18 | * CPU Model Dependent Features Floating Point Unit:: |
---|
19 | @end menu |
---|
20 | @end ifinfo |
---|
21 | |
---|
22 | @ifinfo |
---|
23 | @node CPU Model Dependent Features Introduction, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features, CPU Model Dependent Features |
---|
24 | @end ifinfo |
---|
25 | @section Introduction |
---|
26 | |
---|
27 | Microprocessors are generally classified into |
---|
28 | families with a variety of CPU models or implementations within |
---|
29 | that family. Within a processor family, there is a high level |
---|
30 | of binary compatibility. This family may be based on either an |
---|
31 | architectural specification or on maintaining compatibility with |
---|
32 | a popular processor. Recent microprocessor families such as the |
---|
33 | SPARC or PA-RISC are based on an architectural specification |
---|
34 | which is independent or any particular CPU model or |
---|
35 | implementation. Older families such as the M68xxx and the iX86 |
---|
36 | evolved as the manufacturer strived to produce higher |
---|
37 | performance processor models which maintained binary |
---|
38 | compatibility with older models. |
---|
39 | |
---|
40 | RTEMS takes advantage of the similarity of the |
---|
41 | various models within a CPU family. Although the models do vary |
---|
42 | in significant ways, the high level of compatibility makes it |
---|
43 | possible to share the bulk of the CPU dependent executive code |
---|
44 | across the entire family. Each processor family supported by |
---|
45 | RTEMS has a list of features which vary between CPU models |
---|
46 | within a family. For example, the most common model dependent |
---|
47 | feature regardless of CPU family is the presence or absence of a |
---|
48 | floating point unit or coprocessor. When defining the list of |
---|
49 | features present on a particular CPU model, one simply notes |
---|
50 | that floating point hardware is or is not present and defines a |
---|
51 | single constant appropriately. Conditional compilation is |
---|
52 | utilized to include the appropriate source code for this CPU |
---|
53 | model's feature set. It is important to note that this means |
---|
54 | that RTEMS is thus compiled using the appropriate feature set |
---|
55 | and compilation flags optimal for this CPU model used. The |
---|
56 | alternative would be to generate a binary which would execute on |
---|
57 | all family members using only the features which were always |
---|
58 | present. |
---|
59 | |
---|
60 | This chapter presents the set of features which vary |
---|
61 | across i386 implementations and are of importance to RTEMS. |
---|
62 | The set of CPU model feature macros are defined in the file |
---|
63 | c/src/exec/score/cpu/i386/i386.h based upon the particular CPU |
---|
64 | model defined on the compilation command line. |
---|
65 | |
---|
66 | @ifinfo |
---|
67 | @node CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features bswap Instruction, CPU Model Dependent Features Introduction, CPU Model Dependent Features |
---|
68 | @end ifinfo |
---|
69 | @section CPU Model Name |
---|
70 | |
---|
71 | The macro CPU_MODEL_NAME is a string which designates |
---|
72 | the name of this CPU model. For example, for the Intel i386 without an |
---|
73 | i387 coprocessor, this macro is set to the string "i386 with i387". |
---|
74 | |
---|
75 | @ifinfo |
---|
76 | @node CPU Model Dependent Features bswap Instruction, CPU Model Dependent Features Floating Point Unit, CPU Model Dependent Features CPU Model Name, CPU Model Dependent Features |
---|
77 | @end ifinfo |
---|
78 | @section bswap Instruction |
---|
79 | |
---|
80 | The macro I386_HAS_BSWAP is set to 1 to indicate that |
---|
81 | this CPU model has the @code{bswap} instruction which |
---|
82 | endian swaps a thirty-two bit quantity. This instruction |
---|
83 | appears to be present in all CPU models |
---|
84 | i486's and above. |
---|
85 | |
---|
86 | |
---|
87 | @ifinfo |
---|
88 | @node CPU Model Dependent Features Floating Point Unit, Calling Conventions, CPU Model Dependent Features bswap Instruction , CPU Model Dependent Features |
---|
89 | @end ifinfo |
---|
90 | @section Floating Point Unit |
---|
91 | |
---|
92 | The macro I386_HAS_FPU is set to 1 to indicate that |
---|
93 | this CPU model has a hardware floating point unit and 0 |
---|
94 | otherwise. The hardware floating point may be on-chip (as in the |
---|
95 | case of an i486DX or Pentium) or as a coprocessor (as in the case of |
---|
96 | an i386/i387 combination). |
---|