source: rtems/c/src/lib/libbsp/i386/shared/smp/smp-imps.h @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 6.5 KB
Line 
1/*
2 * Author: Erich Boleyn  <erich@uruk.org>
3 *         http://www.uruk.org/~erich/
4 *
5 * Copyright (c) 1997-2011 Erich Boleyn.  All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 *    derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/*
31 *  Header file implementing Intel MultiProcessor Specification (MPS)
32 *  version 1.1 and 1.4 SMP hardware control for Intel Architecture CPUs,
33 *  with hooks for running correctly on a standard PC without the hardware.
34 *
35 *  This file was created from information in the Intel MPS version 1.4
36 *  document, order number 242016-004, which can be ordered from the
37 *  Intel literature center.
38 */
39
40/*
41 *  This file is based upon code by Eric Boleyn as documented above. 
42 *  RTEMS support was added and minimal other changes were made. 
43 *  This should make it easier to compare this file with the original
44 *  version.
45 *
46 *  COPYRIGHT (c) 2011.
47 *  On-Line Applications Research Corporation (OAR).
48 *
49 *  The license and distribution terms for this file may be
50 *  found in the file LICENSE in this distribution or at
51 *  http://www.rtems.com/license/LICENSE.
52 */
53
54#ifndef _SMP_IMPS_H
55#define _SMP_IMPS_H
56
57/* make sure "apic.h" is included */
58#ifndef _APIC_H
59#error          Must include "apic.h" before "smp-imps.h"
60#endif  /* !_APIC_H */
61
62/*
63 *  Defines used.
64 */
65
66#define IMPS_READ(x)    (*((volatile unsigned *) (x)))
67#define IMPS_WRITE(x,y) (*((volatile unsigned *) (x)) = (y))
68
69#ifdef IMPS_DEBUG
70#define IMPS_DEBUG_PRINT(x)  KERNEL_PRINT(x)
71#else  /* !IMPS_DEBUG */
72#define IMPS_DEBUG_PRINT(x)
73#endif /* !IMPS_DEBUG */
74
75#define IMPS_MAX_CPUS                   APIC_BCAST_ID
76
77/*
78 *  This is the value that must be in the "sig" member of the MP
79 *  Floating Pointer Structure.
80 */
81#define IMPS_FPS_SIGNATURE      ('_' | ('M'<<8) | ('P'<<16) | ('_'<<24))
82#define IMPS_FPS_IMCRP_BIT      0x80
83#define IMPS_FPS_DEFAULT_MAX    7
84
85/*
86 *  This is the value that must be in the "sig" member of the MP
87 *  Configuration Table Header.
88 */
89#define IMPS_CTH_SIGNATURE      ('P' | ('C'<<8) | ('M'<<16) | ('P'<<24))
90
91/*
92 *  These are the "type" values for Base MP Configuration Table entries.
93 */
94#define         IMPS_FLAG_ENABLED       1
95#define IMPS_BCT_PROCESSOR              0
96#define         IMPS_CPUFLAG_BOOT       2
97#define IMPS_BCT_BUS                    1
98#define IMPS_BCT_IOAPIC                 2
99#define IMPS_BCT_IO_INTERRUPT           3
100#define IMPS_BCT_LOCAL_INTERRUPT        4
101#define         IMPS_INT_INT            0
102#define         IMPS_INT_NMI            1
103#define         IMPS_INT_SMI            2
104#define         IMPS_INT_EXTINT         3
105
106
107/*
108 *  Typedefs and data item definitions done here.
109 */
110
111typedef struct imps_fps imps_fps;       /* MP floating pointer structure */
112typedef struct imps_cth imps_cth;       /* MP configuration table header */
113typedef struct imps_processor imps_processor;
114typedef struct imps_bus imps_bus;
115typedef struct imps_ioapic imps_ioapic;
116typedef struct imps_interrupt imps_interrupt;
117
118
119/*
120 *  Data structures defined here
121 */
122
123/*
124 *  MP Floating Pointer Structure (fps)
125 *
126 *  Look at page 4-3 of the MP spec for the starting definitions of
127 *  this structure.
128 */
129struct imps_fps
130{
131  unsigned sig;
132  imps_cth *cth_ptr;
133  unsigned char length;
134  unsigned char spec_rev;
135  unsigned char checksum;
136  unsigned char feature_info[5];
137};
138
139/*
140 *  MP Configuration Table Header  (cth)
141 *
142 *  Look at page 4-5 of the MP spec for the starting definitions of
143 *  this structure.
144 */
145struct imps_cth
146{
147  unsigned sig;
148  unsigned short base_length;
149  unsigned char spec_rev;
150  unsigned char checksum;
151  char oem_id[8];
152  char prod_id[12];
153  unsigned oem_table_ptr;
154  unsigned short oem_table_size;
155  unsigned short entry_count;
156  unsigned lapic_addr;
157  unsigned short extended_length;
158  unsigned char extended_checksum;
159        char reserved[1];
160};
161
162/*
163 *  Base MP Configuration Table Types.  They are sorted according to
164 *  type (i.e. all of type 0 come first, etc.).  Look on page 4-6 for
165 *  the start of the descriptions.
166 */
167
168struct imps_processor
169{
170  unsigned char type;                     /* must be 0 */
171  unsigned char apic_id;
172  unsigned char apic_ver;
173  unsigned char flags;
174  unsigned signature;
175  unsigned features;
176  char reserved[8];
177};
178
179struct imps_bus
180{
181  unsigned char type;                     /* must be 1 */
182  unsigned char id;
183  char bus_type[6];
184};
185
186struct imps_ioapic
187{
188  unsigned char type;                     /* must be 2 */
189  unsigned char id;
190  unsigned char ver;
191  unsigned char flags;
192  unsigned addr;
193};
194
195struct imps_interrupt
196{
197  unsigned char type;                     /* must be 3 or 4 */
198  unsigned char int_type;
199  unsigned short flags;
200  unsigned char source_bus_id;
201  unsigned char source_bus_irq;
202  unsigned char dest_apic_id;
203  unsigned char dest_apic_intin;
204};
205
206/*
207 *  Exported globals here.
208 */
209
210/*
211 *  These map from virtual cpu numbers to APIC id's and back.
212 */
213extern unsigned char imps_cpu_apic_map[IMPS_MAX_CPUS];
214extern unsigned char imps_apic_cpu_map[IMPS_MAX_CPUS];
215
216/* base address of application processor reset code at 0x70000 */
217extern char _binary_appstart_bin_start[];
218extern char _binary_appstart_bin_size[];
219
220/*
221 *  Defines that use variables
222 */
223#define IMPS_LAPIC_READ(x)  (*((volatile unsigned *) (imps_lapic_addr+(x))))
224#define IMPS_LAPIC_WRITE(x, y)   \
225   (*((volatile unsigned *) (imps_lapic_addr+(x))) = (y))
226
227#endif  /* !_SMP_IMPS_H */
228
Note: See TracBrowser for help on using the repository browser.