nmi.c (61126) | nmi.c (61994) |
---|---|
1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 | 1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 |
37 * $FreeBSD: head/sys/i386/isa/nmi.c 61126 2000-05-31 13:32:28Z bde $ | 37 * $FreeBSD: head/sys/i386/isa/nmi.c 61994 2000-06-23 07:44:33Z msmith $ |
38 */ 39/* 40 * This file contains an aggregated module marked: 41 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 42 * All rights reserved. 43 * See the notice for details. 44 */ 45 46#include "opt_auto_eoi.h" 47 48#include "isa.h" 49 50#include <sys/param.h> 51#ifndef SMP 52#include <machine/lock.h> 53#endif 54#include <sys/systm.h> 55#include <sys/syslog.h> | 38 */ 39/* 40 * This file contains an aggregated module marked: 41 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 42 * All rights reserved. 43 * See the notice for details. 44 */ 45 46#include "opt_auto_eoi.h" 47 48#include "isa.h" 49 50#include <sys/param.h> 51#ifndef SMP 52#include <machine/lock.h> 53#endif 54#include <sys/systm.h> 55#include <sys/syslog.h> |
56#include <sys/kernel.h> |
|
56#include <sys/malloc.h> | 57#include <sys/malloc.h> |
58#include <sys/module.h> |
|
57#include <sys/errno.h> 58#include <sys/interrupt.h> 59#include <machine/ipl.h> 60#include <machine/md_var.h> 61#include <machine/segments.h> 62#include <sys/bus.h> 63 64#if defined(APIC_IO) --- 85 unchanged lines hidden (view full) --- 150#define NMI_PARITY (1 << 7) 151#define NMI_IOCHAN (1 << 6) 152#define ENMI_WATCHDOG (1 << 7) 153#define ENMI_BUSTIMER (1 << 6) 154#define ENMI_IOSTATUS (1 << 5) 155#endif 156 157/* | 59#include <sys/errno.h> 60#include <sys/interrupt.h> 61#include <machine/ipl.h> 62#include <machine/md_var.h> 63#include <machine/segments.h> 64#include <sys/bus.h> 65 66#if defined(APIC_IO) --- 85 unchanged lines hidden (view full) --- 152#define NMI_PARITY (1 << 7) 153#define NMI_IOCHAN (1 << 6) 154#define ENMI_WATCHDOG (1 << 7) 155#define ENMI_BUSTIMER (1 << 6) 156#define ENMI_IOSTATUS (1 << 5) 157#endif 158 159/* |
160 * Bus attachment for the ISA PIC. 161 */ 162static struct isa_pnp_id atpic_ids[] = { 163 { 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, 164 { 0 } 165}; 166 167static int 168atpic_probe(device_t dev) 169{ 170 int result; 171 172 if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, atpic_ids)) <= 0) 173 device_quiet(dev); 174 return(result); 175} 176 177/* 178 * In the APIC_IO case we might be granted IRQ 2, as this is typically 179 * consumed by chaining between the two PIC components. If we're using 180 * the APIC, however, this may not be the case, and as such we should 181 * free the resource. (XXX untested) 182 * 183 * The generic ISA attachment code will handle allocating any other resources 184 * that we don't explicitly claim here. 185 */ 186static int 187atpic_attach(device_t dev) 188{ 189#ifdef APIC_IO 190 int rid; 191 bus_resource_t res; 192 193 /* try to allocate our IRQ and then free it */ 194 rid = 0; 195 res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, 0); 196 if (res != NULL) 197 bus_release_resource(dev, SYS_RES_IRQ, rid, res); 198#endif 199 return(0); 200} 201 202static device_method_t atpic_methods[] = { 203 /* Device interface */ 204 DEVMETHOD(device_probe, atpic_probe), 205 DEVMETHOD(device_attach, atpic_attach), 206 DEVMETHOD(device_detach, bus_generic_detach), 207 DEVMETHOD(device_shutdown, bus_generic_shutdown), 208 DEVMETHOD(device_suspend, bus_generic_suspend), 209 DEVMETHOD(device_resume, bus_generic_resume), 210 { 0, 0 } 211}; 212 213static driver_t atpic_driver = { 214 "atpic", 215 atpic_methods, 216 1, /* no softc */ 217}; 218 219static devclass_t atpic_devclass; 220 221DRIVER_MODULE(atpic, isa, atpic_driver, atpic_devclass, 0, 0); 222 223/* |
|
158 * Handle a NMI, possibly a machine check. 159 * return true to panic system, false to ignore. 160 */ 161int 162isa_nmi(cd) 163 int cd; 164{ 165#ifdef PC98 --- 362 unchanged lines hidden (view full) --- 528 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 529 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 530 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 531 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 532 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 533 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 534 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 535 * | 224 * Handle a NMI, possibly a machine check. 225 * return true to panic system, false to ignore. 226 */ 227int 228isa_nmi(cd) 229 int cd; 230{ 231#ifdef PC98 --- 362 unchanged lines hidden (view full) --- 594 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 595 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 596 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 597 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 598 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 599 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 600 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 601 * |
536 * $FreeBSD: head/sys/i386/isa/nmi.c 61126 2000-05-31 13:32:28Z bde $ | 602 * $FreeBSD: head/sys/i386/isa/nmi.c 61994 2000-06-23 07:44:33Z msmith $ |
537 * 538 */ 539 540typedef struct intrec { 541 intrmask_t mask; 542 inthand2_t *handler; 543 void *argument; 544 struct intrec *next; --- 309 unchanged lines hidden --- | 603 * 604 */ 605 606typedef struct intrec { 607 intrmask_t mask; 608 inthand2_t *handler; 609 void *argument; 610 struct intrec *next; --- 309 unchanged lines hidden --- |