Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/sys/apic_common.h
+++ new/usr/src/uts/i86pc/sys/apic_common.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 23 */
24 +/*
25 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
26 + */
24 27
25 28 #ifndef _SYS_APIC_COMMON_H
26 29 #define _SYS_APIC_COMMON_H
27 30
28 31 #include <sys/psm_types.h>
29 32 #include <sys/avintr.h>
30 33 #include <sys/privregs.h>
31 34 #include <sys/pci.h>
35 +#include <sys/cyclic.h>
32 36
33 37 #ifdef __cplusplus
34 38 extern "C" {
35 39 #endif
36 40
37 41 /*
38 42 * Functions & Variables common to pcplusmp & apix
39 43 */
40 44
41 45 #include <sys/psm_common.h>
42 46
43 47 /* Methods for multiple IOAPIC */
44 48 enum apic_ioapic_method_type {
45 49 APIC_MUL_IOAPIC_NONE, /* use to disable pcplusmp fallback */
46 50 APIC_MUL_IOAPIC_MASK, /* Set RT Entry Mask bit before EOI */
47 51 APIC_MUL_IOAPIC_DEOI, /* Directed EOI */
48 52 APIC_MUL_IOAPIC_IOXAPIC, /* IOxAPIC */
49 53 APIC_MUL_IOAPIC_IIR, /* IOMMU interrup remapping */
50 54 APIC_MUL_IOAPIC_PCPLUSMP /* Fall back to old pcplusmp */
51 55 };
52 56
53 57 #define APIX_IS_DIRECTED_EOI(type) \
54 58 ((type) == APIC_MUL_IOAPIC_DEOI || (type) == APIC_MUL_IOAPIC_IIR)
55 59 #define APIX_IS_MASK_RDT(type) \
56 60 ((type) == APIC_MUL_IOAPIC_NONE || (type) == APIC_MUL_IOAPIC_MASK)
57 61
58 62 extern int apix_enable;
59 63 extern int apix_loaded(void);
60 64 extern enum apic_ioapic_method_type apix_mul_ioapic_method;
61 65
62 66 extern int apic_oneshot;
63 67 /* to allow disabling one-shot capability */
64 68 extern int apic_oneshot_enable;
65 69
66 70 /* Now the ones for Dynamic Interrupt distribution */
67 71 extern int apic_enable_dynamic_migration;
68 72
69 73 extern int apic_have_32bit_cr8;
70 74
71 75 extern struct psm_ops *psmops;
72 76
73 77 /*
74 78 * These variables are frequently accessed in apic_intr_enter(),
75 79 * apic_intr_exit and apic_setspl, so group them together
76 80 */
77 81 extern volatile uint32_t *apicadr; /* virtual addr of local APIC */
78 82 extern uchar_t apic_io_vectbase[MAX_IO_APIC];
79 83 extern uchar_t apic_io_vectend[MAX_IO_APIC];
80 84 extern uchar_t apic_io_ver[MAX_IO_APIC];
81 85 extern int apic_io_max;
82 86 extern int apic_nvidia_io_max;
83 87 extern int apic_setspl_delay; /* apic_setspl - delay enable */
84 88 extern int apic_clkvect;
85 89
86 90 /* vector at which error interrupts come in */
87 91 extern int apic_errvect;
88 92 extern int apic_enable_error_intr;
89 93 extern int apic_error_display_delay;
90 94
91 95 /* vector at which performance counter overflow interrupts come in */
92 96 extern int apic_cpcovf_vect;
93 97 extern int apic_enable_cpcovf_intr;
94 98
95 99 /* vector at which CMCI interrupts come in */
96 100 extern int apic_cmci_vect;
97 101 extern int cmi_enable_cmci;
98 102 extern void cmi_cmci_trap(void);
99 103
100 104 extern kmutex_t cmci_cpu_setup_lock; /* protects cmci_cpu_setup_registered */
101 105 extern int cmci_cpu_setup_registered;
102 106
103 107 extern int apic_forceload;
104 108
105 109 extern int apic_coarse_hrtime; /* 0 - use accurate slow gethrtime() */
106 110 /* 1 - use gettime() for performance */
107 111 extern int apic_flat_model; /* 0 - clustered. 1 - flat */
108 112
109 113 extern int apic_panic_on_nmi;
110 114 extern int apic_panic_on_apic_error;
111 115
112 116 extern int apic_verbose;
113 117
114 118 #ifdef DEBUG
115 119 extern int apic_debug;
116 120 extern int apic_restrict_vector;
117 121
118 122 extern int apic_debug_msgbuf[APIC_DEBUG_MSGBUFSIZE];
119 123 extern int apic_debug_msgbufindex;
120 124
121 125 #endif /* DEBUG */
122 126
123 127 extern uint_t apic_nsec_per_intr;
124 128 extern uint_t apic_nticks;
125 129 extern uint_t apic_skipped_redistribute;
126 130
127 131 extern uint_t last_count_read;
128 132 extern lock_t apic_mode_switch_lock;
129 133 extern lock_t apic_gethrtime_lock;
130 134 extern volatile int apic_hrtime_stamp;
131 135 extern volatile hrtime_t apic_nsec_since_boot;
132 136 extern uint_t apic_hertz_count;
133 137
134 138 extern uint64_t apic_ticks_per_SFnsecs; /* # of ticks in SF nsecs */
135 139
136 140 extern int apic_hrtime_error;
137 141 extern int apic_remote_hrterr;
138 142 extern int apic_num_nmis;
139 143 extern int apic_apic_error;
140 144 extern int apic_num_apic_errors;
141 145 extern int apic_num_cksum_errors;
142 146
143 147 extern int apic_error;
144 148
145 149 /* use to make sure only one cpu handles the nmi */
146 150 extern lock_t apic_nmi_lock;
147 151 /* use to make sure only one cpu handles the error interrupt */
148 152 extern lock_t apic_error_lock;
149 153
150 154 /* Patchable global variables. */
151 155 extern int apic_kmdb_on_nmi; /* 0 - no, 1 - yes enter kmdb */
↓ open down ↓ |
110 lines elided |
↑ open up ↑ |
152 156 extern uint32_t apic_divide_reg_init; /* 0 - divide by 2 */
153 157
154 158 extern apic_intrmap_ops_t *apic_vt_ops;
155 159
156 160 #ifdef DEBUG
157 161 extern int apic_break_on_cpu;
158 162 extern int apic_stretch_interrupts;
159 163 extern int apic_stretch_ISR; /* IPL of 3 matches nothing now */
160 164 #endif
161 165
162 -extern ddi_periodic_t apic_periodic_id;
166 +extern cyclic_id_t apic_cyclic_id;
163 167
164 168 extern void apic_nmi_intr(caddr_t arg, struct regs *rp);
165 169 extern int apic_clkinit();
166 170 extern hrtime_t apic_gettime();
167 171 extern hrtime_t apic_gethrtime();
168 172 extern int apic_cpu_start(processorid_t cpuid, caddr_t ctx);
169 173 extern int apic_cpu_stop(processorid_t cpuid, caddr_t ctx);
170 174 extern int apic_cpu_add(psm_cpu_request_t *reqp);
171 175 extern int apic_cpu_remove(psm_cpu_request_t *reqp);
172 176 extern int apic_cpu_ops(psm_cpu_request_t *reqp);
173 177 extern void apic_switch_ipi_callback(boolean_t enter);
174 178 extern void apic_send_ipi(int cpun, int ipl);
175 179 extern void apic_set_idlecpu(processorid_t cpun);
176 180 extern void apic_unset_idlecpu(processorid_t cpun);
177 181 extern void apic_shutdown(int cmd, int fcn);
178 182 extern void apic_preshutdown(int cmd, int fcn);
179 183 extern processorid_t apic_get_next_processorid(processorid_t cpun);
180 184 extern uint_t apic_calibrate(volatile uint32_t *, uint16_t *);
181 185
182 186 extern int apic_error_intr();
183 187 extern void apic_cpcovf_mask_clear(void);
184 188 extern int cmci_cpu_setup(cpu_setup_t what, int cpuid, void *arg);
185 189 extern void apic_intrmap_init(int apic_mode);
186 190 extern processorid_t apic_find_cpu(int flag);
187 191 extern processorid_t apic_get_next_bind_cpu(void);
188 192
189 193 extern int apic_support_msi;
190 194 extern int apic_multi_msi_enable;
191 195 extern int apic_msix_enable;
192 196
193 197 extern uint32_t apic_get_localapicid(uint32_t cpuid);
194 198 extern uchar_t apic_get_ioapicid(uchar_t ioapicindex);
195 199
196 200 #ifdef __cplusplus
197 201 }
198 202 #endif
199 203
200 204 #endif /* _SYS_APIC_COMMON_H */
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX