Deleted Added
full compact
npx.c (924) npx.c (1321)
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.5 1993/11/03 23:32:35 paul Exp $
35 * $Id: npx.c,v 1.6 1994/01/03 07:55:43 davidg Exp $
36 */
37
38#include "npx.h"
39#if NNPX > 0
40
41#include "param.h"
42#include "systm.h"
43#include "conf.h"

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

109static int npxattach __P((struct isa_device *dvp));
110static int npxprobe __P((struct isa_device *dvp));
111static int npxprobe1 __P((struct isa_device *dvp));
112
113struct isa_driver npxdriver = {
114 npxprobe, npxattach, "npx",
115};
116
36 */
37
38#include "npx.h"
39#if NNPX > 0
40
41#include "param.h"
42#include "systm.h"
43#include "conf.h"

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

109static int npxattach __P((struct isa_device *dvp));
110static int npxprobe __P((struct isa_device *dvp));
111static int npxprobe1 __P((struct isa_device *dvp));
112
113struct isa_driver npxdriver = {
114 npxprobe, npxattach, "npx",
115};
116
117u_int npx0mask;
117u_int npx0_imask;
118struct proc *npxproc;
119
120static bool_t npx_ex16;
121static bool_t npx_exists;
122static struct gate_descriptor npx_idt_probeintr;
123static int npx_intrno;
124static volatile u_int npx_intrs_while_probing;
125static bool_t npx_irq13;

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

287 */
288 return (-1);
289 }
290 if (npx_intrs_while_probing != 0) {
291 /*
292 * Bad, we are stuck with IRQ13.
293 */
294 npx_irq13 = 1;
118struct proc *npxproc;
119
120static bool_t npx_ex16;
121static bool_t npx_exists;
122static struct gate_descriptor npx_idt_probeintr;
123static int npx_intrno;
124static volatile u_int npx_intrs_while_probing;
125static bool_t npx_irq13;

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

287 */
288 return (-1);
289 }
290 if (npx_intrs_while_probing != 0) {
291 /*
292 * Bad, we are stuck with IRQ13.
293 */
294 npx_irq13 = 1;
295 npx0mask = dvp->id_irq; /* npxattach too late */
295 npx0_imask = dvp->id_irq; /* npxattach too late */
296 return (IO_NPXSIZE);
297 }
298 /*
299 * Worse, even IRQ13 is broken. Use emulator.
300 */
301 }
302 }
303 /*

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

523 u_char old_icu1_mask;
524 u_char old_icu2_mask;
525 struct gate_descriptor save_idt_npxintr;
526
527 disable_intr();
528 old_icu1_mask = inb(IO_ICU1 + 1);
529 old_icu2_mask = inb(IO_ICU2 + 1);
530 save_idt_npxintr = idt[npx_intrno];
296 return (IO_NPXSIZE);
297 }
298 /*
299 * Worse, even IRQ13 is broken. Use emulator.
300 */
301 }
302 }
303 /*

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

523 u_char old_icu1_mask;
524 u_char old_icu2_mask;
525 struct gate_descriptor save_idt_npxintr;
526
527 disable_intr();
528 old_icu1_mask = inb(IO_ICU1 + 1);
529 old_icu2_mask = inb(IO_ICU2 + 1);
530 save_idt_npxintr = idt[npx_intrno];
531 outb(IO_ICU1 + 1, old_icu1_mask & ~(IRQ_SLAVE | npx0mask));
532 outb(IO_ICU2 + 1, old_icu2_mask & ~(npx0mask >> 8));
531 outb(IO_ICU1 + 1, old_icu1_mask & ~(IRQ_SLAVE | npx0_imask));
532 outb(IO_ICU2 + 1, old_icu2_mask & ~(npx0_imask >> 8));
533 idt[npx_intrno] = npx_idt_probeintr;
534 enable_intr();
535 stop_emulating();
536 fnsave(addr);
537 fwait();
538 start_emulating();
539 npxproc = NULL;
540 disable_intr();
541 icu1_mask = inb(IO_ICU1 + 1); /* masks may have changed */
542 icu2_mask = inb(IO_ICU2 + 1);
543 outb(IO_ICU1 + 1,
533 idt[npx_intrno] = npx_idt_probeintr;
534 enable_intr();
535 stop_emulating();
536 fnsave(addr);
537 fwait();
538 start_emulating();
539 npxproc = NULL;
540 disable_intr();
541 icu1_mask = inb(IO_ICU1 + 1); /* masks may have changed */
542 icu2_mask = inb(IO_ICU2 + 1);
543 outb(IO_ICU1 + 1,
544 (icu1_mask & ~npx0mask) | (old_icu1_mask & npx0mask));
544 (icu1_mask & ~npx0_imask) | (old_icu1_mask & npx0_imask));
545 outb(IO_ICU2 + 1,
545 outb(IO_ICU2 + 1,
546 (icu2_mask & ~(npx0mask >> 8))
547 | (old_icu2_mask & (npx0mask >> 8)));
546 (icu2_mask & ~(npx0_imask >> 8))
547 | (old_icu2_mask & (npx0_imask >> 8)));
548 idt[npx_intrno] = save_idt_npxintr;
549 enable_intr(); /* back to usual state */
550}
551
552#endif /* NNPX > 0 */
548 idt[npx_intrno] = save_idt_npxintr;
549 enable_intr(); /* back to usual state */
550}
551
552#endif /* NNPX > 0 */