From 622a086be3e53ecdbee01a18e5941be524df403a Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 5 Mar 1998 19:37:03 +0000 Subject: [PATCH] Use t_idt instead of idt inside setidt() if f00f_hack() has relocated the IDT. Submitted by: Bruce Evans --- sys/amd64/amd64/machdep.c | 9 +++++++-- sys/i386/i386/machdep.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index b99f5150602..8f03687520e 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.289 1998/02/09 04:45:53 eivind Exp $ + * $Id: machdep.c,v 1.290 1998/03/02 05:47:50 peter Exp $ */ #include "apm.h" @@ -1055,8 +1055,13 @@ setidt(idx, func, typ, dpl, selec) int dpl; int selec; { - struct gate_descriptor *ip = idt + idx; + struct gate_descriptor *ip; +#if defined(I586_CPU) && !defined(NO_F00F_HACK) + ip = (t_idt != NULL ? t_idt : idt) + idx; +#else + ip = idt + idx; +#endif ip->gd_looffset = (int)func; ip->gd_selector = selec; ip->gd_stkcpy = 0; diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index b99f5150602..8f03687520e 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.289 1998/02/09 04:45:53 eivind Exp $ + * $Id: machdep.c,v 1.290 1998/03/02 05:47:50 peter Exp $ */ #include "apm.h" @@ -1055,8 +1055,13 @@ setidt(idx, func, typ, dpl, selec) int dpl; int selec; { - struct gate_descriptor *ip = idt + idx; + struct gate_descriptor *ip; +#if defined(I586_CPU) && !defined(NO_F00F_HACK) + ip = (t_idt != NULL ? t_idt : idt) + idx; +#else + ip = idt + idx; +#endif ip->gd_looffset = (int)func; ip->gd_selector = selec; ip->gd_stkcpy = 0;