Fixed 2nd dword of 64-bit descriptor check

This commit is contained in:
Stanislav Shwartsman 2008-04-26 19:41:28 +00:00
parent ee88a125e7
commit e86102eea5
3 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.463 2008-04-25 20:08:22 sshwarts Exp $
// $Id: cpu.h,v 1.464 2008-04-26 19:41:28 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -3126,7 +3126,7 @@ public: // for now...
BX_SMF void FPU_check_pending_exceptions(void);
BX_SMF void FPU_stack_underflow(int stnr, int pop_stack = 0);
BX_SMF void FPU_stack_overflow(void);
BX_SMF int FPU_exception(int exception);
BX_SMF bx_bool FPU_exception(int exception);
BX_SMF int fpu_save_environment(bxInstruction_c *);
BX_SMF int fpu_load_environment(bxInstruction_c *);
BX_SMF Bit16u unpack_FPU_TW(Bit16u tag_byte);

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: jmp_far.cc,v 1.13 2008-04-19 20:00:28 sshwarts Exp $
// $Id: jmp_far.cc,v 1.14 2008-04-26 19:41:28 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005 Stanislav Shwartsman
@ -175,7 +175,9 @@ BX_CPU_C::jmp_task_gate(bx_descriptor_t *gate_descriptor)
BX_ERROR(("jump_protected: TSS selector points to bad TSS"));
exception(BX_GP_EXCEPTION, raw_tss_selector & 0xfffc, 0);
}
if (tss_descriptor.type!=9 && tss_descriptor.type!=1) {
if (tss_descriptor.type!=BX_SYS_SEGMENT_AVAIL_286_TSS &&
tss_descriptor.type!=BX_SYS_SEGMENT_AVAIL_386_TSS)
{
BX_ERROR(("jump_protected: TSS selector points to bad TSS"));
exception(BX_GP_EXCEPTION, raw_tss_selector & 0xfffc, 0);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: segment_ctrl_pro.cc,v 1.89 2008-04-25 21:21:46 sshwarts Exp $
// $Id: segment_ctrl_pro.cc,v 1.90 2008-04-26 19:41:28 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -739,8 +739,8 @@ void BX_CPU_C::fetch_raw_descriptor64(const bx_selector_t *selector,
access_read_linear(offset, 8, 0, BX_READ, &raw_descriptor1);
access_read_linear(offset + 8, 8, 0, BX_READ, &raw_descriptor2);
if (GET32H(raw_descriptor2) != 0) {
BX_ERROR(("fetch_raw_descriptor64: extended attributes DWORD4 != 0"));
if (raw_descriptor2 & BX_CONST64(0x00001F0000000000)) {
BX_ERROR(("fetch_raw_descriptor64: extended attributes DWORD4 TYPE != 0"));
exception(BX_GP_EXCEPTION, selector->value & 0xfffc, 0);
}