qemu/include/hw/isa/i8257.h
Marc-André Lureau e305a16510 portio: keep references on portio
The isa_register_portio_list() function allocates ioports
data/state. Let's keep the reference to this data on some owner.  This
isn't enough to fix leaks, but at least, ASAN stops complaining of
direct leaks. Further cleanup would require calling
portio_list_del/destroy().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2016-09-08 18:05:21 +04:00

44 lines
782 B
C

#ifndef HW_I8257_H
#define HW_I8257_H
#define TYPE_I8257 "i8257"
typedef struct I8257Regs {
int now[2];
uint16_t base[2];
uint8_t mode;
uint8_t page;
uint8_t pageh;
uint8_t dack;
uint8_t eop;
IsaDmaTransferHandler transfer_handler;
void *opaque;
} I8257Regs;
typedef struct I8257State {
/* <private> */
ISADevice parent_obj;
/* <public> */
int32_t base;
int32_t page_base;
int32_t pageh_base;
int32_t dshift;
uint8_t status;
uint8_t command;
uint8_t mask;
uint8_t flip_flop;
I8257Regs regs[4];
MemoryRegion channel_io;
MemoryRegion cont_io;
QEMUBH *dma_bh;
bool dma_bh_scheduled;
int running;
PortioList portio_page;
PortioList portio_pageh;
} I8257State;
#endif