fixed allocated physical memory limit check in memory.cc
Force eflags before saving them - register eflags using param handlers
This commit is contained in:
parent
e55ec3e8e3
commit
d17eb99f76
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: apic.cc,v 1.91 2006-06-01 14:05:23 sshwarts Exp $
|
||||
// $Id: apic.cc,v 1.92 2006-06-01 20:05:15 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -913,19 +913,21 @@ void bx_local_apic_c::register_state(bx_param_c *parent)
|
||||
unsigned i;
|
||||
char name[6];
|
||||
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, base_addr);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, id);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, spurious_vector);
|
||||
BXRS_PARAM_BOOL(parent, software_enabled, software_enabled);
|
||||
BXRS_PARAM_BOOL(parent, focus_disable, focus_disable);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, task_priority);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, spurious_vector);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, log_dest);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, dest_format);
|
||||
bx_list_c *lapic = new bx_list_c(parent, "local_apic", 25);
|
||||
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, base_addr);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, id);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, spurious_vector);
|
||||
BXRS_PARAM_BOOL(lapic, software_enabled, software_enabled);
|
||||
BXRS_PARAM_BOOL(lapic, focus_disable, focus_disable);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, task_priority);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, spurious_vector);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, log_dest);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, dest_format);
|
||||
|
||||
bx_list_c *ISR = new bx_list_c(parent, "isr", BX_LOCAL_APIC_MAX_INTS);
|
||||
bx_list_c *TMR = new bx_list_c(parent, "tmr", BX_LOCAL_APIC_MAX_INTS);
|
||||
bx_list_c *IRR = new bx_list_c(parent, "irr", BX_LOCAL_APIC_MAX_INTS);
|
||||
bx_list_c *ISR = new bx_list_c(lapic, "isr", BX_LOCAL_APIC_MAX_INTS);
|
||||
bx_list_c *TMR = new bx_list_c(lapic, "tmr", BX_LOCAL_APIC_MAX_INTS);
|
||||
bx_list_c *IRR = new bx_list_c(lapic, "irr", BX_LOCAL_APIC_MAX_INTS);
|
||||
for (i=0; i<BX_LOCAL_APIC_MAX_INTS; i++) {
|
||||
sprintf(name, "0x%02x", i);
|
||||
new bx_shadow_num_c(ISR, name, &isr[i]);
|
||||
@ -933,24 +935,24 @@ void bx_local_apic_c::register_state(bx_param_c *parent)
|
||||
new bx_shadow_num_c(IRR, name, &irr[i]);
|
||||
}
|
||||
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, error_status);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, shadow_error_status);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, icr_hi);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, icr_lo);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, error_status);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, shadow_error_status);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, icr_hi);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, icr_lo);
|
||||
|
||||
bx_list_c *LVT = new bx_list_c(parent, "lvt", APIC_LVT_ENTRIES);
|
||||
bx_list_c *LVT = new bx_list_c(lapic, "lvt", APIC_LVT_ENTRIES);
|
||||
for (i=0; i<APIC_LVT_ENTRIES; i++) {
|
||||
sprintf(name, "%d", i);
|
||||
new bx_shadow_num_c(LVT, name, &lvt[i], BASE_HEX);
|
||||
}
|
||||
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, timer_initial);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, timer_current);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, timer_divconf);
|
||||
BXRS_DEC_PARAM_SIMPLE(parent, timer_divide_factor);
|
||||
BXRS_PARAM_BOOL(parent, timer_active, timer_active);
|
||||
BXRS_HEX_PARAM_SIMPLE(parent, ticksInitial);
|
||||
BXRS_PARAM_BOOL(parent, INTR, INTR);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, timer_initial);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, timer_current);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, timer_divconf);
|
||||
BXRS_DEC_PARAM_SIMPLE(lapic, timer_divide_factor);
|
||||
BXRS_PARAM_BOOL(lapic, timer_active, timer_active);
|
||||
BXRS_HEX_PARAM_SIMPLE(lapic, ticksInitial);
|
||||
BXRS_PARAM_BOOL(lapic, INTR, INTR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: init.cc,v 1.111 2006-05-30 17:01:27 sshwarts Exp $
|
||||
// $Id: init.cc,v 1.112 2006-06-01 20:05:15 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -423,7 +423,8 @@ void BX_CPU_C::register_state(void)
|
||||
BXRS_HEX_PARAM_SIMPLE(list, EDI);
|
||||
BXRS_HEX_PARAM_SIMPLE(list, EIP);
|
||||
#endif
|
||||
BXRS_HEX_PARAM_FIELD(list, EFLAGS, eflags.val32);
|
||||
BXRS_PARAM_SPECIAL32(list, EFLAGS,
|
||||
param_save_handler, param_restore_handler);
|
||||
#if BX_CPU_LEVEL >= 3
|
||||
BXRS_HEX_PARAM_FIELD(list, DR0, dr0);
|
||||
BXRS_HEX_PARAM_FIELD(list, DR1, dr1);
|
||||
@ -466,7 +467,7 @@ void BX_CPU_C::register_state(void)
|
||||
|
||||
bx_list_c *LDTR = new bx_list_c (list, "LDTR", 4);
|
||||
BXRS_PARAM_SPECIAL16(LDTR, selector, param_save_handler, param_restore_handler);
|
||||
BXRS_HEX_PARAM_FIELD(LDTR, base, ldtr.cache.u.ldt.base );
|
||||
BXRS_HEX_PARAM_FIELD(LDTR, base, ldtr.cache.u.ldt.base);
|
||||
BXRS_HEX_PARAM_FIELD(LDTR, limit, ldtr.cache.u.ldt.limit);
|
||||
BXRS_PARAM_SPECIAL8 (LDTR, ar_byte, param_save_handler, param_restore_handler);
|
||||
|
||||
@ -536,8 +537,7 @@ void BX_CPU_C::register_state(void)
|
||||
#endif
|
||||
|
||||
#if BX_SUPPORT_APIC
|
||||
bx_list_c *lapic = new bx_list_c(list, "local_apic", 25);
|
||||
local_apic.register_state(lapic);
|
||||
local_apic.register_state(list);
|
||||
#endif
|
||||
|
||||
BXRS_PARAM_BOOL(list, EXT, EXT);
|
||||
@ -571,6 +571,8 @@ Bit64s BX_CPU_C::param_save(bx_param_c *param, Bit64s val)
|
||||
val = get_std_cpuid_features();
|
||||
} else if (!strcmp(pname, "cpuid_ext")) {
|
||||
val = get_extended_cpuid_features();
|
||||
} else if (!strcmp(pname, "EFLAGS")) {
|
||||
val = BX_CPU_THIS_PTR read_eflags();
|
||||
#if BX_SUPPORT_X86_64
|
||||
} else if (!strcmp(pname, "EFER")) {
|
||||
val = BX_CPU_THIS_PTR get_EFER();
|
||||
@ -637,6 +639,8 @@ Bit64s BX_CPU_C::param_restore(bx_param_c *param, Bit64s val)
|
||||
if (val != get_extended_cpuid_features()) {
|
||||
BX_PANIC(("save/restore: CPUID mismatch"));
|
||||
}
|
||||
} else if (!strcmp(pname, "EFLAGS")) {
|
||||
BX_CPU_THIS_PTR setEFlags(val);
|
||||
#if BX_SUPPORT_X86_64
|
||||
} else if (!strcmp(pname, "EFER")) {
|
||||
BX_CPU_THIS_PTR msr.sce = (val >> 0) & 1;
|
||||
@ -688,7 +692,6 @@ void BX_CPU_C::after_restore_state(void)
|
||||
{
|
||||
SetCR0(cr0.val32);
|
||||
CR3_change(cr3);
|
||||
setEFlags(eflags.val32);
|
||||
TLB_flush(1);
|
||||
assert_checks();
|
||||
invalidate_prefetch_q();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: memory.cc,v 1.56 2006-05-31 20:23:58 sshwarts Exp $
|
||||
// $Id: memory.cc,v 1.57 2006-06-01 20:05:15 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -101,7 +101,7 @@ BX_MEM_C::writePhysicalPage(BX_CPU_C *cpu, bx_phy_address addr, unsigned len, vo
|
||||
mem_write:
|
||||
|
||||
// all memory access feets in single 4K page
|
||||
if (a20addr <= BX_MEM_THIS len) {
|
||||
if (a20addr < BX_MEM_THIS len) {
|
||||
#if BX_SUPPORT_ICACHE
|
||||
pageWriteStampTable.decWriteStamp(a20addr);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user