npx.c (147741) | npx.c (153138) |
---|---|
1/*- 2 * Copyright (c) 1990 William Jolitz. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990 William Jolitz. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 17 unchanged lines hidden (view full) --- 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 147741 2005-07-02 20:06:44Z delphij $"); | 34__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 153138 2005-12-05 22:11:44Z jhb $"); |
35 36#include "opt_cpu.h" 37#include "opt_isa.h" 38#include "opt_npx.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/bus.h> --- 215 unchanged lines hidden (view full) --- 258 IO_NPX, IO_NPX + IO_NPXSIZE - 1, IO_NPXSIZE, RF_ACTIVE); 259 if (ioport_res == NULL) 260 panic("npx: can't get ports"); 261 if (resource_int_value("npx", 0, "irq", &irq_num) != 0) 262 irq_num = IRQ_NPX; 263 irq_rid = 0; 264 irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, 265 irq_num, 1, RF_ACTIVE); | 35 36#include "opt_cpu.h" 37#include "opt_isa.h" 38#include "opt_npx.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/bus.h> --- 215 unchanged lines hidden (view full) --- 258 IO_NPX, IO_NPX + IO_NPXSIZE - 1, IO_NPXSIZE, RF_ACTIVE); 259 if (ioport_res == NULL) 260 panic("npx: can't get ports"); 261 if (resource_int_value("npx", 0, "irq", &irq_num) != 0) 262 irq_num = IRQ_NPX; 263 irq_rid = 0; 264 irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, 265 irq_num, 1, RF_ACTIVE); |
266 if (irq_res == NULL) 267 panic("npx: can't get IRQ"); 268 if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, npx_intr, 269 NULL, &irq_cookie) != 0) 270 panic("npx: can't create intr"); | 266 if (irq_res != NULL) { 267 if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, 268 npx_intr, NULL, &irq_cookie) != 0) 269 panic("npx: can't create intr"); 270 } |
271 272 /* 273 * Partially reset the coprocessor, if any. Some BIOS's don't reset 274 * it after a warm boot. 275 */ 276 npx_full_reset(); 277 outb(IO_NPX, 0); 278 --- 100 unchanged lines hidden (view full) --- 379 */ 380#ifdef SMP 381 if (mp_ncpus > 1) 382 panic("npx0 cannot be emulated on an SMP system"); 383#endif 384 /* FALLTHROUGH */ 385no_irq13: 386 idt[IDT_MF] = save_idt_npxtrap; | 271 272 /* 273 * Partially reset the coprocessor, if any. Some BIOS's don't reset 274 * it after a warm boot. 275 */ 276 npx_full_reset(); 277 outb(IO_NPX, 0); 278 --- 100 unchanged lines hidden (view full) --- 379 */ 380#ifdef SMP 381 if (mp_ncpus > 1) 382 panic("npx0 cannot be emulated on an SMP system"); 383#endif 384 /* FALLTHROUGH */ 385no_irq13: 386 idt[IDT_MF] = save_idt_npxtrap; |
387 bus_teardown_intr(dev, irq_res, irq_cookie); 388 bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res); | 387 if (irq_res != NULL) { 388 bus_teardown_intr(dev, irq_res, irq_cookie); 389 bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res); 390 } |
389 bus_release_resource(dev, SYS_RES_IOPORT, ioport_rid, ioport_res); 390 return (0); 391} 392 393/* 394 * Attach routine - announce which it is, and wire into system 395 */ 396static int --- 680 unchanged lines hidden --- | 391 bus_release_resource(dev, SYS_RES_IOPORT, ioport_rid, ioport_res); 392 return (0); 393} 394 395/* 396 * Attach routine - announce which it is, and wire into system 397 */ 398static int --- 680 unchanged lines hidden --- |