Deleted Added
full compact
apicvar.h (130980) apicvar.h (138528)
1/*-
2 * Copyright (c) 2003 John Baldwin <jhb@FreeBSD.org>
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

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2003 John Baldwin <jhb@FreeBSD.org>
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

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/i386/include/apicvar.h 130980 2004-06-23 15:29:20Z jhb $
29 * $FreeBSD: head/sys/i386/include/apicvar.h 138528 2004-12-07 20:15:01Z ups $
30 */
31
32#ifndef _MACHINE_APICVAR_H_
33#define _MACHINE_APICVAR_H_
34
35/*
36 * Local && I/O APIC variable definitions.
37 */

--- 38 unchanged lines hidden (view full) ---

76 * Note: 0x80 needs to be handled specially and not allocated to an
77 * I/O device!
78 */
79
80#define APIC_ID_ALL 0xff
81#define APIC_IO_INTS (IDT_IO_INTS + 16)
82#define APIC_NUM_IOINTS 192
83
30 */
31
32#ifndef _MACHINE_APICVAR_H_
33#define _MACHINE_APICVAR_H_
34
35/*
36 * Local && I/O APIC variable definitions.
37 */

--- 38 unchanged lines hidden (view full) ---

76 * Note: 0x80 needs to be handled specially and not allocated to an
77 * I/O device!
78 */
79
80#define APIC_ID_ALL 0xff
81#define APIC_IO_INTS (IDT_IO_INTS + 16)
82#define APIC_NUM_IOINTS 192
83
84/*
85 ********************* !!! WARNING !!! ******************************
86 * Each local apic has an interrupt receive fifo that is two entries deep
87 * for each interrupt priority class (higher 4 bits of interrupt vector).
88 * Once the fifo is full the APIC can no longer receive interrupts for this
89 * class and sending IPIs from other CPUs will be blocked.
90 * To avoid deadlocks there should be no more than two IPI interrupts
91 * pending at the same time.
92 * Currently this is guaranteed by dividing the IPIs in two groups that have
93 * each at most one IPI interrupt pending. The first group is protected by the
94 * smp_ipi_mtx and waits for the completion of the IPI (Only one IPI user
95 * at a time) The second group uses a single interrupt and a bitmap to avoid
96 * redundant IPI interrupts.
97 *
98 * Right now IPI_STOP used by kdb shares the interrupt priority class with
99 * the two IPI groups mentioned above. As such IPI_STOP may cause a deadlock.
100 * Eventually IPI_STOP should use NMI IPIs - this would eliminate this and
101 * other deadlocks caused by IPI_STOP.
102 */
103
84#define APIC_LOCAL_INTS 240
104#define APIC_LOCAL_INTS 240
85#define APIC_TIMER_INT APIC_LOCAL_INTS
86#define APIC_ERROR_INT (APIC_LOCAL_INTS + 1)
87#define APIC_THERMAL_INT (APIC_LOCAL_INTS + 2)
88
105
89#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3)
90#define IPI_AST APIC_IPI_INTS /* Generate software trap. */
106#if 0
107#define APIC_TIMER_INT (APIC_LOCAL_INTS + X)
108#define APIC_ERROR_INT (APIC_LOCAL_INTS + X)
109#define APIC_THERMAL_INT (APIC_LOCAL_INTS + X)
110#endif
111
112#define APIC_IPI_INTS (APIC_LOCAL_INTS + 0)
113#define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */
91#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */
92#define IPI_INVLPG (APIC_IPI_INTS + 2)
93#define IPI_INVLRNG (APIC_IPI_INTS + 3)
94#define IPI_LAZYPMAP (APIC_IPI_INTS + 4) /* Lazy pmap release. */
114#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */
115#define IPI_INVLPG (APIC_IPI_INTS + 2)
116#define IPI_INVLRNG (APIC_IPI_INTS + 3)
117#define IPI_LAZYPMAP (APIC_IPI_INTS + 4) /* Lazy pmap release. */
95#define IPI_HARDCLOCK (APIC_IPI_INTS + 8) /* Inter-CPU clock handling. */
96#define IPI_STATCLOCK (APIC_IPI_INTS + 9)
97#define IPI_RENDEZVOUS (APIC_IPI_INTS + 10) /* Inter-CPU rendezvous. */
98#define IPI_STOP (APIC_IPI_INTS + 11) /* Stop CPU until restarted. */
118/* Vector to handle bitmap based IPIs */
119#define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 5)
99
120
121/* IPIs handled by IPI_BITMAPED_VECTOR (XXX ups is there a better place?) */
122#define IPI_AST 0 /* Generate software trap. */
123#define IPI_HARDCLOCK 1 /* Inter-CPU clock handling. */
124#define IPI_STATCLOCK 2
125#define IPI_BITMAP_LAST IPI_STATCLOCK
126#define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST)
127
128#define IPI_STOP (APIC_IPI_INTS + 6) /* Stop CPU until restarted. */
129
130/* The spurious interrupt can share the priority class with the IPIs since
131 * it is not a normal interrupt. (Does not use the APIC's interrupt fifo)
132 */
100#define APIC_SPURIOUS_INT 255
101
102#define LVT_LINT0 0
103#define LVT_LINT1 1
104#define LVT_TIMER 2
105#define LVT_ERROR 3
106#define LVT_PMC 4
107#define LVT_THERMAL 5

--- 72 unchanged lines hidden ---
133#define APIC_SPURIOUS_INT 255
134
135#define LVT_LINT0 0
136#define LVT_LINT1 1
137#define LVT_TIMER 2
138#define LVT_ERROR 3
139#define LVT_PMC 4
140#define LVT_THERMAL 5

--- 72 unchanged lines hidden ---