3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 /*
26 * Copyright (c) 2010, Intel Corporation.
27 * All rights reserved.
28 */
29
30 #ifndef _SYS_APIC_APIC_H
31 #define _SYS_APIC_APIC_H
32
33 #include <sys/psm_types.h>
34 #include <sys/avintr.h>
35 #include <sys/pci.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include <sys/psm_common.h>
42
43 #define APIC_PCPLUSMP_NAME "pcplusmp"
44 #define APIC_APIX_NAME "apix"
100 #define CURR_COUNT_OFFSET (sizeof (int32_t) * APIC_CURR_COUNT)
101
102 /* Divider Configuration Register */
103 #define APIC_DIVIDE_REG 0xf8
104
105 /* Various mode for local APIC. Modes are mutually exclusive */
106 typedef enum apic_mode {
107 APIC_IS_DISABLED = 0,
108 APIC_MODE_NOTSET,
109 LOCAL_APIC,
110 LOCAL_X2APIC
111 } apic_mode_t;
112
113 /* x2APIC SELF IPI Register */
114 #define X2APIC_SELF_IPI 0xFC
115
116 /* General x2APIC constants used at various places */
117 #define APIC_SVR_SUPPRESS_BROADCAST_EOI 0x1000
118 #define APIC_DIRECTED_EOI_BIT 0x1000000
119
120 /* IRR register */
121 #define APIC_IRR_REG 0x80
122
123 /* ISR register */
124 #define APIC_ISR_REG 0x40
125
126 #define APIC_IO_REG 0x0
127 #define APIC_IO_DATA 0x4
128 #define APIC_IO_EOI 0x10
129
130 /* Bit offset of APIC ID in LID_REG, INT_CMD and in DEST_REG */
131 #define APIC_ID_BIT_OFFSET 24
132 #define APIC_ICR_ID_BIT_OFFSET 24
133 #define APIC_LDR_ID_BIT_OFFSET 24
134
135 /*
136 * Choose between flat and clustered models by writing the following to the
137 * FORMAT_REG. 82489 DX documentation seemed to suggest that writing 0 will
138 * disable logical destination mode.
139 * Does not seem to be in the docs for local APICs on the processors.
850 extern uchar_t apic_vectortoipl[APIC_AVAIL_VECTOR / APIC_VECTOR_PER_IPL];
851 extern int apic_imcrp;
852 extern int apic_revector_pending;
853 extern char apic_level_intr[APIC_MAX_VECTOR+1];
854 extern uchar_t apic_resv_vector[MAXIPL+1];
855 extern int apic_sample_factor_redistribution;
856 extern int apic_int_busy_mark;
857 extern int apic_int_free_mark;
858 extern int apic_diff_for_redistribution;
859 extern int apic_poweroff_method;
860 extern int apic_enable_acpi;
861 extern int apic_nproc;
862 extern int apic_max_nproc;
863 extern int apic_next_bind_cpu;
864 extern int apic_redistribute_sample_interval;
865 extern int apic_multi_msi_enable;
866 extern int apic_sci_vect;
867 extern int apic_hpet_vect;
868 extern uchar_t apic_ipls[];
869 extern apic_reg_ops_t *apic_reg_ops;
870 extern apic_mode_t apic_mode;
871 extern void x2apic_update_psm();
872 extern void apic_change_ops();
873 extern void apic_common_send_ipi(int, int);
874 extern void apic_set_directed_EOI_handler();
875 extern int apic_directed_EOI_supported();
876
877 extern apic_intrmap_ops_t *apic_vt_ops;
878
879 #ifdef __cplusplus
880 }
881 #endif
882
883 #endif /* _SYS_APIC_APIC_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2017 Joyent, Inc.
24 */
25 /*
26 * Copyright (c) 2010, Intel Corporation.
27 * All rights reserved.
28 */
29
30 #ifndef _SYS_APIC_APIC_H
31 #define _SYS_APIC_APIC_H
32
33 #include <sys/psm_types.h>
34 #include <sys/avintr.h>
35 #include <sys/pci.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include <sys/psm_common.h>
42
43 #define APIC_PCPLUSMP_NAME "pcplusmp"
44 #define APIC_APIX_NAME "apix"
100 #define CURR_COUNT_OFFSET (sizeof (int32_t) * APIC_CURR_COUNT)
101
102 /* Divider Configuration Register */
103 #define APIC_DIVIDE_REG 0xf8
104
105 /* Various mode for local APIC. Modes are mutually exclusive */
106 typedef enum apic_mode {
107 APIC_IS_DISABLED = 0,
108 APIC_MODE_NOTSET,
109 LOCAL_APIC,
110 LOCAL_X2APIC
111 } apic_mode_t;
112
113 /* x2APIC SELF IPI Register */
114 #define X2APIC_SELF_IPI 0xFC
115
116 /* General x2APIC constants used at various places */
117 #define APIC_SVR_SUPPRESS_BROADCAST_EOI 0x1000
118 #define APIC_DIRECTED_EOI_BIT 0x1000000
119
120 /* x2APIC enable bit in REG_APIC_BASE_MSR */
121 #define X2APIC_ENABLE_BIT 10
122
123 /* IRR register */
124 #define APIC_IRR_REG 0x80
125
126 /* ISR register */
127 #define APIC_ISR_REG 0x40
128
129 #define APIC_IO_REG 0x0
130 #define APIC_IO_DATA 0x4
131 #define APIC_IO_EOI 0x10
132
133 /* Bit offset of APIC ID in LID_REG, INT_CMD and in DEST_REG */
134 #define APIC_ID_BIT_OFFSET 24
135 #define APIC_ICR_ID_BIT_OFFSET 24
136 #define APIC_LDR_ID_BIT_OFFSET 24
137
138 /*
139 * Choose between flat and clustered models by writing the following to the
140 * FORMAT_REG. 82489 DX documentation seemed to suggest that writing 0 will
141 * disable logical destination mode.
142 * Does not seem to be in the docs for local APICs on the processors.
853 extern uchar_t apic_vectortoipl[APIC_AVAIL_VECTOR / APIC_VECTOR_PER_IPL];
854 extern int apic_imcrp;
855 extern int apic_revector_pending;
856 extern char apic_level_intr[APIC_MAX_VECTOR+1];
857 extern uchar_t apic_resv_vector[MAXIPL+1];
858 extern int apic_sample_factor_redistribution;
859 extern int apic_int_busy_mark;
860 extern int apic_int_free_mark;
861 extern int apic_diff_for_redistribution;
862 extern int apic_poweroff_method;
863 extern int apic_enable_acpi;
864 extern int apic_nproc;
865 extern int apic_max_nproc;
866 extern int apic_next_bind_cpu;
867 extern int apic_redistribute_sample_interval;
868 extern int apic_multi_msi_enable;
869 extern int apic_sci_vect;
870 extern int apic_hpet_vect;
871 extern uchar_t apic_ipls[];
872 extern apic_reg_ops_t *apic_reg_ops;
873 extern apic_reg_ops_t local_apic_regs_ops;
874 extern apic_mode_t apic_mode;
875 extern void x2apic_update_psm();
876 extern void apic_change_ops();
877 extern void apic_common_send_ipi(int, int);
878 extern void apic_set_directed_EOI_handler();
879 extern int apic_directed_EOI_supported();
880
881 extern apic_intrmap_ops_t *apic_vt_ops;
882
883 #ifdef __cplusplus
884 }
885 #endif
886
887 #endif /* _SYS_APIC_APIC_H */
|