diff options
author | 2010-01-18 09:34:43 +0000 | |
---|---|---|
committer | 2010-01-18 09:34:43 +0000 | |
commit | e738b79785852050ce8b83e369a7fc4dd46a071b (patch) | |
tree | 1ac39e9f40790b375c57fea4e5d56ca8d132babc /src/emu/cpu/vtlb.c | |
parent | 3f87f47a2ecdccb9d9627d0d52b76f262becb949 (diff) |
Correct a long-standing design flaw: device configuration state
is now separate from runtime device state. I have larger plans
for devices, so there is some temporary scaffolding to hold
everything together, but this first step does separate things
out.
There is a new class 'running_device' which represents the
state of a live device. A list of these running_devices sits
in machine->devicelist and is created when a running_machine
is instantiated.
To access the configuration state, use device->baseconfig()
which returns a reference to the configuration.
The list of running_devices in machine->devicelist has a 1:1
correspondance with the list of device configurations in
machine->config->devicelist, and most navigation options work
equally on either (scanning by class, type, etc.)
For the most part, drivers will now deal with running_device
objects instead of const device_config objects. In fact, in
order to do this patch, I did the following global search &
replace:
const device_config -> running_device
device->static_config -> device->baseconfig().static_config
device->inline_config -> device->baseconfig().inline_config
and then fixed up the compiler errors that fell out.
Some specifics:
Removed device_get_info_* functions and replaced them with
methods called get_config_*.
Added methods for get_runtime_* to access runtime state from
the running_device.
DEVICE_GET_INFO callbacks are only passed a device_config *.
This means they have no access to the token or runtime state
at all. For most cases this is fine.
Added new DEVICE_GET_RUNTIME_INFO callback that is passed
the running_device for accessing data that is live at runtime.
In the future this will go away to make room for a cleaner
mechanism.
Cleaned up the handoff of memory regions from the memory
subsystem to the devices.
Diffstat (limited to 'src/emu/cpu/vtlb.c')
-rw-r--r-- | src/emu/cpu/vtlb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c index c64e987edb6..68320609d5d 100644 --- a/src/emu/cpu/vtlb.c +++ b/src/emu/cpu/vtlb.c @@ -30,7 +30,7 @@ /* VTLB state */ struct _vtlb_state { - const device_config *device; /* CPU device */ + running_device *device; /* CPU device */ int space; /* address space */ int dynamic; /* number of dynamic entries */ int fixed; /* number of fixed entries */ @@ -55,7 +55,7 @@ struct _vtlb_state given CPU -------------------------------------------------*/ -vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries) +vtlb_state *vtlb_alloc(running_device *cpu, int space, int fixed_entries, int dynamic_entries) { vtlb_state *vtlb; @@ -69,7 +69,7 @@ vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, i vtlb->fixed = fixed_entries; vtlb->pageshift = cpu_get_page_shift(cpu, space); vtlb->addrwidth = cpu_get_logaddr_width(cpu, space); - vtlb->translate = (cpu_translate_func)device_get_info_fct(cpu, CPUINFO_FCT_TRANSLATE); + vtlb->translate = (cpu_translate_func)cpu->get_config_fct(CPUINFO_FCT_TRANSLATE); /* validate CPU information */ assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK); |