1 /*
2 * Copyright (c) 1996, by Steve Passe
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. The name of the developer may NOT be used to endorse or promote products
11 * derived from this software without specific prior written permission.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 *
25 * $FreeBSD: releng/5.0/sys/i386/include/smptests.h 99582 2002-07-08 09:14:01Z peter $
26 */
27
28 #ifndef _MACHINE_SMPTESTS_H_
29 #define _MACHINE_SMPTESTS_H_
30
31
32 /*
33 * Various 'tests in progress' and configuration parameters.
34 */
35
36
37 /*
38 * Control the "giant lock" pushdown by logical steps.
39 */
40 #define PUSHDOWN_LEVEL_1
41 #define PUSHDOWN_LEVEL_2
42
43 /*
44 * Put FAST_INTR() ISRs at an APIC priority above the regular INTs.
45 * Allow the mp_lock() routines to handle FAST interrupts while spinning.
46 */
47 #ifdef PUSHDOWN_LEVEL_1
48 #define FAST_HI
49 #endif
50
51
52 /*
53 * These defines enable critical region locking of areas that were
54 * protected via cli/sti in the UP kernel.
55 *
56 * COMLOCK protects the sio/cy drivers.
57 * known to be incomplete:
58 * joystick lkm
59 * ?
60 */
61 #ifdef PUSHDOWN_LEVEL_1
62 #define USE_COMLOCK
63 #endif
64
65
66 /*
67 * Portions of the old TEST_LOPRIO code, back from the grave!
68 */
69 #define GRAB_LOPRIO
70
71
72 /*
73 * Send CPUSTOP IPI for stop/restart of other CPUs on DDB break.
74 #define VERBOSE_CPUSTOP_ON_DDBBREAK
75 */
76 #define CPUSTOP_ON_DDBBREAK
77
78
79 /*
80 * Bracket code/comments relevant to the current 'giant lock' model.
81 * Everything is now the 'giant lock' model, but we will use this as
82 * we start to "push down" the lock.
83 */
84 #define GIANT_LOCK
85
86 #ifdef APIC_IO
87 /*
88 * Don't assume that slow interrupt handler X is called from vector
89 * X + ICU_OFFSET.
90 */
91 #define APIC_INTR_REORDER
92
93 #endif /* APIC_IO */
94
95 /*
96 * Misc. counters.
97 *
98 #define COUNT_XINVLTLB_HITS
99 */
100
101
102 /**
103 * Hack to "fake-out" kernel into thinking it is running on a 'default config'.
104 *
105 * value == default type
106 #define TEST_DEFAULT_CONFIG 6
107 */
108
109
110 /*
111 * Simple test code for IPI interaction, save for future...
112 *
113 #define TEST_TEST1
114 #define IPI_TARGET_TEST1 1
115 */
116
117
118 /*
119 * Address of POST hardware port.
120 * Defining this enables POSTCODE macros.
121 *
122 #define POST_ADDR 0x80
123 */
124
125
126 /*
127 * POST hardware macros.
128 */
129 #ifdef POST_ADDR
130 #define ASMPOSTCODE_INC \
131 pushl %eax ; \
132 movl _current_postcode, %eax ; \
133 incl %eax ; \
134 andl $0xff, %eax ; \
135 movl %eax, _current_postcode ; \
136 outb %al, $POST_ADDR ; \
137 popl %eax
138
139 /*
140 * Overwrite the current_postcode value.
141 */
142 #define ASMPOSTCODE(X) \
143 pushl %eax ; \
144 movl $X, %eax ; \
145 movl %eax, _current_postcode ; \
146 outb %al, $POST_ADDR ; \
147 popl %eax
148
149 /*
150 * Overwrite the current_postcode low nibble.
151 */
152 #define ASMPOSTCODE_LO(X) \
153 pushl %eax ; \
154 movl _current_postcode, %eax ; \
155 andl $0xf0, %eax ; \
156 orl $X, %eax ; \
157 movl %eax, _current_postcode ; \
158 outb %al, $POST_ADDR ; \
159 popl %eax
160
161 /*
162 * Overwrite the current_postcode high nibble.
163 */
164 #define ASMPOSTCODE_HI(X) \
165 pushl %eax ; \
166 movl _current_postcode, %eax ; \
167 andl $0x0f, %eax ; \
168 orl $(X<<4), %eax ; \
169 movl %eax, _current_postcode ; \
170 outb %al, $POST_ADDR ; \
171 popl %eax
172 #else
173 #define ASMPOSTCODE_INC
174 #define ASMPOSTCODE(X)
175 #define ASMPOSTCODE_LO(X)
176 #define ASMPOSTCODE_HI(X)
177 #endif /* POST_ADDR */
178
179
180 #endif /* _MACHINE_SMPTESTS_H_ */
Cache object: ecf55a85505b6dd7b86c2b76a9bad2ae
|