Merged from sys/i386/isa/npx.c revision 1.84.

This commit is contained in:
KATO Takenori 2000-09-07 13:33:48 +00:00
parent 841d7a731e
commit 258cacb69b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65567

View File

@ -280,6 +280,12 @@ npx_probe(dev)
setidt(16, probetrap, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
setidt(npx_intrno, probeintr, SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
npx_idt_probeintr = idt[npx_intrno];
/*
* XXX This looks highly bogus, but it appears that npc_probe1
* needs interrupts enabled. Does this make any difference
* here?
*/
enable_intr();
result = npx_probe1(dev);
disable_intr();
@ -853,7 +859,7 @@ npxdna()
/*
* Record new context early in case frstor causes an IRQ13.
*/
npxproc = curproc;
PCPU_SET(npxproc, CURPROC);
curpcb->pcb_savefpu.sv_ex_sw = 0;
/*
* The following frstor may cause an IRQ13 when the state being
@ -890,16 +896,18 @@ npxsave(addr)
fnsave(addr);
/* fnop(); */
start_emulating();
npxproc = NULL;
PCPU_SET(npxproc, NULL);
#else /* SMP */
int intrstate;
u_char icu1_mask;
u_char icu2_mask;
u_char old_icu1_mask;
u_char old_icu2_mask;
struct gate_descriptor save_idt_npxintr;
intrstate = save_intr();
disable_intr();
#ifdef PC98
old_icu1_mask = inb(IO_ICU1 + 2);
@ -917,12 +925,12 @@ npxsave(addr)
outb(IO_ICU2 + 1, old_icu2_mask & ~(npx0_imask >> 8));
#endif
idt[npx_intrno] = npx_idt_probeintr;
enable_intr();
write_eflags(intrstate);
stop_emulating();
fnsave(addr);
fnop();
start_emulating();
npxproc = NULL;
PCPU_SET(npxproc, NULL);
disable_intr();
#ifdef PC98
icu1_mask = inb(IO_ICU1 + 2); /* masks may have changed */
@ -942,7 +950,7 @@ npxsave(addr)
| (old_icu2_mask & (npx0_imask >> 8)));
#endif
idt[npx_intrno] = save_idt_npxintr;
enable_intr(); /* back to usual state */
restore_intr(intrstate); /* back to previous state */
#endif /* SMP */
}