Deleted Added
sdiff udiff text old ( 115703 ) new ( 117870 )
full compact
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:

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

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 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/i386/isa/npx.c 115703 2003-06-02 16:32:55Z obrien $");
39
40#include "opt_cpu.h"
41#include "opt_debug_npx.h"
42#include "opt_isa.h"
43#include "opt_math_emulate.h"
44#include "opt_npx.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/bus.h>
49#include <sys/kernel.h>
50#include <sys/lock.h>
51#include <sys/malloc.h>

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

101/*
102 * 387 and 287 Numeric Coprocessor Extension (NPX) Driver.
103 */
104
105/* Configuration flags. */
106#define NPX_DISABLE_I586_OPTIMIZED_BCOPY (1 << 0)
107#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1)
108#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2)
109#define NPX_PREFER_EMULATOR (1 << 3)
110
111#if defined(__GNUC__) && !defined(lint)
112
113#define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr)))
114#define fnclex() __asm("fnclex")
115#define fninit() __asm("fninit")
116#define fnsave(addr) __asm __volatile("fnsave %0" : "=m" (*(addr)))
117#define fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr)))

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

465 if (resource_int_value("npx", 0, "flags", &flags) != 0)
466 flags = 0;
467
468 if (flags)
469 device_printf(dev, "flags 0x%x ", flags);
470 if (npx_irq13) {
471 device_printf(dev, "using IRQ 13 interface\n");
472 } else {
473#if defined(MATH_EMULATE) || defined(GPL_MATH_EMULATE)
474 if (npx_ex16) {
475 if (!(flags & NPX_PREFER_EMULATOR))
476 device_printf(dev, "INT 16 interface\n");
477 else {
478 device_printf(dev, "FPU exists, but flags request "
479 "emulator\n");
480 hw_float = npx_exists = 0;
481 }
482 } else if (npx_exists) {
483 device_printf(dev, "error reporting broken; using 387 emulator\n");
484 hw_float = npx_exists = 0;
485 } else
486 device_printf(dev, "387 emulator\n");
487#else
488 if (npx_ex16) {
489 device_printf(dev, "INT 16 interface\n");
490 if (flags & NPX_PREFER_EMULATOR) {
491 device_printf(dev, "emulator requested, but none compiled "
492 "into kernel, using FPU\n");
493 }
494 } else
495 device_printf(dev, "no 387 emulator in kernel and no FPU!\n");
496#endif
497 }
498 npxinit(__INITIAL_NPXCW__);
499
500 if (npx_cleanstate_ready == 0) {
501 s = intr_disable();
502 stop_emulating();
503 fpusave(&npx_cleanstate);
504 start_emulating();

--- 636 unchanged lines hidden ---