Deleted Added
full compact
npx.c (3440) npx.c (3816)
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:

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

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91
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:

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

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * from: @(#)npx.c 7.2 (Berkeley) 5/12/91
35 * $Id: npx.c,v 1.13 1994/09/22 14:44:16 davidg Exp $
35 * $Id: npx.c,v 1.14 1994/10/08 22:27:58 phk Exp $
36 */
37
38#include "npx.h"
39#if NNPX > 0
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/conf.h>
44#include <sys/file.h>
45#include <sys/proc.h>
36 */
37
38#include "npx.h"
39#if NNPX > 0
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/conf.h>
44#include <sys/file.h>
45#include <sys/proc.h>
46#include <sys/devconf.h>
47#include <sys/ioctl.h>
48
46#include <machine/cpu.h>
47#include <machine/pcb.h>
48#include <machine/trap.h>
49#include <machine/cpu.h>
50#include <machine/pcb.h>
51#include <machine/trap.h>
49#include <sys/ioctl.h>
50#include <machine/specialreg.h>
52#include <machine/specialreg.h>
53
51#include <i386/isa/icu.h>
52#include <i386/isa/isa_device.h>
53#include <i386/isa/isa.h>
54
55/*
56 * 387 and 287 Numeric Coprocessor Extension (NPX) Driver.
57 */
58

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

297 dvp->id_irq = 0;
298 /*
299 * special return value to flag that we do not
300 * actually use any I/O registers
301 */
302 return (-1);
303}
304
54#include <i386/isa/icu.h>
55#include <i386/isa/isa_device.h>
56#include <i386/isa/isa.h>
57
58/*
59 * 387 and 287 Numeric Coprocessor Extension (NPX) Driver.
60 */
61

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

300 dvp->id_irq = 0;
301 /*
302 * special return value to flag that we do not
303 * actually use any I/O registers
304 */
305 return (-1);
306}
307
308static struct kern_devconf kdc_npx[NNPX] = { {
309 0, 0, 0, /* filled in by dev_attach */
310 "npx", 0, { MDDT_ISA, 0 },
311 isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
312 &kdc_isa0, /* parent */
313 0, /* parentdata */
314 DC_UNKNOWN, /* not supported */
315 "Floating-point unit"
316} };
317
318static inline void
319npx_registerdev(struct isa_device *id)
320{
321 if(id->id_unit)
322 kdc_npx[id->id_unit] = kdc_npx[0];
323 kdc_npx[id->id_unit].kdc_unit = id->id_unit;
324 kdc_npx[id->id_unit].kdc_isa = id;
325 dev_attach(&kdc_npx[id->id_unit]);
326}
327
305/*
306 * Attach routine - announce which it is, and wire into system
307 */
308int
309npxattach(dvp)
310 struct isa_device *dvp;
311{
312 if (!npx_ex16 && !npx_irq13) {
313 if (npx_exists) {
314 printf("npx%d: Error reporting broken, using 387 emulator\n",dvp->id_unit);
315 hw_float = npx_exists = 0;
316 } else {
317 printf("npx%d: 387 Emulator\n",dvp->id_unit);
318 }
319 }
320 npxinit(__INITIAL_NPXCW__);
328/*
329 * Attach routine - announce which it is, and wire into system
330 */
331int
332npxattach(dvp)
333 struct isa_device *dvp;
334{
335 if (!npx_ex16 && !npx_irq13) {
336 if (npx_exists) {
337 printf("npx%d: Error reporting broken, using 387 emulator\n",dvp->id_unit);
338 hw_float = npx_exists = 0;
339 } else {
340 printf("npx%d: 387 Emulator\n",dvp->id_unit);
341 }
342 }
343 npxinit(__INITIAL_NPXCW__);
344 npx_registerdev(dvp);
321 return (1); /* XXX unused */
322}
323
324/*
325 * Initialize floating point unit.
326 */
327void
328npxinit(control)

--- 215 unchanged lines hidden ---
345 return (1); /* XXX unused */
346}
347
348/*
349 * Initialize floating point unit.
350 */
351void
352npxinit(control)

--- 215 unchanged lines hidden ---