summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/vtlb.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-11-10 07:42:09 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-11-10 07:42:09 +0000
commit92f305310513e310dcca7f5b1c3fe7ec2b197775 (patch)
tree26a4873c3e46ad13db9d1a92de2be5179754d95b /src/emu/cpu/vtlb.c
parent7c2bd582be58669e84d3bfd2c927401641a7fa80 (diff)
Major cpuintrf changes:
* added a set of cpu_* calls which accept a CPU device object; these are now the preferred means of manipulating a CPU * removed the cpunum_* calls; added an array of cpu[] to the running_machine object; converted all existing cpunum_* calls to cpu_* calls, pulling the CPU device object from the new array in the running_machine * removed the activecpu_* calls; added an activecpu member to the running_machine object; converted all existing activecpu_* calls to cpu_* calls, pulling the active CPU device object from the running_machine * changed cpuintrf_push_context() to cpu_push_context(), taking a CPU object pointer; changed cpuintrf_pop_context() to cpu_pop_context(); eventually these will go away * many other similar changes moving toward a model where all CPU references are done by the CPU object and not by index
Diffstat (limited to 'src/emu/cpu/vtlb.c')
-rw-r--r--src/emu/cpu/vtlb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index a4baf8a09fb..f966046be25 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -54,8 +54,9 @@ struct _vtlb_state
given CPU
-------------------------------------------------*/
-vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_entries)
+vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries)
{
+ char tempname[100];
vtlb_state *vtlb;
/* allocate memory for the core structure */
@@ -66,31 +67,33 @@ vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_ent
vtlb->space = space;
vtlb->dynamic = dynamic_entries;
vtlb->fixed = fixed_entries;
- vtlb->pageshift = cpunum_page_shift(cpunum, space);
- vtlb->addrwidth = cpunum_logaddr_width(cpunum, space);
- vtlb->translate = (cpu_translate_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_TRANSLATE);
+ vtlb->pageshift = cpu_get_page_shift(cpu, space);
+ vtlb->addrwidth = cpu_get_logaddr_width(cpu, space);
+ vtlb->translate = (cpu_translate_func)cpu_get_info_fct(cpu, CPUINFO_PTR_TRANSLATE);
/* validate CPU information */
assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK);
assert(vtlb->translate != NULL);
assert(vtlb->addrwidth > vtlb->pageshift);
+ state_save_combine_module_and_tag(tempname, "vtlb", cpu->tag);
+
/* allocate the entry array */
vtlb->live = malloc_or_die(sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries));
memset(vtlb->live, 0, sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries));
- state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->live, fixed_entries + dynamic_entries);
+ state_save_register_item_pointer(tempname, space, vtlb->live, fixed_entries + dynamic_entries);
/* allocate the lookup table */
vtlb->table = malloc_or_die(sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift));
memset(vtlb->table, 0, sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift));
- state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->table, 1 << (vtlb->addrwidth - vtlb->pageshift));
+ state_save_register_item_pointer(tempname, space, vtlb->table, 1 << (vtlb->addrwidth - vtlb->pageshift));
/* allocate the fixed page count array */
if (fixed_entries > 0)
{
vtlb->fixedpages = malloc_or_die(sizeof(vtlb->fixedpages[0]) * fixed_entries);
memset(vtlb->fixedpages, 0, sizeof(vtlb->fixedpages[0]) * fixed_entries);
- state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->fixedpages, fixed_entries);
+ state_save_register_item_pointer(tempname, space, vtlb->fixedpages, fixed_entries);
}
return vtlb;
}