source: rtems/cpukit/score/cpu/i386/rtems/score/registers.h @ 7f70d1b7

4.104.114.84.95
Last change on this file since 7f70d1b7 was 7f70d1b7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/28/05 at 15:56:09

New header guard.

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**
2 * @file rtems/score/registers.h
3 */
4
5/*
6 *  This file contains definition and constants related to Intel Cpu
7 *
8 *  COPYRIGHT (c) 1998 valette@crf.canon.fr
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#ifndef _RTEMS_SCORE_REGISTERS_H
18#define _RTEMS_SCORE_REGISTERS_H
19
20/*
21 * definition related to EFLAGS
22 */
23#define EFLAGS_CARRY                    0x1
24#define EFLAGS_PARITY                   0x4
25
26#define EFLAGS_AUX_CARRY                0x10
27#define EFLAGS_ZERO                     0x40
28#define EFLAGS_SIGN                     0x80
29
30#define EFLAGS_TRAP                     0x100
31#define EFLAGS_INTR_ENABLE              0x200
32#define EFLAGS_DIRECTION                0x400
33#define EFLAGS_OVERFLOW                 0x800
34
35#define EFLAGS_IOPL_MASK                0x3000
36#define EFLAGS_NESTED_TASK              0x8000
37
38#define EFLAGS_RESUME                   0x10000
39#define EFLAGS_VIRTUAL_MODE             0x20000
40#define EFLAGS_ALIGN_CHECK              0x40000
41#define EFLAGS_VIRTUAL_INTR             0x80000
42
43#define EFLAGS_VIRTUAL_INTR_PEND        0x100000
44#define EFLAGS_ID                       0x200000
45
46/*
47 * definitions related to CR0
48 */
49#define CR0_PROTECTION_ENABLE           0x1
50#define CR0_MONITOR_COPROC              0x2
51#define CR0_COPROC_SOFT_EMUL            0x4
52#define CR0_FLOATING_INSTR_EXCEPTION    0x8
53
54#define CR0_EXTENSION_TYPE              0x10
55#define CR0_NUMERIC_ERROR               0x20
56
57#define CR0_WRITE_PROTECT               0x10000
58#define CR0_ALIGMENT_MASK               0x40000
59
60#define CR0_NO_WRITE_THROUGH            0x20000000
61#define CR0_PAGE_LEVEL_CACHE_DISABLE    0x40000000
62#define CR0_PAGING                      0x80000000
63
64/*
65 * definitions related to CR3
66 */
67
68#define CR3_PAGE_CACHE_DISABLE          0x10
69#define CR3_PAGE_WRITE_THROUGH          0x8
70
71
72#ifndef ASM
73
74/*
75 * definition of eflags registers has a bit field structure
76 */
77typedef struct {
78  /*
79   * fist byte : bits 0->7
80   */
81  unsigned int carry                    : 1;
82  unsigned int                          : 1;
83  unsigned int parity                   : 1;
84  unsigned int                          : 1;
85
86  unsigned int auxiliary_carry          : 1;
87  unsigned int                          : 1;
88  unsigned int zero                     : 1;    /* result is zero */
89  unsigned int sign                     : 1;    /* result is less than zero */
90  /*
91   * Second byte : bits 7->15
92   */
93  unsigned int trap                     : 1;
94  unsigned int intr_enable              : 1;    /* set => intr on */
95  unsigned int direction                : 1;    /* set => autodecrement */
96  unsigned int overflow                 : 1;
97
98  unsigned int IO_privilege             : 2;
99  unsigned int nested_task              : 1;
100  unsigned int                          : 1;
101  /*
102   * Third byte : bits 15->23
103   */
104  unsigned int resume                   : 1;
105  unsigned int virtual_mode             : 1;
106  unsigned int aligment_check           : 1;
107  unsigned int virtual_intr             : 1;
108
109  unsigned int virtual_intr_pending     : 1;
110  unsigned int id                       : 1;
111  unsigned int                          : 2;
112
113  /*
114   * fourth byte : bits 24->31 : UNUSED
115   */
116  unsigned int                          : 8;
117}eflags_bits;
118
119typedef union {
120  eflags_bits   eflags;
121  unsigned int  i;
122}eflags;
123/*
124 * definition of eflags registers has a bit field structure
125 */
126typedef struct {
127  /*
128   * fist byte : bits 0->7
129   */
130  unsigned int protection_enable        : 1;
131  unsigned int monitor_coproc           : 1;
132  unsigned int coproc_soft_emul         : 1;
133  unsigned int floating_instr_except    : 1;
134
135  unsigned int extension_type           : 1;
136  unsigned int numeric_error            : 1;
137  unsigned int                          : 2;
138  /*
139   * second byte 8->15 : UNUSED
140   */
141  unsigned int                          : 8;
142  /*
143   * third byte 16->23
144   */
145  unsigned int write_protect            : 1;
146  unsigned int                          : 1;
147  unsigned int aligment_mask            : 1;
148  unsigned int                          : 1;
149
150  unsigned int                          : 4;
151  /*
152   * fourth byte 24->31
153   */
154  unsigned int                          : 4;
155
156  unsigned int                          : 1;
157  unsigned int no_write_through         : 1;
158  unsigned int page_level_cache_disable : 1;
159  unsigned int paging   : 1;
160}cr0_bits;
161
162typedef union {
163  cr0_bits      cr0;
164  unsigned int  i;
165}cr0;
166
167/*
168 * definition of cr3 registers has a bit field structure
169 */
170typedef struct {
171
172  unsigned int                          : 3;
173  unsigned int page_write_transparent   : 1;
174  unsigned int page_cache_disable       : 1;
175  unsigned int                          : 7;
176  unsigned int page_directory_base      :20;
177}cr3_bits;
178
179typedef union {
180  cr3_bits      cr3;
181  unsigned int  i;
182}cr3;
183
184#endif
185
186#endif
Note: See TracBrowser for help on using the repository browser.