Deleted Added
full compact
npx.c (2056) npx.c (2631)
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.9 1994/06/11 05:17:15 davidg Exp $
35 * $Id: npx.c,v 1.10 1994/08/13 03:50:11 wollman 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>

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

114 npxprobe, npxattach, "npx",
115};
116
117u_int npx0_imask;
118struct proc *npxproc;
119
120static bool_t npx_ex16;
121static bool_t npx_exists;
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>

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

114 npxprobe, npxattach, "npx",
115};
116
117u_int npx0_imask;
118struct proc *npxproc;
119
120static bool_t npx_ex16;
121static bool_t npx_exists;
122int hw_float;
122static struct gate_descriptor npx_idt_probeintr;
123static int npx_intrno;
124static volatile u_int npx_intrs_while_probing;
125static bool_t npx_irq13;
126static volatile u_int npx_traps_while_probing;
127
128/*
129 * Special interrupt handlers. Someday intr0-intr15 will be used to count

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

261 fnstsw(&status);
262 if ((status & 0xb8ff) == 0) {
263 /*
264 * Good, now check for a proper control word.
265 */
266 control = 0x5a5a;
267 fnstcw(&control);
268 if ((control & 0x1f3f) == 0x033f) {
123static struct gate_descriptor npx_idt_probeintr;
124static int npx_intrno;
125static volatile u_int npx_intrs_while_probing;
126static bool_t npx_irq13;
127static volatile u_int npx_traps_while_probing;
128
129/*
130 * Special interrupt handlers. Someday intr0-intr15 will be used to count

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

262 fnstsw(&status);
263 if ((status & 0xb8ff) == 0) {
264 /*
265 * Good, now check for a proper control word.
266 */
267 control = 0x5a5a;
268 fnstcw(&control);
269 if ((control & 0x1f3f) == 0x033f) {
269 npx_exists = 1;
270 hw_float = npx_exists = 1;
270 /*
271 * We have an npx, now divide by 0 to see if exception
272 * 16 works.
273 */
274 control &= ~(1 << 2); /* enable divide by 0 trap */
275 fldcw(&control);
276 npx_traps_while_probing = npx_intrs_while_probing = 0;
277 fp_divide_by_0();

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

318 */
319int
320npxattach(dvp)
321 struct isa_device *dvp;
322{
323 if (!npx_ex16 && !npx_irq13) {
324 if (npx_exists) {
325 printf("npx%d: Error reporting broken, using 387 emulator\n",dvp->id_unit);
271 /*
272 * We have an npx, now divide by 0 to see if exception
273 * 16 works.
274 */
275 control &= ~(1 << 2); /* enable divide by 0 trap */
276 fldcw(&control);
277 npx_traps_while_probing = npx_intrs_while_probing = 0;
278 fp_divide_by_0();

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

319 */
320int
321npxattach(dvp)
322 struct isa_device *dvp;
323{
324 if (!npx_ex16 && !npx_irq13) {
325 if (npx_exists) {
326 printf("npx%d: Error reporting broken, using 387 emulator\n",dvp->id_unit);
326 npx_exists = 0;
327 hw_float = npx_exists = 0;
327 } else {
328 printf("npx%d: 387 Emulator\n",dvp->id_unit);
329 }
330 }
331 npxinit(__INITIAL_NPXCW__);
332 return (1); /* XXX unused */
333}
334

--- 220 unchanged lines hidden ---
328 } else {
329 printf("npx%d: 387 Emulator\n",dvp->id_unit);
330 }
331 }
332 npxinit(__INITIAL_NPXCW__);
333 return (1); /* XXX unused */
334}
335

--- 220 unchanged lines hidden ---