Small cleanup in access.cc
VME feature code should be valid only for CPU LEVEL >= 4
This commit is contained in:
parent
6a36385743
commit
fd13784231
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: access.cc,v 1.53 2005-03-03 20:24:51 sshwarts Exp $
|
||||
// $Id: access.cc,v 1.54 2005-03-12 19:34:17 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -58,11 +58,6 @@ BX_CPU_C::write_virtual_checks(bx_segment_reg_t *seg, bx_address offset,
|
||||
#endif
|
||||
if (protected_mode()) {
|
||||
if (seg->cache.valid==0) {
|
||||
BX_ERROR(("seg = %s", BX_CPU_THIS_PTR strseg(seg)));
|
||||
BX_ERROR(("seg->selector.value = %04x", (unsigned) seg->selector.value));
|
||||
BX_ERROR(("write_virtual_checks: valid bit = 0"));
|
||||
BX_ERROR(("CS: %04x", (unsigned) BX_CPU_THIS_PTR sregs[1].selector.value));
|
||||
BX_ERROR(("IP: %04x", (unsigned) BX_CPU_THIS_PTR prev_eip));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -126,9 +121,7 @@ BX_CPU_C::write_virtual_checks(bx_segment_reg_t *seg, bx_address offset,
|
||||
if (offset > (seg->cache.u.segment.limit_scaled - length + 1)
|
||||
|| (length-1 > seg->cache.u.segment.limit_scaled))
|
||||
{
|
||||
//BX_INFO(("write_virtual_checks() SEG EXCEPTION: %x:%x + %x",
|
||||
// (unsigned) seg->selector.value, (unsigned) offset, (unsigned) length));
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[2]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
else exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
if (seg->cache.u.segment.limit_scaled >= 7) {
|
||||
@ -157,13 +150,8 @@ BX_CPU_C::read_virtual_checks(bx_segment_reg_t *seg, bx_address offset,
|
||||
#endif
|
||||
if (protected_mode()) {
|
||||
if (seg->cache.valid==0) {
|
||||
BX_ERROR(("seg = %s", BX_CPU_THIS_PTR strseg(seg)));
|
||||
BX_ERROR(("seg->selector.value = %04x", (unsigned) seg->selector.value));
|
||||
//BX_ERROR(("read_virtual_checks: valid bit = 0"));
|
||||
//BX_ERROR(("CS: %04x", (unsigned)
|
||||
// BX_CPU_THIS_PTR sregs[1].selector.value));
|
||||
//BX_ERROR(("IP: %04x", (unsigned) BX_CPU_THIS_PTR prev_eip));
|
||||
//debug(EIP);
|
||||
BX_ERROR(("seg[%s]->selector.value = %04x",
|
||||
BX_CPU_THIS_PTR strseg(seg), (unsigned) seg->selector.value));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -250,7 +238,7 @@ BX_CPU_C::read_virtual_checks(bx_segment_reg_t *seg, bx_address offset,
|
||||
if (offset > (seg->cache.u.segment.limit_scaled - length + 1)
|
||||
|| (length-1 > seg->cache.u.segment.limit_scaled))
|
||||
{
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[2]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
else exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
if (seg->cache.u.segment.limit_scaled >= 7) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: cpu.h,v 1.203 2005-03-12 16:40:12 sshwarts Exp $
|
||||
// $Id: cpu.h,v 1.204 2005-03-12 19:34:18 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -2666,7 +2666,9 @@ public: // for now...
|
||||
BX_SMF void stack_return_to_v86(Bit32u new_eip, Bit32u raw_cs_selector,
|
||||
Bit32u flags32);
|
||||
BX_SMF void stack_return_from_v86(bxInstruction_c *);
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
BX_SMF void v86_redirect_interrupt(Bit32u vector);
|
||||
#endif
|
||||
BX_SMF void init_v8086_mode(void);
|
||||
BX_SMF void v8086_message(void);
|
||||
BX_SMF void task_switch(bx_selector_t *selector,
|
||||
|
@ -109,6 +109,7 @@ void BX_CPU_C::INT_Ib(bxInstruction_c *i)
|
||||
|
||||
if (v8086_mode())
|
||||
{
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
if (BX_CPU_THIS_PTR cr4.get_VME())
|
||||
{
|
||||
Bit16u io_base;
|
||||
@ -134,6 +135,7 @@ void BX_CPU_C::INT_Ib(bxInstruction_c *i)
|
||||
}
|
||||
}
|
||||
else // VME is off
|
||||
#endif
|
||||
{
|
||||
if (BX_CPU_THIS_PTR get_IOPL() < 3)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vm8086.cc,v 1.17 2005-03-09 22:01:13 sshwarts Exp $
|
||||
// $Id: vm8086.cc,v 1.18 2005-03-12 19:34:18 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -272,10 +272,12 @@ void BX_CPU_C::init_v8086_mode(void)
|
||||
BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS].selector.rpl = 3;
|
||||
}
|
||||
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
void BX_CPU_C::v86_redirect_interrupt(Bit32u vector)
|
||||
{
|
||||
BX_PANIC(("Redirection of interrupts through virtual-mode idt still not implemented"));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* BX_CPU_LEVEL >= 3 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user