Remove useless state: page_size_extensions

This commit is contained in:
Fabian 2018-07-12 17:44:35 -06:00
parent 0e28694837
commit e5fca784fc
5 changed files with 4 additions and 11 deletions

View file

@ -72,9 +72,6 @@ function CPU(bus, wm, v86oxide, coverage_logger)
// current privilege level
this.cpl = new Int32Array(wm.memory.buffer, 612, 1);
// if false, pages are 4 KiB, else 4 Mib
this.page_size_extensions = new Int32Array(wm.memory.buffer, 616, 1);
// current operand/address size
this.is_32 = new Int32Array(wm.memory.buffer, 804, 1);
@ -343,7 +340,7 @@ CPU.prototype.get_state = function()
state[9] = this.page_fault[0];
state[10] = this.cr;
state[11] = this.cpl[0];
state[12] = this.page_size_extensions[0];
state[13] = this.is_32[0];
state[16] = this.stack_size_32[0];
@ -428,7 +425,7 @@ CPU.prototype.set_state = function(state)
this.page_fault[0] = state[9];
this.cr.set(state[10]);
this.cpl[0] = state[11];
this.page_size_extensions[0] = state[12];
this.is_32[0] = state[13];
this.stack_size_32[0] = state[16];
@ -607,7 +604,6 @@ CPU.prototype.reset = function()
this.dreg[7] = 0x400;
this.cpl[0] = 0;
this.paging[0] = 0;
this.page_size_extensions[0] = 0;
this.is_32[0] = +false;
this.stack_size_32[0] = +false;
this.prefixes[0] = 0;

View file

@ -68,8 +68,6 @@
#define LDTR 7
#define PSE_ENABLED 128
#define PAGE_TABLE_PRESENT_MASK (1 << 0)
#define PAGE_TABLE_RW_MASK (1 << 1)
#define PAGE_TABLE_USER_MASK (1 << 2)

View file

@ -193,7 +193,7 @@ int32_t do_page_translation(int32_t addr, bool for_writing, bool user)
}
}
if(page_dir_entry & *page_size_extensions)
if((page_dir_entry & PAGE_TABLE_PSE_MASK) && (cr[4] & CR4_PSE))
{
// size bit is set

View file

@ -36,7 +36,7 @@ static int32_t* const gdtr_offset = (int32_t* const) 576;
static int32_t* const cr = (int32_t* const) 580; // length 32
static uint8_t* const cpl = (uint8_t* const) 612;
static int32_t* const page_size_extensions = (int32_t* const) 616;
// gap
static int32_t* const last_virt_eip = (int32_t* const) 620;
static int32_t* const eip_phys = (int32_t* const) 624;
static int32_t* const last_virt_esp = (int32_t* const) 628;

View file

@ -546,7 +546,6 @@ void instr_0F22(int32_t r, int32_t creg) {
}
cr[4] = data;
page_size_extensions[0] = (cr[4] & CR4_PSE) ? PSE_ENABLED : 0;
if(cr[4] & CR4_PAE)
{