mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
ppc: convert to memory API
Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b0ce84e50b
commit
23c5e4cab2
15 changed files with 203 additions and 219 deletions
|
@ -117,6 +117,7 @@ typedef struct CUDATimer {
|
|||
} CUDATimer;
|
||||
|
||||
typedef struct CUDAState {
|
||||
MemoryRegion mem;
|
||||
/* cuda registers */
|
||||
uint8_t b; /* B-side data */
|
||||
uint8_t a; /* A-side data */
|
||||
|
@ -722,7 +723,7 @@ static void cuda_reset(void *opaque)
|
|||
set_counter(s, &s->timers[1], 0xffff);
|
||||
}
|
||||
|
||||
void cuda_init (int *cuda_mem_index, qemu_irq irq)
|
||||
void cuda_init (MemoryRegion **cuda_mem, qemu_irq irq)
|
||||
{
|
||||
struct tm tm;
|
||||
CUDAState *s = &cuda_state;
|
||||
|
@ -738,8 +739,9 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq)
|
|||
s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
|
||||
|
||||
s->adb_poll_timer = qemu_new_timer_ns(vm_clock, cuda_adb_poll, s);
|
||||
*cuda_mem_index = cpu_register_io_memory(cuda_read, cuda_write, s,
|
||||
cpu_register_io_memory(cuda_read, cuda_write, s,
|
||||
DEVICE_NATIVE_ENDIAN);
|
||||
*cuda_mem = &s->mem;
|
||||
vmstate_register(NULL, -1, &vmstate_cuda, s);
|
||||
qemu_register_reset(cuda_reset, s);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue